ACRFTV ;IHS/OIRM/DSD/THL,AEF - TRAVEL REPORT; [ 11/01/2001 9:44 AM ]
;;2.1;ADMIN RESOURCE MGT SYSTEM;;NOV 05, 2001
;;ROUTINE TO PRINT TRAVEL REPORT
EN F D SELECT Q:$D(ACRQUIT)!$D(ACROUT)
EXIT ;EP
K ACR,ACR1,ACR2,ACR3,ACR4,ACR5,ACR6,ACR0,ACROBJ,ACROBJ0,ACRDTAIL,ACRDOC,ACRDOC0,ACRREQ2,ACRTVT,ACRDTL1,ACRBOTH,ACRZZDA,ACRZDA,ACRY,ACRAAT,ACRAPT,ACRDAYS,ACRDFR,ACREMP,ACRENTR1,ACRENTR2,ACRENTRY,ACREXPL,ACRFR,ACRJ,ACRJI,ACRNUM,ACRQUIT
K ACRRCJ,ACRRTN,ACRSOF,ACRSOFT,ACRSOFX,ACRTM,ACRTO,ACRTVDA,ACRTYPS,ACRBEGIN,ACREND,ACRTRAV,ACR7,ACR9,ACRALWDA,ACRDEPT,ACROCDA,ACRDT,ACRFY,ACRI,ACROBL,ACRREF,ACRREQ,ACRSPENT,ACRSPT,ACRSSA,ACRSSADA,ACRDOCDA,ACRX,ACR11,ACRREQT,ACROBLT,ACRSPTT
K ACRPURP,ACRINCMP,ACRSIGS,ACRSIGT,ACRBEG,ACRLOC,ACRTV0,ACRTVDT,ACROUT,ACR12,ACR13,ACR14,ACRCAN,ACR21,ACRPD,ACRTVTX,ACRXREF,ACRDPTDA,ACRPAGE
K ^TMP("ACRTV",$J)
Q
SELECT D ^XBKVAR S IOP="HOME" D ^%ZIS D HOME^ACRFMENU
D EXIT
W @IOF
W !?10,"Travel Report"
S DIR(0)="SO^1:Purchasing Office;2:Department;3:Department Account;4:Common Accounting Number;5:Sub-Allowance;6:Allowance;7:Individual Traveler;8:TDY Duty Station;9:Rental Car Used;10:Actual Expenses Claimed;11:Non-Contract Carrier Used"
S DIR("A")="Which type of report"
D DIR^ACRFDIC
I $D(ACRQUIT)!$D(ACROUT)!("11023456789"'[+Y) Q
S ACRTVT=$S(Y=1:"PO",Y=2:"TDEPT",Y=3:"F",Y=4:"CAN",Y=5:"G",Y=6:"H",Y=7:"D",Y=8:"LOC",Y=9:"RC",Y=10:"AE",Y=11:"NCC",1:"")
Q:ACRTVT=""
I ACRTVT="CAN" D CAN^ACRFTV1 Q:$D(ACRQUIT)!$D(ACROUT) G ZIS
I ACRTVT="TDEPT"!(ACRTVT="PO") D DEPT^ACRFTV1 Q:$D(ACRQUIT)!$D(ACROUT) G ZIS
I ACRTVT="LOC" D LOCATION Q:$D(ACRQUIT)!$D(ACROUT) G ZIS
I "^RC^AE^NCC^"[(U_ACRTVT_U) G ZIS
S ACRENTR1=$S(ACRTVT="F":"LOCBAMT",ACRTVT="G":"ALCAMT",ACRTVT="H":"ALLAMT",1:"")
S ACRENTRY=$S(ACRTVT="F":"ALCAMT",ACRTVT="G":"ALLAMT",ACRTVT="H":"APPAMT",1:""),(ACRSOF,ACRSOFX,ACRSOFT)=""
I ACRTVT'="D" D ENTRY^ACRFDTP I '$D(ACRZDA) K ACRQUIT Q
I ACRTVT="F" D C1^ACRFTV1 Q:$D(ACRQUIT)!$D(ACROUT)
I ACRTVT="D" D TRAVELER Q:$L(ACRTRAV)<2
ZIS D DETAIL
I $D(ACRQUIT)!$D(ACROUT) K ACRQUIT Q
D INCOMP
Q:$D(ACRQUIT)!$D(ACROUT)
D:$D(ACRDTAIL) SIGS
Q:$D(ACRQUIT)!$D(ACROUT)
D INVITE:ACRTVT'="D"
Q:$D(ACROUT)!$D(ACRQUIT)
W !
D DATES^ACRFDATE
Q:$D(ACROUT)!$D(ACRQUIT)!'$G(ACRBEGIN)!'$G(ACREND)
S ACRRTN="SS^ACRFTV2"
S ZTDESC="TRAVEL REPORT"
D ^ACRFZIS
K ACRQUIT
Q
DETAIL ;EP;
K ACRDTAIL,ACRBOTH,ACRDTL1
S DIR(0)="SO^1:Summary;2:Detailed Report;3:Both"
S DIR("A")="Which one"
W !
D DIR^ACRFDIC
I $D(ACRQUIT)!$D(ACROUT) Q
I Y=1 K ACRDTAIL
E S ACRDTAIL=""
I Y=3 S ACRBOTH=""
S DIR(0)="YO"
S DIR("A")="List by Object Code"
S DIR("B")="NO"
W !
D DIR^ACRFDIC
Q:$D(ACROUT)!$D(ACRQUIT)
S ACRDTL1=+Y
Q
TRAVELER ;EP;TO SELECT AND PRINT TRAVEL REPORT FOR INDIVIDUAL TRAVELER
S ACRTRAV=U
F ACRJ=1:1 D TRAV1 Q:$D(ACRQUIT)
K ACRQUIT
Q
TRAV1 S DIC="^VA(200,"
S DIC(0)="AEMQZ"
S DIC("A")=$S(ACRJ=1:"Traveler's Name: ",1:"Select another Traveler: ")
W !
D DIC^ACRFDIC
I '$D(Y) S ACRQUIT="" Q
I +Y<1 S ACRQUIT="" Q
S ACRTRAV=ACRTRAV_+Y_U
Q
LOCATION ;SELECT TRAVEL LOCATION
S DIC="^ACRPD("
S DIC(0)="AEMQZ"
S DIC("A")="Select TDY Location: "
W !
D DIC^ACRFDIC
I '$D(Y) S ACRQUIT="" Q
I +$G(Y)<1 S ACRQUIT="" Q
S ACRLOC=+Y
Q
INCOMP ;EP;TO PRINT LIST OF TO'S FOR WHCIH TV IS NOT COMPLETE
S DIR(0)="YO"
S DIR("A",1)="Include ONLY Travel Orders"
S DIR("A")="for which the Travel Voucher is not complete"
S DIR("B")="NO"
W !
D DIR^ACRFDIC
S:$G(ACRY)=1 ACRINCMP=""
Q
SIGS ;EP;TO PRINT SIGNATURE DETAILS FOR TRAVEL VOUCHER
S DIR(0)="YO"
S DIR("A")="Include SIGNATURE DETAILS"
S DIR("B")="NO"
S DIR("?",1)="If you select 'Y' for YES, the dates of Travel Voucher signatures"
S DIR("?")="and days between signatures will be included."
W !
D DIR^ACRFDIC
S:$G(ACRY)=1 ACRSIGS=""
Q
SIGT ;EP;TO PRINT SIGNATURE TOTAL SUMMARY
W !!,"AVERAGE NUMBER OF DAYS TO PROCESS TRAVEL VOUCHERS"
W !,"BY TYPE OF SIGNATRUE:"
F ACRI=1:1:6 D
.S ACR=$G(ACRSIGT(ACRI)),ACRD=$P(ACR,U,2),ACR=+ACR
.W:ACRI=1 !?7,"TO TRAVELER..: "
.W:ACRI=2 !?7,"TRAVELER SIG.: "
.I ACRD]"" D
..W:ACRI=3 !?7,"RECOMMEND SIG: "
..W:ACRI=4 !?7,"APPROVER SIG.: "
.W:ACRI=5 !?7,"AUDITOR SIG..: "
.W:ACRI=6 !?7,"CERTIFIER SIG: "
.I ACR,ACRD/ACR>0 W $J($FN(ACRD/ACR,"P",0),5)
Q
INVITE ;SELECT REPORT FOR TRAVELERS FROM OUTSIDE THE AREA ONLY
S DIR(0)="YO"
S DIR("A")="Report for OUTSIDE travelers ONLY"
S DIR("B")="NO"
W !
D DIR^ACRFDIC
K ACRINVIT
Q:+Y'=1
S ACRINVIT=""
I '$O(^ACRSYS(1)) S ACRADA=1 Q
AREA ;EP;
S DIC="^ACRSYS("
S DIC(0)="AEMQZ"
S DIC("A")="Report for which AREA: "
W !
D DIC^ACRFDIC
I +Y>0 S ACRADA=+Y
E S ACRQUIT=""
Q
ACRFTV ;IHS/OIRM/DSD/THL,AEF - TRAVEL REPORT; [ 11/01/2001 9:44 AM ]
+1 ;;2.1;ADMIN RESOURCE MGT SYSTEM;;NOV 05, 2001
+2 ;;ROUTINE TO PRINT TRAVEL REPORT
EN FOR
DO SELECT
IF $DATA(ACRQUIT)!$DATA(ACROUT)
QUIT
EXIT ;EP
+1 KILL ACR,ACR1,ACR2,ACR3,ACR4,ACR5,ACR6,ACR0,ACROBJ,ACROBJ0,ACRDTAIL,ACRDOC,ACRDOC0,ACRREQ2,ACRTVT,ACRDTL1,ACRBOTH,ACRZZDA,ACRZDA,ACRY,ACRAAT,ACRAPT,ACRDAYS,ACRDFR,ACREMP,ACRENTR1,ACRENTR2,ACRENTRY,ACREXPL,ACRFR,ACRJ,ACRJI,ACRNUM,ACRQUIT
+2 KILL ACRRCJ,ACRRTN,ACRSOF,ACRSOFT,ACRSOFX,ACRTM,ACRTO,ACRTVDA,ACRTYPS,ACRBEGIN,ACREND,ACRTRAV,ACR7,ACR9,ACRALWDA,ACRDEPT,ACROCDA,ACRDT,ACRFY,ACRI,ACROBL,ACRREF,ACRREQ,ACRSPENT,ACRSPT,ACRSSA,ACRSSADA,ACRDOCDA,ACRX,ACR11,ACRREQT,ACROBLT,ACRSPTT
+3 KILL ACRPURP,ACRINCMP,ACRSIGS,ACRSIGT,ACRBEG,ACRLOC,ACRTV0,ACRTVDT,ACROUT,ACR12,ACR13,ACR14,ACRCAN,ACR21,ACRPD,ACRTVTX,ACRXREF,ACRDPTDA,ACRPAGE
+4 KILL ^TMP("ACRTV",$JOB)
+5 QUIT
SELECT DO ^XBKVAR
SET IOP="HOME"
DO ^%ZIS
DO HOME^ACRFMENU
+1 DO EXIT
+2 WRITE @IOF
+3 WRITE !?10,"Travel Report"
+4 SET DIR(0)="SO^1:Purchasing Office;2:Department;3:Department Account;4:Common Accounting Number;5:Sub-Allowance;6:Allowance;7:Individual Traveler;8:TDY Duty Station;9:Rental Car Used;10:Actual Expenses Claimed;11:Non-Contract Carrier Used"
+5 SET DIR("A")="Which type of report"
+6 DO DIR^ACRFDIC
+7 IF $DATA(ACRQUIT)!$DATA(ACROUT)!("11023456789"'[+Y)
QUIT
+8 SET ACRTVT=$SELECT(Y=1:"PO",Y=2:"TDEPT",Y=3:"F",Y=4:"CAN",Y=5:"G",Y=6:"H",Y=7:"D",Y=8:"LOC",Y=9:"RC",Y=10:"AE",Y=11:"NCC",1:"")
+9 IF ACRTVT=""
QUIT
+10 IF ACRTVT="CAN"
DO CAN^ACRFTV1
IF $DATA(ACRQUIT)!$DATA(ACROUT)
QUIT
GOTO ZIS
+11 IF ACRTVT="TDEPT"!(ACRTVT="PO")
DO DEPT^ACRFTV1
IF $DATA(ACRQUIT)!$DATA(ACROUT)
QUIT
GOTO ZIS
+12 IF ACRTVT="LOC"
DO LOCATION
IF $DATA(ACRQUIT)!$DATA(ACROUT)
QUIT
GOTO ZIS
+13 IF "^RC^AE^NCC^"[(U_ACRTVT_U)
GOTO ZIS
+14 SET ACRENTR1=$SELECT(ACRTVT="F":"LOCBAMT",ACRTVT="G":"ALCAMT",ACRTVT="H":"ALLAMT",1:"")
+15 SET ACRENTRY=$SELECT(ACRTVT="F":"ALCAMT",ACRTVT="G":"ALLAMT",ACRTVT="H":"APPAMT",1:"")
SET (ACRSOF,ACRSOFX,ACRSOFT)=""
+16 IF ACRTVT'="D"
DO ENTRY^ACRFDTP
IF '$DATA(ACRZDA)
KILL ACRQUIT
QUIT
+17 IF ACRTVT="F"
DO C1^ACRFTV1
IF $DATA(ACRQUIT)!$DATA(ACROUT)
QUIT
+18 IF ACRTVT="D"
DO TRAVELER
IF $LENGTH(ACRTRAV)<2
QUIT
ZIS DO DETAIL
+1 IF $DATA(ACRQUIT)!$DATA(ACROUT)
KILL ACRQUIT
QUIT
+2 DO INCOMP
+3 IF $DATA(ACRQUIT)!$DATA(ACROUT)
QUIT
+4 IF $DATA(ACRDTAIL)
DO SIGS
+5 IF $DATA(ACRQUIT)!$DATA(ACROUT)
QUIT
+6 IF ACRTVT'="D"
DO INVITE
+7 IF $DATA(ACROUT)!$DATA(ACRQUIT)
QUIT
+8 WRITE !
+9 DO DATES^ACRFDATE
+10 IF $DATA(ACROUT)!$DATA(ACRQUIT)!'$GET(ACRBEGIN)!'$GET(ACREND)
QUIT
+11 SET ACRRTN="SS^ACRFTV2"
+12 SET ZTDESC="TRAVEL REPORT"
+13 DO ^ACRFZIS
+14 KILL ACRQUIT
+15 QUIT
DETAIL ;EP;
+1 KILL ACRDTAIL,ACRBOTH,ACRDTL1
+2 SET DIR(0)="SO^1:Summary;2:Detailed Report;3:Both"
+3 SET DIR("A")="Which one"
+4 WRITE !
+5 DO DIR^ACRFDIC
+6 IF $DATA(ACRQUIT)!$DATA(ACROUT)
QUIT
+7 IF Y=1
KILL ACRDTAIL
+8 IF '$TEST
SET ACRDTAIL=""
+9 IF Y=3
SET ACRBOTH=""
+10 SET DIR(0)="YO"
+11 SET DIR("A")="List by Object Code"
+12 SET DIR("B")="NO"
+13 WRITE !
+14 DO DIR^ACRFDIC
+15 IF $DATA(ACROUT)!$DATA(ACRQUIT)
QUIT
+16 SET ACRDTL1=+Y
+17 QUIT
TRAVELER ;EP;TO SELECT AND PRINT TRAVEL REPORT FOR INDIVIDUAL TRAVELER
+1 SET ACRTRAV=U
+2 FOR ACRJ=1:1
DO TRAV1
IF $DATA(ACRQUIT)
QUIT
+3 KILL ACRQUIT
+4 QUIT
TRAV1 SET DIC="^VA(200,"
+1 SET DIC(0)="AEMQZ"
+2 SET DIC("A")=$SELECT(ACRJ=1:"Traveler's Name: ",1:"Select another Traveler: ")
+3 WRITE !
+4 DO DIC^ACRFDIC
+5 IF '$DATA(Y)
SET ACRQUIT=""
QUIT
+6 IF +Y<1
SET ACRQUIT=""
QUIT
+7 SET ACRTRAV=ACRTRAV_+Y_U
+8 QUIT
LOCATION ;SELECT TRAVEL LOCATION
+1 SET DIC="^ACRPD("
+2 SET DIC(0)="AEMQZ"
+3 SET DIC("A")="Select TDY Location: "
+4 WRITE !
+5 DO DIC^ACRFDIC
+6 IF '$DATA(Y)
SET ACRQUIT=""
QUIT
+7 IF +$GET(Y)<1
SET ACRQUIT=""
QUIT
+8 SET ACRLOC=+Y
+9 QUIT
INCOMP ;EP;TO PRINT LIST OF TO'S FOR WHCIH TV IS NOT COMPLETE
+1 SET DIR(0)="YO"
+2 SET DIR("A",1)="Include ONLY Travel Orders"
+3 SET DIR("A")="for which the Travel Voucher is not complete"
+4 SET DIR("B")="NO"
+5 WRITE !
+6 DO DIR^ACRFDIC
+7 IF $GET(ACRY)=1
SET ACRINCMP=""
+8 QUIT
SIGS ;EP;TO PRINT SIGNATURE DETAILS FOR TRAVEL VOUCHER
+1 SET DIR(0)="YO"
+2 SET DIR("A")="Include SIGNATURE DETAILS"
+3 SET DIR("B")="NO"
+4 SET DIR("?",1)="If you select 'Y' for YES, the dates of Travel Voucher signatures"
+5 SET DIR("?")="and days between signatures will be included."
+6 WRITE !
+7 DO DIR^ACRFDIC
+8 IF $GET(ACRY)=1
SET ACRSIGS=""
+9 QUIT
SIGT ;EP;TO PRINT SIGNATURE TOTAL SUMMARY
+1 WRITE !!,"AVERAGE NUMBER OF DAYS TO PROCESS TRAVEL VOUCHERS"
+2 WRITE !,"BY TYPE OF SIGNATRUE:"
+3 FOR ACRI=1:1:6
Begin DoDot:1
+4 SET ACR=$GET(ACRSIGT(ACRI))
SET ACRD=$PIECE(ACR,U,2)
SET ACR=+ACR
+5 IF ACRI=1
WRITE !?7,"TO TRAVELER..: "
+6 IF ACRI=2
WRITE !?7,"TRAVELER SIG.: "
+7 IF ACRD]""
Begin DoDot:2
+8 IF ACRI=3
WRITE !?7,"RECOMMEND SIG: "
+9 IF ACRI=4
WRITE !?7,"APPROVER SIG.: "
End DoDot:2
+10 IF ACRI=5
WRITE !?7,"AUDITOR SIG..: "
+11 IF ACRI=6
WRITE !?7,"CERTIFIER SIG: "
+12 IF ACR
IF ACRD/ACR>0
WRITE $JUSTIFY($FNUMBER(ACRD/ACR,"P",0),5)
End DoDot:1
+13 QUIT
INVITE ;SELECT REPORT FOR TRAVELERS FROM OUTSIDE THE AREA ONLY
+1 SET DIR(0)="YO"
+2 SET DIR("A")="Report for OUTSIDE travelers ONLY"
+3 SET DIR("B")="NO"
+4 WRITE !
+5 DO DIR^ACRFDIC
+6 KILL ACRINVIT
+7 IF +Y'=1
QUIT
+8 SET ACRINVIT=""
+9 IF '$ORDER(^ACRSYS(1))
SET ACRADA=1
QUIT
AREA ;EP;
+1 SET DIC="^ACRSYS("
+2 SET DIC(0)="AEMQZ"
+3 SET DIC("A")="Report for which AREA: "
+4 WRITE !
+5 DO DIC^ACRFDIC
+6 IF +Y>0
SET ACRADA=+Y
+7 IF '$TEST
SET ACRQUIT=""
+8 QUIT