PRCPRAIR ;WISC/RFJ-abbreviated item report (option, whse) ;09 Jun 93
;;5.1;IFCAP;;Oct 20, 2000
;Per VHA Directive 10-93-142, this routine should not be modified.
D ^PRCPUSEL Q:'$G(PRCP("I"))
I PRCP("DPTYPE")'="W" D PRIMARY^PRCPRAIP Q
;
; abbreviated item report for whse
N PRCPEND,PRCPSTRT,X
K X S X(1)="The Abbreviated Item Report will sort the Warehouse inventory items by the NSN." D DISPLAY^PRCPUX2(40,79,.X)
K X S X(1)="Select the range of NSNs to display" D DISPLAY^PRCPUX2(2,40,.X)
D NSNSEL^PRCPURS0 I '$D(PRCPSTRT) Q
W ! S %ZIS="Q" D ^%ZIS Q:POP I $D(IO("Q")) D D ^%ZTLOAD K IO("Q"),ZTSK Q
. S ZTDESC="Abbreviated Item Report",ZTRTN="DQ^PRCPRAIR"
. S ZTSAVE("PRCP*")="",ZTSAVE("ZTREQ")="@"
W !!,"<*> please wait <*>"
DQ ; queue starts here
N %,%H,%I,ITEMDA,ITEMDATA,NOW,NSN,PAGE,PRCPFLAG,SCREEN,X,Y
K ^TMP($J,"PRCPRAIR")
S ITEMDA=0 F S ITEMDA=$O(^PRCP(445,PRCP("I"),1,ITEMDA)) Q:'ITEMDA D
. S NSN=$$NSN^PRCPUX1(ITEMDA) S:NSN="" NSN=" "
. I NSN]PRCPSTRT,PRCPEND]NSN S ^TMP($J,"PRCPRAIR",NSN,ITEMDA)=""
. I $E(NSN,1,$L(PRCPSTRT))=PRCPSTRT!($E(NSN,1,$L(PRCPEND))=PRCPEND) S ^TMP($J,"PRCPRAIR",NSN,ITEMDA)=""
; print report
D NOW^%DTC S Y=% D DD^%DT S NOW=Y,PAGE=1,SCREEN=$$SCRPAUSE^PRCPUREP U IO D H
S NSN="" F S NSN=$O(^TMP($J,"PRCPRAIR",NSN)) Q:NSN=""!($G(PRCPFLAG)) S ITEMDA=0 F S ITEMDA=$O(^TMP($J,"PRCPRAIR",NSN,ITEMDA)) Q:'ITEMDA!($G(PRCPFLAG)) D
. I $Y>(IOSL-6) D:SCREEN P^PRCPUREP Q:$D(PRCPFLAG) D H
. S ITEMDATA=$G(^PRCP(445,PRCP("I"),1,ITEMDA,0))
. W !,$TR(NSN,"-"),?15,$E($$DESCR^PRCPUX1(PRCP("I"),ITEMDA),1,23),?39,ITEMDA,?46,$J(+$P(ITEMDATA,"^",7),8),$J($$UNIT^PRCPUX1(PRCP("I"),ITEMDA,"/"),10),$J($$STORAGE^PRCPESTO(PRCP("I"),ITEMDA),16)
. S %=0 F S %=$O(^PRCP(445,PRCP("I"),1,ITEMDA,1,%)) Q:'%!($G(PRCPFLAG)) D
. . I $X>60 W !
. . S X=$E($$STORELOC^PRCPESTO(%),1,15),X=" "_X_$E(" ",$L(X)+1,15)
. . W X
. . I $X>60,$Y>(IOSL-6) D:SCREEN P^PRCPUREP Q:$D(PRCPFLAG) D H
. I $G(ZTQUEUED),$$S^%ZTLOAD S PRCPFLAG=1 W !?10,"<<< TASKMANAGER JOB TERMINATED BY USER >>>"
I '$G(PRCPFLAG) D END^PRCPUREP
D ^%ZISC K ^TMP($J,"PRCPRAIR")
Q
;
H S %=NOW_" PAGE "_PAGE,PAGE=PAGE+1 I PAGE'=2!(SCREEN) W @IOF
W $C(13),"ABBREVIATED ITEM REPORT FOR: ",$E(PRCP("IN"),1,20),?(80-$L(%)),%
S %="",$P(%,"-",81)=""
W !,"NSN",?15,"DESCRIPTION",?39,"MI",$J("QTY OH",13),$J("UNIT/IS",10),$J("MAIN STORAGE",16),!?5,"ADD STORAGE",?26,"ADD STORAGE",?46,"ADD STORAGE",?66,"ADD STORAGE",!,%
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPRCPRAIR 2538 printed Dec 13, 2024@02:14:32 Page 2
PRCPRAIR ;WISC/RFJ-abbreviated item report (option, whse) ;09 Jun 93
+1 ;;5.1;IFCAP;;Oct 20, 2000
+2 ;Per VHA Directive 10-93-142, this routine should not be modified.
+3 DO ^PRCPUSEL
if '$GET(PRCP("I"))
QUIT
+4 IF PRCP("DPTYPE")'="W"
DO PRIMARY^PRCPRAIP
QUIT
+5 ;
+6 ; abbreviated item report for whse
+7 NEW PRCPEND,PRCPSTRT,X
+8 KILL X
SET X(1)="The Abbreviated Item Report will sort the Warehouse inventory items by the NSN."
DO DISPLAY^PRCPUX2(40,79,.X)
+9 KILL X
SET X(1)="Select the range of NSNs to display"
DO DISPLAY^PRCPUX2(2,40,.X)
+10 DO NSNSEL^PRCPURS0
IF '$DATA(PRCPSTRT)
QUIT
+11 WRITE !
SET %ZIS="Q"
DO ^%ZIS
if POP
QUIT
IF $DATA(IO("Q"))
Begin DoDot:1
+12 SET ZTDESC="Abbreviated Item Report"
SET ZTRTN="DQ^PRCPRAIR"
+13 SET ZTSAVE("PRCP*")=""
SET ZTSAVE("ZTREQ")="@"
End DoDot:1
DO ^%ZTLOAD
KILL IO("Q"),ZTSK
QUIT
+14 WRITE !!,"<*> please wait <*>"
DQ ; queue starts here
+1 NEW %,%H,%I,ITEMDA,ITEMDATA,NOW,NSN,PAGE,PRCPFLAG,SCREEN,X,Y
+2 KILL ^TMP($JOB,"PRCPRAIR")
+3 SET ITEMDA=0
FOR
SET ITEMDA=$ORDER(^PRCP(445,PRCP("I"),1,ITEMDA))
if 'ITEMDA
QUIT
Begin DoDot:1
+4 SET NSN=$$NSN^PRCPUX1(ITEMDA)
if NSN=""
SET NSN=" "
+5 IF NSN]PRCPSTRT
IF PRCPEND]NSN
SET ^TMP($JOB,"PRCPRAIR",NSN,ITEMDA)=""
+6 IF $EXTRACT(NSN,1,$LENGTH(PRCPSTRT))=PRCPSTRT!($EXTRACT(NSN,1,$LENGTH(PRCPEND))=PRCPEND)
SET ^TMP($JOB,"PRCPRAIR",NSN,ITEMDA)=""
End DoDot:1
+7 ; print report
+8 DO NOW^%DTC
SET Y=%
DO DD^%DT
SET NOW=Y
SET PAGE=1
SET SCREEN=$$SCRPAUSE^PRCPUREP
USE IO
DO H
+9 SET NSN=""
FOR
SET NSN=$ORDER(^TMP($JOB,"PRCPRAIR",NSN))
if NSN=""!($GET(PRCPFLAG))
QUIT
SET ITEMDA=0
FOR
SET ITEMDA=$ORDER(^TMP($JOB,"PRCPRAIR",NSN,ITEMDA))
if 'ITEMDA!($GET(PRCPFLAG))
QUIT
Begin DoDot:1
+10 IF $Y>(IOSL-6)
if SCREEN
DO P^PRCPUREP
if $DATA(PRCPFLAG)
QUIT
DO H
+11 SET ITEMDATA=$GET(^PRCP(445,PRCP("I"),1,ITEMDA,0))
+12 WRITE !,$TRANSLATE(NSN,"-"),?15,$EXTRACT($$DESCR^PRCPUX1(PRCP("I"),ITEMDA),1,23),?39,ITEMDA,?46,$JUSTIFY(+$PIECE(ITEMDATA,"^",7),8),$JUSTIFY($$UNIT^PRCPUX1(PRCP("I"),ITEMDA,"/"),10),$JUSTIFY($$STORAGE^PRCPESTO(PRCP("I"),ITEMDA),16)
+13 SET %=0
FOR
SET %=$ORDER(^PRCP(445,PRCP("I"),1,ITEMDA,1,%))
if '%!($GET(PRCPFLAG))
QUIT
Begin DoDot:2
+14 IF $X>60
WRITE !
+15 SET X=$EXTRACT($$STORELOC^PRCPESTO(%),1,15)
SET X=" "_X_$EXTRACT(" ",$LENGTH(X)+1,15)
+16 WRITE X
+17 IF $X>60
IF $Y>(IOSL-6)
if SCREEN
DO P^PRCPUREP
if $DATA(PRCPFLAG)
QUIT
DO H
End DoDot:2
+18 IF $GET(ZTQUEUED)
IF $$S^%ZTLOAD
SET PRCPFLAG=1
WRITE !?10,"<<< TASKMANAGER JOB TERMINATED BY USER >>>"
End DoDot:1
+19 IF '$GET(PRCPFLAG)
DO END^PRCPUREP
+20 DO ^%ZISC
KILL ^TMP($JOB,"PRCPRAIR")
+21 QUIT
+22 ;
H SET %=NOW_" PAGE "_PAGE
SET PAGE=PAGE+1
IF PAGE'=2!(SCREEN)
WRITE @IOF
+1 WRITE $CHAR(13),"ABBREVIATED ITEM REPORT FOR: ",$EXTRACT(PRCP("IN"),1,20),?(80-$LENGTH(%)),%
+2 SET %=""
SET $PIECE(%,"-",81)=""
+3 WRITE !,"NSN",?15,"DESCRIPTION",?39,"MI",$JUSTIFY("QTY OH",13),$JUSTIFY("UNIT/IS",10),$JUSTIFY("MAIN STORAGE",16),!?5,"ADD STORAGE",?26,"ADD STORAGE",?46,"ADD STORAGE",?66,"ADD STORAGE",!,%
+4 QUIT