ACRFSS41 ;IHS/OIRM/DSD/THL,AEF - CONTINUATION OF ACRFSS4; [ 02/02/2005 10:22 AM ]
;;2.1;ADMIN RESOURCE MGT SYSTEM;**3,16**;NOV 05, 2001
;;CONTINUATION OF ACRFSS4
ADD ;EP;
I '$O(^ACRDOC(ACRDOCDA,9,0))#2 D Q
.W *7,*7
.W !!,"No AUTHORIZED DESTINATIONS have been entered."
.D PAUSE^ACRFWARN
F D ADD1 Q:$D(ACRQUIT)!$D(ACROUT)
Q
ADD1 S (ACRJ,ACRDAYS)=+$G(ACRDAYS)
I ACRJ>0 D Q:$D(ACRQUIT)!$D(ACROUT)
.S DIR(0)="NO^1:"_ACRJ
.S DIR("A")="Day "_(ACRJ+1)_" information is the same as day #"
.W !
.D DIR^ACRFDIC
.I X="" K ACRQUIT Q
.Q:$D(ACRQUIT)!$D(ACROUT)
.I +Y S ACRDUP=+Y D DAYS
D ADD11
I $D(ACRQUIT) K ACRQUIT Q
I $D(ACRTVCH) S ACRCHANG=""
S DA=ACRDA
S DIE="^ACRTV("
S DR="[ACR TRAVEL DAY-2]"
S DIE("NO^")=""
D DDS^ACRFDIC
I $D(ACRSCREN) K ACRSCREN D DIE^ACRFDIC
S ^TMP("ACRTV",$J,ACRJ)=ACRDA_U_^ACRTV(ACRDA,0)
I ACRJ=1 D DUP Q:$D(ACRQUIT)
D SCHK
W !
S DIR(0)="YO"
S DIR("A")="Add another day"
S DIR("B")="NO"
D DIR^ACRFDIC
I Y'=1 S ACRQUIT=""
Q
SCHK N ACRJ
D APCHK^ACRFSCHK
D APPROVE^ACRFSCHK
Q
ADD11 ;FILE NEW DAY
S DIC("DR")=".02////"_ACRDOCDA_";.03////"_ACRDOCDA_";7.5////"_$P(^ACRDOC(ACRDOCDA,"TOSA"),U,10)_";32////"_$P(^("TOSA"),U,10)
I ACRJ=0,$D(^ACRDOC(ACRDOCDA,"TO")),$P(^("TO"),U,9) D
.N ACRDUZ
.S ACRDUZ=$P(^ACRDOC(ACRDOCDA,"TO"),U,9)
.I $D(^ACRAU(ACRDUZ,0)),$D(^(1)) S DIC("DR")=DIC("DR")_";7////"_$P(^(1),U,2)
I ACRJ<1 S ACRNEW=$P(^ACRDOC(ACRDOCDA,"TO"),U,14)
D DDATE:ACRJ>0
D FYCHECK
Q:$D(ACRQUIT)
S ACRJ=ACRJ+1
S X=ACRJ
S DIC="^ACRTV("
S DIC(0)="L"
S DIC("DR")=DIC("DR")_";.04////"_$S(ACRNEW<$P(^ACRDOC(ACRDOCDA,"TO"),U,14)!(ACRNEW>$P(^("TO"),U,15)):2,1:1)
S DIC("DR")=DIC("DR")_";1////"_ACRNEW
I $D(ACRDUP),ACRJ>1 D
.S ACRTVDAX=0
.F S ACRTVDAX=$O(^ACRTV("D",ACRDOCDA,ACRTVDAX)) Q:'ACRTVDAX I $D(^ACRTV(ACRTVDAX,0)),+^(0)=ACRDUP,$D(^("DT")) S ACRTVDT=^("DT") Q
S ACRTVDAX=+$O(^ACRDOC(ACRDOCDA,9,0))
I ACRTVDAX,$D(^ACRDOC(ACRDOCDA,9,ACRTVDAX,0)) S ACRTVDAX=+^(0)
I ACRTVDAX,$D(^ACRPD(ACRTVDAX,0)) S DIC("DR")=DIC("DR")_";4////"_ACRTVDAX K ACRTVDAX
I $D(ACRDUP),$D(ACRTVDT) D
.S DIC("DR")=DIC("DR")_";4////"_$P(ACRTVDT,U,4)_";11////"_$P(ACRTVDT,U,11)
.I $P(ACRTVDT,U,4),$D(^ACRPD($P(ACRTVDT,U,4),0)) S DIC("DR")=DIC("DR")_";17////On duty "_$P(^(0),U)
.I ACRJ=$S($D(ACRDAYS):ACRDAYS,1:ACRJ) S DIC("DR")=DIC("DR")_";3////"_(ACRNEW_".1800")_";7////"_$P(ACRTVDT,U,7)
.I ACRJ<$S($D(ACRDAYS):ACRDAYS,1:ACRJ) S DIC("DR")=DIC("DR")_";9////"_$P(ACRTVDT,U,9)
I $G(ACRREF)=600 S DIC("DR")=DIC("DR")_";.05////1"
D FILE^ACRFDIC
S ACRDA=+Y
S ACRDT=$G(^ACRTV(+Y,"DT"))
S ^TMP("ACRTV",$J,ACRJ)=ACRDA_"^"_^ACRTV(ACRDA,0)
K ACRDUP
;I $P(ACRDT,U,5)=""!($P(ACRDT,U,6)="") D ; ACR*2.1*16.10 IM12185
;.S DA=ACRDA ; ACR*2.1*16.10 IM12185
;.S DIE="^ACRTV(" ; ACR*2.1*16.10 IM12185
;.S DR="5////"_$P(^ACRSYS(1,"DT"),U,22)_$S(+ACRDT<$P(^ACRDOC(ACRDOCDA,"TO"),U,15):";6////"_$P(^ACRSYS(1,"DT"),U,21),1:"") ; ACR*2.1*16.10 IM12185
;.D DIE^ACRFDIC ; ACR*2.1*16.10 IM12185
I $P(ACRDT,U,5)="" D ; only check per diem rate ; ACR*2.1*16.10 IM12185
.S DA=ACRDA ; ACR*2.1*16.10 IM12185
.S DIE="^ACRTV(" ; ACR*2.1*16.10 IM12185
.S DR="5////"_$P(^ACRSYS(1,"DT"),U,22) ; ACR*2.1*16.10 IM12185
.D DIE^ACRFDIC ; ACR*2.1*16.10 IM12185
;
I $P(ACRDT,U,6)="",(+ACRDT<$P(^ACRDOC(ACRDOCDA,"TO"),U,15)) D ;only check lodging rate ; ACR*2.1*16.10 IM12185
.S DA=ACRDA ; ACR*2.1*16.10 IM12185
.S DIE="^ACRTV(" ; ACR*2.1*16.10 IM12185
.S DR="6////"_$P(^ACRSYS(1,"DT"),U,21) ; ACR*2.1*16.10 IM12185
.D DIE^ACRFDIC ; ACR*2.1*16.10 IM12185
Q
DDATE S ACRD=0
F S ACRD=$O(^TMP("ACRTV",$J,ACRD)) Q:'ACRD S ACRDA=+^TMP("ACRTV",$J,ACRD)
I $D(^ACRTV(+$G(ACRDA),"DT")) S X1=$P(^("DT"),U)
E S X1=$P(^ACRDOC(ACRDOCDA,"TO"),U,14)
S X2=1
D C^%DTC
S ACRNEW=X
Q
EDIT ;EP;
;S ACRJ=ACRDAYS ;ACR*2.1*3.20
S ACRJ=+$G(ACRDAYS) ;ACR*2.1*3.20
K ACRQUIT
S DIR(0)="LO^1:"_ACRJ
S DIR("A")="Which DAY(s)"
W !
D DIR^ACRFDIC
Q:$D(ACRQUIT)!$D(ACROUT)
N ACRZ,ACRI
S ACRZ=Y
F ACRI=1:1 S ACRYY=$P(ACRZ,",",ACRI) Q:ACRYY="" D:$D(^TMP("ACRTV",$J,ACRYY))&'$D(ACRQUIT) EDIT1
Q
EDIT1 I ACRI>1 D Q:$D(ACRQUIT)!$D(ACROUT)
.S DIR(0)="YO"
.S DIR("A")="Continue Travel day edit"
.S DIR("B")="YES"
.W !
.N ACRY
.D DIR^ACRFDIC
.I +Y'=1 S ACRQUIT=""
F D E Q:$D(ACRQUIT)
K ACRQUIT,ACRCOUNT
Q
E S (ACRTVDA,ACRDA,DA)=$P(^TMP("ACRTV",$J,ACRYY),U)
S ACRCOUNT=$G(ACRCOUNT)+1
I $D(ACRTVCH) D CHK1
S DA=ACRDA
S DIE="^ACRTV("
S DR="[ACR TRAVEL DAY-2]"
S DIE("NO^")=""
D DDS^ACRFDIC
I '$D(ACRSCREN) S ACRQUIT=""
I $D(ACRSCREN) K ACRSCREN D ^ACRFETD
I $D(ACRTVCH) D CHK2
K ACRTVCH
Q
DELETE ;EP;DELETE TRAVEL DAYS
S ACRJ=$G(ACRDAYS)
S DIR(0)="LO^1:"_ACRJ
S DIR("A")="Which DAY(s)"
W !
D DIR^ACRFDIC
Q:$D(ACRQUIT)!$D(ACROUT)!(+Y<1)
S ACRDEL=Y
S DIR(0)="YO"
S DIR("A")="Sure you want to delete travel day(s) "_$E(Y,1,$L(Y)-1)_" "
S DIR("B")="NO"
W !
D DIR^ACRFDIC
Q:Y'=1
F ACRI=1:1 S ACRYY=$P(ACRDEL,",",ACRI) Q:ACRYY="" D:$D(^TMP("ACRTV",$J,ACRYY)) DTV1
K ACRDEL
D SCHK
Q
DTV1 S DA=+^TMP("ACRTV",$J,ACRYY)
S DIK="^ACRTV("
D DIK^ACRFDIC
S ACRDAYS=ACRDAYS-1
I $D(ACRTVCH) S ACRCHANG=""
K ^TMP("ACRTV",$J,ACRYY)
Q
DISP W @IOF
W !?19,@ACRON,"DAILY TRAVEL INFORMATION",@ACROF
N DXS,DIP,DC,DN
S D0=DA
D ^ACRPTD
Q
VOUCHER ;EP;VOUCHER AUDIT
S DIR(0)="YO"
S DIR("A")="Edit the Travel Voucher"
S DIR("B")="NO"
W !
D DIR^ACRFDIC
Q:ACRY'=1
S ACRDOCDA=ACRDOCDA
F D DISPLAY^ACRFSS42,EDIT Q:$D(ACRQUIT)!$D(ACROUT)
Q
CHK1 ;SET VARIABLES FOR POST-EDIT COMPARISON
S ^TMP("ACRTV",$J,"CHK",ACRTVDA)=^ACRTV(ACRTVDA,0)_"&&&&"_^ACRTV(ACRTVDA,"DT")
Q
CHK2 ;COMPARE TRAVEL DAY INFO AFTER EDIT
Q:'ACRTVDA
Q:'$D(^ACRTV(ACRTVDA,0))
S X=^ACRTV(ACRTVDA,0)_"&&&&"_^ACRTV(ACRTVDA,"DT")
I ^TMP("ACRTV",$J,"CHK",ACRTVDA)'=X S ACRCHANG=""
Q
LODGE ;EP;DISPLAY LODGING AND PER DIEM RATES FOR CITIES TO WHICH THE
;TRAVELER IS TRAVELING
D LODGE^ACRFSS43
Q
DELAUTO ;EP;DELETE RENTAL CAR EXPENSES IF RENTAL CAR IS DENIED
D DELAUTO^ACRFSS43
Q
DUP ;DUPLICATE DATA FOR ALL DAYS
D DAYS
Q:$G(ACRDAYS)<1
S DIR(0)="YO"
S DIR("A")="Duplicate information from Day 1 to Day(s) 2 - "_ACRDAYS
S DIR("B")="YES"
W !
D DIR^ACRFDIC
I $G(Y)'=1 K ACRQUIT Q
F ACRJJ=1:1:ACRDAYS-1 S ACRJ=ACRJJ,ACRDUP=1 D ADD11 Q:$D(ACRQUIT)
K ACRDUP
S ACRQUIT=""
Q
DAYS S X1=$P(^ACRDOC(ACRDOCDA,"TO"),U,15)
S X2=$P(^ACRDOC(ACRDOCDA,"TO"),U,14)
D ^%DTC
S ACRDAYS=$S(X<1:0,X+1<100:X+1,1:100)
Q
FYCHECK ;EP;CHECK TO SEE IF TRAVEL DAY IS IN SAME FY AS THE BUDGET ACCOUNT
;PREVENT ADDING DAY FOR NEXT FY FOR SINGLE YEAR ACCOUNT
Q:$G(ACRAPP)'?7N
N ACRFY,X,X1
S ACRFY=$P(^ACRLOCB($S($G(ACRLBDA):ACRLBDA,1:$P(ACRDOC0,U,6)),"DT"),U)
S X=ACRNEW\10000+1700,X1=ACRNEW\100#100
I X>ACRFY!(X=ACRFY&(X1>9)) D FYMESS
I X<(ACRFY-1)!(X<ACRFY&(X1<10)) D FYMESS
Q
FYMESS ;
N X
D SCREEN^ACRFAU
W:$D(ACRSCREN) @IOF
W *7,*7
W @ACRON
W !!,"You cannot create a travel day which is in a Fiscal Year other"
W !,"than Fiscal Year ",ACRFY,", using this account. Select an account"
W !,"from an appropriate Fiscal Year for additional travel days."
W @ACROF
I '$D(ACRDUP) D PAUSE^ACRFWARN I 1
E H 5
K X,ACRSCREN
S DIR(0)="DO^::E"
S DIR("A")="Date of Travel"
W !
D DIR^ACRFDIC
I +Y<1 S ACRQUIT="" Q
S ACRNEW=Y
D FYCHECK
Q
ACRFSS41 ;IHS/OIRM/DSD/THL,AEF - CONTINUATION OF ACRFSS4; [ 02/02/2005 10:22 AM ]
+1 ;;2.1;ADMIN RESOURCE MGT SYSTEM;**3,16**;NOV 05, 2001
+2 ;;CONTINUATION OF ACRFSS4
ADD ;EP;
+1 IF '$ORDER(^ACRDOC(ACRDOCDA,9,0))#2
Begin DoDot:1
+2 WRITE *7,*7
+3 WRITE !!,"No AUTHORIZED DESTINATIONS have been entered."
+4 DO PAUSE^ACRFWARN
End DoDot:1
QUIT
+5 FOR
DO ADD1
IF $DATA(ACRQUIT)!$DATA(ACROUT)
QUIT
+6 QUIT
ADD1 SET (ACRJ,ACRDAYS)=+$GET(ACRDAYS)
+1 IF ACRJ>0
Begin DoDot:1
+2 SET DIR(0)="NO^1:"_ACRJ
+3 SET DIR("A")="Day "_(ACRJ+1)_" information is the same as day #"
+4 WRITE !
+5 DO DIR^ACRFDIC
+6 IF X=""
KILL ACRQUIT
QUIT
+7 IF $DATA(ACRQUIT)!$DATA(ACROUT)
QUIT
+8 IF +Y
SET ACRDUP=+Y
DO DAYS
End DoDot:1
IF $DATA(ACRQUIT)!$DATA(ACROUT)
QUIT
+9 DO ADD11
+10 IF $DATA(ACRQUIT)
KILL ACRQUIT
QUIT
+11 IF $DATA(ACRTVCH)
SET ACRCHANG=""
+12 SET DA=ACRDA
+13 SET DIE="^ACRTV("
+14 SET DR="[ACR TRAVEL DAY-2]"
+15 SET DIE("NO^")=""
+16 DO DDS^ACRFDIC
+17 IF $DATA(ACRSCREN)
KILL ACRSCREN
DO DIE^ACRFDIC
+18 SET ^TMP("ACRTV",$JOB,ACRJ)=ACRDA_U_^ACRTV(ACRDA,0)
+19 IF ACRJ=1
DO DUP
IF $DATA(ACRQUIT)
QUIT
+20 DO SCHK
+21 WRITE !
+22 SET DIR(0)="YO"
+23 SET DIR("A")="Add another day"
+24 SET DIR("B")="NO"
+25 DO DIR^ACRFDIC
+26 IF Y'=1
SET ACRQUIT=""
+27 QUIT
SCHK NEW ACRJ
+1 DO APCHK^ACRFSCHK
+2 DO APPROVE^ACRFSCHK
+3 QUIT
ADD11 ;FILE NEW DAY
+1 SET DIC("DR")=".02////"_ACRDOCDA_";.03////"_ACRDOCDA_";7.5////"_$PIECE(^ACRDOC(ACRDOCDA,"TOSA"),U,10)_";32////"_$PIECE(^("TOSA"),U,10)
+2 IF ACRJ=0
IF $DATA(^ACRDOC(ACRDOCDA,"TO"))
IF $PIECE(^("TO"),U,9)
Begin DoDot:1
+3 NEW ACRDUZ
+4 SET ACRDUZ=$PIECE(^ACRDOC(ACRDOCDA,"TO"),U,9)
+5 IF $DATA(^ACRAU(ACRDUZ,0))
IF $DATA(^(1))
SET DIC("DR")=DIC("DR")_";7////"_$PIECE(^(1),U,2)
End DoDot:1
+6 IF ACRJ<1
SET ACRNEW=$PIECE(^ACRDOC(ACRDOCDA,"TO"),U,14)
+7 IF ACRJ>0
DO DDATE
+8 DO FYCHECK
+9 IF $DATA(ACRQUIT)
QUIT
+10 SET ACRJ=ACRJ+1
+11 SET X=ACRJ
+12 SET DIC="^ACRTV("
+13 SET DIC(0)="L"
+14 SET DIC("DR")=DIC("DR")_";.04////"_$SELECT(ACRNEW<$PIECE(^ACRDOC(ACRDOCDA,"TO"),U,14)!(ACRNEW>$PIECE(^("TO"),U,15)):2,1:1)
+15 SET DIC("DR")=DIC("DR")_";1////"_ACRNEW
+16 IF $DATA(ACRDUP)
IF ACRJ>1
Begin DoDot:1
+17 SET ACRTVDAX=0
+18 FOR
SET ACRTVDAX=$ORDER(^ACRTV("D",ACRDOCDA,ACRTVDAX))
IF 'ACRTVDAX
QUIT
IF $DATA(^ACRTV(ACRTVDAX,0))
IF +^(0)=ACRDUP
IF $DATA(^("DT"))
SET ACRTVDT=^("DT")
QUIT
End DoDot:1
+19 SET ACRTVDAX=+$ORDER(^ACRDOC(ACRDOCDA,9,0))
+20 IF ACRTVDAX
IF $DATA(^ACRDOC(ACRDOCDA,9,ACRTVDAX,0))
SET ACRTVDAX=+^(0)
+21 IF ACRTVDAX
IF $DATA(^ACRPD(ACRTVDAX,0))
SET DIC("DR")=DIC("DR")_";4////"_ACRTVDAX
KILL ACRTVDAX
+22 IF $DATA(ACRDUP)
IF $DATA(ACRTVDT)
Begin DoDot:1
+23 SET DIC("DR")=DIC("DR")_";4////"_$PIECE(ACRTVDT,U,4)_";11////"_$PIECE(ACRTVDT,U,11)
+24 IF $PIECE(ACRTVDT,U,4)
IF $DATA(^ACRPD($PIECE(ACRTVDT,U,4),0))
SET DIC("DR")=DIC("DR")_";17////On duty "_$PIECE(^(0),U)
+25 IF ACRJ=$SELECT($DATA(ACRDAYS):ACRDAYS,1:ACRJ)
SET DIC("DR")=DIC("DR")_";3////"_(ACRNEW_".1800")_";7////"_$PIECE(ACRTVDT,U,7)
+26 IF ACRJ<$SELECT($DATA(ACRDAYS):ACRDAYS,1:ACRJ)
SET DIC("DR")=DIC("DR")_";9////"_$PIECE(ACRTVDT,U,9)
End DoDot:1
+27 IF $GET(ACRREF)=600
SET DIC("DR")=DIC("DR")_";.05////1"
+28 DO FILE^ACRFDIC
+29 SET ACRDA=+Y
+30 SET ACRDT=$GET(^ACRTV(+Y,"DT"))
+31 SET ^TMP("ACRTV",$JOB,ACRJ)=ACRDA_"^"_^ACRTV(ACRDA,0)
+32 KILL ACRDUP
+33 ;I $P(ACRDT,U,5)=""!($P(ACRDT,U,6)="") D ; ACR*2.1*16.10 IM12185
+34 ;.S DA=ACRDA ; ACR*2.1*16.10 IM12185
+35 ;.S DIE="^ACRTV(" ; ACR*2.1*16.10 IM12185
+36 ;.S DR="5////"_$P(^ACRSYS(1,"DT"),U,22)_$S(+ACRDT<$P(^ACRDOC(ACRDOCDA,"TO"),U,15):";6////"_$P(^ACRSYS(1,"DT"),U,21),1:"") ; ACR*2.1*16.10 IM12185
+37 ;.D DIE^ACRFDIC ; ACR*2.1*16.10 IM12185
+38 ; only check per diem rate ; ACR*2.1*16.10 IM12185
IF $PIECE(ACRDT,U,5)=""
Begin DoDot:1
+39 ; ACR*2.1*16.10 IM12185
SET DA=ACRDA
+40 ; ACR*2.1*16.10 IM12185
SET DIE="^ACRTV("
+41 ; ACR*2.1*16.10 IM12185
SET DR="5////"_$PIECE(^ACRSYS(1,"DT"),U,22)
+42 ; ACR*2.1*16.10 IM12185
DO DIE^ACRFDIC
End DoDot:1
+43 ;
+44 ;only check lodging rate ; ACR*2.1*16.10 IM12185
IF $PIECE(ACRDT,U,6)=""
IF (+ACRDT<$PIECE(^ACRDOC(ACRDOCDA,"TO"),U,15))
Begin DoDot:1
+45 ; ACR*2.1*16.10 IM12185
SET DA=ACRDA
+46 ; ACR*2.1*16.10 IM12185
SET DIE="^ACRTV("
+47 ; ACR*2.1*16.10 IM12185
SET DR="6////"_$PIECE(^ACRSYS(1,"DT"),U,21)
+48 ; ACR*2.1*16.10 IM12185
DO DIE^ACRFDIC
End DoDot:1
+49 QUIT
DDATE SET ACRD=0
+1 FOR
SET ACRD=$ORDER(^TMP("ACRTV",$JOB,ACRD))
IF 'ACRD
QUIT
SET ACRDA=+^TMP("ACRTV",$JOB,ACRD)
+2 IF $DATA(^ACRTV(+$GET(ACRDA),"DT"))
SET X1=$PIECE(^("DT"),U)
+3 IF '$TEST
SET X1=$PIECE(^ACRDOC(ACRDOCDA,"TO"),U,14)
+4 SET X2=1
+5 DO C^%DTC
+6 SET ACRNEW=X
+7 QUIT
EDIT ;EP;
+1 ;S ACRJ=ACRDAYS ;ACR*2.1*3.20
+2 ;ACR*2.1*3.20
SET ACRJ=+$GET(ACRDAYS)
+3 KILL ACRQUIT
+4 SET DIR(0)="LO^1:"_ACRJ
+5 SET DIR("A")="Which DAY(s)"
+6 WRITE !
+7 DO DIR^ACRFDIC
+8 IF $DATA(ACRQUIT)!$DATA(ACROUT)
QUIT
+9 NEW ACRZ,ACRI
+10 SET ACRZ=Y
+11 FOR ACRI=1:1
SET ACRYY=$PIECE(ACRZ,",",ACRI)
IF ACRYY=""
QUIT
IF $DATA(^TMP("ACRTV",$JOB,ACRYY))&'$DATA(ACRQUIT)
DO EDIT1
+12 QUIT
EDIT1 IF ACRI>1
Begin DoDot:1
+1 SET DIR(0)="YO"
+2 SET DIR("A")="Continue Travel day edit"
+3 SET DIR("B")="YES"
+4 WRITE !
+5 NEW ACRY
+6 DO DIR^ACRFDIC
+7 IF +Y'=1
SET ACRQUIT=""
End DoDot:1
IF $DATA(ACRQUIT)!$DATA(ACROUT)
QUIT
+8 FOR
DO E
IF $DATA(ACRQUIT)
QUIT
+9 KILL ACRQUIT,ACRCOUNT
+10 QUIT
E SET (ACRTVDA,ACRDA,DA)=$PIECE(^TMP("ACRTV",$JOB,ACRYY),U)
+1 SET ACRCOUNT=$GET(ACRCOUNT)+1
+2 IF $DATA(ACRTVCH)
DO CHK1
+3 SET DA=ACRDA
+4 SET DIE="^ACRTV("
+5 SET DR="[ACR TRAVEL DAY-2]"
+6 SET DIE("NO^")=""
+7 DO DDS^ACRFDIC
+8 IF '$DATA(ACRSCREN)
SET ACRQUIT=""
+9 IF $DATA(ACRSCREN)
KILL ACRSCREN
DO ^ACRFETD
+10 IF $DATA(ACRTVCH)
DO CHK2
+11 KILL ACRTVCH
+12 QUIT
DELETE ;EP;DELETE TRAVEL DAYS
+1 SET ACRJ=$GET(ACRDAYS)
+2 SET DIR(0)="LO^1:"_ACRJ
+3 SET DIR("A")="Which DAY(s)"
+4 WRITE !
+5 DO DIR^ACRFDIC
+6 IF $DATA(ACRQUIT)!$DATA(ACROUT)!(+Y<1)
QUIT
+7 SET ACRDEL=Y
+8 SET DIR(0)="YO"
+9 SET DIR("A")="Sure you want to delete travel day(s) "_$EXTRACT(Y,1,$LENGTH(Y)-1)_" "
+10 SET DIR("B")="NO"
+11 WRITE !
+12 DO DIR^ACRFDIC
+13 IF Y'=1
QUIT
+14 FOR ACRI=1:1
SET ACRYY=$PIECE(ACRDEL,",",ACRI)
IF ACRYY=""
QUIT
IF $DATA(^TMP("ACRTV",$JOB,ACRYY))
DO DTV1
+15 KILL ACRDEL
+16 DO SCHK
+17 QUIT
DTV1 SET DA=+^TMP("ACRTV",$JOB,ACRYY)
+1 SET DIK="^ACRTV("
+2 DO DIK^ACRFDIC
+3 SET ACRDAYS=ACRDAYS-1
+4 IF $DATA(ACRTVCH)
SET ACRCHANG=""
+5 KILL ^TMP("ACRTV",$JOB,ACRYY)
+6 QUIT
DISP WRITE @IOF
+1 WRITE !?19,@ACRON,"DAILY TRAVEL INFORMATION",@ACROF
+2 NEW DXS,DIP,DC,DN
+3 SET D0=DA
+4 DO ^ACRPTD
+5 QUIT
VOUCHER ;EP;VOUCHER AUDIT
+1 SET DIR(0)="YO"
+2 SET DIR("A")="Edit the Travel Voucher"
+3 SET DIR("B")="NO"
+4 WRITE !
+5 DO DIR^ACRFDIC
+6 IF ACRY'=1
QUIT
+7 SET ACRDOCDA=ACRDOCDA
+8 FOR
DO DISPLAY^ACRFSS42
DO EDIT
IF $DATA(ACRQUIT)!$DATA(ACROUT)
QUIT
+9 QUIT
CHK1 ;SET VARIABLES FOR POST-EDIT COMPARISON
+1 SET ^TMP("ACRTV",$JOB,"CHK",ACRTVDA)=^ACRTV(ACRTVDA,0)_"&&&&"_^ACRTV(ACRTVDA,"DT")
+2 QUIT
CHK2 ;COMPARE TRAVEL DAY INFO AFTER EDIT
+1 IF 'ACRTVDA
QUIT
+2 IF '$DATA(^ACRTV(ACRTVDA,0))
QUIT
+3 SET X=^ACRTV(ACRTVDA,0)_"&&&&"_^ACRTV(ACRTVDA,"DT")
+4 IF ^TMP("ACRTV",$JOB,"CHK",ACRTVDA)'=X
SET ACRCHANG=""
+5 QUIT
LODGE ;EP;DISPLAY LODGING AND PER DIEM RATES FOR CITIES TO WHICH THE
+1 ;TRAVELER IS TRAVELING
+2 DO LODGE^ACRFSS43
+3 QUIT
DELAUTO ;EP;DELETE RENTAL CAR EXPENSES IF RENTAL CAR IS DENIED
+1 DO DELAUTO^ACRFSS43
+2 QUIT
DUP ;DUPLICATE DATA FOR ALL DAYS
+1 DO DAYS
+2 IF $GET(ACRDAYS)<1
QUIT
+3 SET DIR(0)="YO"
+4 SET DIR("A")="Duplicate information from Day 1 to Day(s) 2 - "_ACRDAYS
+5 SET DIR("B")="YES"
+6 WRITE !
+7 DO DIR^ACRFDIC
+8 IF $GET(Y)'=1
KILL ACRQUIT
QUIT
+9 FOR ACRJJ=1:1:ACRDAYS-1
SET ACRJ=ACRJJ
SET ACRDUP=1
DO ADD11
IF $DATA(ACRQUIT)
QUIT
+10 KILL ACRDUP
+11 SET ACRQUIT=""
+12 QUIT
DAYS SET X1=$PIECE(^ACRDOC(ACRDOCDA,"TO"),U,15)
+1 SET X2=$PIECE(^ACRDOC(ACRDOCDA,"TO"),U,14)
+2 DO ^%DTC
+3 SET ACRDAYS=$SELECT(X<1:0,X+1<100:X+1,1:100)
+4 QUIT
FYCHECK ;EP;CHECK TO SEE IF TRAVEL DAY IS IN SAME FY AS THE BUDGET ACCOUNT
+1 ;PREVENT ADDING DAY FOR NEXT FY FOR SINGLE YEAR ACCOUNT
+2 IF $GET(ACRAPP)'?7N
QUIT
+3 NEW ACRFY,X,X1
+4 SET ACRFY=$PIECE(^ACRLOCB($SELECT($GET(ACRLBDA):ACRLBDA,1:$PIECE(ACRDOC0,U,6)),"DT"),U)
+5 SET X=ACRNEW\10000+1700
SET X1=ACRNEW\100#100
+6 IF X>ACRFY!(X=ACRFY&(X1>9))
DO FYMESS
+7 IF X<(ACRFY-1)!(X<ACRFY&(X1<10))
DO FYMESS
+8 QUIT
FYMESS ;
+1 NEW X
+2 DO SCREEN^ACRFAU
+3 IF $DATA(ACRSCREN)
WRITE @IOF
+4 WRITE *7,*7
+5 WRITE @ACRON
+6 WRITE !!,"You cannot create a travel day which is in a Fiscal Year other"
+7 WRITE !,"than Fiscal Year ",ACRFY,", using this account. Select an account"
+8 WRITE !,"from an appropriate Fiscal Year for additional travel days."
+9 WRITE @ACROF
+10 IF '$DATA(ACRDUP)
DO PAUSE^ACRFWARN
IF 1
+11 IF '$TEST
HANG 5
+12 KILL X,ACRSCREN
+13 SET DIR(0)="DO^::E"
+14 SET DIR("A")="Date of Travel"
+15 WRITE !
+16 DO DIR^ACRFDIC
+17 IF +Y<1
SET ACRQUIT=""
QUIT
+18 SET ACRNEW=Y
+19 DO FYCHECK
+20 QUIT