ACR326 ; GENERATED FROM 'ACR TRIBAL CONTRACT DISPLAY' PRINT TEMPLATE (#3976) ; 09/30/09 ; (FILE 9002196, MARGIN=80)
G BEGIN
N W !
T W:$X ! I '$D(DIOT(2)),DN,$D(IOSL),$S('$D(DIWF):1,$P(DIWF,"B",2):$P(DIWF,"B",2),1:1)+$Y'<IOSL,$D(^UTILITY($J,1))#2,^(1)?1U1P1E.E X ^(1)
S DISTP=DISTP+1,DILCT=DILCT+1 D:'(DISTP#100) CSTP^DIO2
Q
DT I $G(DUZ("LANG"))>1,Y W $$OUT^DIALOGU(Y,"DD") Q
I Y W $P("JAN^FEB^MAR^APR^MAY^JUN^JUL^AUG^SEP^OCT^NOV^DEC",U,$E(Y,4,5))_" " W:Y#100 $J(Y#100\1,2)_"," W Y\10000+1700 W:Y#1 " "_$E(Y_0,9,10)_":"_$E(Y_"000",11,12) Q
W Y Q
M D @DIXX
Q
BEGIN ;
S:'$D(DN) DN=1 S DISTP=$G(DISTP),DILCT=$G(DILCT)
I $D(DXS)<9 M DXS=^DIPT(3976,"DXS")
S I(0)="^ACRDOC(",J(0)=9002196
D N:$X>0 Q:'DN W ?0 W "[1 ]*ORDER DATE:"
S X=$G(^ACRDOC(D0,"PO")) W ?18 S Y=$P(X,U,1) D DT
D N:$X>40 Q:'DN W ?40 W "[10] GBL NO....:"
W ?58,$E($P(X,U,10),1,10)
D N:$X>0 Q:'DN W ?0 W "[2 ] CONTRACT #:"
W ?18,$E($P(X,U,2),1,15)
D N:$X>40 Q:'DN W ?40 W "[11]*ON/BEFORE.:"
W ?58 S Y=$P(X,U,12) D DT
D N:$X>0 Q:'DN W ?0 W "[3 ]*ISSUE OFF.:"
S X=$G(^ACRDOC(D0,"POIO")) W ?18 S Y=$P(X,U,1) S Y=$S(Y="":Y,$D(^AUTTPRG(Y,0))#2:$P(^(0),U),1:Y) W $E(Y,1,20)
D N:$X>40 Q:'DN W ?40 W "[12] DISCOUNT..:"
S X=$G(^ACRDOC(D0,"PO")) W ?58,$E($P(X,U,13),1,20)
D N:$X>0 Q:'DN W ?0 W "[4 ]*SHIP TO...:"
S X=$G(^ACRDOC(D0,"POST")) W ?18 S Y=$P(X,U,1) S Y=$S(Y="":Y,$D(^AUTTPRG(Y,0))#2:$P(^(0),U),1:Y) W $E(Y,1,20)
D N:$X>40 Q:'DN W ?40 W "[13] SHIP POINT:"
S X=$G(^ACRDOC(D0,"PO")) W ?58,$E($P(X,U,14),1,20)
D N:$X>0 Q:'DN W ?0 W "[5 ]*CONTRACTOR:"
W ?18 S Y=$P(X,U,5) S Y=$S(Y="":Y,$D(^AUTTVNDR(Y,0))#2:$P(^(0),U),1:Y) W $E(Y,1,20)
D N:$X>40 Q:'DN W ?40 W "[14] GRS WEIGHT:"
W ?58,$E($P(X,U,15),1,10)
D N:$X>0 Q:'DN W ?0 W " BUS. CLASS:"
W ?18 X DXS(1,9.3) S X=$P(DIP(201),U,2) S D0=I(0,0) K DIP K:DN Y W $E(X,1,20)
D N:$X>40 Q:'DN W ?40 W "[15] SHIP VIA..:"
S X=$G(^ACRDOC(D0,"PO")) W ?58,$E($P(X,U,18),1,20)
D N:$X>0 Q:'DN W ?0 W "[6 ]*REQ OFFICE:"
W ?18 S Y=$P(X,U,7) S Y=$S(Y="":Y,$D(^AUTTPRG(Y,0))#2:$P(^(0),U),1:Y) W $E(Y,1,20)
D N:$X>40 Q:'DN W ?40 W "[16]*INVOICE TO:"
S X=$G(^ACRDOC(D0,"POMI")) W ?58 S Y=$P(X,U,1) S Y=$S(Y="":Y,$D(^AUTTPRG(Y,0))#2:$P(^(0),U),1:Y) W $E(Y,1,20)
D N:$X>0 Q:'DN W ?0 W "[7 ]*TYPE ORDER:"
S X=$G(^ACRDOC(D0,"PO")) W ?18 S Y=$P(X,U,6) W:Y]"" $S($D(DXS(2,Y)):DXS(2,Y),1:Y)
D N:$X>40 Q:'DN W ?40 W "[17] DRAFT PYMT:"
S X=$G(^ACRDOC(D0,0)) W ?58 S Y=$P(X,U,12) W:Y]"" $S($D(DXS(3,Y)):DXS(3,Y),1:Y)
D N:$X>0 Q:'DN W ?0 W "[8 ] FOB. POINT:"
S X=$G(^ACRDOC(D0,"PO")) W ?18 S Y=$P(X,U,9) W:Y]"" $S($D(DXS(4,Y)):DXS(4,Y),1:Y)
D N:$X>40 Q:'DN W ?40 W "[18]*AUTHRZD BY:"
S X=$G(^ACRDOC(D0,"AU")) W ?58 S Y=$P(X,U,1) S Y(0)=Y S Y=$$NAME2^ACRFUTL1(Y) W $E(Y,1,20)
D N:$X>0 Q:'DN W ?0 W "[9 ] INSPT/ACCP:"
S X=$G(^ACRDOC(D0,"PO")) W ?18 S Y=$P(X,U,11) S Y=$S(Y="":Y,$D(^AUTTPRG(Y,0))#2:$P(^(0),U),1:Y) W $E(Y,1,20)
D N:$X>40 Q:'DN W ?40 W "[19] BPA TOTAL.:"
S X=$G(^ACRDOC(D0,0)) W ?58 S Y=$P(X,U,18) W:Y]"" $J(Y,12,2)
D N:$X>40 Q:'DN W ?40 W "[20]*AUTHORITY.:"
S X=$G(^ACRDOC(D0,"PO")) W ?58 S Y=$P(X,U,22) W:Y]"" $S($D(DXS(5,Y)):DXS(5,Y),1:Y)
D N:$X>40 Q:'DN W ?40 W "[21] CUST ACCT#:"
W ?58,$E($P(X,U,23),1,20)
K Y
Q
HEAD ;
W !,"--------------------------------------------------------------------------------",!!
ACR326 ; GENERATED FROM 'ACR TRIBAL CONTRACT DISPLAY' PRINT TEMPLATE (#3976) ; 09/30/09 ; (FILE 9002196, MARGIN=80)
+1 GOTO BEGIN
N WRITE !
T IF $X
WRITE !
IF '$DATA(DIOT(2))
IF DN
IF $DATA(IOSL)
IF $SELECT('$DATA(DIWF):1,$PIECE(DIWF,"B",2):$PIECE(DIWF,"B",2),1:1)+$Y'<IOSL
IF $DATA(^UTILITY($JOB,1))#2
IF ^(1)?1U1P1E.E
XECUTE ^(1)
+1 SET DISTP=DISTP+1
SET DILCT=DILCT+1
IF '(DISTP#100)
DO CSTP^DIO2
+2 QUIT
DT IF $GET(DUZ("LANG"))>1
IF Y
WRITE $$OUT^DIALOGU(Y,"DD")
QUIT
+1 IF Y
WRITE $PIECE("JAN^FEB^MAR^APR^MAY^JUN^JUL^AUG^SEP^OCT^NOV^DEC",U,$EXTRACT(Y,4,5))_" "
IF Y#100
WRITE $JUSTIFY(Y#100\1,2)_","
WRITE Y\10000+1700
IF Y#1
WRITE " "_$EXTRACT(Y_0,9,10)_":"_$EXTRACT(Y_"000",11,12)
QUIT
+2 WRITE Y
QUIT
M DO @DIXX
+1 QUIT
BEGIN ;
+1 IF '$DATA(DN)
SET DN=1
SET DISTP=$GET(DISTP)
SET DILCT=$GET(DILCT)
+2 IF $DATA(DXS)<9
MERGE DXS=^DIPT(3976,"DXS")
+3 SET I(0)="^ACRDOC("
SET J(0)=9002196
+4 IF $X>0
DO N
IF 'DN
QUIT
WRITE ?0
WRITE "[1 ]*ORDER DATE:"
+5 SET X=$GET(^ACRDOC(D0,"PO"))
WRITE ?18
SET Y=$PIECE(X,U,1)
DO DT
+6 IF $X>40
DO N
IF 'DN
QUIT
WRITE ?40
WRITE "[10] GBL NO....:"
+7 WRITE ?58,$EXTRACT($PIECE(X,U,10),1,10)
+8 IF $X>0
DO N
IF 'DN
QUIT
WRITE ?0
WRITE "[2 ] CONTRACT #:"
+9 WRITE ?18,$EXTRACT($PIECE(X,U,2),1,15)
+10 IF $X>40
DO N
IF 'DN
QUIT
WRITE ?40
WRITE "[11]*ON/BEFORE.:"
+11 WRITE ?58
SET Y=$PIECE(X,U,12)
DO DT
+12 IF $X>0
DO N
IF 'DN
QUIT
WRITE ?0
WRITE "[3 ]*ISSUE OFF.:"
+13 SET X=$GET(^ACRDOC(D0,"POIO"))
WRITE ?18
SET Y=$PIECE(X,U,1)
SET Y=$SELECT(Y="":Y,$DATA(^AUTTPRG(Y,0))#2:$PIECE(^(0),U),1:Y)
WRITE $EXTRACT(Y,1,20)
+14 IF $X>40
DO N
IF 'DN
QUIT
WRITE ?40
WRITE "[12] DISCOUNT..:"
+15 SET X=$GET(^ACRDOC(D0,"PO"))
WRITE ?58,$EXTRACT($PIECE(X,U,13),1,20)
+16 IF $X>0
DO N
IF 'DN
QUIT
WRITE ?0
WRITE "[4 ]*SHIP TO...:"
+17 SET X=$GET(^ACRDOC(D0,"POST"))
WRITE ?18
SET Y=$PIECE(X,U,1)
SET Y=$SELECT(Y="":Y,$DATA(^AUTTPRG(Y,0))#2:$PIECE(^(0),U),1:Y)
WRITE $EXTRACT(Y,1,20)
+18 IF $X>40
DO N
IF 'DN
QUIT
WRITE ?40
WRITE "[13] SHIP POINT:"
+19 SET X=$GET(^ACRDOC(D0,"PO"))
WRITE ?58,$EXTRACT($PIECE(X,U,14),1,20)
+20 IF $X>0
DO N
IF 'DN
QUIT
WRITE ?0
WRITE "[5 ]*CONTRACTOR:"
+21 WRITE ?18
SET Y=$PIECE(X,U,5)
SET Y=$SELECT(Y="":Y,$DATA(^AUTTVNDR(Y,0))#2:$PIECE(^(0),U),1:Y)
WRITE $EXTRACT(Y,1,20)
+22 IF $X>40
DO N
IF 'DN
QUIT
WRITE ?40
WRITE "[14] GRS WEIGHT:"
+23 WRITE ?58,$EXTRACT($PIECE(X,U,15),1,10)
+24 IF $X>0
DO N
IF 'DN
QUIT
WRITE ?0
WRITE " BUS. CLASS:"
+25 WRITE ?18
XECUTE DXS(1,9.3)
SET X=$PIECE(DIP(201),U,2)
SET D0=I(0,0)
KILL DIP
IF DN
KILL Y
WRITE $EXTRACT(X,1,20)
+26 IF $X>40
DO N
IF 'DN
QUIT
WRITE ?40
WRITE "[15] SHIP VIA..:"
+27 SET X=$GET(^ACRDOC(D0,"PO"))
WRITE ?58,$EXTRACT($PIECE(X,U,18),1,20)
+28 IF $X>0
DO N
IF 'DN
QUIT
WRITE ?0
WRITE "[6 ]*REQ OFFICE:"
+29 WRITE ?18
SET Y=$PIECE(X,U,7)
SET Y=$SELECT(Y="":Y,$DATA(^AUTTPRG(Y,0))#2:$PIECE(^(0),U),1:Y)
WRITE $EXTRACT(Y,1,20)
+30 IF $X>40
DO N
IF 'DN
QUIT
WRITE ?40
WRITE "[16]*INVOICE TO:"
+31 SET X=$GET(^ACRDOC(D0,"POMI"))
WRITE ?58
SET Y=$PIECE(X,U,1)
SET Y=$SELECT(Y="":Y,$DATA(^AUTTPRG(Y,0))#2:$PIECE(^(0),U),1:Y)
WRITE $EXTRACT(Y,1,20)
+32 IF $X>0
DO N
IF 'DN
QUIT
WRITE ?0
WRITE "[7 ]*TYPE ORDER:"
+33 SET X=$GET(^ACRDOC(D0,"PO"))
WRITE ?18
SET Y=$PIECE(X,U,6)
IF Y]""
WRITE $SELECT($DATA(DXS(2,Y)):DXS(2,Y),1:Y)
+34 IF $X>40
DO N
IF 'DN
QUIT
WRITE ?40
WRITE "[17] DRAFT PYMT:"
+35 SET X=$GET(^ACRDOC(D0,0))
WRITE ?58
SET Y=$PIECE(X,U,12)
IF Y]""
WRITE $SELECT($DATA(DXS(3,Y)):DXS(3,Y),1:Y)
+36 IF $X>0
DO N
IF 'DN
QUIT
WRITE ?0
WRITE "[8 ] FOB. POINT:"
+37 SET X=$GET(^ACRDOC(D0,"PO"))
WRITE ?18
SET Y=$PIECE(X,U,9)
IF Y]""
WRITE $SELECT($DATA(DXS(4,Y)):DXS(4,Y),1:Y)
+38 IF $X>40
DO N
IF 'DN
QUIT
WRITE ?40
WRITE "[18]*AUTHRZD BY:"
+39 SET X=$GET(^ACRDOC(D0,"AU"))
WRITE ?58
SET Y=$PIECE(X,U,1)
SET Y(0)=Y
SET Y=$$NAME2^ACRFUTL1(Y)
WRITE $EXTRACT(Y,1,20)
+40 IF $X>0
DO N
IF 'DN
QUIT
WRITE ?0
WRITE "[9 ] INSPT/ACCP:"
+41 SET X=$GET(^ACRDOC(D0,"PO"))
WRITE ?18
SET Y=$PIECE(X,U,11)
SET Y=$SELECT(Y="":Y,$DATA(^AUTTPRG(Y,0))#2:$PIECE(^(0),U),1:Y)
WRITE $EXTRACT(Y,1,20)
+42 IF $X>40
DO N
IF 'DN
QUIT
WRITE ?40
WRITE "[19] BPA TOTAL.:"
+43 SET X=$GET(^ACRDOC(D0,0))
WRITE ?58
SET Y=$PIECE(X,U,18)
IF Y]""
WRITE $JUSTIFY(Y,12,2)
+44 IF $X>40
DO N
IF 'DN
QUIT
WRITE ?40
WRITE "[20]*AUTHORITY.:"
+45 SET X=$GET(^ACRDOC(D0,"PO"))
WRITE ?58
SET Y=$PIECE(X,U,22)
IF Y]""
WRITE $SELECT($DATA(DXS(5,Y)):DXS(5,Y),1:Y)
+46 IF $X>40
DO N
IF 'DN
QUIT
WRITE ?40
WRITE "[21] CUST ACCT#:"
+47 WRITE ?58,$EXTRACT($PIECE(X,U,23),1,20)
+48 KILL Y
+49 QUIT
HEAD ;
+1 WRITE !,"--------------------------------------------------------------------------------",!!