ASURD132 ; IHS/ITSC/LMH -RPT 13 REQ-ANAL DETAIL LINES ;
;;4.2T2;Supply Accounting Mgmt. System;;JUN 30, 2000
;This routine formats and prints report 13, Requirements Analysis
;Report (Continued from and involked by ^ASURD13P)
S ASUV("STKST")=$P(ASUX(0),U,3),ASUV("RPM")=ASUMS("LTM")+ASUMS("SFSKM"),ASUV("SEL MO")=+ASUD("R13","MOBG")
I ASUV("SEL MO")<1!(ASUV("SEL MO")>12) W *7,*7,"ERROR IN REPORT 13 MONTH COMPUTATION" Q
D AMIQ,P3 Q
AMIQ ;FIND OAMIQ AND LAMIQ
S ASUV("MO")=ASUD("R13","MOBG")+1,(ASUQ,ASUV("PMIQ-O"),ASUV("PMIQ-L"))=0
F ASUU(19)=ASUV("MO"):1 S:ASUU(19)=13 ASUU(19)=1 S ASUQ=ASUQ+1,ASUV("MO")=1 Q:ASUQ>6 S ASUV("PMIQ-O")=ASUV("PMIQ-O")+ASUMS("DMD","QTY",ASUU(19))
S ASUV("MO")=ASUD("R13","MOBG"),ASUQ=0
F ASUU(19)=ASUV("MO"):-1 S:ASUU(19)=0 ASUU(19)=12 S ASUQ=ASUQ+1 Q:ASUQ>6 S ASUV("PMIQ-L")=ASUV("PMIQ-L")+ASUMS("DMD","QTY",ASUU(19))
S ASUV("PMIQ-O")=ASUV("PMIQ-O")/6,ASUV("PMIQ-L")=ASUV("PMIQ-L")/6,ASUV("PMIQ-O")=$E(ASUV("PMIQ-O"),1,6),ASUV("PMIQ-L")=$E(ASUV("PMIQ-L"),1,6)
I $E($P(ASUV("PMIQ-O"),".",2))>5 D
.S ASUV("PMIQ-O")=$P(ASUV("PMIQ-O"),".")+1
E D
.S ASUV("PMIQ-O")=$P(ASUV("PMIQ-O"),".")
I $E($P(ASUV("PMIQ-L"),".",2))>5 D
.S ASUV("PMIQ-L")=$P(ASUV("PMIQ-L"),".")+1
E D
.S ASUV("PMIQ-L")=$P(ASUV("PMIQ-L"),".")
Q
P3 ;1-12 PRINT
S ASUV("OFS",0)=0_U_8_U_4 D P6
W ?76,"C-RPQ",?83,$J(ASUMS("RPQ"),5),?91,"STKST",?97,$J(ASUV("STKST"),5),?105,"TYPE CODE",?116,ASUMS("EOQ","TP") W ?118,"SUI",?128,ASUMS("VENUI")
W !?2,ASUMX("DESC",2)
S ASUC("LN")=ASUC("LN")+1
S ASUV("OFS",0)=11_U_7_U_3 D P6
W ?76,"O-AMIQ",?83,$J(ASUV("PMIQ-O"),5),?91,"OH QTY",?97,$J(ASUMS("QTY","O/H"),5)
D
W:"C"[ASUMS("EOQ","TP") ?105,"MOD",?109,ASUMS("EOQ","MM")
W:"B"[ASUMS("EOQ","TP") ?105,"MOD",?109,ASUMS("EOQ","QM")
W:"SPDQY"[ASUMS("EOQ","TP") ?105,"MOD",?109,ASUMS("EOQ","AM")
W ?118,"SUI",?128,ASUMS("VENUI"),!?2,ASUMX("DESC",2)
S ASUC("LN")=ASUC("LN")+1
S ASUV("OFS",0)=10_U_6_U_2 D P6
W ?76,"L-AMIQ",?83,$J(ASUV("PMIQ-L"),5),?91,"DI QTY",?97,$J(ASUMS("D/I","QTY-TOT"),5),?105,"EOQ MOS",?113,ASUMS("EOQ","MO"),?119,$S($G(ASUS("QTYAJ"))]"":"EOQ*",1:"EOQ "),?124,$J(ASUMS("EOQ","QTY"),7)
N X S X=ASUMX("ESTB") W !?3,"DATE EST",?12,$E(X,2,3),"-",$E(X,4,5)
S ASUC("LN")=ASUC("LN")+1
N X S X=ASUMX("SOBJ") W ?18,"SUBOBJECT",?28,$E(X,1,2),".",$E(X,3,4)
S ASUV("OFS",0)=9_U_5_U_1 D P6
W ?76,"PAMIQ",?83,$J(ASUMS("PMIQ"),5),?91,"DO QTY",?97,$J(ASUMS("D/O","QTY"),5),?105,"LUPP" W ?110,$J($FN(ASUMS("LPP"),",",2),12),?123,"T13",$J(ASUMS("R13","TIMES"),5)
D P7
Q
P6 ;MONS 1-12 SET
S ASUV("OFS")=$P(ASUV("OFS",0),U) D DMCMPT W ?34,$E(ASUD("R13","MO",ASUV("OFS")),1,2),?37,$J(ASUMS("DMD","QTY",ASUV("OFS")),4),?43,$J(ASUMS("DMD","CALL",ASUV("OFS")),4)
S ASUV("OFS")=$P(ASUV("OFS",0),U,2) D DMCMPT W ?48,$E(ASUD("R13","MO",ASUV("OFS")),1,2),?51,$J(ASUMS("DMD","QTY",ASUV("OFS")),4),?57,$J(ASUMS("DMD","CALL",ASUV("OFS")),4)
S ASUV("OFS")=$P(ASUV("OFS",0),U,3) D DMCMPT W ?62,$E(ASUD("R13","MO",ASUV("OFS")),1,2),?65,$J(ASUMS("DMD","QTY",ASUV("OFS")),4),?71,$J(ASUMS("DMD","CALL",ASUV("OFS")),4)
DMCMPT ;EP; -COMPUTE SUB DISPLACEMENT TO CORRECT MONTH
S ASUV("OFS")=ASUV("SEL MO")+ASUV("OFS") S:ASUV("OFS")>12 ASUV("OFS")=ASUV("OFS")-12 Q
P7 ;MONS 1-12 PRINT
S ASUV("OFS")=11 D DMCMPT S ASUV("OFS",1)=ASUV("OFS")
S ASUV("OFS")=10 D DMCMPT S ASUV("OFS",2)=ASUV("OFS")
S ASUV("OFS")=9 D DMCMPT S ASUV("OFS",3)=ASUV("OFS")
W !?29,"TOTALS",?36,$J((ASUMS("DMD","QTY",ASUV("OFS",1))+ASUMS("DMD","QTY",ASUV("OFS",2))+ASUMS("DMD","QTY",ASUV("OFS",3))+ASUMS("DMD","QTY",ASUV("SEL MO"))),5)
S ASUC("LN")=ASUC("LN")+1
W ?42,$J((ASUMS("DMD","CALL",ASUV("OFS",1))+ASUMS("DMD","CALL",ASUV("OFS",2))+ASUMS("DMD","CALL",ASUV("OFS",3))+ASUMS("DMD","CALL",ASUV("SEL MO"))),5)
S ASUV("OFS")=7 D DMCMPT S ASUV("OFS",1)=ASUV("OFS")
S ASUV("OFS")=6 D DMCMPT S ASUV("OFS",2)=ASUV("OFS")
S ASUV("OFS")=5 D DMCMPT S ASUV("OFS",3)=ASUV("OFS")
S ASUV("OFS")=8 D DMCMPT
W ?50,$J((ASUMS("DMD","QTY",ASUV("OFS"))+ASUMS("DMD","QTY",ASUV("OFS",1))+ASUMS("DMD","QTY",ASUV("OFS",2))+ASUMS("DMD","QTY",ASUV("OFS",3))),5)
W ?56,$J((ASUMS("DMD","CALL",ASUV("OFS"))+ASUMS("DMD","CALL",ASUV("OFS",1))+ASUMS("DMD","CALL",ASUV("OFS",2))+ASUMS("DMD","CALL",ASUV("OFS",3))),5)
S ASUV("OFS")=3 D DMCMPT S ASUV("OFS",1)=ASUV("OFS")
S ASUV("OFS")=2 D DMCMPT S ASUV("OFS",2)=ASUV("OFS")
S ASUV("OFS")=1 D DMCMPT S ASUV("OFS",3)=ASUV("OFS")
S ASUV("OFS")=4 D DMCMPT
W ?64,$J((ASUMS("DMD","QTY",ASUV("OFS"))+ASUMS("DMD","QTY",ASUV("OFS",1))+ASUMS("DMD","QTY",ASUV("OFS",2))+ASUMS("DMD","QTY",ASUV("OFS",3))),5)
W ?70,$J((ASUMS("DMD","CALL",ASUV("OFS"))+ASUMS("DMD","CALL",ASUV("OFS",1))+ASUMS("DMD","CALL",ASUV("OFS",2))+ASUMS("DMD","CALL",ASUV("OFS",3))),5)
W ?77,"RPM",?82,$FN(ASUV("RPM"),",",1),?91,"LTM",?96,$FN(ASUMS("LTM"),",",1),?104,"SOURCE CD",?114,ASUMS("SRC")
S ASUL("EOQVAL")=ASUMS("EOQ","QTY")*ASUMS("LPP"),ASUC("EOQVAL",5)=ASUC("EOQVAL",5)+ASUL("EOQVAL")
W ?117,"EOV",?121,$J($FN(ASUL("EOQVAL"),",",2),12)
Q
ASURD132 ; IHS/ITSC/LMH -RPT 13 REQ-ANAL DETAIL LINES ;
+1 ;;4.2T2;Supply Accounting Mgmt. System;;JUN 30, 2000
+2 ;This routine formats and prints report 13, Requirements Analysis
+3 ;Report (Continued from and involked by ^ASURD13P)
+4 SET ASUV("STKST")=$PIECE(ASUX(0),U,3)
SET ASUV("RPM")=ASUMS("LTM")+ASUMS("SFSKM")
SET ASUV("SEL MO")=+ASUD("R13","MOBG")
+5 IF ASUV("SEL MO")<1!(ASUV("SEL MO")>12)
WRITE *7,*7,"ERROR IN REPORT 13 MONTH COMPUTATION"
QUIT
+6 DO AMIQ
DO P3
QUIT
AMIQ ;FIND OAMIQ AND LAMIQ
+1 SET ASUV("MO")=ASUD("R13","MOBG")+1
SET (ASUQ,ASUV("PMIQ-O"),ASUV("PMIQ-L"))=0
+2 FOR ASUU(19)=ASUV("MO"):1
IF ASUU(19)=13
SET ASUU(19)=1
SET ASUQ=ASUQ+1
SET ASUV("MO")=1
IF ASUQ>6
QUIT
SET ASUV("PMIQ-O")=ASUV("PMIQ-O")+ASUMS("DMD","QTY",ASUU(19))
+3 SET ASUV("MO")=ASUD("R13","MOBG")
SET ASUQ=0
+4 FOR ASUU(19)=ASUV("MO"):-1
IF ASUU(19)=0
SET ASUU(19)=12
SET ASUQ=ASUQ+1
IF ASUQ>6
QUIT
SET ASUV("PMIQ-L")=ASUV("PMIQ-L")+ASUMS("DMD","QTY",ASUU(19))
+5 SET ASUV("PMIQ-O")=ASUV("PMIQ-O")/6
SET ASUV("PMIQ-L")=ASUV("PMIQ-L")/6
SET ASUV("PMIQ-O")=$EXTRACT(ASUV("PMIQ-O"),1,6)
SET ASUV("PMIQ-L")=$EXTRACT(ASUV("PMIQ-L"),1,6)
+6 IF $EXTRACT($PIECE(ASUV("PMIQ-O"),".",2))>5
Begin DoDot:1
+7 SET ASUV("PMIQ-O")=$PIECE(ASUV("PMIQ-O"),".")+1
End DoDot:1
+8 IF '$TEST
Begin DoDot:1
+9 SET ASUV("PMIQ-O")=$PIECE(ASUV("PMIQ-O"),".")
End DoDot:1
+10 IF $EXTRACT($PIECE(ASUV("PMIQ-L"),".",2))>5
Begin DoDot:1
+11 SET ASUV("PMIQ-L")=$PIECE(ASUV("PMIQ-L"),".")+1
End DoDot:1
+12 IF '$TEST
Begin DoDot:1
+13 SET ASUV("PMIQ-L")=$PIECE(ASUV("PMIQ-L"),".")
End DoDot:1
+14 QUIT
P3 ;1-12 PRINT
+1 SET ASUV("OFS",0)=0_U_8_U_4
DO P6
+2 WRITE ?76,"C-RPQ",?83,$JUSTIFY(ASUMS("RPQ"),5),?91,"STKST",?97,$JUSTIFY(ASUV("STKST"),5),?105,"TYPE CODE",?116,ASUMS("EOQ","TP")
WRITE ?118,"SUI",?128,ASUMS("VENUI")
+3 WRITE !?2,ASUMX("DESC",2)
+4 SET ASUC("LN")=ASUC("LN")+1
+5 SET ASUV("OFS",0)=11_U_7_U_3
DO P6
+6 WRITE ?76,"O-AMIQ",?83,$JUSTIFY(ASUV("PMIQ-O"),5),?91,"OH QTY",?97,$JUSTIFY(ASUMS("QTY","O/H"),5)
+7 Begin DoDot:1
End DoDot:1
+8 IF "C"[ASUMS("EOQ","TP")
WRITE ?105,"MOD",?109,ASUMS("EOQ","MM")
+9 IF "B"[ASUMS("EOQ","TP")
WRITE ?105,"MOD",?109,ASUMS("EOQ","QM")
+10 IF "SPDQY"[ASUMS("EOQ","TP")
WRITE ?105,"MOD",?109,ASUMS("EOQ","AM")
+11 WRITE ?118,"SUI",?128,ASUMS("VENUI"),!?2,ASUMX("DESC",2)
+12 SET ASUC("LN")=ASUC("LN")+1
+13 SET ASUV("OFS",0)=10_U_6_U_2
DO P6
+14 WRITE ?76,"L-AMIQ",?83,$JUSTIFY(ASUV("PMIQ-L"),5),?91,"DI QTY",?97,$JUSTIFY(ASUMS("D/I","QTY-TOT"),5),?105,"EOQ MOS",?113,ASUMS("EOQ","MO"),?119,$SELECT($GET(ASUS("QTYAJ"))]"":"EOQ*",1:"EOQ "),?124,$JUSTIFY(ASUMS("EOQ","QTY"),7)
+15 NEW X
SET X=ASUMX("ESTB")
WRITE !?3,"DATE EST",?12,$EXTRACT(X,2,3),"-",$EXTRACT(X,4,5)
+16 SET ASUC("LN")=ASUC("LN")+1
+17 NEW X
SET X=ASUMX("SOBJ")
WRITE ?18,"SUBOBJECT",?28,$EXTRACT(X,1,2),".",$EXTRACT(X,3,4)
+18 SET ASUV("OFS",0)=9_U_5_U_1
DO P6
+19 WRITE ?76,"PAMIQ",?83,$JUSTIFY(ASUMS("PMIQ"),5),?91,"DO QTY",?97,$JUSTIFY(ASUMS("D/O","QTY"),5),?105,"LUPP"
WRITE ?110,$JUSTIFY($FNUMBER(ASUMS("LPP"),",",2),12),?123,"T13",$JUSTIFY(ASUMS("R13","TIMES"),5)
+20 DO P7
+21 QUIT
P6 ;MONS 1-12 SET
+1 SET ASUV("OFS")=$PIECE(ASUV("OFS",0),U)
DO DMCMPT
WRITE ?34,$EXTRACT(ASUD("R13","MO",ASUV("OFS")),1,2),?37,$JUSTIFY(ASUMS("DMD","QTY",ASUV("OFS")),4),?43,$JUSTIFY(ASUMS("DMD","CALL",ASUV("OFS")),4)
+2 SET ASUV("OFS")=$PIECE(ASUV("OFS",0),U,2)
DO DMCMPT
WRITE ?48,$EXTRACT(ASUD("R13","MO",ASUV("OFS")),1,2),?51,$JUSTIFY(ASUMS("DMD","QTY",ASUV("OFS")),4),?57,$JUSTIFY(ASUMS("DMD","CALL",ASUV("OFS")),4)
+3 SET ASUV("OFS")=$PIECE(ASUV("OFS",0),U,3)
DO DMCMPT
WRITE ?62,$EXTRACT(ASUD("R13","MO",ASUV("OFS")),1,2),?65,$JUSTIFY(ASUMS("DMD","QTY",ASUV("OFS")),4),?71,$JUSTIFY(ASUMS("DMD","CALL",ASUV("OFS")),4)
DMCMPT ;EP; -COMPUTE SUB DISPLACEMENT TO CORRECT MONTH
+1 SET ASUV("OFS")=ASUV("SEL MO")+ASUV("OFS")
IF ASUV("OFS")>12
SET ASUV("OFS")=ASUV("OFS")-12
QUIT
P7 ;MONS 1-12 PRINT
+1 SET ASUV("OFS")=11
DO DMCMPT
SET ASUV("OFS",1)=ASUV("OFS")
+2 SET ASUV("OFS")=10
DO DMCMPT
SET ASUV("OFS",2)=ASUV("OFS")
+3 SET ASUV("OFS")=9
DO DMCMPT
SET ASUV("OFS",3)=ASUV("OFS")
+4 WRITE !?29,"TOTALS",?36,$JUSTIFY((ASUMS("DMD","QTY",ASUV("OFS",1))+ASUMS("DMD","QTY",ASUV("OFS",2))+ASUMS("DMD","QTY",ASUV("OFS",3))+ASUMS("DMD","QTY",ASUV("SEL MO"))),5)
+5 SET ASUC("LN")=ASUC("LN")+1
+6 WRITE ?42,$JUSTIFY((ASUMS("DMD","CALL",ASUV("OFS",1))+ASUMS("DMD","CALL",ASUV("OFS",2))+ASUMS("DMD","CALL",ASUV("OFS",3))+ASUMS("DMD","CALL",ASUV("SEL MO"))),5)
+7 SET ASUV("OFS")=7
DO DMCMPT
SET ASUV("OFS",1)=ASUV("OFS")
+8 SET ASUV("OFS")=6
DO DMCMPT
SET ASUV("OFS",2)=ASUV("OFS")
+9 SET ASUV("OFS")=5
DO DMCMPT
SET ASUV("OFS",3)=ASUV("OFS")
+10 SET ASUV("OFS")=8
DO DMCMPT
+11 WRITE ?50,$JUSTIFY((ASUMS("DMD","QTY",ASUV("OFS"))+ASUMS("DMD","QTY",ASUV("OFS",1))+ASUMS("DMD","QTY",ASUV("OFS",2))+ASUMS("DMD","QTY",ASUV("OFS",3))),5)
+12 WRITE ?56,$JUSTIFY((ASUMS("DMD","CALL",ASUV("OFS"))+ASUMS("DMD","CALL",ASUV("OFS",1))+ASUMS("DMD","CALL",ASUV("OFS",2))+ASUMS("DMD","CALL",ASUV("OFS",3))),5)
+13 SET ASUV("OFS")=3
DO DMCMPT
SET ASUV("OFS",1)=ASUV("OFS")
+14 SET ASUV("OFS")=2
DO DMCMPT
SET ASUV("OFS",2)=ASUV("OFS")
+15 SET ASUV("OFS")=1
DO DMCMPT
SET ASUV("OFS",3)=ASUV("OFS")
+16 SET ASUV("OFS")=4
DO DMCMPT
+17 WRITE ?64,$JUSTIFY((ASUMS("DMD","QTY",ASUV("OFS"))+ASUMS("DMD","QTY",ASUV("OFS",1))+ASUMS("DMD","QTY",ASUV("OFS",2))+ASUMS("DMD","QTY",ASUV("OFS",3))),5)
+18 WRITE ?70,$JUSTIFY((ASUMS("DMD","CALL",ASUV("OFS"))+ASUMS("DMD","CALL",ASUV("OFS",1))+ASUMS("DMD","CALL",ASUV("OFS",2))+ASUMS("DMD","CALL",ASUV("OFS",3))),5)
+19 WRITE ?77,"RPM",?82,$FNUMBER(ASUV("RPM"),",",1),?91,"LTM",?96,$FNUMBER(ASUMS("LTM"),",",1),?104,"SOURCE CD",?114,ASUMS("SRC")
+20 SET ASUL("EOQVAL")=ASUMS("EOQ","QTY")*ASUMS("LPP")
SET ASUC("EOQVAL",5)=ASUC("EOQVAL",5)+ASUL("EOQVAL")
+21 WRITE ?117,"EOV",?121,$JUSTIFY($FNUMBER(ASUL("EOQVAL"),",",2),12)
+22 QUIT