ASUASEOQ ;DSD/DFM - STATION TRANS ENTER EOQ TYPE CODE; [ 04/15/98 2:46 PM ]
;;3.0;SAMS;**1**;AUG 20, 1993
RDEQTC ;
S DIR("A")="9. ENTER EOQ TYPE CODE"
S X="P" S:ASUTRNS("TRANSACTION CODE")="5C" X="PO"
S DIR(0)=X_"^9002039.06:MXE" K X
S DIR("?")="Enter valid Economic Type Code "
D ^DIR
I $D(DUOUT)!($D(DIROUT))!($D(DTOUT)) G EXIT
S ASUTRNS(ASUTRNS,"EOQ TYPE")=$P(Y,U,2)
S (ASUTRNS(ASUTRNS,"EOQ MOD MTHS"),ASUTRNS(ASUTRNS,"EOQ MOD QTY"),ASUTRNS(ASUTRNS,"EOQ ACT MO"))=""
I ASUTRNS(ASUTRNS,"EOQ TYPE")']"",ASUTRNS(ASUTRNS,"REVIEW POINT QTY")']"",ASUTRNS("TRANSACTION CODE")="5C" G EXIT
I ASUTRNS(ASUTRNS,"REVIEW POINT QTY")]""&(+ASUTRNS(ASUTRNS,"REVIEW POINT QTY")=0) G CKEQTC
I ASUTRNS(ASUTRNS,"EOQ TYPE")="C" G RDEOQMM
I ASUTRNS(ASUTRNS,"EOQ TYPE")="B" G RDEOQMQ
I ASUTRNS(ASUTRNS,"EOQ TYPE")="Y"!(ASUTRNS(ASUTRNS,"EOQ TYPE")="D")!(ASUTRNS(ASUTRNS,"EOQ TYPE")="Q") G RDEOQAM
G SETSW
CKEQTC ;
I ASUTRNS(ASUTRNS,"EOQ TYPE")="P" G SETSW
I ASUTRNS(ASUTRNS,"EOQ TYPE")="Y" G RDEOQAM
W *7,!,"Review Point Quantity = 0, EOQ Type Code must be 'P' or 'Y'"
G RDEQTC
RDEOQMM ;
S DIR("A")="10. ENTER EOQ MODIFIER MONTHS"
S DIR(0)="N^1:12:0" D ^DIR
I $D(DUOUT)!($D(DIROUT))!($D(DTOUT)) G EXIT
I $L(X)=1 S X="0"_X
S ASUTRNS(ASUTRNS,"EOQ MOD MTHS")=X
G SETSW
RDEOQMQ ;
S DIR("A")="11. ENTER EOQ MODIFIER QUANTITY"
S DIR(0)="N^1:9999:0" D ^DIR
I $D(DUOUT)!($D(DIROUT))!($D(DTOUT)) G EXIT
S Z="0000",X=$E(Z,1,4-$L(X))_X K Z
S ASUTRNS(ASUTRNS,"EOQ MOD QTY")=X
G SETSW
RDEOQAM ;READ EOQ ACTION MONTHS
D ^ASUASQAM
I $D(DUOUT)!($D(DIROUT))!($D(DTOUT)) G EXIT
SETSW ;
I ASUTRNS("TRANSACTION CODE")="5C" S:ASUTRNS(ASUTRNS,"EOQ TYPE")]"" ASUSW("CHANGED")=1
EXIT ;RETURN TO CALLING ROUTINE
K DIR,X,Y,Z
Q
ASUASEOQ ;DSD/DFM - STATION TRANS ENTER EOQ TYPE CODE; [ 04/15/98 2:46 PM ]
+1 ;;3.0;SAMS;**1**;AUG 20, 1993
RDEQTC ;
+1 SET DIR("A")="9. ENTER EOQ TYPE CODE"
+2 SET X="P"
IF ASUTRNS("TRANSACTION CODE")="5C"
SET X="PO"
+3 SET DIR(0)=X_"^9002039.06:MXE"
KILL X
+4 SET DIR("?")="Enter valid Economic Type Code "
+5 DO ^DIR
+6 IF $DATA(DUOUT)!($DATA(DIROUT))!($DATA(DTOUT))
GOTO EXIT
+7 SET ASUTRNS(ASUTRNS,"EOQ TYPE")=$PIECE(Y,U,2)
+8 SET (ASUTRNS(ASUTRNS,"EOQ MOD MTHS"),ASUTRNS(ASUTRNS,"EOQ MOD QTY"),ASUTRNS(ASUTRNS,"EOQ ACT MO"))=""
+9 IF ASUTRNS(ASUTRNS,"EOQ TYPE")']""
IF ASUTRNS(ASUTRNS,"REVIEW POINT QTY")']""
IF ASUTRNS("TRANSACTION CODE")="5C"
GOTO EXIT
+10 IF ASUTRNS(ASUTRNS,"REVIEW POINT QTY")]""&(+ASUTRNS(ASUTRNS,"REVIEW POINT QTY")=0)
GOTO CKEQTC
+11 IF ASUTRNS(ASUTRNS,"EOQ TYPE")="C"
GOTO RDEOQMM
+12 IF ASUTRNS(ASUTRNS,"EOQ TYPE")="B"
GOTO RDEOQMQ
+13 IF ASUTRNS(ASUTRNS,"EOQ TYPE")="Y"!(ASUTRNS(ASUTRNS,"EOQ TYPE")="D")!(ASUTRNS(ASUTRNS,"EOQ TYPE")="Q")
GOTO RDEOQAM
+14 GOTO SETSW
CKEQTC ;
+1 IF ASUTRNS(ASUTRNS,"EOQ TYPE")="P"
GOTO SETSW
+2 IF ASUTRNS(ASUTRNS,"EOQ TYPE")="Y"
GOTO RDEOQAM
+3 WRITE *7,!,"Review Point Quantity = 0, EOQ Type Code must be 'P' or 'Y'"
+4 GOTO RDEQTC
RDEOQMM ;
+1 SET DIR("A")="10. ENTER EOQ MODIFIER MONTHS"
+2 SET DIR(0)="N^1:12:0"
DO ^DIR
+3 IF $DATA(DUOUT)!($DATA(DIROUT))!($DATA(DTOUT))
GOTO EXIT
+4 IF $LENGTH(X)=1
SET X="0"_X
+5 SET ASUTRNS(ASUTRNS,"EOQ MOD MTHS")=X
+6 GOTO SETSW
RDEOQMQ ;
+1 SET DIR("A")="11. ENTER EOQ MODIFIER QUANTITY"
+2 SET DIR(0)="N^1:9999:0"
DO ^DIR
+3 IF $DATA(DUOUT)!($DATA(DIROUT))!($DATA(DTOUT))
GOTO EXIT
+4 SET Z="0000"
SET X=$EXTRACT(Z,1,4-$LENGTH(X))_X
KILL Z
+5 SET ASUTRNS(ASUTRNS,"EOQ MOD QTY")=X
+6 GOTO SETSW
RDEOQAM ;READ EOQ ACTION MONTHS
+1 DO ^ASUASQAM
+2 IF $DATA(DUOUT)!($DATA(DIROUT))!($DATA(DTOUT))
GOTO EXIT
SETSW ;
+1 IF ASUTRNS("TRANSACTION CODE")="5C"
IF ASUTRNS(ASUTRNS,"EOQ TYPE")]""
SET ASUSW("CHANGED")=1
EXIT ;RETURN TO CALLING ROUTINE
+1 KILL DIR,X,Y,Z
+2 QUIT