ACRPTD ; GENERATED FROM 'ACR TRAVEL DAY' PRINT TEMPLATE (#3876) ; 09/29/09 ; (FILE 9002193.5, 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(3876,"DXS")
S I(0)="^ACRTV(",J(0)=9002193.5
W ?0 X DXS(1,9) K DIP K:DN Y
D N:$X>0 Q:'DN W ?0 W "TRAVEL DAY..:"
S X=$G(^ACRTV(D0,0)) W ?15 S Y=$P(X,U,1) W:Y]"" $J(Y,4,0)
D N:$X>40 Q:'DN W ?40 W "DATE........:"
S X=$G(^ACRTV(D0,"DT")) W ?55 S Y=$P(X,U,1) D DT
D N:$X>0 Q:'DN W ?0 W "DEPART......:"
W ?15 S Y=$P(X,U,2) S Y(0)=Y I $G(Y)>1 X ^DD("DD") S Y=$P(Y,"@",2) S:+Y<12 Y=+Y_":"_$P(Y,":",2)_" AM" S:Y'["AM" Y=+Y-$S(+Y'=12:12,1:0)_":"_$P(Y,":",2)_" PM" W $E(Y,1,30)
D N:$X>40 Q:'DN W ?40 W "ARRIVE......:"
S X=$G(^ACRTV(D0,"DT")) W ?55 S Y=$P(X,U,3) S Y(0)=Y I $G(Y)>1 X ^DD("DD") S Y=$P(Y,"@",2) S:+Y<12 Y=+Y_":"_$P(Y,":",2)_" AM" S:Y'["AM" Y=+Y-$S(+Y'=12:12,1:0)_":"_$P(Y,":",2)_" PM" W $E(Y,1,10)
D N:$X>0 Q:'DN W ?0 W "DEPART FROM.:"
S X=$G(^ACRTV(D0,"DT")) W ?15 S Y=$P(X,U,18) W:Y]"" $S($D(DXS(2,Y)):DXS(2,Y),1:Y)
D N:$X>40 Q:'DN W ?40 W "ARRIVE AT...:"
W ?55 S Y=$P(X,U,19) W:Y]"" $S($D(DXS(3,Y)):DXS(3,Y),1:Y)
D N:$X>0 Q:'DN W ?0 W "DAILY DETAIL:"
S X=$G(^ACRTV(D0,"DESC")) W ?15,$E($P(X,U,1),1,55)
D N:$X>15 Q:'DN W ?15,$E($P(X,U,2),1,55)
D N:$X>15 Q:'DN W ?15,$E($P(X,U,3),1,55)
D N:$X>15 Q:'DN W ?15,$E($P(X,U,4),1,55)
D N:$X>0 Q:'DN W ?0 W "DUTY STATION:"
S X=$G(^ACRTV(D0,"DT")) W ?15 S Y=$P(X,U,4) S Y=$S(Y="":Y,$D(^ACRPD(Y,0))#2:$P(^(0),U),1:Y) W $E(Y,1,30)
D N:$X>40 Q:'DN W ?40 W "PERDIEM/LDG.:"
W ?55 S DIP(1)=$S($D(^ACRTV(D0,"DT")):^("DT"),1:"") S X=$P(DIP(1),U,5)_"/"_$P(DIP(1),U,6) K DIP K:DN Y W X
D N:$X>0 Q:'DN W ?0 W "MILES.......:"
S X=$G(^ACRTV(D0,"DT")) W ?15 S Y=$P(X,U,7) W:Y]"" $J(Y,4,0)
D N:$X>40 Q:'DN W ?40 W "TAXI/SHUTTLE:"
W ?55 S Y=$P(X,U,8) W:Y]"" $J(Y,6,2)
S X=$G(^ACRTV(D0,1)) D N:$X>40 Q:'DN W ?40,$E($P(X,U,4),1,40)
D N:$X>0 Q:'DN W ?0 W "PERS. PHONE.:"
S X=$G(^ACRTV(D0,"DT")) W ?15 S Y=$P(X,U,9) W:Y]"" $J(Y,6,2)
D N:$X>40 Q:'DN W ?40 W "OTHER EXPENS:"
W ?55 S Y=$P(X,U,10) W:Y]"" $J(Y,8,2)
D N:$X>0 Q:'DN W ?0 W "EXPLANATION.:"
W ?15,$E($P(X,U,17),1,50)
S X=$G(^ACRTV(D0,1)) D N:$X>15 Q:'DN W ?15,$E($P(X,U,1),1,50)
D N:$X>15 Q:'DN W ?15,$E($P(X,U,2),1,50)
D N:$X>15 Q:'DN W ?15,$E($P(X,U,3),1,50)
D N:$X>0 Q:'DN W ?0 W "HOTEL.......:"
S X=$G(^ACRTV(D0,"DT")) W ?15 S Y=$P(X,U,11) S Y=$S(Y="":Y,$D(^ACRHOTEL(Y,0))#2:$P(^(0),U),1:Y) W $E(Y,1,20)
D N:$X>40 Q:'DN W ?40 W "CAR RENTAL..:"
W ?55 S Y=$P(X,U,13) S Y=$S(Y="":Y,$D(^ACRRCOMP(Y,0))#2:$P(^(0),U),1:Y) W $E(Y,1,20)
D N:$X>0 Q:'DN W ?0 W "CONFIRMATN #:"
W ?15,$E($P(X,U,12),1,15)
D N:$X>40 Q:'DN W ?40 W "CONFIRMATN #:"
W ?55,$E($P(X,U,14),1,15)
D N:$X>0 Q:'DN W ?0 W "GUARANTEED..:"
W ?15 S Y=$P(X,U,16) W:Y]"" $S($D(DXS(4,Y)):DXS(4,Y),1:Y)
D N:$X>40 Q:'DN W ?40 W "CAR EXPENSE.:"
W ?55 S Y=$P(X,U,15) W:Y]"" $J(Y,7,2)
D N:$X>0 Q:'DN W ?0 W "CAR RENTAL JUSTIFICATION:"
S X=$G(^ACRTV(D0,"RCJ")) D N:$X>15 Q:'DN W ?15,$E($P(X,U,1),1,45)
D N:$X>15 Q:'DN W ?15,$E($P(X,U,2),1,45)
D N:$X>15 Q:'DN W ?15,$E($P(X,U,3),1,45)
D N:$X>15 Q:'DN W ?15,$E($P(X,U,4),1,45)
D N:$X>15 Q:'DN W ?15,$E($P(X,U,5),1,45)
K Y
Q
HEAD ;
W !,"--------------------------------------------------------------------------------",!!
ACRPTD ; GENERATED FROM 'ACR TRAVEL DAY' PRINT TEMPLATE (#3876) ; 09/29/09 ; (FILE 9002193.5, 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(3876,"DXS")
+3 SET I(0)="^ACRTV("
SET J(0)=9002193.5
+4 WRITE ?0
XECUTE DXS(1,9)
KILL DIP
IF DN
KILL Y
+5 IF $X>0
DO N
IF 'DN
QUIT
WRITE ?0
WRITE "TRAVEL DAY..:"
+6 SET X=$GET(^ACRTV(D0,0))
WRITE ?15
SET Y=$PIECE(X,U,1)
IF Y]""
WRITE $JUSTIFY(Y,4,0)
+7 IF $X>40
DO N
IF 'DN
QUIT
WRITE ?40
WRITE "DATE........:"
+8 SET X=$GET(^ACRTV(D0,"DT"))
WRITE ?55
SET Y=$PIECE(X,U,1)
DO DT
+9 IF $X>0
DO N
IF 'DN
QUIT
WRITE ?0
WRITE "DEPART......:"
+10 WRITE ?15
SET Y=$PIECE(X,U,2)
SET Y(0)=Y
IF $GET(Y)>1
XECUTE ^DD("DD")
SET Y=$PIECE(Y,"@",2)
IF +Y<12
SET Y=+Y_":"_$PIECE(Y,":",2)_" AM"
IF Y'["AM"
SET Y=+Y-$SELECT(+Y'=12:12,1:0)_":"_$PIECE(Y,":",2)_" PM"
WRITE $EXTRACT(Y,1,30)
+11 IF $X>40
DO N
IF 'DN
QUIT
WRITE ?40
WRITE "ARRIVE......:"
+12 SET X=$GET(^ACRTV(D0,"DT"))
WRITE ?55
SET Y=$PIECE(X,U,3)
SET Y(0)=Y
IF $GET(Y)>1
XECUTE ^DD("DD")
SET Y=$PIECE(Y,"@",2)
IF +Y<12
SET Y=+Y_":"_$PIECE(Y,":",2)_" AM"
IF Y'["AM"
SET Y=+Y-$SELECT(+Y'=12:12,1:0)_":"_$PIECE(Y,":",2)_" PM"
WRITE $EXTRACT(Y,1,10)
+13 IF $X>0
DO N
IF 'DN
QUIT
WRITE ?0
WRITE "DEPART FROM.:"
+14 SET X=$GET(^ACRTV(D0,"DT"))
WRITE ?15
SET Y=$PIECE(X,U,18)
IF Y]""
WRITE $SELECT($DATA(DXS(2,Y)):DXS(2,Y),1:Y)
+15 IF $X>40
DO N
IF 'DN
QUIT
WRITE ?40
WRITE "ARRIVE AT...:"
+16 WRITE ?55
SET Y=$PIECE(X,U,19)
IF Y]""
WRITE $SELECT($DATA(DXS(3,Y)):DXS(3,Y),1:Y)
+17 IF $X>0
DO N
IF 'DN
QUIT
WRITE ?0
WRITE "DAILY DETAIL:"
+18 SET X=$GET(^ACRTV(D0,"DESC"))
WRITE ?15,$EXTRACT($PIECE(X,U,1),1,55)
+19 IF $X>15
DO N
IF 'DN
QUIT
WRITE ?15,$EXTRACT($PIECE(X,U,2),1,55)
+20 IF $X>15
DO N
IF 'DN
QUIT
WRITE ?15,$EXTRACT($PIECE(X,U,3),1,55)
+21 IF $X>15
DO N
IF 'DN
QUIT
WRITE ?15,$EXTRACT($PIECE(X,U,4),1,55)
+22 IF $X>0
DO N
IF 'DN
QUIT
WRITE ?0
WRITE "DUTY STATION:"
+23 SET X=$GET(^ACRTV(D0,"DT"))
WRITE ?15
SET Y=$PIECE(X,U,4)
SET Y=$SELECT(Y="":Y,$DATA(^ACRPD(Y,0))#2:$PIECE(^(0),U),1:Y)
WRITE $EXTRACT(Y,1,30)
+24 IF $X>40
DO N
IF 'DN
QUIT
WRITE ?40
WRITE "PERDIEM/LDG.:"
+25 WRITE ?55
SET DIP(1)=$SELECT($DATA(^ACRTV(D0,"DT")):^("DT"),1:"")
SET X=$PIECE(DIP(1),U,5)_"/"_$PIECE(DIP(1),U,6)
KILL DIP
IF DN
KILL Y
WRITE X
+26 IF $X>0
DO N
IF 'DN
QUIT
WRITE ?0
WRITE "MILES.......:"
+27 SET X=$GET(^ACRTV(D0,"DT"))
WRITE ?15
SET Y=$PIECE(X,U,7)
IF Y]""
WRITE $JUSTIFY(Y,4,0)
+28 IF $X>40
DO N
IF 'DN
QUIT
WRITE ?40
WRITE "TAXI/SHUTTLE:"
+29 WRITE ?55
SET Y=$PIECE(X,U,8)
IF Y]""
WRITE $JUSTIFY(Y,6,2)
+30 SET X=$GET(^ACRTV(D0,1))
IF $X>40
DO N
IF 'DN
QUIT
WRITE ?40,$EXTRACT($PIECE(X,U,4),1,40)
+31 IF $X>0
DO N
IF 'DN
QUIT
WRITE ?0
WRITE "PERS. PHONE.:"
+32 SET X=$GET(^ACRTV(D0,"DT"))
WRITE ?15
SET Y=$PIECE(X,U,9)
IF Y]""
WRITE $JUSTIFY(Y,6,2)
+33 IF $X>40
DO N
IF 'DN
QUIT
WRITE ?40
WRITE "OTHER EXPENS:"
+34 WRITE ?55
SET Y=$PIECE(X,U,10)
IF Y]""
WRITE $JUSTIFY(Y,8,2)
+35 IF $X>0
DO N
IF 'DN
QUIT
WRITE ?0
WRITE "EXPLANATION.:"
+36 WRITE ?15,$EXTRACT($PIECE(X,U,17),1,50)
+37 SET X=$GET(^ACRTV(D0,1))
IF $X>15
DO N
IF 'DN
QUIT
WRITE ?15,$EXTRACT($PIECE(X,U,1),1,50)
+38 IF $X>15
DO N
IF 'DN
QUIT
WRITE ?15,$EXTRACT($PIECE(X,U,2),1,50)
+39 IF $X>15
DO N
IF 'DN
QUIT
WRITE ?15,$EXTRACT($PIECE(X,U,3),1,50)
+40 IF $X>0
DO N
IF 'DN
QUIT
WRITE ?0
WRITE "HOTEL.......:"
+41 SET X=$GET(^ACRTV(D0,"DT"))
WRITE ?15
SET Y=$PIECE(X,U,11)
SET Y=$SELECT(Y="":Y,$DATA(^ACRHOTEL(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 "CAR RENTAL..:"
+43 WRITE ?55
SET Y=$PIECE(X,U,13)
SET Y=$SELECT(Y="":Y,$DATA(^ACRRCOMP(Y,0))#2:$PIECE(^(0),U),1:Y)
WRITE $EXTRACT(Y,1,20)
+44 IF $X>0
DO N
IF 'DN
QUIT
WRITE ?0
WRITE "CONFIRMATN #:"
+45 WRITE ?15,$EXTRACT($PIECE(X,U,12),1,15)
+46 IF $X>40
DO N
IF 'DN
QUIT
WRITE ?40
WRITE "CONFIRMATN #:"
+47 WRITE ?55,$EXTRACT($PIECE(X,U,14),1,15)
+48 IF $X>0
DO N
IF 'DN
QUIT
WRITE ?0
WRITE "GUARANTEED..:"
+49 WRITE ?15
SET Y=$PIECE(X,U,16)
IF Y]""
WRITE $SELECT($DATA(DXS(4,Y)):DXS(4,Y),1:Y)
+50 IF $X>40
DO N
IF 'DN
QUIT
WRITE ?40
WRITE "CAR EXPENSE.:"
+51 WRITE ?55
SET Y=$PIECE(X,U,15)
IF Y]""
WRITE $JUSTIFY(Y,7,2)
+52 IF $X>0
DO N
IF 'DN
QUIT
WRITE ?0
WRITE "CAR RENTAL JUSTIFICATION:"
+53 SET X=$GET(^ACRTV(D0,"RCJ"))
IF $X>15
DO N
IF 'DN
QUIT
WRITE ?15,$EXTRACT($PIECE(X,U,1),1,45)
+54 IF $X>15
DO N
IF 'DN
QUIT
WRITE ?15,$EXTRACT($PIECE(X,U,2),1,45)
+55 IF $X>15
DO N
IF 'DN
QUIT
WRITE ?15,$EXTRACT($PIECE(X,U,3),1,45)
+56 IF $X>15
DO N
IF 'DN
QUIT
WRITE ?15,$EXTRACT($PIECE(X,U,4),1,45)
+57 IF $X>15
DO N
IF 'DN
QUIT
WRITE ?15,$EXTRACT($PIECE(X,U,5),1,45)
+58 KILL Y
+59 QUIT
HEAD ;
+1 WRITE !,"--------------------------------------------------------------------------------",!!