source: FOIAVistA/tag/r/ENGINEERING-EN/ENFAR2.m@ 1104

Last change on this file since 1104 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 3.4 KB
Line 
1ENFAR2 ;WIRMFO/SAB-FIXED ASSET RPT, CAPITALIZED EQUIPMENT SUMMARY; 7/19/96
2 ;;7.0;ENGINEERING;**25,33**;Aug 17, 1993
3 ; Summary of Capitalized NX Equipment Assets by Station, Fund, SGL
4EN ;
5 ; ask type of breakdown
6 S DIR(0)="Y",DIR("A")="Report SGL totals by Fund"
7 S DIR("B")="YES"
8 D ^DIR K DIR G:$D(DIRUT) EXIT
9 S ENBYFUND=Y
10 ; ask device
11 W !!,"This report searches the entire equipment file and may take some"
12 W !,"time to complete. Consider queuing this report to run after-hours."
13 S %ZIS="QM" D ^%ZIS G:POP EXIT
14 I $D(IO("Q")) D G EXIT
15 . S ZTRTN="QEN^ENFAR2",ZTSAVE("ENBYFUND")=""
16 . S ZTDESC="Capitalized NX Equip. Summary for Station"
17 . D ^%ZTLOAD,HOME^%ZIS K ZTSK
18QEN ; queued entry
19 U IO
20 ; collect data
21 S (ENC,END)=0 K ENT
22 S ENSND=$$GET1^DIQ(6910,"1,",1) S:ENSND="" ENSND="Unk" ; default station
23 I 'ENBYFUND S ENFUND="all"
24 S ENDA=0 F S ENDA=$O(^ENG(6914,ENDA)) Q:'ENDA D Q:END
25 . S ENC=ENC+1
26 . I '(ENC#500),$D(ZTQUEUED),$$S^%ZTLOAD S ZTSTOP=1,END=1 Q
27 . S ENY8=$G(^ENG(6914,ENDA,8))
28 . Q:$P(ENY8,U,2)'=1 ; not capitalized
29 . Q:$P($G(^ENG(6914,ENDA,3)),U,11)]"" ; disposition date exists
30 . Q:$P($G(^ENG(6914,ENDA,0)),U,4)'="NX" ; not NX
31 . S ENY9=$G(^ENG(6914,ENDA,9))
32 . S ENSN=$P(ENY9,U,5) S:ENSN="" ENSN=ENSND
33 . I ENBYFUND S X=$P(ENY9,U,7),ENFUND=$S(X:$P($G(^ENG(6914.6,X,0)),U),1:"<null>")
34 . S ENSGL=$$GET1^DIQ(6914,ENDA_",",38) I ENSGL="" S ENSGL="<null>"
35 . S:ENSGL="" ENSGL="<null>" ; for dangling pointers
36 . S $P(ENT(ENSN,ENFUND,ENSGL),U)=$P($G(ENT(ENSN,ENFUND,ENSGL)),U)+1 ; count
37 . S $P(ENT(ENSN,ENFUND,ENSGL),U,2)=$P($G(ENT(ENSN,ENFUND,ENSGL)),U,2)+$P($G(^ENG(6914,ENDA,2)),U,3) ; asset value
38 K ENY8,ENY9
39 ; print results
40 S ENPG=0 D NOW^%DTC S Y=% D DD^%DT S ENDT=Y
41 S ENL="",$P(ENL,"-",IOM)=""
42 I 'END S ENSN="" F S ENSN=$O(ENT(ENSN)) Q:ENSN="" D Q:END
43 . D HD Q:END
44 . S ENTS="0^0" ; initialize station totals
45 . S ENFUND="" F S ENFUND=$O(ENT(ENSN,ENFUND)) Q:ENFUND="" D Q:END
46 . . S ENTF="0^0" ; initialize fund totals
47 . . S ENSGL=""
48 . . F S ENSGL=$O(ENT(ENSN,ENFUND,ENSGL)) Q:ENSGL="" D Q:END
49 . . . I $Y+4>IOSL D HD Q:END
50 . . . W !,?12,ENFUND,?22,ENSGL
51 . . . W ?30,$J($P(ENT(ENSN,ENFUND,ENSGL),U),5)
52 . . . W ?38,"$",$J($FN($P(ENT(ENSN,ENFUND,ENSGL),U,2),",",2),16)
53 . . . S $P(ENTF,U)=$P(ENTF,U)+$P(ENT(ENSN,ENFUND,ENSGL),U)
54 . . . S $P(ENTF,U,2)=$P(ENTF,U,2)+$P(ENT(ENSN,ENFUND,ENSGL),U,2)
55 . . S $P(ENTS,U)=$P(ENTS,U)+$P(ENTF,U)
56 . . S $P(ENTS,U,2)=$P(ENTS,U,2)+$P(ENTF,U,2)
57 . . Q:'ENBYFUND
58 . . I $Y+5>IOSL D HD Q:END
59 . . W !,?30,"-----",?38,"-----------------"
60 . . W !,?30,$J($P(ENTF,U),5),?38,"$",$J($FN($P(ENTF,U,2),",",2),16),!
61 . I $Y+5>IOSL D HD Q:END
62 . W !,?30,"-----",?38,"-----------------"
63 . W !,?16,"STATION TOTAL"
64 . W ?30,$J($P(ENTS,U),5),?38,"$",$J($FN($P(ENTS,U,2),",",2),16)
65 I 'END,$E(IOST,1,2)="C-" S DIR(0)="E" D ^DIR K DIR
66 D ^%ZISC
67EXIT I $D(ZTQUEUED) S ZTREQ="@"
68 K DIR,DIROUT,DIRUT,DIWF,DIWL,DTOUT,DUOUT,X,Y
69 K ENBYFUND,ENC,ENDA,ENFUND,ENSGL,ENSN,ENSND,ENT,ENTF,ENTS
70 K END,ENDT,ENL,ENPG
71 Q
72HD ; header
73 I $D(ZTQUEUED),$$S^%ZTLOAD S ZTSTOP=1,END=1 Q
74 I $E(IOST,1,2)="C-",ENPG S DIR(0)="E" D ^DIR K DIR I 'Y S END=1 Q
75 I $E(IOST,1,2)="C-"!ENPG W @IOF
76 S ENPG=ENPG+1
77 W !,"CAPITALIZED NX EQUIP. SUMMARY FOR STATION: ",ENSN
78 W ?49,ENDT,?72,"page ",ENPG
79 W !,ENL
80 W !!,?20,"STANDARD",?38,"TOTAL"
81 W !,?20,"GENERAL",?30,"ITEM",?38,"ASSET"
82 W !,?12,"FUND",?20,"LEDGER",?30,"COUNT",?38,"VALUE"
83 W !,?12,"------",?20,"--------",?30,"-----",?38,"-----------------"
84 Q
85 ;ENFAR2
Note: See TracBrowser for help on using the repository browser.