source: WorldVistAEHR/trunk/r/ENGINEERING-EN/ENFABAL2.m@ 1154

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

initial load of WorldVistAEHR

File size: 3.1 KB
Line 
1ENFABAL2 ;WIRMFO/SAB-MAINTAIN FILE 6915.9 FAP BALANCES (cont) ;7/19/96
2 ;;7.0;ENGINEERING;**29,33**;AUG 17, 1883
3 ;This routine should not be modified.
4EN ; called from RECALC^ENFABAL
5 W !,"Report of FAP Recalculation for "_$$FMTE^XLFDT(ENDTR)
6 ; ask device
7 S %ZIS="QM" D ^%ZIS G:POP EXIT
8 I $D(IO("Q")) D G EXIT
9 . S ZTRTN="QEN^ENFABAL2"
10 . S ZTDESC="Report of FAP Recalc for "_$$FMTE^XLFDT(ENDTR)
11 . F X="ENDTR","^TMP($J,""P""," S ZTSAVE(X)=""
12 . D ^%ZTLOAD,HOME^%ZIS K ZTSK
13QEN ; queued entry
14 N END,ENDT,ENFUND,ENL,ENPG,ENSGL,ENSN
15 U IO
16 ; generate output
17 S (END,ENPG)=0 D NOW^%DTC S Y=% D DD^%DT S ENDT=Y
18 S ENL="",$P(ENL,"-",IOM)=""
19 D HD
20 S ENSN="" F S ENSN=$O(^TMP($J,"P",ENSN)) Q:ENSN="" D
21 . S ENFUND="" F S ENFUND=$O(^TMP($J,"P",ENSN,ENFUND)) Q:ENFUND="" D
22 . . S ENSGL=""
23 . . F S ENSGL=$O(^TMP($J,"P",ENSN,ENFUND,ENSGL)) Q:ENSGL="" D
24 . . . S Y=$G(^TMP($J,"P",ENSN,ENFUND,ENSGL))
25 . . . I $Y+5>IOSL D HD
26 . . . W !,?2,ENSN,?11,ENFUND,?19,ENSGL,?23,$J($P(Y,U),13,2)
27 . . . W ?42,$J($P(Y,U,2),13,2)
28 I $E(IOST,1,2)="C-" S DIR(0)="E" D ^DIR K DIR
29 D ^%ZISC
30 I $D(ZTQUEUED) S ZTREQ="@" K ^TMP($J)
31EXIT K DIR,DIROUT,DIRUT,DIWF,DIWL,DTOUT,DUOUT,X,Y
32 Q
33HD ; header
34 I $E(IOST,1,2)="C-",ENPG S DIR(0)="E" D ^DIR K DIR I 'Y S END=1 Q
35 I $E(IOST,1,2)="C-"!ENPG W @IOF
36 S ENPG=ENPG+1
37 W !,"FAP Net Activity Comparison",?48,ENDT,?72,"page ",ENPG
38 W !!,"FAP Balance File vs. Recalculation for ",$$FMTE^XLFDT(ENDTR)
39 W !!,?2,"STATION",?11,"FUND",?19,"SGL",?25,"NET FROM FILE"
40 W ?42,"NET FROM RECALCULATION"
41 Q
42 ;
43TVSF ; compare transactions vs. file
44 ; called from RECALC^ENFABAL
45 ; input
46 ; ENDTR - month to recalculate (FileMan date)
47 ; ^TMP($J,"R",station,fund,sgl)=net $ activity from recalc
48 ; output -
49 ; problems where net activity is not equal in
50 ; ^TMP($J,"P",station,fund,sgl)=net from file^net from recalc
51 N ENI,ENFUND,ENFUNDI,ENPM,ENPMI,ENSGL,ENSGLI,ENSMI,ENSN,PAMT,RAMT,SAMT
52 ; loop thru station
53 S ENSN="" F S ENSN=$O(^TMP($J,"R",ENSN)) Q:ENSN="" D
54 . S ENI(1)=$O(^ENG(6915.9,"B",ENSN,0))
55 . ; loop thru fund
56 . S ENFUND="" F S ENFUND=$O(^TMP($J,"R",ENSN,ENFUND)) Q:ENFUND="" D
57 . . S ENFUNDI=$O(^ENG(6914.6,"B",ENFUND,0))
58 . . S ENI(2)=$S(ENI(1):$O(^ENG(6915.9,ENI(1),1,"B",ENFUNDI,0)),1:"")
59 . . ; loop thru sgl
60 . . S ENSGL=""
61 . . F S ENSGL=$O(^TMP($J,"R",ENSN,ENFUND,ENSGL)) Q:ENSGL="" D
62 . . . S ENSGLI=$O(^ENG(6914.3,"B",ENSGL,0))
63 . . . S ENI(3)=$S(ENI(2):$O(^ENG(6915.9,ENI(1),1,ENI(2),1,"B",ENSGLI,0)),1:"")
64 . . . I ENI(1),ENI(2),ENI(3) Q ; already checked in FVST module
65 . . . S ENSMI=$S(ENI(3):$O(^ENG(6915.9,ENI(1),1,ENI(2),1,ENI(3),1,"B",ENDTR,0)),1:"")
66 . . . S ENPM=$S(ENI(3):$O(^ENG(6915.9,ENI(1),1,ENI(2),1,ENI(3),1,"B",ENDTR),-1),1:"")
67 . . . S ENPMI=$S(ENPM:$O(^ENG(6915.9,ENI(1),1,ENI(2),1,ENI(3),1,"B",ENPM,0)),1:"")
68 . . . S SAMT=$S(ENSMI:$P($G(^ENG(6915.9,ENI(1),1,ENI(2),1,ENI(3),1,ENSMI,0)),U,2),1:"")
69 . . . S PAMT=$S(ENPMI:$P($G(^ENG(6915.9,ENI(1),1,ENI(2),1,ENI(3),1,ENPMI,0)),U,2),1:"")
70 . . . I SAMT="" S SAMT=PAMT ; balance inherited from prior month
71 . . . S RAMT=$P($G(^TMP($J,"R",ENSN,ENFUND,ENSGL)),U)
72 . . . I +(SAMT-PAMT)'=+RAMT S ^TMP($J,"P",ENSN,ENFUND,ENSGL)=(+(SAMT-PAMT))_U_(+RAMT)
73 Q
74 ;ENFABAL2
Note: See TracBrowser for help on using the repository browser.