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

ACRFSSA1.m

Go to the documentation of this file.
ACRFSSA1 ;IHS/OIRM/DSD/THL,AEF - AUXILLIARY SUB-ROUTINES FOR ACRFSS* ROUTINES;  [ 07/20/2006  9:58 AM ]
 ;;2.1;ADMIN RESOURCE MGT SYSTEM;**3,5,20**;NOV 05, 2001
 ;;CONTINUATION OF ACRFSSA
TA ;EP;
 N ACRQTA   ;ACR*2.1*3.25
 N ACRTAMT  ;ACR*2.1*5.10
 N ACRADVR  ;ACR*2.1*5.10
 D ADVANCE
 Q:$D(ACRQTA)   ;HAS OUTSTANDING ADVANCE               ;ACR*2.1*3.25
 S ACRADVR=$$ADVR^ACRFSSA1(ACRDOCDA,ACRTAMT,ACRADV)    ;ACR*2.1*5.10
 W !!,"ALLOWABLE TRAVEL ADVANCE: ",$J($FN(ACRADV,"P",2),8)
 W !,"CURRENT AMOUNT REQUESTED: ",$J($FN(ACRADVR,"P",2),8)  ;ACR*2.1*5.10
 S DIR(0)="YO"
 S DIR("A")="ACCEPT ALLOWABLE ADVANCE"
 S DIR("B")="YES"                                       ;ACR*2.1*5.10
 D DIR^ACRFDIC
 I Y=1 S ACRADV=ACRADVR D ETA Q                         ;ACR*2.1*5.10
 I Y=0 D
 .S DA=ACRDOCDA
 .S DIE="^ACRDOC("
 .S DR="130160T"
 .D DIE^ACRFDIC
 .I $D(^ACRDOC(ACRDOCDA,"TO")),$P(^("TO"),U,25) S ACRADV=$P(^("TO"),U,25) D
 ..S DA=ACRDOCDA
 ..S DIE="^ACROBL("
 ..S DR="1000////"_ACRADV
 ..D DIE^ACRFDIC
 ..D OTA                                               ;ACR*2.1*5.10
 Q
OTA ;EP;RECORD OUTSTANDING TRAVEL ADVANCE
 I '$D(^ACROTA(ACRDOCDA,0)) D
 .N ACRNOW
 .D NOW^%DTC
 .S ACRNOW=%
 .S (DINUM,X)=ACRDOCDA
 .S DIC="^ACROTA("
 .S DIC(0)="LZ"
 .S DIC("DR")=".02////"_$P($G(^ACRDOC(ACRDOCDA,"TO")),U,9)
 .D FILE^ACRFDIC
 S DA=ACRDOCDA
 S DIE="^ACROTA("
 S DR=".03////"_ACRADV
 D DIE^ACRFDIC
 I +$G(^ACROBL(ACRDOCDA,"TA"))'=ACRADV D
 .S DA=ACRDOCDA
 .S DIE="^ACROBL("
 .S DR="1000////"_ACRADV
 .D DIE^ACRFDIC
 I $P($G(^ACRDOC(ACRDOCDA,"TO")),U,25)'=ACRADV D
 .S DA=ACRDOCDA
 .;I '$D(ACRTAMT) S ACRTAMT=ACRADV/.8 S:ACRADV=0 ACRTAMT=0  ;ACR*2.1*5.10;ACR*2.1*20.08  IM18616
 .I '$D(ACRTAMT) S ACRTAMT=ACRADV/.6 S:ACRADV=0 ACRTAMT=0  ;ACR*2.1*5.10;ACR*2.1*20.08  IM18616
 .S DIE="^ACRDOC("
 .S DR="130160///"_ACRADV
 .D DIE^ACRFDIC
 Q
