ACRFETD ;IHS/OIRM/DSD/THL,AEF - EDIT TRAVEL DAY; [ 11/01/2001 9:44 AM ]
;;2.1;ADMIN RESOURCE MGT SYSTEM;;NOV 05, 2001
;;ROUTINE TO ALLOW EDIT OF TRAVEL DAYS
EN D FIELDS
F D EN1 Q:$D(ACRQUIT)
EXIT K ACRX,ACRTV0,ACRTV1,ACRTVDT,ACRFLDS,ACRY,ACR,ACRTVDSC,ACRTVRCJ,ACRJ
Q
EN1 ;
D DISP
S DIR(0)="LO^1:22"
S DIR("A")=" Edit which fields"
D DIR^ACRFDIC
I +Y<1 S ACRQUIT="" Q
S ACRFLDS=ACRY
W !
F J=1:1 S ACRX=$P(ACRFLDS,",",J) Q:ACRX="" D DIE
Q
DIE ;
S DA=ACRTVDA
S DIE="^ACRTV("
S DR=ACR("DR",ACRX)
I $E(DR)'="[",DR'["T" S DR=DR_"T"
D DIE^ACRFDIC
Q
DISP ;DISPLAY TRAVEL DAY INFO
D GATHER
W @IOF
W !?17,@ACRON,"DAILY TRAVEL INFORMATION",@ACROF
W !,"1. DATE........: ",$G(ACR(1))
W ?40,"11. HOTEL.......: ",$G(ACR(11))
W !,"2. DEPART TIME.: ",$G(ACR(2))
W ?40,"12. CONFIRMATN #: ",$G(ACR(12))
W !,"3. DEPART FROM.: ",$G(ACR(3))
W ?40,"13. RENTAL CAR..: ",$G(ACR(13))
W !,"4. ARRIVE TIME.: ",$G(ACR(4))
W ?40,"14. CONFIRMATN #: ",$G(ACR(14))
W !,"5. ARRIVE AT...: ",$G(ACR(5))
W ?40,"15. CAR EXPENSE.: ",$G(ACR(15))
W !,"6. DUTY STATION: ",$G(ACR(6))
W ?40,"16. PERDIEM/LDG.: ",$G(ACR(16))
W !,"7. MILES-AIRPRT: ",$G(ACR(7))
W ?40,"17. POV MILES...: ",$G(ACR(17))
W !,"8. MILEAGE RATE: ",$G(ACR(8))
W ?40,"18. POV MLS RATE: ",$G(ACR(18))
W !,"9. HOME PHONE..: ",$G(ACR(9))
W ?40,"19. TAXI/SHUTTLE: ",$G(ACR(19))
W !,"10.OTHER EXPENS: ",$G(ACR(10))
W ?40,"20. AIRPORT PARK: ",$G(ACR(20))
W !," EXPLAIN OTHER EXPENSES: "
S ACRX=$P(ACRTVDT,U,17)_U_$P(ACRTV1,U,1,3)
D D1
W !,"21.DETAIL DESCRIPTION: "
S ACRX=ACR(21)
D D1
W !,"22.RENTAL CAR JUSTIFICATION: "
S ACRX=ACR(22)
D D1
W !,"--------------------------------------------------------------------------------"
Q
D1 ;
S ACRX=$TR(ACRX,"^"," ")
W !?5
F ACRJ=1:1 S X=$P(ACRX," ",ACRJ) Q:$P(ACRX," ",ACRJ,99)="" W:$X+$L(X)>78 !?5 W X," "
Q
GATHER ;GATHER TRAVEL DAY INFO
N X,Y
S ACRTV0=$G(^ACRTV(ACRTVDA,0))
S ACRTVDT=$G(^ACRTV(ACRTVDA,"DT"))
S ACRTV1=$G(^ACRTV(ACRTVDA,1))
S ACRTVDSC=$G(^ACRTV(ACRTVDA,"DESC"))
S ACRTVRCJ=$G(^ACRTV(ACRTVDA,"RCJ"))
S Y=$P(ACRTVDT,U)
X ^DD("DD")
S ACR(1)=$P(Y,",")
S X=$P(ACRTV0,U,4)
S X=$P($P($P(^DD(9002193.5,.04,0),U,3),(X_":"),2),";")
S ACR(1)=ACR(1)_"-"_$E(X,1,15)
S Y=$P(ACRTVDT,U,2)
X ^DD("DD")
S ACR(2)=$P(Y,"@",2)
S (ACR(3),ACR(5))=""
S (ACRDFR,X)=$P(ACRTVDT,U,18)
I X D
.S X=X_":"
.S X=$P($P($P(^DD(9002193.5,2.5,0),U,3),X,2),";")
.S ACR(3)=$S(ACR(2)]"":X,1:"")
S Y=$P(ACRTVDT,U,3)
X ^DD("DD")
S ACR(4)=$P(Y,"@",2)
S (ACRAAT,X)=$P(ACRTVDT,U,19)
I X D
.S X=X_":"
.S X=$P($P($P(^DD(9002193.5,3.5,0),U,3),X,2),";")
.S ACR(5)=X
S X=$P(ACRTVDT,U,4)
S ACR(6)=$E($P($G(^ACRPD(+X,0)),U),1,20)
S ACR(7)=$P(ACRTVDT,U,7)
S ACR(8)=$P(ACRTVDT,U,20)
S ACR(9)=$P(ACRTVDT,U,9)
S ACR(10)=$P(ACRTVDT,U,10)
S X=$P(ACRTVDT,U,11)
S ACR(11)=$E($P($G(^ACRHOTEL(+X,0)),U),1,20)
S ACR(12)=$P(ACRTVDT,U,12)
S X=$P(ACRTVDT,U,13),ACR(13)=$P($G(^ACRRCOMP(+X,0)),U)
S ACR(14)=$P(ACRTVDT,U,14)
S ACR(15)=$P(ACRTVDT,U,15)
S ACR(16)=$TR($P(ACRTVDT,U,5,6),"^","/")
S ACR(17)=$P(ACRTVDT,U,21)
S ACR(18)=$P(ACRTVDT,U,23)
S ACR(19)=$P(ACRTVDT,U,8)
S ACR(20)=$P(ACRTVDT,U,22)
S ACR(21)=ACRTVDSC
S ACR(22)=ACRTVRCJ
Q
FIELDS ;SET FIELDS TO BE EDITED
S ACR("DR",1)="1T;.04T"
S ACR("DR",2)="[ACR DEPART]"
S ACR("DR",3)=2.5
S ACR("DR",4)="[ACR ARRIVE]"
S ACR("DR",5)=3.5
S ACR("DR",6)=4
S ACR("DR",7)="7T;7.5T;31T"
S ACR("DR",8)=7.5
S ACR("DR",9)=9
S ACR("DR",10)="[ACR EXPLAIN OTHER EXPENSE]"
S ACR("DR",11)=11
S ACR("DR",12)=12
S ACR("DR",13)="[ACR RENTAL CAR]"
S ACR("DR",14)=14
S ACR("DR",15)=15
S ACR("DR",16)="5T;6T"
S ACR("DR",17)=30
S ACR("DR",18)=32
S ACR("DR",19)="8T;29T"
S ACR("DR",20)=31
S ACR("DR",21)="[ACR DETAILED DESC]"
S ACR("DR",22)="[ACR RENTAL CAR JUST]"
Q
ACRFETD ;IHS/OIRM/DSD/THL,AEF - EDIT TRAVEL DAY; [ 11/01/2001 9:44 AM ]
+1 ;;2.1;ADMIN RESOURCE MGT SYSTEM;;NOV 05, 2001
+2 ;;ROUTINE TO ALLOW EDIT OF TRAVEL DAYS
EN DO FIELDS
+1 FOR
DO EN1
IF $DATA(ACRQUIT)
QUIT
EXIT KILL ACRX,ACRTV0,ACRTV1,ACRTVDT,ACRFLDS,ACRY,ACR,ACRTVDSC,ACRTVRCJ,ACRJ
+1 QUIT
EN1 ;
+1 DO DISP
+2 SET DIR(0)="LO^1:22"
+3 SET DIR("A")=" Edit which fields"
+4 DO DIR^ACRFDIC
+5 IF +Y<1
SET ACRQUIT=""
QUIT
+6 SET ACRFLDS=ACRY
+7 WRITE !
+8 FOR J=1:1
SET ACRX=$PIECE(ACRFLDS,",",J)
IF ACRX=""
QUIT
DO DIE
+9 QUIT
DIE ;
+1 SET DA=ACRTVDA
+2 SET DIE="^ACRTV("
+3 SET DR=ACR("DR",ACRX)
+4 IF $EXTRACT(DR)'="["
IF DR'["T"
SET DR=DR_"T"
+5 DO DIE^ACRFDIC
+6 QUIT
DISP ;DISPLAY TRAVEL DAY INFO
+1 DO GATHER
+2 WRITE @IOF
+3 WRITE !?17,@ACRON,"DAILY TRAVEL INFORMATION",@ACROF
+4 WRITE !,"1. DATE........: ",$GET(ACR(1))
+5 WRITE ?40,"11. HOTEL.......: ",$GET(ACR(11))
+6 WRITE !,"2. DEPART TIME.: ",$GET(ACR(2))
+7 WRITE ?40,"12. CONFIRMATN #: ",$GET(ACR(12))
+8 WRITE !,"3. DEPART FROM.: ",$GET(ACR(3))
+9 WRITE ?40,"13. RENTAL CAR..: ",$GET(ACR(13))
+10 WRITE !,"4. ARRIVE TIME.: ",$GET(ACR(4))
+11 WRITE ?40,"14. CONFIRMATN #: ",$GET(ACR(14))
+12 WRITE !,"5. ARRIVE AT...: ",$GET(ACR(5))
+13 WRITE ?40,"15. CAR EXPENSE.: ",$GET(ACR(15))
+14 WRITE !,"6. DUTY STATION: ",$GET(ACR(6))
+15 WRITE ?40,"16. PERDIEM/LDG.: ",$GET(ACR(16))
+16 WRITE !,"7. MILES-AIRPRT: ",$GET(ACR(7))
+17 WRITE ?40,"17. POV MILES...: ",$GET(ACR(17))
+18 WRITE !,"8. MILEAGE RATE: ",$GET(ACR(8))
+19 WRITE ?40,"18. POV MLS RATE: ",$GET(ACR(18))
+20 WRITE !,"9. HOME PHONE..: ",$GET(ACR(9))
+21 WRITE ?40,"19. TAXI/SHUTTLE: ",$GET(ACR(19))
+22 WRITE !,"10.OTHER EXPENS: ",$GET(ACR(10))
+23 WRITE ?40,"20. AIRPORT PARK: ",$GET(ACR(20))
+24 WRITE !," EXPLAIN OTHER EXPENSES: "
+25 SET ACRX=$PIECE(ACRTVDT,U,17)_U_$PIECE(ACRTV1,U,1,3)
+26 DO D1
+27 WRITE !,"21.DETAIL DESCRIPTION: "
+28 SET ACRX=ACR(21)
+29 DO D1
+30 WRITE !,"22.RENTAL CAR JUSTIFICATION: "
+31 SET ACRX=ACR(22)
+32 DO D1
+33 WRITE !,"--------------------------------------------------------------------------------"
+34 QUIT
D1 ;
+1 SET ACRX=$TRANSLATE(ACRX,"^"," ")
+2 WRITE !?5
+3 FOR ACRJ=1:1
SET X=$PIECE(ACRX," ",ACRJ)
IF $PIECE(ACRX," ",ACRJ,99)=""
QUIT
IF $X+$LENGTH(X)>78
WRITE !?5
WRITE X," "
+4 QUIT
GATHER ;GATHER TRAVEL DAY INFO
+1 NEW X,Y
+2 SET ACRTV0=$GET(^ACRTV(ACRTVDA,0))
+3 SET ACRTVDT=$GET(^ACRTV(ACRTVDA,"DT"))
+4 SET ACRTV1=$GET(^ACRTV(ACRTVDA,1))
+5 SET ACRTVDSC=$GET(^ACRTV(ACRTVDA,"DESC"))
+6 SET ACRTVRCJ=$GET(^ACRTV(ACRTVDA,"RCJ"))
+7 SET Y=$PIECE(ACRTVDT,U)
+8 XECUTE ^DD("DD")
+9 SET ACR(1)=$PIECE(Y,",")
+10 SET X=$PIECE(ACRTV0,U,4)
+11 SET X=$PIECE($PIECE($PIECE(^DD(9002193.5,.04,0),U,3),(X_":"),2),";")
+12 SET ACR(1)=ACR(1)_"-"_$EXTRACT(X,1,15)
+13 SET Y=$PIECE(ACRTVDT,U,2)
+14 XECUTE ^DD("DD")
+15 SET ACR(2)=$PIECE(Y,"@",2)
+16 SET (ACR(3),ACR(5))=""
+17 SET (ACRDFR,X)=$PIECE(ACRTVDT,U,18)
+18 IF X
Begin DoDot:1
+19 SET X=X_":"
+20 SET X=$PIECE($PIECE($PIECE(^DD(9002193.5,2.5,0),U,3),X,2),";")
+21 SET ACR(3)=$SELECT(ACR(2)]"":X,1:"")
End DoDot:1
+22 SET Y=$PIECE(ACRTVDT,U,3)
+23 XECUTE ^DD("DD")
+24 SET ACR(4)=$PIECE(Y,"@",2)
+25 SET (ACRAAT,X)=$PIECE(ACRTVDT,U,19)
+26 IF X
Begin DoDot:1
+27 SET X=X_":"
+28 SET X=$PIECE($PIECE($PIECE(^DD(9002193.5,3.5,0),U,3),X,2),";")
+29 SET ACR(5)=X
End DoDot:1
+30 SET X=$PIECE(ACRTVDT,U,4)
+31 SET ACR(6)=$EXTRACT($PIECE($GET(^ACRPD(+X,0)),U),1,20)
+32 SET ACR(7)=$PIECE(ACRTVDT,U,7)
+33 SET ACR(8)=$PIECE(ACRTVDT,U,20)
+34 SET ACR(9)=$PIECE(ACRTVDT,U,9)
+35 SET ACR(10)=$PIECE(ACRTVDT,U,10)
+36 SET X=$PIECE(ACRTVDT,U,11)
+37 SET ACR(11)=$EXTRACT($PIECE($GET(^ACRHOTEL(+X,0)),U),1,20)
+38 SET ACR(12)=$PIECE(ACRTVDT,U,12)
+39 SET X=$PIECE(ACRTVDT,U,13)
SET ACR(13)=$PIECE($GET(^ACRRCOMP(+X,0)),U)
+40 SET ACR(14)=$PIECE(ACRTVDT,U,14)
+41 SET ACR(15)=$PIECE(ACRTVDT,U,15)
+42 SET ACR(16)=$TRANSLATE($PIECE(ACRTVDT,U,5,6),"^","/")
+43 SET ACR(17)=$PIECE(ACRTVDT,U,21)
+44 SET ACR(18)=$PIECE(ACRTVDT,U,23)
+45 SET ACR(19)=$PIECE(ACRTVDT,U,8)
+46 SET ACR(20)=$PIECE(ACRTVDT,U,22)
+47 SET ACR(21)=ACRTVDSC
+48 SET ACR(22)=ACRTVRCJ
+49 QUIT
FIELDS ;SET FIELDS TO BE EDITED
+1 SET ACR("DR",1)="1T;.04T"
+2 SET ACR("DR",2)="[ACR DEPART]"
+3 SET ACR("DR",3)=2.5
+4 SET ACR("DR",4)="[ACR ARRIVE]"
+5 SET ACR("DR",5)=3.5
+6 SET ACR("DR",6)=4
+7 SET ACR("DR",7)="7T;7.5T;31T"
+8 SET ACR("DR",8)=7.5
+9 SET ACR("DR",9)=9
+10 SET ACR("DR",10)="[ACR EXPLAIN OTHER EXPENSE]"
+11 SET ACR("DR",11)=11
+12 SET ACR("DR",12)=12
+13 SET ACR("DR",13)="[ACR RENTAL CAR]"
+14 SET ACR("DR",14)=14
+15 SET ACR("DR",15)=15
+16 SET ACR("DR",16)="5T;6T"
+17 SET ACR("DR",17)=30
+18 SET ACR("DR",18)=32
+19 SET ACR("DR",19)="8T;29T"
+20 SET ACR("DR",20)=31
+21 SET ACR("DR",21)="[ACR DETAILED DESC]"
+22 SET ACR("DR",22)="[ACR RENTAL CAR JUST]"
+23 QUIT