source: FOIAVistA/trunk/r/EQUIPMENT_TURN_IN_REQUEST-PRCN/PRCNCOST.m@ 1757

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

initial load of FOIAVistA 6/30/08 version

File size: 2.4 KB
Line 
1PRCNCOST ;SSI/SEB-Display Cost Report ;[ 02/26/97 5:57 PM ]
2 ;;1.0;PRCN;**3**;Sep 13, 1996
3EN ;
4 W !!,"This report should be printed on 132 column paper !"
5 S IOM=132,%ZIS="Q" D ^%ZIS Q:POP>0
6 I $D(IO("Q")) D Q
7 . S ZTRTN="BEG^PRCNCOST",ZTDESC="Equipment Cost Report"
8 . D ^%ZTLOAD,HOME^%ZIS K IO("Q"),ZTSK,%ZTLOAD,ZTREQ
9 I $E(IOST)="C" U IO
10BEG K ^TMP($J) S PG=0,$P(LIN,"-",130)=""
11 D HDR S GTOTAL=0,D0=""
12 F STA=10,31 F S D0=$O(^PRCN(413,"AC",STA,D0)) Q:D0="" D
13 . S PSERV=$P(^PRCN(413,D0,0),U,3) Q:PSERV=""
14 . S SERV=$P(^DIC(49,PSERV,0),U),^TMP($J,"COST",SERV,D0)=""
15 S SERV=""
16SRV S SERV=$O(^TMP($J,"COST",SERV)) G EXIT:$G(C)'="",FIN:SERV=""
17 W !,"Service: ",SERV S (D0,STOTAL)=0,NL=NL+1 D CHKPG Q:$G(C)'=""
18 S D0="" F S D0=$O(^TMP($J,"COST",SERV,D0)) Q:D0="" D GETSUMS
19 Q:$D(C) W !!,"Subtotal for ",SERV,":",?117,$J(STOTAL,10,2),!
20 F I=1:1:130 W "-"
21 S GTOTAL=GTOTAL+STOTAL,NL=NL+3 D CHKPG
22 G SRV
23FIN W !,"Total:",?117,$J(GTOTAL,10,2) S NL=NL+1 D CHKPG
24 I $E(IOST)'="C" W @IOF
25 D ^%ZISC
26EXIT K D0,D1,GTOTAL,STOTAL,LTOTAL,TOTAL,SERV,PSERV,C,FN,I,NL,PN,COST
27 K TXT,LIN,STA,^TMP($J,"COST")
28 Q
29GETSUMS ; Get line item total & display stuff
30 W !,$P(^PRCN(413,D0,0),U) S (D1,TOTAL,LTOTAL)=0
31 F S D1=$O(^PRCN(413,D0,1,D1)) Q:'+D1 D
32 . S DR=15,DR(413.015)=6,DIQ(0)="C",DIQ="LBTOT"
33 . S DIC=413,DA=D0,DA(1)=D1,DA(413.015)=D1 NEW D1
34 . D EN^DIQ1
35 . S X=$G(LBTOT(413.015,DA(413.015),6))
36 . S LTOTAL=LTOTAL+X
37 . K DIC,LBTOT,DIC,DR,DIQ,DA,X
38 S TOTAL=TOTAL+LTOTAL W $J(LTOTAL,10,2)
39 F FN=20,22,24,53,54,60,63,65,66 D
40 . S:FN<25 I=2,PN=FN-15 S:FN>25 I=7,PN=FN-51
41 . S COST=$P($G(^PRCN(413,D0,I)),U,PN),TOTAL=TOTAL+COST
42 . W $J(COST,10,2)
43 W $J(TOTAL,10,2) S STOTAL=STOTAL+TOTAL,NL=NL+1 D CHKPG
44 Q
45CHKPG ; If printing to screen & it is full, clear screen
46 Q:IOT'["TRM"!(IOSL>NL+3) W !,"Hit RETURN to continue or '^' to quit. "
47 R C:DTIME S:'$T C=U K:C'?1"^".E C
48 Q
49HDR ; Print a header for the report
50 S PG=PG+1,TXT=" " I $E(IOST)="C" W @IOF
51 W !,"EQUIPMENT REQUEST COST SUMMARY REPORT"
52 W $J("",IOM-$L(TXT)\2) S X="N",%DT="T" D ^%DT W $$FMTE^XLFDT(Y,"1P")_" PAGE: "_PG,!
53 W ?31,"Annual",?61,"Training",?71,"Training",?81,"Constr./",?91
54 W "Special",?101,"Test",?111,"Maint.",!,?21,"Line Item",?31,"Recurring"
55 W ?41,"Training",?51,"Contract",?61,"Tuition",?71,"Travel",?81
56 W "Renov.",?91,"Install.",?101,"Equipment",?111,"Impact",?121,"Total"
57 W !,"Transaction #" S NL=5 F I=2:1:12 W ?(I*10+1),"Cost"
58 W !,LIN
59 Q
Note: See TracBrowser for help on using the repository browser.