Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: ACRFSS42

ACRFSS42.m

Go to the documentation of this file.
ACRFSS42 ;IHS/OIRM/DSD/THL,AEF - EDIT TRAVEL VOUCHER - CONT; [ 11/01/2001   9:44 AM ]
 ;;2.1;ADMIN RESOURCE MGT SYSTEM;;NOV 05, 2001
 ;;CONTINUATION OF ACRFSS4
DISPLAY ;EP;
 K ACRTV
 Q:$D(ACRDAILY)
 D CHK^ACRFSSA1
 K ACRQUIT
 D HEADSS4^ACRFSSD1
 Q:$D(ACRQUIT)!$D(ACROUT)
 I $P(^ACRDOC(ACRDOCDA,"TO"),U,26),'$P($G(^ACRDOC(ACRDOCDA,"TOAU")),U,8) D
 .S DA=ACRDOCDA
 .S DIE="^ACRDOC("
 .S DR="130170////0"
 .D DIE^ACRFDIC
 S ACRMRR=$P(^ACRDOC(ACRDOCDA,"TOSA"),U,10)
 S ACR4P=$P(^ACRDOC(ACRDOCDA,"TO"),U,26)
 S ACRDUZ=$P(^ACRDOC(ACRDOCDA,"TO"),U,9)
 S (ACRREIM,ACRJ,ACRTOT,ACRPD,ACRLDG,ACRMR,ACRTAX,ACRPHN,ACROTH,ACROTHT,ACRRC,ACRTVRC,ACRAIRPT,ACRAIRP,ACRAIRT)=0
 S ACRADV=+$G(ACRADV)
 S ACRALTOT=+$G(ACRALTOT)
 K ^TMP("ACRTV",$J)
 I '$D(^ACRTV("D",ACRDOCDA)) D  Q
 .W !?10,"NO TRAVEL DAYS RECORDED FOR THIS TRAVEL ORDER."
 .S ACRDAYS=0
 D LASTDAY
 S ACRTVDA=0
 F  S ACRTVDA=$O(^ACRTV("D",ACRDOCDA,ACRTVDA)) Q:'ACRTVDA  D
 .I $G(ACRREFX)'=600,$P($G(^ACRTV(ACRTVDA,0)),U,5)=1 Q
 .I '$D(^ACRTV(ACRTVDA,0)) K ^ACRTV("D",ACRDOCDA,ACRTVDA) Q
 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ACRMRR)
 .S ACRTVPHN=$P(ACRTV1,U,9)
 .S ACRTVOTH=$P(ACRTV1,U,10)
 .S ACRTVEXP=$P(ACRTV1,U,17)
 .S ACRTVRC=$P(ACRTV1,U,15)
 .S:ACRTVEP]"" ACRTVEXP=ACRTVEXP_U_ACRTVEP
 .S ACRTVRCC=$P(ACRTV1,U,13)
 .I ACRTVRCC,$D(^ACRRCOMP(ACRTVRCC,0)) S ACRTVRCC=$P(^(0),U)
 .S ACROTH=ACROTH+ACRTVOTH
 .S ACRPD=ACRPD+ACRTVPD
 .S ACRLDG=ACRLDG+ACRTVLDG
 .S ACRMR=ACRMR+ACRTVMR
 .S ACRTAX=ACRTAX+ACRTVTAX
 .S ACRPHN=ACRPHN+ACRTVPHN
 .S ACRRC=ACRRC+ACRTVRC
 I $P(^ACRDOC(ACRDOCDA,"TOAU"),U,6),$P(^("TOAU"),U,6)<ACRMR S ACRMR=$P(^("TOAU"),U,6)
 S ACRDAYS=ACRJ
 S ACRPHNX=ACRJ-1*$P(^ACRSYS(1,"DT"),U,17)
 S ACRPHN=$S(ACRPHN>ACRPHNX:ACRPHNX,1:ACRPHN)
 D TAXI
 K ACRPHNX
 S (ACRTVDT,ACRJ)=0
 F  S ACRTVDT=$O(^TMP("ACRTV",$J,"D",ACRTVDT)) Q:'ACRTVDT!$D(ACRQUIT)  D
 .S ACRTVDA=0
 .F  S ACRTVDA=$O(^TMP("ACRTV",$J,"D",ACRTVDT,ACRDOCDA,ACRTVDA)) Q:'ACRTVDA!$D(ACRQUIT)  D
 ..S ACRJ=ACRJ+1
 ..D DP1^ACRFSS44
 I $D(^ACRAL("C",ACRDOCDA)) D
 .W !!,"Transportation cost to and from airport including airport parking not to exceed"
 .W !,"round trip taxi fare of ",$FN($P($G(^ACRAU(ACRDUZ,1)),U,9),"P",2),"  (Amount claimed:",$FN(ACRAIRPT(1),"P",2)," authorized:",$FN(ACRAIRPT,"P",2),")"
 W !?26,"---------"
 W ?36,"---------"
 W ?46,"-------"
 W ?54,"--------"
 W ?63,"--------"
 W ?72,"-------"
 W !?26,$J($FN(ACRPD,"P",2),8)
 W ?36,$J($FN(ACRLDG,"P",2),8)
 W ?46,$J($FN(ACRMR+ACRAIRT,"P",2),7)
 W ?54,$J($FN(ACRTAX,"P",2),7)
 S ACRTOT=ACRTOT+ACRPD+ACRLDG+ACRMR+ACRTAX+ACRPHN+ACROTH+ACRRC+ACR4P+ACRAIRPT+$$TMFEE(ACRDOCDA)
 S ACROTHT=ACROTHT+ACRMR+ACRTAX+ACRPHN+ACROTH+ACRAIRPT
 W ?63,$J($FN(ACRPHN,"P",2),7)
 W ?72,$J($FN(ACROTH+ACRAIRPT-ACRAIRT,"P",2),7)
 D ALTOT^ACRFSSA1
 D ADVANCE^ACRFSSA1
 S ACRTOT=ACRTOT+$G(ACRALTOT)
 S ACRREIM=ACRREIM+ACRRC+ACRPD+ACRLDG+ACROTHT+ACR4P+$S($P(^ACRDOC(ACRDOCDA,"TOAU"),U,5)=1:$G(ACRALTOT),1:0)
 I $P($G(^ACRSYS(1,400)),U,4) S ACRREIM=ACRREIM+$$TMFEE(ACRDOCDA) ; ADD TM FEE TO REIMBURSABLE IF CREATE TM FEE PMT DHR = YES
 D TOTAL^ACRFSSA1
 K ACRQUIT,ACRHOT
 Q
