ASU1DUPD ; IHS/ITSC/LMH -POST DUE IN ;
;;4.2T2;Supply Accounting Mgmt. System;;JUN 30, 2000
;;This routine posts Due In transaction data to SAMS masters.
;;It is involked after a valid due in is entered.
;; - Requires local arrays ASUT AND ASUV
S:$G(DDSREFT)']"" DDSREFT=$G(ASUV("DDSREFT"))
I $E(ASUT("TRCD"),2)?1N D
.S ASUV("PO#")=0 D
..I ASUMS("D/I","PO#",1)']"" S ASUV("PO#")=1 Q
..I ASUMS("D/I","PO#",2)']"" S ASUV("PO#")=2 Q
..I ASUMS("D/I","PO#",3)']"" S ASUV("PO#")=3 Q
.;I 'ASUV("PO#")&($G(ASUT(ASUT,"PON"))'="") S ASUV("PO#")=1 ;WAR 7/28/99
.Q:ASUV("PO#")=0
.S ASUMS("D/I","QTY",ASUV("PO#"))=ASUT(ASUT,"QTY")
.S ASUMS("D/I","VAL",ASUV("PO#"))=ASUT(ASUT,"VAL")
.S ASUMS("D/I","PO#",ASUV("PO#"))=ASUT(ASUT,"PON")
.S ASUMS("D/I","DT",ASUV("PO#"))=ASUT(ASUT,"DTD")
.S ASUMS("D/I","SSA",ASUV("PO#"))=ASUT(ASUT,"SSA")
E D
.S ASUV("PO#")=0 D
..I ASUT(ASUT,"PON")=ASUMS("D/I","PO#",1) S ASUV("PO#")=1 Q
..I ASUT(ASUT,"PON")=ASUMS("D/I","PO#",2) S ASUV("PO#")=2 Q
..I ASUT(ASUT,"PON")=ASUMS("D/I","PO#",3) S ASUV("PO#")=3 Q
.;I 'ASUV("PO#")&($G(ASUT(ASUT,"PON"))'="") S ASUV("PO#")=1 ;WAR 7/28/99
.Q:ASUV("PO#")=0
.;Purchase order found - set transaction fields to match master then clear the master due in entry out
.S ASUT(ASUT,"QTY")=ASUMS("D/I","QTY",ASUV("PO#"))
.S ASUT(ASUT,"D/IF")=ASUMS("D/I","QTY",ASUV("PO#"))*-1
.S ASUT(ASUT,"VAL")=ASUMS("D/I","VAL",ASUV("PO#"))
.S ASUT(ASUT,"SSA")=ASUMS("D/I","SSA",ASUV("PO#"))
.S (ASUMS("D/I","QTY",ASUV("PO#")),ASUMS("D/I","VAL",ASUV("PO#")))=""
.S ASUMS("D/I","PO#",ASUV("PO#"))=""
.S ASUMS("D/I","DT",ASUV("PO#"))=""
.S ASUMS("D/I","SSA",ASUV("PO#"))=""
Q:ASUV("PO#")=0
K ASUV("PO#")
S ASUT(ASUT,"D/IF")=0
D MIX^ASUMSTWR ;Update Station Master
D ^ASUJHIST ;Move transaction to History file
Q
ASU1DUPD ; IHS/ITSC/LMH -POST DUE IN ;
+1 ;;4.2T2;Supply Accounting Mgmt. System;;JUN 30, 2000
+2 ;;This routine posts Due In transaction data to SAMS masters.
+3 ;;It is involked after a valid due in is entered.
+4 ;; - Requires local arrays ASUT AND ASUV
+5 IF $GET(DDSREFT)']""
SET DDSREFT=$GET(ASUV("DDSREFT"))
+6 IF $EXTRACT(ASUT("TRCD"),2)?1N
Begin DoDot:1
+7 SET ASUV("PO#")=0
Begin DoDot:2
+8 IF ASUMS("D/I","PO#",1)']""
SET ASUV("PO#")=1
QUIT
+9 IF ASUMS("D/I","PO#",2)']""
SET ASUV("PO#")=2
QUIT
+10 IF ASUMS("D/I","PO#",3)']""
SET ASUV("PO#")=3
QUIT
End DoDot:2
+11 ;I 'ASUV("PO#")&($G(ASUT(ASUT,"PON"))'="") S ASUV("PO#")=1 ;WAR 7/28/99
+12 IF ASUV("PO#")=0
QUIT
+13 SET ASUMS("D/I","QTY",ASUV("PO#"))=ASUT(ASUT,"QTY")
+14 SET ASUMS("D/I","VAL",ASUV("PO#"))=ASUT(ASUT,"VAL")
+15 SET ASUMS("D/I","PO#",ASUV("PO#"))=ASUT(ASUT,"PON")
+16 SET ASUMS("D/I","DT",ASUV("PO#"))=ASUT(ASUT,"DTD")
+17 SET ASUMS("D/I","SSA",ASUV("PO#"))=ASUT(ASUT,"SSA")
End DoDot:1
+18 IF '$TEST
Begin DoDot:1
+19 SET ASUV("PO#")=0
Begin DoDot:2
+20 IF ASUT(ASUT,"PON")=ASUMS("D/I","PO#",1)
SET ASUV("PO#")=1
QUIT
+21 IF ASUT(ASUT,"PON")=ASUMS("D/I","PO#",2)
SET ASUV("PO#")=2
QUIT
+22 IF ASUT(ASUT,"PON")=ASUMS("D/I","PO#",3)
SET ASUV("PO#")=3
QUIT
End DoDot:2
+23 ;I 'ASUV("PO#")&($G(ASUT(ASUT,"PON"))'="") S ASUV("PO#")=1 ;WAR 7/28/99
+24 IF ASUV("PO#")=0
QUIT
+25 ;Purchase order found - set transaction fields to match master then clear the master due in entry out
+26 SET ASUT(ASUT,"QTY")=ASUMS("D/I","QTY",ASUV("PO#"))
+27 SET ASUT(ASUT,"D/IF")=ASUMS("D/I","QTY",ASUV("PO#"))*-1
+28 SET ASUT(ASUT,"VAL")=ASUMS("D/I","VAL",ASUV("PO#"))
+29 SET ASUT(ASUT,"SSA")=ASUMS("D/I","SSA",ASUV("PO#"))
+30 SET (ASUMS("D/I","QTY",ASUV("PO#")),ASUMS("D/I","VAL",ASUV("PO#")))=""
+31 SET ASUMS("D/I","PO#",ASUV("PO#"))=""
+32 SET ASUMS("D/I","DT",ASUV("PO#"))=""
+33 SET ASUMS("D/I","SSA",ASUV("PO#"))=""
End DoDot:1
+34 IF ASUV("PO#")=0
QUIT
+35 KILL ASUV("PO#")
+36 SET ASUT(ASUT,"D/IF")=0
+37 ;Update Station Master
DO MIX^ASUMSTWR
+38 ;Move transaction to History file
DO ^ASUJHIST
+39 QUIT