source: FOIAVistA/trunk/r/IFCAP-PRC-PRX--PRCA--PRCN/PRCPRSO1.m@ 1783

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

initial load of FOIAVistA 6/30/08 version

File size: 3.4 KB
Line 
1PRCPRSO1 ;WISC/RFJ/VAC-days of stock on hand report (print) ; 9/20/06 11:15am
2 ;;5.1;IFCAP;**98**;Oct 20, 2000;Build 37
3 ;Per VHA Directive 2004-038, this routine should not be modified.
4 ;
5 ;*98 Modified to show Standard, ODI or Both
6 Q
7 ;
8 ;
9PRINT ; print report
10 N %,%H,%I,D,DESCR,GROUP,ITEMDA,NOW,NSN,PAGE,PRCPFLAG,SCREEN,TOTAL,X,Y
11 D NOW^%DTC S Y=% D DD^%DT S NOW=Y,PAGE=1,SCREEN=$$SCRPAUSE^PRCPUREP U IO D H
12 I PRCP("DPTYPE")="W" D WHSE
13 I PRCP("DPTYPE")'="W" D PRIMARY
14 I '$G(PRCPFLAG),$Y>(IOSL-3) D:SCREEN P^PRCPUREP I '$G(PRCPFLAG) D H
15 I $G(PRCPFLAG) Q
16 W !!?38,"TOTAL SELLING VALUE IN STOCK: ",$J(TOTAL,12,2)
17 D END^PRCPUREP
18 Q
19 ;
20 ;
21WHSE ; print whse report
22 S TOTAL=0,NSN="" F S NSN=$O(^TMP($J,"PRCPRSOH",NSN)) Q:NSN=""!($G(PRCPFLAG)) S ITEMDA=0 F S ITEMDA=$O(^TMP($J,"PRCPRSOH",NSN,ITEMDA)) Q:'ITEMDA!($G(PRCPFLAG)) S D=^(ITEMDA) D
23 . I $G(ZTQUEUED),$$S^%ZTLOAD S PRCPFLAG=1 W !?10,"<<< TASKMANAGER JOB TERMINATED BY USER >>>" Q
24 . W !,$TR(NSN,"-"),?15,$E($$DESCR^PRCPUX1(PRCP("I"),ITEMDA),1,15),?31,ITEMDA,?37,$J($$UNIT^PRCPUX1(PRCP("I"),ITEMDA,"/"),8)
25 . S TOTAL=TOTAL+$P(D,"^",5)
26 . I $P(D,"^",5)>99999.99 S $P(D,"^",5)=">99999"
27 . I $P(D,"^",4)>9999 S $P(D,"^",4)=">9999"
28 . I $P(D,"^",3)>9999 S $P(D,"^",3)=">9999"
29 . I $P(D,"^",2)>99.99 S $P(D,"^",2)=">99.99"
30 . I $P(D,"^")>99999 S $P(D,"^")=">99999"
31 . W ?45,$J($P(D,"^"),7),$J($P(D,"^",2),7),$J($P(D,"^",3),6),$J($P(D,"^",4),6),$J($P(D,"^",5),9)
32 . I $Y>(IOSL-4) D:SCREEN P^PRCPUREP Q:$D(PRCPFLAG) D H
33 Q
34 ;
35 ;
36PRIMARY ; print primary or secondary report
37 S TOTAL=0,GROUP="" F S GROUP=$O(^TMP($J,"PRCPRSOH",GROUP)) Q:GROUP=""!($G(PRCPFLAG)) D
38 . I $G(ZTQUEUED),$$S^%ZTLOAD S PRCPFLAG=1 W !?10,"<<< TASKMANAGER JOB TERMINATED BY USER >>>" Q
39 . I $Y>(IOSL-6) D:SCREEN P^PRCPUREP Q:$D(PRCPFLAG) D H
40 . W !!?5,"GROUP: ",$S(GROUP=" ":"<<NONE>>",1:GROUP)
41 . S DESCR="" F S DESCR=$O(^TMP($J,"PRCPRSOH",GROUP,DESCR)) Q:DESCR=""!($G(PRCPFLAG)) S ITEMDA=0 F S ITEMDA=$O(^TMP($J,"PRCPRSOH",GROUP,DESCR,ITEMDA)) Q:'ITEMDA!($G(PRCPFLAG)) S D=^(ITEMDA) D
42 . . W !,$E($$DESCR^PRCPUX1(PRCP("I"),ITEMDA),1,30),?31,ITEMDA,?37,$J($$UNIT^PRCPUX1(PRCP("I"),ITEMDA,"/"),8)
43 . . S TOTAL=TOTAL+$P(D,"^",5)
44 . . I $P(D,"^",5)>99999.99 S $P(D,"^",5)=">99999"
45 . . I $P(D,"^",4)>9999 S $P(D,"^",4)=">9999"
46 . . I $P(D,"^",3)>9999 S $P(D,"^",3)=">9999"
47 . . I $P(D,"^",2)>99.99 S $P(D,"^",2)=">99.99"
48 . . I $P(D,"^")>99999 S $P(D,"^")=">99999"
49 . . W ?45,$J($P(D,"^"),7),$J($P(D,"^",2),7),$J($P(D,"^",3),6),$J($P(D,"^",4),6),$J($P(D,"^",5),9)
50 . . I $Y>(IOSL-4) D:SCREEN P^PRCPUREP Q:$D(PRCPFLAG) D H
51 Q
52 ;
53 ;
54H S %=NOW_" PAGE "_PAGE,PAGE=PAGE+1 I PAGE'=2!(SCREEN) W @IOF
55 W $C(13),"DAYS OF STOCK ON HAND REPORT: ",$E(PRCP("IN"),1,20),?(80-$L(%)),%
56 S %="",$P(%,"-",81)=""
57 W !?5,"USAGE DATE RANGE FROM ",DATESTRD," TO ",DATEENDD," (",TOTALDAY," DAYS)"
58 W !?5,"ITEMS WITH STOCK ON HAND ",$S(PRCPTYPE=1:"LESS",1:"GREATER")," THAN ",PRCPDAYS," DAYS"
59 I PRCP("DPTYPE")'="W" D
60 . I ODIFLG=1 W !?5,"REPORT SHOWS STANDARD ITEMS ONLY"
61 . I ODIFLG=2 W !?5,"REPORT SHOWS ON-DEMAND ITEMS ONLY"
62 . I ODIFLG=3 W !?5,"REPORT SHOWS BOTH STANDARD AND ON-DEMAND ITEMS"
63 W !?45,$J("TOTAL",7),$J("DAYS",7),$J("QTY",6),$J("DAYS",6),$J("SELL",9)
64 I PRCP("DPTYPE")="W" W !,"NSN",?15,"DESCRIPTION"
65 E W !,"DESCRIPTION"
66 W ?31,"IM",$J("UNIT/IS",12),?45,$J("USAGE",7),$J("AVG",7),$J("ONHND",6),$J("LEFT",6),$J("VALUE",9),!,%
67 Q
Note: See TracBrowser for help on using the repository browser.