PRCST5 ; GENERATED FROM 'PRCS APPROVE REQUEST' PRINT TEMPLATE (#299) ; 11/15/05 ; (FILE 410, 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(299,"DXS")
S I(0)="^PRCS(410,",J(0)=410
D N:$X>0 Q:'DN W ?0 W "CP TRANSACTION NUMBER: "
S X=$G(^PRCS(410,D0,0)) W ?25,$E($P(X,U,1),1,18)
W ?45 S X=$S('$D(D0):"",D0<0:"",1:D0),DIP(1)=$G(X) S X="IEN",X1=DIP(1) S:X]""&(X?.ANP)&(X1'[U)&(X1'["$C(94)") DIPA($E(X,1,30))=X1 S X="" K DIP K:DN Y W X
D N:$X>0 Q:'DN W ?0 W "TEMPORARY TRANSACTION: "
W ?25 S DIP(1)=$S($D(^PRCS(410,D0,0)):^(0),1:"") S X=$P(DIP(1),U,3),DIP(2)=$G(X) S X=1,DIP(3)=$G(X) S X=10,X=$E(DIP(2),DIP(3),X) K DIP K:DN Y W X
D N:$X>0 Q:'DN W ?0 W " "
D N:$X>0 Q:'DN W ?0 W "TRANSACTION TYPE: "
S X=$G(^PRCS(410,D0,0)) W ?20 S Y=$P(X,U,2) W:Y]"" $S($D(DXS(1,Y)):DXS(1,Y),1:Y)
D N:$X>0 Q:'DN W ?0 W "FORM TYPE: "
W ?13 S Y=$P(X,U,4) S Y=$S(Y="":Y,$D(^PRCS(410.5,Y,0))#2:$P(^(0),U),1:Y) W $E(Y,1,30)
D N:$X>0 Q:'DN W ?0 W " "
D N:$X>0 Q:'DN W ?0 W "REQUESTOR: "
S X=$G(^PRCS(410,D0,7)) W ?13 S Y=$P(X,U,1) S Y=$S(Y="":Y,$D(^VA(200,Y,0))#2:$P(^(0),U),1:Y) W $E(Y,1,35)
D N:$X>0 Q:'DN W ?0 W " "
D N:$X>0 Q:'DN W ?0 W "DATE OF REQUEST: "
S X=$G(^PRCS(410,D0,1)) W ?19 S Y=$P(X,U,1) D DT
D N:$X>0 Q:'DN W ?0 W "DATE REQUIRED: "
W ?17 S Y=$P(X,U,4) D DT
D N:$X>0 Q:'DN W ?0 W " "
D N:$X>0 Q:'DN W ?0 W "COMMITTED (ESTIMATED) COST: "
S X=$G(^PRCS(410,D0,4)) W ?30 S Y=$P(X,U,1) W:Y]"" $J(Y,11,2)
D N:$X>0 Q:'DN W ?0 W " "
D N:$X>0 Q:'DN W ?0 W "VENDOR: "
S X=$G(^PRCS(410,D0,2)) W ?10,$E($P(X,U,1),1,30)
D N:$X>0 Q:'DN W ?0 W " "
D N:$X>0 Q:'DN W ?0 W "ITEM #1 DESCRIPTION: "
S PRCST5X=$$GET1^DIQ(410.02,"1,"_DIPA("IEN")_",",1,"","PRCTXT","PRCERR") K DIP K:DN Y
W $S($D(PRCTXT(1)):$E(PRCTXT(1),1,30),1:"Item Description not available") K DIP K:DN Y
W ?0 K PRCST5X,PRCTXT,DIERR,PRCERR K DIP K:DN Y
K Y
Q
HEAD ;
W !,"--------------------------------------------------------------------------------",!!
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPRCST5 2485 printed Dec 13, 2024@02:19:04 Page 2
PRCST5 ; GENERATED FROM 'PRCS APPROVE REQUEST' PRINT TEMPLATE (#299) ; 11/15/05 ; (FILE 410, 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(299,"DXS")
+3 SET I(0)="^PRCS(410,"
SET J(0)=410
+4 if $X>0
DO N
if 'DN
QUIT
WRITE ?0
WRITE "CP TRANSACTION NUMBER: "
+5 SET X=$GET(^PRCS(410,D0,0))
WRITE ?25,$EXTRACT($PIECE(X,U,1),1,18)
+6 WRITE ?45
SET X=$SELECT('$DATA(D0):"",D0<0:"",1:D0)
SET DIP(1)=$GET(X)
SET X="IEN"
SET X1=DIP(1)
if X]""&(X?.ANP)&(X1'[U)&(X1'["$C(94)")
SET DIPA($EXTRACT(X,1,30))=X1
SET X=""
KILL DIP
if DN
KILL Y
WRITE X
+7 if $X>0
DO N
if 'DN
QUIT
WRITE ?0
WRITE "TEMPORARY TRANSACTION: "
+8 WRITE ?25
SET DIP(1)=$SELECT($DATA(^PRCS(410,D0,0)):^(0),1:"")
SET X=$PIECE(DIP(1),U,3)
SET DIP(2)=$GET(X)
SET X=1
SET DIP(3)=$GET(X)
SET X=10
SET X=$EXTRACT(DIP(2),DIP(3),X)
KILL DIP
if DN
KILL Y
WRITE X
+9 if $X>0
DO N
if 'DN
QUIT
WRITE ?0
WRITE " "
+10 if $X>0
DO N
if 'DN
QUIT
WRITE ?0
WRITE "TRANSACTION TYPE: "
+11 SET X=$GET(^PRCS(410,D0,0))
WRITE ?20
SET Y=$PIECE(X,U,2)
if Y]""
WRITE $SELECT($DATA(DXS(1,Y)):DXS(1,Y),1:Y)
+12 if $X>0
DO N
if 'DN
QUIT
WRITE ?0
WRITE "FORM TYPE: "
+13 WRITE ?13
SET Y=$PIECE(X,U,4)
SET Y=$SELECT(Y="":Y,$DATA(^PRCS(410.5,Y,0))#2:$PIECE(^(0),U),1:Y)
WRITE $EXTRACT(Y,1,30)
+14 if $X>0
DO N
if 'DN
QUIT
WRITE ?0
WRITE " "
+15 if $X>0
DO N
if 'DN
QUIT
WRITE ?0
WRITE "REQUESTOR: "
+16 SET X=$GET(^PRCS(410,D0,7))
WRITE ?13
SET Y=$PIECE(X,U,1)
SET Y=$SELECT(Y="":Y,$DATA(^VA(200,Y,0))#2:$PIECE(^(0),U),1:Y)
WRITE $EXTRACT(Y,1,35)
+17 if $X>0
DO N
if 'DN
QUIT
WRITE ?0
WRITE " "
+18 if $X>0
DO N
if 'DN
QUIT
WRITE ?0
WRITE "DATE OF REQUEST: "
+19 SET X=$GET(^PRCS(410,D0,1))
WRITE ?19
SET Y=$PIECE(X,U,1)
DO DT
+20 if $X>0
DO N
if 'DN
QUIT
WRITE ?0
WRITE "DATE REQUIRED: "
+21 WRITE ?17
SET Y=$PIECE(X,U,4)
DO DT
+22 if $X>0
DO N
if 'DN
QUIT
WRITE ?0
WRITE " "
+23 if $X>0
DO N
if 'DN
QUIT
WRITE ?0
WRITE "COMMITTED (ESTIMATED) COST: "
+24 SET X=$GET(^PRCS(410,D0,4))
WRITE ?30
SET Y=$PIECE(X,U,1)
if Y]""
WRITE $JUSTIFY(Y,11,2)
+25 if $X>0
DO N
if 'DN
QUIT
WRITE ?0
WRITE " "
+26 if $X>0
DO N
if 'DN
QUIT
WRITE ?0
WRITE "VENDOR: "
+27 SET X=$GET(^PRCS(410,D0,2))
WRITE ?10,$EXTRACT($PIECE(X,U,1),1,30)
+28 if $X>0
DO N
if 'DN
QUIT
WRITE ?0
WRITE " "
+29 if $X>0
DO N
if 'DN
QUIT
WRITE ?0
WRITE "ITEM #1 DESCRIPTION: "
+30 SET PRCST5X=$$GET1^DIQ(410.02,"1,"_DIPA("IEN")_",",1,"","PRCTXT","PRCERR")
KILL DIP
if DN
KILL Y
+31 WRITE $SELECT($DATA(PRCTXT(1)):$EXTRACT(PRCTXT(1),1,30),1:"Item Description not available")
KILL DIP
if DN
KILL Y
+32 WRITE ?0
KILL PRCST5X,PRCTXT,DIERR,PRCERR
KILL DIP
if DN
KILL Y
+33 KILL Y
+34 QUIT
HEAD ;
+1 WRITE !,"--------------------------------------------------------------------------------",!!