ACRPII ; GENERATED FROM 'ACR ITEM INVENTORY' PRINT TEMPLATE (#3844) ; 09/29/09 ; (FILE 9002193, 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)
S I(0)="^ACRSS(",J(0)=9002193
D N:$X>0 Q:'DN W ?0 W "ITEM #...:"
S X=$G(^ACRSS(D0,0)) W ?12 S Y=$P(X,U,1) W:Y]"" $J(Y,4,0)
D N:$X>26 Q:'DN W ?26 W "ORDER #..:"
S X=$G(^ACRSS(D0,"NMS")) W ?38,$E($P(X,U,1),1,30)
D N:$X>53 Q:'DN W ?53 W "DOCUMNT #:"
S X=$G(^ACRSS(D0,0)) W ?65 S Y=$P(X,U,3) S Y=$S(Y="":Y,$D(^ACRDOC(Y,0))#2:$P(^(0),U),1:Y) W $E(Y,1,14)
D N:$X>0 Q:'DN W ?0 W "NSN......:"
S X=$G(^ACRSS(D0,"NMS")) W ?12,$E($P(X,U,2),1,17)
D N:$X>26 Q:'DN W ?26 W "NDC......:"
W ?38,$E($P(X,U,3),1,14)
D N:$X>53 Q:'DN W ?53 W "VON......:"
S X=$G(^ACRSS(D0,"VND")) W ?65,$E($P(X,U,2),1,14)
D N:$X>0 Q:'DN W ?0 W "VENDOR...:"
W ?12 S Y=$P(X,U,1) S Y=$S(Y="":Y,$D(^AUTTVNDR(Y,0))#2:$P(^(0),U),1:Y) W $E(Y,1,30)
D N:$X>53 Q:'DN W ?53 W "OBJ CLASS:"
S X=$G(^ACRSS(D0,0)) W ?65 S Y=$P(X,U,4) S Y=$S(Y="":Y,$D(^AUTTOBJC(Y,0))#2:$P(^(0),U),1:Y) W $E(Y,1,4)
D N:$X>0 Q:'DN W ?0 W "# ORDERED:"
W ?12 S DIP(1)=$S($D(^ACRSS(D0,"DT")):^("DT"),1:"") S X=$P(DIP(1),U,1),DIP(2)=X S X=10,X=$J(DIP(2),X) K DIP K:DN Y W X
D N:$X>26 Q:'DN W ?26 W "UNIT COST:"
W ?38 S DIP(1)=$S($D(^ACRSS(D0,"DT")):^("DT"),1:"") S X=$P(DIP(1),U,3),DIP(2)=X S X=10,DIP(3)=X S X=2,X=$J(DIP(2),DIP(3),X) K DIP K:DN Y W X
D N:$X>53 Q:'DN W ?53 W "EST TOTAL:"
W ?65 S DIP(1)=$S($D(^ACRSS(D0,"DT")):^("DT"),1:"") S X=$P(DIP(1),U,4),DIP(2)=X S X=10,DIP(3)=X S X=2,X=$J(DIP(2),DIP(3),X) K DIP K:DN Y W X
D N:$X>0 Q:'DN W ?0 W "UNIT ISSU:"
W ?12 S DIP(1)=$S($D(^ACRSS(D0,"DT")):^("DT"),1:"") S X=$S('$D(^ACRUI(+$P(DIP(1),U,2),0)):"",1:$P(^(0),U,1)),DIP(2)=X S X=10,X=$J(DIP(2),X) K DIP K:DN Y W X
D N:$X>26 Q:'DN W ?26 W "# ACCEPTD:"
W ?38 S DIP(1)=$S($D(^ACRSS(D0,"DT")):^("DT"),1:"") S X=$P(DIP(1),U,6),DIP(2)=X S X=10,X=$J(DIP(2),X) K DIP K:DN Y W X
D N:$X>53 Q:'DN W ?53 W "TOTL PAID:"
W ?65 S DIP(1)=$S($D(^ACRSS(D0,"DT")):^("DT"),1:"") S X=$P(DIP(1),U,21),DIP(2)=X S X=10,DIP(3)=X S X=2,X=$J(DIP(2),DIP(3),X) K DIP K:DN Y W X
D T Q:'DN D N D N:$X>9 Q:'DN W ?9 W "DESCRIPTION"
D N:$X>9 Q:'DN W ?9 W "---------------------------------------------"
S X=$G(^ACRSS(D0,"DESC")) D N:$X>9 Q:'DN W ?9,$E($P(X,U,1),1,30)
D N:$X>9 Q:'DN W ?9,$E($P(X,U,2),1,30)
D N:$X>9 Q:'DN W ?9,$E($P(X,U,3),1,30)
D N:$X>9 Q:'DN W ?9,$E($P(X,U,4),1,30)
D N:$X>9 Q:'DN W ?9,$E($P(X,U,5),1,30)
K Y
Q
HEAD ;
W !,"--------------------------------------------------------------------------------",!!
ACRPII ; GENERATED FROM 'ACR ITEM INVENTORY' PRINT TEMPLATE (#3844) ; 09/29/09 ; (FILE 9002193, 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 SET I(0)="^ACRSS("
SET J(0)=9002193
+3 IF $X>0
DO N
IF 'DN
QUIT
WRITE ?0
WRITE "ITEM #...:"
+4 SET X=$GET(^ACRSS(D0,0))
WRITE ?12
SET Y=$PIECE(X,U,1)
IF Y]""
WRITE $JUSTIFY(Y,4,0)
+5 IF $X>26
DO N
IF 'DN
QUIT
WRITE ?26
WRITE "ORDER #..:"
+6 SET X=$GET(^ACRSS(D0,"NMS"))
WRITE ?38,$EXTRACT($PIECE(X,U,1),1,30)
+7 IF $X>53
DO N
IF 'DN
QUIT
WRITE ?53
WRITE "DOCUMNT #:"
+8 SET X=$GET(^ACRSS(D0,0))
WRITE ?65
SET Y=$PIECE(X,U,3)
SET Y=$SELECT(Y="":Y,$DATA(^ACRDOC(Y,0))#2:$PIECE(^(0),U),1:Y)
WRITE $EXTRACT(Y,1,14)
+9 IF $X>0
DO N
IF 'DN
QUIT
WRITE ?0
WRITE "NSN......:"
+10 SET X=$GET(^ACRSS(D0,"NMS"))
WRITE ?12,$EXTRACT($PIECE(X,U,2),1,17)
+11 IF $X>26
DO N
IF 'DN
QUIT
WRITE ?26
WRITE "NDC......:"
+12 WRITE ?38,$EXTRACT($PIECE(X,U,3),1,14)
+13 IF $X>53
DO N
IF 'DN
QUIT
WRITE ?53
WRITE "VON......:"
+14 SET X=$GET(^ACRSS(D0,"VND"))
WRITE ?65,$EXTRACT($PIECE(X,U,2),1,14)
+15 IF $X>0
DO N
IF 'DN
QUIT
WRITE ?0
WRITE "VENDOR...:"
+16 WRITE ?12
SET Y=$PIECE(X,U,1)
SET Y=$SELECT(Y="":Y,$DATA(^AUTTVNDR(Y,0))#2:$PIECE(^(0),U),1:Y)
WRITE $EXTRACT(Y,1,30)
+17 IF $X>53
DO N
IF 'DN
QUIT
WRITE ?53
WRITE "OBJ CLASS:"
+18 SET X=$GET(^ACRSS(D0,0))
WRITE ?65
SET Y=$PIECE(X,U,4)
SET Y=$SELECT(Y="":Y,$DATA(^AUTTOBJC(Y,0))#2:$PIECE(^(0),U),1:Y)
WRITE $EXTRACT(Y,1,4)
+19 IF $X>0
DO N
IF 'DN
QUIT
WRITE ?0
WRITE "# ORDERED:"
+20 WRITE ?12
SET DIP(1)=$SELECT($DATA(^ACRSS(D0,"DT")):^("DT"),1:"")
SET X=$PIECE(DIP(1),U,1)
SET DIP(2)=X
SET X=10
SET X=$JUSTIFY(DIP(2),X)
KILL DIP
IF DN
KILL Y
WRITE X
+21 IF $X>26
DO N
IF 'DN
QUIT
WRITE ?26
WRITE "UNIT COST:"
+22 WRITE ?38
SET DIP(1)=$SELECT($DATA(^ACRSS(D0,"DT")):^("DT"),1:"")
SET X=$PIECE(DIP(1),U,3)
SET DIP(2)=X
SET X=10
SET DIP(3)=X
SET X=2
SET X=$JUSTIFY(DIP(2),DIP(3),X)
KILL DIP
IF DN
KILL Y
WRITE X
+23 IF $X>53
DO N
IF 'DN
QUIT
WRITE ?53
WRITE "EST TOTAL:"
+24 WRITE ?65
SET DIP(1)=$SELECT($DATA(^ACRSS(D0,"DT")):^("DT"),1:"")
SET X=$PIECE(DIP(1),U,4)
SET DIP(2)=X
SET X=10
SET DIP(3)=X
SET X=2
SET X=$JUSTIFY(DIP(2),DIP(3),X)
KILL DIP
IF DN
KILL Y
WRITE X
+25 IF $X>0
DO N
IF 'DN
QUIT
WRITE ?0
WRITE "UNIT ISSU:"
+26 WRITE ?12
SET DIP(1)=$SELECT($DATA(^ACRSS(D0,"DT")):^("DT"),1:"")
SET X=$SELECT('$DATA(^ACRUI(+$PIECE(DIP(1),U,2),0)):"",1:$PIECE(^(0),U,1))
SET DIP(2)=X
SET X=10
SET X=$JUSTIFY(DIP(2),X)
KILL DIP
IF DN
KILL Y
WRITE X
+27 IF $X>26
DO N
IF 'DN
QUIT
WRITE ?26
WRITE "# ACCEPTD:"
+28 WRITE ?38
SET DIP(1)=$SELECT($DATA(^ACRSS(D0,"DT")):^("DT"),1:"")
SET X=$PIECE(DIP(1),U,6)
SET DIP(2)=X
SET X=10
SET X=$JUSTIFY(DIP(2),X)
KILL DIP
IF DN
KILL Y
WRITE X
+29 IF $X>53
DO N
IF 'DN
QUIT
WRITE ?53
WRITE "TOTL PAID:"
+30 WRITE ?65
SET DIP(1)=$SELECT($DATA(^ACRSS(D0,"DT")):^("DT"),1:"")
SET X=$PIECE(DIP(1),U,21)
SET DIP(2)=X
SET X=10
SET DIP(3)=X
SET X=2
SET X=$JUSTIFY(DIP(2),DIP(3),X)
KILL DIP
IF DN
KILL Y
WRITE X
+31 DO T
IF 'DN
QUIT
DO N
IF $X>9
DO N
IF 'DN
QUIT
WRITE ?9
WRITE "DESCRIPTION"
+32 IF $X>9
DO N
IF 'DN
QUIT
WRITE ?9
WRITE "---------------------------------------------"
+33 SET X=$GET(^ACRSS(D0,"DESC"))
IF $X>9
DO N
IF 'DN
QUIT
WRITE ?9,$EXTRACT($PIECE(X,U,1),1,30)
+34 IF $X>9
DO N
IF 'DN
QUIT
WRITE ?9,$EXTRACT($PIECE(X,U,2),1,30)
+35 IF $X>9
DO N
IF 'DN
QUIT
WRITE ?9,$EXTRACT($PIECE(X,U,3),1,30)
+36 IF $X>9
DO N
IF 'DN
QUIT
WRITE ?9,$EXTRACT($PIECE(X,U,4),1,30)
+37 IF $X>9
DO N
IF 'DN
QUIT
WRITE ?9,$EXTRACT($PIECE(X,U,5),1,30)
+38 KILL Y
+39 QUIT
HEAD ;
+1 WRITE !,"--------------------------------------------------------------------------------",!!