source: WorldVistAEHR/trunk/r/ENGINEERING-EN/ENFARB.m@ 862

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

initial load of WorldVistAEHR

File size: 3.4 KB
RevLine 
[613]1ENFARB ;WIRMFO/SAB-FIXED ASSET RPT, SUMMARY OF SGL $ BALANCES; 12/16/96
2 ;;7.0;ENGINEERING;**39**;Aug 17, 1993
3 ; Summary of $ Balances by Station, [Fund,] and SGL
4EN ;
5 ; ask for period (month/year)
6 S DIR(0)="D^::E^K:($E(Y,4,5)=""00"")!($E(Y,1,5)>$E(DT,1,5)) X"
7 S DIR("A")="Enter month of desired closing balances"
8 S X("Y")=$E(DT,1,3),X("M")=$E(DT,4,5)
9 S X=$S(X("M")="01":(X("Y")-1)_"12",1:X("Y")_$E("00",1,2-$L(X("M")-1))_(X("M")-1))_"00"
10 S DIR("B")=$$FMTE^XLFDT(X)
11 K X
12 S DIR("?",1)="Month and year are required and future dates are invalid."
13 S DIR("?",2)="This date will be used to select the closing balances"
14 S DIR("?",3)="that will be shown on the output."
15 S DIR("?",4)=" "
16 S DIR("?")="Enter the month and year."
17 D ^DIR K DIR G:$D(DIRUT) EXIT
18 S ENDTR=$E(Y,1,5)_"00" ; month to report
19 ; ask type of breakdown
20 S DIR(0)="Y",DIR("A")="Report SGL totals by Fund"
21 S DIR("B")="YES"
22 D ^DIR K DIR G:$D(DIRUT) EXIT
23 S ENBYFUND=Y
24 ; ask device
25 S %ZIS="QM" D ^%ZIS G:POP EXIT
26 I $D(IO("Q")) D G EXIT
27 . S ZTRTN="QEN^ENFARB"
28 . S ZTSAVE("ENDTR")="",ZTSAVE("ENBYFUND")=""
29 . S ZTDESC="FAP $ Balances"
30 . D ^%ZTLOAD,HOME^%ZIS K ZTSK
31QEN ; queued entry
32 U IO
33COLLECT ; collect data
34 S END=0 K ENT
35 I 'ENBYFUND S ENFUND="all"
36 ; loop thru stations
37 S ENI(1)=0 F S ENI(1)=$O(^ENG(6915.9,ENI(1))) Q:'ENI(1) D
38 . S ENSN=$$GET1^DIQ(6915.9,ENI(1)_",",.01)
39 . ; loop thru funds
40 . S ENI(2)=0 F S ENI(2)=$O(^ENG(6915.9,ENI(1),1,ENI(2))) Q:'ENI(2) D
41 . . S:ENBYFUND ENFUND=$$GET1^DIQ(6915.91,ENI(2)_","_ENI(1)_",",.01)
42 . . ; loop thru standard general ledgers
43 . . S ENI(3)=0
44 . . F S ENI(3)=$O(^ENG(6915.9,ENI(1),1,ENI(2),1,ENI(3))) Q:'ENI(3) D
45 . . . S ENSGL=$$GET1^DIQ(6915.911,ENI(3)_","_ENI(2)_","_ENI(1)_",",.01)
46 . . . S ENBAL=$$GETBAL^ENFABAL(ENI(1),ENI(2),ENI(3),ENDTR)
47 . . . S:ENBAL>0 ENT(ENSN,ENFUND,ENSGL)=$G(ENT(ENSN,ENFUND,ENSGL))+ENBAL
48PRINT ; print results
49 S ENPG=0 D NOW^%DTC S Y=% D DD^%DT S ENDT=Y
50 S ENDTR("E")=$$FMTE^XLFDT(ENDTR)
51 S ENL="",$P(ENL,"-",IOM)=""
52 S ENSN="" F S ENSN=$O(ENT(ENSN)) Q:ENSN="" D Q:END
53 . D HD Q:END
54 . S ENTS="0^0" ; initialize station totals
55 . S ENFUND="" F S ENFUND=$O(ENT(ENSN,ENFUND)) Q:ENFUND="" D Q:END
56 . . S ENTF="0^0" ; initialize fund totals
57 . . S ENSGL=""
58 . . F S ENSGL=$O(ENT(ENSN,ENFUND,ENSGL)) Q:ENSGL="" D Q:END
59 . . . I $Y+4>IOSL D HD Q:END
60 . . . W !,?12,ENFUND,?22,ENSGL
61 . . . W ?30,"$",$J($FN($P(ENT(ENSN,ENFUND,ENSGL),U),",",2),16)
62 . . . S $P(ENTF,U)=$P(ENTF,U)+$P(ENT(ENSN,ENFUND,ENSGL),U)
63 . . Q:END
64 . . S $P(ENTS,U)=$P(ENTS,U)+$P(ENTF,U)
65 . . Q:'ENBYFUND
66 . . I $Y+5>IOSL D HD Q:END
67 . . W !,?30,"-----------------"
68 . . W !,?30,"$",$J($FN($P(ENTF,U),",",2),16),!
69 . Q:END
70 . I $Y+5>IOSL D HD Q:END
71 . W !,?30,"-----------------"
72 . W !,?16,"STATION TOTAL"
73 . W ?30,"$",$J($FN($P(ENTS,U),",",2),16)
74 I 'END,$E(IOST,1,2)="C-" S DIR(0)="E" D ^DIR K DIR
75 D ^%ZISC
76EXIT I $D(ZTQUEUED) S ZTREQ="@"
77 K DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
78 K ENBAL,ENBYFUND,ENDA,ENDTR,ENFUND,ENI,ENSGL,ENSN,ENT,ENTF,ENTS
79 K END,ENDT,ENL,ENPG
80 Q
81HD ; header
82 I $D(ZTQUEUED),$$S^%ZTLOAD S ZTSTOP=1,END=1 Q
83 I $E(IOST,1,2)="C-",ENPG S DIR(0)="E" D ^DIR K DIR I 'Y S END=1 Q
84 I $E(IOST,1,2)="C-"!ENPG W @IOF
85 S ENPG=ENPG+1
86 W !,ENDTR("E")," ",$S($E(ENDTR,1,5)=$E(DT,1,5):"CURRENT",1:"CLOSING")
87 W " BALANCES FOR STATION: ",ENSN
88 W ?49,ENDT,?72,"page ",ENPG
89 W !,ENL
90 W !!,?20,"STANDARD",?30,"TOTAL"
91 W !,?20,"GENERAL",?30,"ASSET"
92 W !,?12,"FUND",?20,"LEDGER",?30,"VALUE"
93 W !,?12,"------",?20,"--------",?30,"-----------------"
94 Q
95 ;ENFARB
Note: See TracBrowser for help on using the repository browser.