PRCPAWS0 ;WISC/RFJ-adjust inventory level - supply only adjustment ;11 Mar 94
;;5.1;IFCAP;;Oct 20, 2000
;Per VHA Directive 10-93-142, this routine should not be modified.
Q
;
;
; called from prcpawa0 for type 4 supply only adjustment
SUPPLY ; supply only adjustment
; select item from the inventory point and ask for input.
N DATA,ITEMDA,ITEMDATA,ORDERNO,PRCPAWN0,PRCPID,QTY,REASON,VALUE
K X S X(1)="NOTE: ITEMS ADJUSTED UNDER THIS OPTION WILL NOT AUTOMATICALLY CREATE THE FMS OR ISMS CODE SHEETS. THE CODE SHEETS WILL HAVE TO BE MANUALLY CREATED." W ! D DISPLAY^PRCPUX2(5,75,.X)
K ^TMP($J,"PRCPAWS0")
F D Q:'ITEMDA W !!!!!
. W !!," >> Select an item number from the ",PRCP("IN")," inventory point. <<"
. S ITEMDA=$$ITEM^PRCPUITM(PRCP("I"),0,"","") I 'ITEMDA Q
. D SHOWDATA^PRCPAWA0(PRCP("I"),ITEMDA)
. ;
. ; item already selected
. I $D(^TMP($J,"PRCPAWS0","PROCESS",ITEMDA)) S XP=" THIS ITEM WAS PREVIOUSLY SELECTED DURING THIS SELECTION PROCESS.",XP(1)=" OK TO REMOVE THIS ADJUSTMENT SO YOU CAN ENTER A NEW ONE" W !! I $$YN^PRCPUYN(1)'=1 Q
. K ^TMP($J,"PRCPAWS0","PROCESS",ITEMDA)
. ;
. ; enter adjustment
. S ITEMDATA=$G(^PRCP(445,PRCP("I"),1,ITEMDA,0)) I ITEMDATA="" Q
. W !!,"**************** E N T E R A D J U S T M E N T D A T A ****************",!
. S QTY=$$QTY^PRCPAWU0(-$P(ITEMDATA,"^",7),99998) I QTY["^" Q
. S VALUE=$$VALUE^PRCPAWU0(-99999.99,99999.99," INVENTORY","") I VALUE["^" Q
. I 'QTY,'VALUE W !!?10,">> EITHER QUANTITY OR VALUE NEEDS TO BE ENTERED FOR AN ADJUSTMENT <<" Q
. W ! S REASON=$$REASON^PRCPAWU0("") I REASON["^" Q
. S ^TMP($J,"PRCPAWS0","PROCESS",ITEMDA)=QTY_"^^"_VALUE_"^^^^"_REASON
;
I ITEMDA["^" D Q Q
I '$O(^TMP($J,"PRCPAWS0","PROCESS",0)) W !!?10,">> NO ITEMS HAVE BEEN SELECTED <<" D Q Q
;
K X S X(1)="NOTE: ITEMS ADJUSTED UNDER THIS OPTION WILL NOT AUTOMATICALLY CREATE THE FMS OR ISMS CODE SHEETS. THE CODE SHEETS WILL HAVE TO BE MANUALLY CREATED." W ! D DISPLAY^PRCPUX2(5,75,.X)
S XP="READY TO PROCESS INVENTORY ADJUSTMENTS",XH="Enter YES to PROCESS the INVENTORY adjustments, NO to exit."
W !! I $$YN^PRCPUYN(1)'=1 D Q Q
;
; process inventory adjustments
S ORDERNO=$$ORDERNO^PRCPUTRX(PRCP("I"))
S ITEMDA=0 F S ITEMDA=$O(^TMP($J,"PRCPAWS0","PROCESS",ITEMDA)) Q:'ITEMDA S DATA=^(ITEMDA) I DATA'="" D
. K PRCPAWN0
. S PRCPAWN0("QTY")=$P(DATA,"^"),PRCPAWN0("INVVAL")=$P(DATA,"^",3),PRCPAWN0("SELVAL")=0,PRCPAWN0("REASON")="0:"_$P(DATA,"^",7),PRCPAWN0("2237PO")=PRC("SITE")
. D ITEM^PRCPUUIW(PRCP("I"),ITEMDA,"A",ORDERNO,.PRCPAWN0)
. K PRCPAWN0
;
; create log or isms code sheets
D CODESHTS^PRCPAWC0(PRCP("I"),"A"_ORDERNO)
; print form
D PRINFORM^PRCPAWR0("A"_ORDERNO)
Q K ^TMP($J,"PRCPAWS0")
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPRCPAWS0 2796 printed Nov 22, 2024@17:23:02 Page 2
PRCPAWS0 ;WISC/RFJ-adjust inventory level - supply only adjustment ;11 Mar 94
+1 ;;5.1;IFCAP;;Oct 20, 2000
+2 ;Per VHA Directive 10-93-142, this routine should not be modified.
+3 QUIT
+4 ;
+5 ;
+6 ; called from prcpawa0 for type 4 supply only adjustment
SUPPLY ; supply only adjustment
+1 ; select item from the inventory point and ask for input.
+2 NEW DATA,ITEMDA,ITEMDATA,ORDERNO,PRCPAWN0,PRCPID,QTY,REASON,VALUE
+3 KILL X
SET X(1)="NOTE: ITEMS ADJUSTED UNDER THIS OPTION WILL NOT AUTOMATICALLY CREATE THE FMS OR ISMS CODE SHEETS. THE CODE SHEETS WILL HAVE TO BE MANUALLY CREATED."
WRITE !
DO DISPLAY^PRCPUX2(5,75,.X)
+4 KILL ^TMP($JOB,"PRCPAWS0")
+5 FOR
Begin DoDot:1
+6 WRITE !!," >> Select an item number from the ",PRCP("IN")," inventory point. <<"
+7 SET ITEMDA=$$ITEM^PRCPUITM(PRCP("I"),0,"","")
IF 'ITEMDA
QUIT
+8 DO SHOWDATA^PRCPAWA0(PRCP("I"),ITEMDA)
+9 ;
+10 ; item already selected
+11 IF $DATA(^TMP($JOB,"PRCPAWS0","PROCESS",ITEMDA))
SET XP=" THIS ITEM WAS PREVIOUSLY SELECTED DURING THIS SELECTION PROCESS."
SET XP(1)=" OK TO REMOVE THIS ADJUSTMENT SO YOU CAN ENTER A NEW ONE"
WRITE !!
IF $$YN^PRCPUYN(1)'=1
QUIT
+12 KILL ^TMP($JOB,"PRCPAWS0","PROCESS",ITEMDA)
+13 ;
+14 ; enter adjustment
+15 SET ITEMDATA=$GET(^PRCP(445,PRCP("I"),1,ITEMDA,0))
IF ITEMDATA=""
QUIT
+16 WRITE !!,"**************** E N T E R A D J U S T M E N T D A T A ****************",!
+17 SET QTY=$$QTY^PRCPAWU0(-$PIECE(ITEMDATA,"^",7),99998)
IF QTY["^"
QUIT
+18 SET VALUE=$$VALUE^PRCPAWU0(-99999.99,99999.99," INVENTORY","")
IF VALUE["^"
QUIT
+19 IF 'QTY
IF 'VALUE
WRITE !!?10,">> EITHER QUANTITY OR VALUE NEEDS TO BE ENTERED FOR AN ADJUSTMENT <<"
QUIT
+20 WRITE !
SET REASON=$$REASON^PRCPAWU0("")
IF REASON["^"
QUIT
+21 SET ^TMP($JOB,"PRCPAWS0","PROCESS",ITEMDA)=QTY_"^^"_VALUE_"^^^^"_REASON
End DoDot:1
if 'ITEMDA
QUIT
WRITE !!!!!
+22 ;
+23 IF ITEMDA["^"
DO Q
QUIT
+24 IF '$ORDER(^TMP($JOB,"PRCPAWS0","PROCESS",0))
WRITE !!?10,">> NO ITEMS HAVE BEEN SELECTED <<"
DO Q
QUIT
+25 ;
+26 KILL X
SET X(1)="NOTE: ITEMS ADJUSTED UNDER THIS OPTION WILL NOT AUTOMATICALLY CREATE THE FMS OR ISMS CODE SHEETS. THE CODE SHEETS WILL HAVE TO BE MANUALLY CREATED."
WRITE !
DO DISPLAY^PRCPUX2(5,75,.X)
+27 SET XP="READY TO PROCESS INVENTORY ADJUSTMENTS"
SET XH="Enter YES to PROCESS the INVENTORY adjustments, NO to exit."
+28 WRITE !!
IF $$YN^PRCPUYN(1)'=1
DO Q
QUIT
+29 ;
+30 ; process inventory adjustments
+31 SET ORDERNO=$$ORDERNO^PRCPUTRX(PRCP("I"))
+32 SET ITEMDA=0
FOR
SET ITEMDA=$ORDER(^TMP($JOB,"PRCPAWS0","PROCESS",ITEMDA))
if 'ITEMDA
QUIT
SET DATA=^(ITEMDA)
IF DATA'=""
Begin DoDot:1
+33 KILL PRCPAWN0
+34 SET PRCPAWN0("QTY")=$PIECE(DATA,"^")
SET PRCPAWN0("INVVAL")=$PIECE(DATA,"^",3)
SET PRCPAWN0("SELVAL")=0
SET PRCPAWN0("REASON")="0:"_$PIECE(DATA,"^",7)
SET PRCPAWN0("2237PO")=PRC("SITE")
+35 DO ITEM^PRCPUUIW(PRCP("I"),ITEMDA,"A",ORDERNO,.PRCPAWN0)
+36 KILL PRCPAWN0
End DoDot:1
+37 ;
+38 ; create log or isms code sheets
+39 DO CODESHTS^PRCPAWC0(PRCP("I"),"A"_ORDERNO)
+40 ; print form
+41 DO PRINFORM^PRCPAWR0("A"_ORDERNO)
Q KILL ^TMP($JOB,"PRCPAWS0")
+1 QUIT