TOTAL ;EP;
 I $P(^ACRDOC(ACRDOCDA,"TO"),U,22)=1 D
 .S ACRATM=ACRREIM-ACRLDG-ACRRC-ACRPHN-ACR4P-$S($P(^ACRDOC(ACRDOCDA,"TOAU"),U,5)=1:$G(ACRALTOT),1:0)
 .S ACRATM=$P(ACRATM,".")
 .S ACRATMX=$E(ACRATM,$L(ACRATM))
 .S:ACRATMX#10 ACRATM=ACRATM+(10-ACRATMX)
 .S:$E(ACRATM,$L(ACRATM)-1)#2 ACRATM=ACRATM+10
 .S ACRATM1=$S(ACRREFX=600:$P(^ACRDOC(ACRDOCDA,"TO"),U,23),1:ACRATM)
 .S ACRATM2=$P(^ACRDOC(ACRDOCDA,"TOAU"),U,8)
 .W !!,"GOVERNMENT ATM CASH WITHDRAWAL ",$S(ACRREFX=600:"AUTHORIZED",1:"ESTIMATED."),": ",$J($FN(ACRATM1,"P",2),10)
 .W !,"GOVERNMENT ATM CASH WITHDRAWAL ",$S(ACRREFX=600:"TAKEN.....",1:"REQUESTED."),": ",$J($FN(ACRATM2,"P",2),10)
 .W !,"GOVERNMENT ATM SERVICE CHARGE  ",$S(ACRREFX=600:"AUTHORIZED",1:"EXPECTED.."),": ",$J($FN($S(ACRREFX=600:$P(^ACRDOC(ACRDOCDA,"TO"),U,26),1:ACRATM*$P(^ACRSYS(1,"DT"),U,16)),"P",2),10)
 .W !,"YOU ARE REQUIRED TO ABIDE BY THE MAX ATM WITHDRAWAL LIMITS OF $60/DAY, $360/WEEK"
 W $$DASH^ACRFMENU
 W !
 W:$D(ACRALTOT) "AIRLINE.: ",$J($FN(ACRALTOT,"P",2),8)
 W:$D(ACRRC) ?25,"RENTAL CAR: ",$J($FN(ACRRC,"P",2),8)
 W ?54,"TOTAL EXPENSES: ",$J($FN(ACRTOT,"P",2),9)
 W !,"PER DIEM: ",$J($FN(ACRPD+ACRLDG,"P",2),8)
 W ?25,"OTHER.....: ",$J($FN(ACROTHT,"P",2),8)
 W ?54,$S(ACRREF=130:"EXCLD AIRLINE.: ",1:"REIMBURSABLE..: "),$J($FN(ACRREIM-$P($G(^ACROTA(ACRDOCDA,0)),U,3),"P",2),9)
 W !,"TM FEE..: ",$J($FN($$TMFEE^ACRFSS42(ACRDOCDA),"P",2),8)
 W ?54,"TRAVEL ADVANCE: ",$J($FN($P(^ACRDOC(ACRDOCDA,"TO"),U,25),"P",2),9)
 I $P($G(^ACRDOC(ACRDOCDA,"TRNG4")),U,16) W !?48,"TOTAL NOT TO EXCEED.: ",$J($FN($P(^("TRNG4"),U,16),"P",2),9) S:ACRTOT>$P(^("TRNG4"),U,16) ACRTOT=$P(^("TRNG4"),U,16)
 W:$D(ACRPRT)&(ACRREF'=130) !?48,"TOTAL AMOUNT CLAIMED: ",$J($FN(ACRTOT-ACRADV,"P",2),9)
 I ACRREF'=130,$P($G(^ACRDOC(ACRDOCDA,"TOAU")),U,7) D
 .S ACROBL=$P(^ACRDOC(ACRDOCDA,"TOAU"),U,7)
 .W !?48,"ORIGINALLY OBLIGATED: ",$J($FN(ACROBL,"P",2),9)
 .I ACRTOT>ACROBL D
 ..W !?48,"UNDER-OBLIGATED.....: ",$J($FN(ACRTOT-ACROBL,"P",2),9)
 D PAUSE^ACRFWARN:'$D(ACRQUIT)
 D UP^ACRFSS3
 K ACRTV("D")
 Q
CHK ;EP;CHECK TO SEE IF ANY SIGNATURES HAVE BEEN APPLIED TO THE TRAVEL
 ;VOUCHER CHECK FOR CHANGE TO TRAVEL DAYS AFTER TRAVEL VOUCHER SIGNED
 Q:'$D(^ACRAPVS("AB",ACRDOCDA))
 N ACR
 S ACRAPVDA=0
 F  S ACRAPVDA=$O(^ACRAPVS("AB",ACRDOCDA,ACRAPVDA)) Q:'ACRAPVDA  I $D(^ACRAPVS(ACRAPVDA,0)),$P(^(0),U,3)=39,$E($G(^ACRAPVS(ACRAPVDA,"DT")))="A" S ACRTVCH="" Q
 Q
ADVANCE ;EP;UPDATE TRAVEL ADVANCE AMOUNT DURING TRAVEL ORDER PROCESSING
 Q:$O(^AUTTDOCR("B","130",0))'=+$P(^ACRDOC(ACRDOCDA,0),U,13)
 S ACRLDG=$G(ACRLDG)  ;ACR*2.1*3.35
 S ACRRC=$G(ACRRC)  ;ACR*2.1*3.35
 S ACROTHT=$G(ACROTHT)  ;ACR*2.1*3.35
 N ACRDUZ
 S ACRDUZ=$P($G(^ACRDOC(ACRDOCDA,"TO")),U,9)
 Q:'ACRDUZ
 D OUTSTD^ACRFTA
 I $G(ACR9E) D  Q
 .K ACR9E
 .W !,"It appears that the traveler has an outstanding travel advance."
 .W !,"No additional advance can be requested until the outstanding"
 .W !,"advance is liquidated."
 .S ACRQTA=1           ;SET QUIT FLAG ;ACR*2.1*3.25
 .D PAUSE^ACRFWARN
 N ACRTO
 S ACRTO=^ACRDOC(ACRDOCDA,"TO")
 I $P(ACRTO,U,22)=0,$P(ACRTO,U,19)="Y" D  I 1
 .S ACRTAMT=ACROTHT+ACRPD+ACRLDG+ACRRC   ;ACR*2.1*5.10
 .;S ACRADV=.8*ACRTAMT                    ;ACR*2.1*5.10;ACR*2.1*20.08  IM18616
 .S ACRADV=.6*ACRTAMT                    ;ACR*2.1*5.10;ACR*2.1*20.08  IM18616
 .S ACRADV=$P(ACRADV,".")
 .;S ACRADVX=$E(ACRADV,$L(ACRADV))       ;ACR*2.1*5.10
 .;S ACRADV=($E(ACRADV,1,$L(ACRADV)-1)_0)+$S(ACRADVX>4:10,1:0)  ;ACR*2.1*5.10
 E  S (ACRADV,ACRTAMT)=0                 ;ACR*2.1*5.10
 Q
ALTOT ;EP;TO CALCULATE TOTAL AIRLINE EXPENSE
 Q:'$D(^ACRAL("E",ACRDOCDA))
 S (ACRALTOT,ACRALDA)=0
 F  S ACRALDA=$O(^ACRAL("E",ACRDOCDA,ACRALDA)) Q:'ACRALDA  D
 .S ACRALTOT=ACRALTOT+$P($G(^ACRAL(ACRALDA,"DT")),U,9)
 .S:+$P($G(^ACRAL(ACRALDA,"DT")),U,11)>0 ACRCONC=$P(^ACRAL(ACRALDA,"DT"),U,11)
 Q
ETA ;EP;TO EDIT/UPDATE TRAVEL ADVANCE
 S DA=ACRDOCDA
 S DIE="^ACROBL("
 S DR="1000////"_ACRADV
 D DIE^ACRFDIC
 S DA=ACRDOCDA
 ;I '$D(ACRTAMT) S ACRTAMT=ACRADV/.8 S:ACRADV=0 ACRTAMT=0 ;ACR*2.1*5.10;ACR*2.1*20.08  IM18616
 I '$D(ACRTAMT) S ACRTAMT=ACRADV/.6 S:ACRADV=0 ACRTAMT=0 ;ACR*2.1*5.10;ACR*2.1*20.08  IM18616
 S DIE="^ACRDOC("
 S DR="130160////"_ACRADV
 D DIE^ACRFDIC
 D OTA                                                   ;ACR*2.1*5.10
 Q
ADVR(ACRDOCDA,ACRTAMT,ACRADV) ;LOCAL ENTRY; EXTRINSIC FUNCTION   ;ACR*2.1*5.10
 ;          ENTERS WITH: DOCUMENT IEN
 ;                       AMOUNT BEFORE MINU 8 %     
 ;                       ALLOWABLE ADVANCE
 ;          RETURNS:     ADVANCE AMOUNT
 ;                       ADJUSTED IF GREATER THAN TAMT-5.00
 ;
 S ACRADVR=+$P($G(^ACRDOC(ACRDOCDA,"TO")),U,25)
 I ACRADVR=0 S ACRADVR=ACRADV
 I ACRADVR'>0 Q 0
 I ACRADVR>(ACRTAMT-5) D
 .W !,"Requested advance cannot be greater than the total allowed amount, less $5.00"
 .W !,"Adjusting the amount to the greatest amount allowed."
 .S ACRADVR=ACRTAMT-5
 .D PAUSE^ACRFWARN
 Q ACRADVR