PRCPSMSP ;WISC/RFJ-isms purchase order transaction ;24 Oct 91
;;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" W !,"THIS OPTION SHOULD ONLY BE USED BY THE WAREHOUSE INVENTORY POINT." Q
I $$ISMSFLAG^PRCPUX2(PRC("SITE"))'=2 W !,"YOU NEED TO TURN THE ISMS SWITCH 'ON' BEFORE YOU CAN USE THIS OPTION." Q
N %,%I,COUNT,D,DA,DIC,PARTLDA,PODA,PRCPFLAG,PRCPWAIT,PURORDER,TOTAL,X,Y
S IOP="HOME" D ^%ZIS K IOP,^TMP($J,"PO"),^TMP($J,"STRING")
SELECTPO W !!,"Select PURCHASE ORDER: " R X:DTIME S:'$T X="^" G:X["^"!(X="") Q I X["?" D G SELECTPO
. S D="G",DIC="^PRC(442,",DIC(0)="QECM",DIC("W")="D DICW^PRCPPOU1",DIC("S")="I $D(^PRC(442,""G"",PRCP(""I""),+Y)) S %=$P($G(^PRCD(442.3,+$G(^PRC(442,+Y,7)),0)),U,2) I %>24,%<42" D IX^DIC K DIC
S DIC="^PRC(442,",DIC(0)="EQMZ",DIC("S")="I $D(^PRC(442,""G"",PRCP(""I""),+Y)) S %=$P($G(^PRCD(442.3,+$G(^PRC(442,+Y,7)),0)),U,2) I %>24,%<42" D ^DIC K DIC G:Y<0 SELECTPO S PODA=+Y,PURORDER=$P($P(^PRC(442,PODA,0),"^"),"-",2)
S PRCPWAIT=1 S:'$D(^PRC(442,PODA,2,0)) ^(0)="^442.11D^^" K DIC W !!,"To select ALL line partial dates, press RETURN."
F S DIC="^PRC(442,"_PODA_",11,",DA(1)=PODA,DIC(0)="QEAMZ",DIC("S")="I $P(^(0),U,16)'=""""" D ^DIC K DIC S DA=+Y D:DA>0 Q:DA'>0
. S PARTLDA=DA W !," ...creating code sheets" K ^TMP($J,"STRING") D DQ^PRCPSMPR
. I $O(^TMP($J,"STRING",0))="" W " NO code sheets created!" Q
. K ^TMP($J,"PO",PARTLDA) S (COUNT,TOTAL)=0 F S COUNT=$O(^TMP($J,"STRING",COUNT)) Q:'COUNT S ^TMP($J,"PO",PARTLDA,COUNT)=^TMP($J,"STRING",COUNT),TOTAL=TOTAL+1 W !?6,^(COUNT)
. W !,"TOTAL CODE SHEETS CREATED: ",+TOTAL,!
I '$O(^TMP($J,"PO",0)) S XP="Do you want to select ALL partial dates",XH="Enter 'YES' to select ALL partial dates, 'NO' or '^' to exit." W ! I $$YN^PRCPUYN(1)=1 D
. W @IOF S DA=0 F S DA=$O(^PRC(442,PODA,11,DA)) Q:'DA!($D(PRCPFLAG)) D
. . S PARTLDA=DA W !!,"PARTIAL: ",DA,?15," ...creating code sheets" K ^TMP($J,"STRING") D DQ^PRCPSMPR
. . I $O(^TMP($J,"STRING",0))="" W " NO code sheets created!" Q
. . K ^TMP($J,"PO",PARTLDA) S (COUNT,TOTAL)=0 F S COUNT=$O(^TMP($J,"STRING",COUNT)) Q:'COUNT S ^TMP($J,"PO",PARTLDA,COUNT)=^TMP($J,"STRING",COUNT),TOTAL=TOTAL+1 W !?6,^(COUNT)
. . W !,"TOTAL CODE SHEETS CREATED: ",+TOTAL,!
. . I $Y>(IOSL-5) D P^PRCPUREP W @IOF
. I '$D(PRCPFLAG) D R^PRCPUREP
I $D(PRCPFLAG) D Q Q
I '$O(^TMP($J,"PO",0)) W !,"NO PARTIAL DATES SELECTED." D Q Q
K ^TMP($J,"STRING")
W @IOF,!,"YOU HAVE SELECTED THE FOLLOWING PARTIAL DATES TO UPDATE ISMS PURCHASES:" S DA=0,COUNT=1 F S DA=$O(^TMP($J,"PO",DA)) Q:'DA!($D(PRCPFLAG)) D
. S %=$G(^PRC(442,PODA,11,DA,0)),Y=$P(%,"^") W !,"PARTIAL ",DA,?15,"DATE: ",$E(Y,4,5),"-",$E(Y,6,7),"-",$E(Y,2,3),?40,$S($P(%,"^",9)="F":"FINAL",1:"PARTIAL")
. S %=0 F S %=$O(^TMP($J,"PO",DA,%)) Q:'% S ^TMP($J,"STRING",COUNT)=^TMP($J,"PO",DA,%),COUNT=COUNT+1
. I $Y>(IOSL-5) D P^PRCPUREP W @IOF
I $D(PRCPFLAG) D Q Q
I '$O(^TMP($J,"STRING",0)) W !!,"NO CODE SHEETS CREATED." D Q Q
S XP="*** ARE YOU SURE YOU WANT TO CREATE THE ISMS TRANSACTION",XP(1)=" AND TRANSMIT IT TO AUSTIN",XH="ENTER 'YES' TO CREATE THE ISMS TRANSACTION AND TRANSMIT IT TO AUSTIN",XH(1)="ENTER 'NO' OR '^' TO EXIT."
W !! I $$YN^PRCPUYN(1)'=1 D Q Q
D CODESHT^PRCPSMGO(PRC("SITE"),"REP",PURORDER)
Q K ^TMP($J,"PO"),^TMP($J,"STRING") Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPRCPSMSP 3449 printed Dec 13, 2024@02:16:01 Page 2
PRCPSMSP ;WISC/RFJ-isms purchase order transaction ;24 Oct 91
+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"
WRITE !,"THIS OPTION SHOULD ONLY BE USED BY THE WAREHOUSE INVENTORY POINT."
QUIT
+5 IF $$ISMSFLAG^PRCPUX2(PRC("SITE"))'=2
WRITE !,"YOU NEED TO TURN THE ISMS SWITCH 'ON' BEFORE YOU CAN USE THIS OPTION."
QUIT
+6 NEW %,%I,COUNT,D,DA,DIC,PARTLDA,PODA,PRCPFLAG,PRCPWAIT,PURORDER,TOTAL,X,Y
+7 SET IOP="HOME"
DO ^%ZIS
KILL IOP,^TMP($JOB,"PO"),^TMP($JOB,"STRING")
SELECTPO WRITE !!,"Select PURCHASE ORDER: "
READ X:DTIME
if '$TEST
SET X="^"
if X["^"!(X="")
GOTO Q
IF X["?"
Begin DoDot:1
+1 SET D="G"
SET DIC="^PRC(442,"
SET DIC(0)="QECM"
SET DIC("W")="D DICW^PRCPPOU1"
SET DIC("S")="I $D(^PRC(442,""G"",PRCP(""I""),+Y)) S %=$P($G(^PRCD(442.3,+$G(^PRC(442,+Y,7)),0)),U,2) I %>24,%<42"
DO IX^DIC
KILL DIC
End DoDot:1
GOTO SELECTPO
+2 SET DIC="^PRC(442,"
SET DIC(0)="EQMZ"
SET DIC("S")="I $D(^PRC(442,""G"",PRCP(""I""),+Y)) S %=$P($G(^PRCD(442.3,+$G(^PRC(442,+Y,7)),0)),U,2) I %>24,%<42"
DO ^DIC
KILL DIC
if Y<0
GOTO SELECTPO
SET PODA=+Y
SET PURORDER=$PIECE($PIECE(^PRC(442,PODA,0),"^"),"-",2)
+3 SET PRCPWAIT=1
if '$DATA(^PRC(442,PODA,2,0))
SET ^(0)="^442.11D^^"
KILL DIC
WRITE !!,"To select ALL line partial dates, press RETURN."
+4 FOR
SET DIC="^PRC(442,"_PODA_",11,"
SET DA(1)=PODA
SET DIC(0)="QEAMZ"
SET DIC("S")="I $P(^(0),U,16)'="""""
DO ^DIC
KILL DIC
SET DA=+Y
if DA>0
Begin DoDot:1
+5 SET PARTLDA=DA
WRITE !," ...creating code sheets"
KILL ^TMP($JOB,"STRING")
DO DQ^PRCPSMPR
+6 IF $ORDER(^TMP($JOB,"STRING",0))=""
WRITE " NO code sheets created!"
QUIT
+7 KILL ^TMP($JOB,"PO",PARTLDA)
SET (COUNT,TOTAL)=0
FOR
SET COUNT=$ORDER(^TMP($JOB,"STRING",COUNT))
if 'COUNT
QUIT
SET ^TMP($JOB,"PO",PARTLDA,COUNT)=^TMP($JOB,"STRING",COUNT)
SET TOTAL=TOTAL+1
WRITE !?6,^(COUNT)
+8 WRITE !,"TOTAL CODE SHEETS CREATED: ",+TOTAL,!
End DoDot:1
if DA'>0
QUIT
+9 IF '$ORDER(^TMP($JOB,"PO",0))
SET XP="Do you want to select ALL partial dates"
SET XH="Enter 'YES' to select ALL partial dates, 'NO' or '^' to exit."
WRITE !
IF $$YN^PRCPUYN(1)=1
Begin DoDot:1
+10 WRITE @IOF
SET DA=0
FOR
SET DA=$ORDER(^PRC(442,PODA,11,DA))
if 'DA!($DATA(PRCPFLAG))
QUIT
Begin DoDot:2
+11 SET PARTLDA=DA
WRITE !!,"PARTIAL: ",DA,?15," ...creating code sheets"
KILL ^TMP($JOB,"STRING")
DO DQ^PRCPSMPR
+12 IF $ORDER(^TMP($JOB,"STRING",0))=""
WRITE " NO code sheets created!"
QUIT
+13 KILL ^TMP($JOB,"PO",PARTLDA)
SET (COUNT,TOTAL)=0
FOR
SET COUNT=$ORDER(^TMP($JOB,"STRING",COUNT))
if 'COUNT
QUIT
SET ^TMP($JOB,"PO",PARTLDA,COUNT)=^TMP($JOB,"STRING",COUNT)
SET TOTAL=TOTAL+1
WRITE !?6,^(COUNT)
+14 WRITE !,"TOTAL CODE SHEETS CREATED: ",+TOTAL,!
+15 IF $Y>(IOSL-5)
DO P^PRCPUREP
WRITE @IOF
End DoDot:2
+16 IF '$DATA(PRCPFLAG)
DO R^PRCPUREP
End DoDot:1
+17 IF $DATA(PRCPFLAG)
DO Q
QUIT
+18 IF '$ORDER(^TMP($JOB,"PO",0))
WRITE !,"NO PARTIAL DATES SELECTED."
DO Q
QUIT
+19 KILL ^TMP($JOB,"STRING")
+20 WRITE @IOF,!,"YOU HAVE SELECTED THE FOLLOWING PARTIAL DATES TO UPDATE ISMS PURCHASES:"
SET DA=0
SET COUNT=1
FOR
SET DA=$ORDER(^TMP($JOB,"PO",DA))
if 'DA!($DATA(PRCPFLAG))
QUIT
Begin DoDot:1
+21 SET %=$GET(^PRC(442,PODA,11,DA,0))
SET Y=$PIECE(%,"^")
WRITE !,"PARTIAL ",DA,?15,"DATE: ",$EXTRACT(Y,4,5),"-",$EXTRACT(Y,6,7),"-",$EXTRACT(Y,2,3),?40,$SELECT($PIECE(%,"^",9)="F":"FINAL",1:"PARTIAL")
+22 SET %=0
FOR
SET %=$ORDER(^TMP($JOB,"PO",DA,%))
if '%
QUIT
SET ^TMP($JOB,"STRING",COUNT)=^TMP($JOB,"PO",DA,%)
SET COUNT=COUNT+1
+23 IF $Y>(IOSL-5)
DO P^PRCPUREP
WRITE @IOF
End DoDot:1
+24 IF $DATA(PRCPFLAG)
DO Q
QUIT
+25 IF '$ORDER(^TMP($JOB,"STRING",0))
WRITE !!,"NO CODE SHEETS CREATED."
DO Q
QUIT
+26 SET XP="*** ARE YOU SURE YOU WANT TO CREATE THE ISMS TRANSACTION"
SET XP(1)=" AND TRANSMIT IT TO AUSTIN"
SET XH="ENTER 'YES' TO CREATE THE ISMS TRANSACTION AND TRANSMIT IT TO AUSTIN"
SET XH(1)="ENTER 'NO' OR '^' TO EXIT."
+27 WRITE !!
IF $$YN^PRCPUYN(1)'=1
DO Q
QUIT
+28 DO CODESHT^PRCPSMGO(PRC("SITE"),"REP",PURORDER)
Q KILL ^TMP($JOB,"PO"),^TMP($JOB,"STRING")
QUIT