source: WorldVistAEHR/trunk/r/ENGINEERING-EN/ENFAR5B.m@ 1270

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

initial load of WorldVistAEHR

File size: 3.5 KB
RevLine 
[613]1ENFAR5B ;WIRMFO/SAB-FIXED ASSET RPT, VOUCHER SUMMARY (CONT); 5/22/97
2 ;;7.0;ENGINEERING;**29,39**;Aug 17, 1993
3GETBAL ; get balances from file #6915.9
4 ; find station
5 S ENI(1)=$$FIND1^DIC(6915.9,"","X",ENSNR,"B") Q:'ENI(1)
6 ; loop thru fund
7 S ENI(2)=0 F S ENI(2)=$O(^ENG(6915.9,ENI(1),1,ENI(2))) Q:'ENI(2) D
8 . S ENFUND=$$GET1^DIQ(6915.91,ENI(2)_","_ENI(1)_",",.01)
9 . ; loop thru sgl
10 . S ENI(3)=0
11 . F S ENI(3)=$O(^ENG(6915.9,ENI(1),1,ENI(2),1,ENI(3))) Q:'ENI(3) D
12 . . S ENSGL=$$GET1^DIQ(6915.911,ENI(3)_","_ENI(2)_","_ENI(1)_",",.01)
13 . . ; get two balances
14 . . S ENBAL1=$$GETBAL^ENFABAL(ENI(1),ENI(2),ENI(3),ENDTM1)
15 . . S ENBAL2=$$GETBAL^ENFABAL(ENI(1),ENI(2),ENI(3),ENDTM2)
16 . . ; save balances in ^tmp
17 . . S:ENBAL1>0!(ENBAL2>0) ^TMP($J,ENFUND,ENSGL)=ENBAL1_U_ENBAL2
18 Q
19PRINT ; print results
20 S (END,ENPG)=0 D NOW^%DTC S Y=% D DD^%DT S ENDTR=Y
21 S ENL="",$P(ENL,"-",IOM)=""
22 I '$D(^TMP($J)) S ENFUND="" D HD W !!,"No activity in selected period",!
23 S ENDTMO=$$FMTE^XLFDT($E(ENDTS,1,5)_"00"),ENDTMC=$$FMTE^XLFDT(ENDTM2)
24 S ENFUND="" F S ENFUND=$O(^TMP($J,ENFUND)) Q:ENFUND="" D Q:END
25 . S ENFUND("I")=$O(^ENG(6914.6,"B",ENFUND,0))
26 . S ENFUND("A")=$S(ENFUND("I"):$P($G(^ENG(6914.6,ENFUND("I"),0)),U,4),1:"")
27 . D HD Q:END
28 . S ENSGL="" F S ENSGL=$O(^TMP($J,ENFUND,ENSGL)) Q:ENSGL="" D Q:END
29 . . S ENBAL=$G(^TMP($J,ENFUND,ENSGL))
30 . . S ENSGL("I")=$O(^ENG(6914.3,"B",ENSGL,0))
31 . . S ENSGL("A")=$S(ENSGL("I"):$P($G(^ENG(6914.3,ENSGL("I"),0)),U,4),1:"")
32 . . W !!,?2,"SGL: ",ENSGL W:ENSGL("A")]"" " ",ENSGL("A")
33 . . S ENT("SGL")=0 ; initialize SGL net activity
34 . . W !,?12,"Opening Balance for ",ENDTMO,":"
35 . . W ?43,$J("$"_$FN(+$P(ENBAL,U,1),",",2),16)
36 . . S ENDT=""
37 . . F S ENDT=$O(^TMP($J,ENFUND,ENSGL,ENDT)) Q:ENDT="" D Q:END
38 . . . S ENY=""
39 . . . F S ENY=$O(^TMP($J,ENFUND,ENSGL,ENDT,ENY)) Q:ENY="" D Q:END
40 . . . . I $Y+4>IOSL D HD Q:END D HDSGL
41 . . . . S ENFILE=$P(ENY,";"),ENDA("F?")=$P(ENY,";",2)
42 . . . . S ENAMT=$P(^TMP($J,ENFUND,ENSGL,ENDT,ENY),U)
43 . . . . S ENY1=$G(^ENG(ENFILE,ENDA("F?"),1))
44 . . . . S ENDA=$P($G(^ENG(ENFILE,ENDA("F?"),0)),U)
45 . . . . W !,?4,$P(ENY1,U,6),?9,$P(ENY1,U,9),?21,$$FMTE^XLFDT(ENDT,"2D")
46 . . . . W ?31,ENDA,?43,$J($FN(ENAMT,",",2),16)
47 . . . . W ?61,$P($G(^ENG(6914,ENDA,2)),U,2) ; p.o.
48 . . . . I ENFILE=6915.3 D
49 . . . . . S ENNOTE=$P($G(^ENG(ENFILE,ENDA("F?"),3)),U,8)
50 . . . . . I ENNOTE]"" W !,?9,"Desc: ",ENNOTE
51 . . . . I ENFILE=6915.5 D
52 . . . . . S ENNOTE=$P($G(^ENG(ENFILE,ENDA("F?"),5)),U,8)
53 . . . . . I ENNOTE>0 W !,?9,"Sold: $",$FN(ENNOTE,",",2)
54 . . . . S ENT("SGL")=ENT("SGL")+ENAMT
55 . . Q:END
56 . . W !,?12,"G/L Acct "_ENSGL_" Net Activity: "
57 . . W ?43,$J($FN(ENT("SGL"),",",2),16)
58 . . W !,?12,"Closing Balance for ",ENDTMC,":"
59 . . W ?43,$J("$"_$FN(+$P(ENBAL,U,2),",",2),16)
60 I 'END,$E(IOST,1,2)="C-" S DIR(0)="E" D ^DIR K DIR
61 K ENDTMC,ENDTMO
62 Q
63HD ; page header
64 I $D(ZTQUEUED),$$S^%ZTLOAD S ZTSTOP=1,END=1 Q
65 I $E(IOST,1,2)="C-",ENPG S DIR(0)="E" D ^DIR K DIR I 'Y S END=1 Q
66 I $E(IOST,1,2)="C-"!ENPG W @IOF
67 S ENPG=ENPG+1
68 W !,"VOUCHER SUMMARY FOR STATION: ",ENSNR,?49,ENDTR,?72,"page ",ENPG
69 W !," FUND: ",ENFUND W:$G(ENFUND("A"))]"" " ",ENFUND("A")
70 W ?32," ACCOUNTING PERIOD FROM ",$$FMTE^XLFDT(ENDTS,"2D")
71 W " TO ",$$FMTE^XLFDT(ENDTE,"2D")
72 W !!,?4,"TRANSACTION",?31,"EQUIP ID#",?43,"NET AMOUNT",?61,"EQUIP P.O.#"
73 W !,?4,"CODE NUMBER DATE"
74 W !,?4,"---- ----------- --------",?31,"----------"
75 W ?43,"----------------",?61,"------------"
76 Q
77HDSGL ; header for continued SGL
78 W !,?2,"SGL: ",ENSGL W:ENSGL("A")]"" " ",ENSGL("A") W " (continued)"
79 Q
80 ;ENFAR5B
Note: See TracBrowser for help on using the repository browser.