TAXI ;EP;TO CALCULATE IF AIRPORT PARKING PLUS TRIP TO AIRPORT IS GREATER
 ;THAN TAXI TO AIRPORT
 S ACRAIRPT(1)=ACRAIRPT+ACRAIRT
 I ACRAIRPT(1),$P($G(^ACRAU(ACRDUZ,1)),U,9),ACRAIRPT(1)>($P(^(1),U,9)) S ACRAIRPT=$P(^(1),U,9)
 E  S ACRAIRPT=ACRAIRPT(1)
 Q
LASTDAY ;EP;TO ADJUST FIRST AND LAST OFFICIAL TRAVEL DAY PERDIEM TO 3/4 ;THL
 ;;AND TO DISALLOW PERDIEM AND LODGING ON NON-OFFICIAL TRAVEL DAYS
 ;;IF FINAL APPROVAL OR DISAPPROVAL COMPLETED, NO ADJUSTMENT IS DONE
 Q:$P($G(^ACROBL(ACRDOCDA,"APV")),U,8)]""
 K ^TMP("ACRTV",$J,"D")
 N ACRJ,ACRXX,ACRY,Z,ACRTDY,ACRPDX,ACRHOT,ACRPD
 S (ACRXX,ACRJ)=0
 F  S ACRXX=$O(^ACRTV("D",ACRDOCDA,ACRXX)) Q:'ACRXX  D
 .Q:$P($G(^ACRTV(ACRXX,0)),U,4)'=1
 .S ACRJ=ACRJ+1
 Q:ACRJ<4
 S (ACRXX,ACRJ)=0
 F  S ACRXX=$O(^ACRTV("D",ACRDOCDA,ACRXX)) Q:'ACRXX  D
 .Q:$P($G(^ACRTV(ACRXX,0)),U,4)'=1
 .S ^TMP("ACRTV",$J,"D",+$P(^ACRTV(ACRXX,"DT"),U),ACRDOCDA,ACRXX)=""
 K ACRQUIT
 S ACRDAY=99999999
 S ACRDAY=$O(^TMP("ACRTV",$J,"D",ACRDAY),-1) Q:'ACRDAY!$D(ACRQUIT)  D
 .S ACRXX=99999999
 .S ACRXX=$O(^TMP("ACRTV",$J,"D",ACRDAY,ACRDOCDA,ACRXX),-1)
 .Q:'ACRXX!$D(ACRQUIT)
 .S ACRTDY=$P($G(^ACRTV(ACRXX,"DT")),U,4)
 .N ACRAMT
 .S ACRAMT=$P($G(^ACRTV(ACRXX,"DT")),U,5)
 .D:ACRTDY
 ..S ACRPDX=$P($G(^ACRPD(+ACRTDY,0)),U,4)
 ..Q:'ACRPDX
 ..Q:ACRPDX*.751>ACRAMT
 ..S DA=ACRXX
 ..S DIE="^ACRTV("
 ..S DR="5////"_(ACRPDX*.75)_";6////0"
 ..D DIE^ACRFDIC
 ..S ACRQUIT=""
 K ACRQUIT,^TMP("ACRTV",$J,"D"),ACRHOT
 Q
TMFEE(X) ;EP -- EXTRINSIC FUNCTION - CALCULATES TRAVEL MGT FEE
 ;
 ;      INPUT:
 ;        X = INTERNAL FMS DOCUMENT IEN
 ;
 ;      OUTPUT:
 ;        Y = TRAVEL MGT FEE AMOUNT
 ;
 N Z,Y
 S (Z,Y)=0
 F  S Z=$O(^ACRSS("C",X,Z)) Q:'Z  D
 . Q:$P($G(^ACRSS(Z,"NMS")),U,5)'="Travel Mgt Fee"
 . S Y=Y+$P($G(^ACRSS(Z,"DT")),U,4)
 Q Y