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

ACRFCLM.m

Go to the documentation of this file.
ACRFCLM ;IHS/OIRM/DSD/THL,AEF - CALCULATE AMOUNT CLAIMED FOR TRAVEL ORDER;  [ 11/01/2001   9:44 AM ]
 ;;2.1;ADMIN RESOURCE MGT SYSTEM;;NOV 05, 2001
 ;;ROUTINE TO CALCULATE AMOUNT CLAIMED FOR TRAVEL ORDER
EN ;EP;TO CALCULATE AND PRINT AMOUNT CLAIMED ON TRAVEL ORDER
 D EN1
EXIT ;EP;TO KILL TRAINING TRAVEL VARIABLES
 K ACR1,ACR11,ACR2,ACR21,ACR3,ACR31,ACR4,ACR5,ACR6,ACRTNGTV,ACRADV,ACRALDA
 Q
EN1 D EN11
 W !!,"----------------------------  PAYMENT INFORMATION  -----------------------------"
 W !,"AMOUNT CLAIMED...........:",$J($FN(ACRX,"P",2),10)
 W !,"APPLIED TO TRAVEL ADVANCE:",$J($FN(ACRADV,"P",2),10)
 W !,"VERIFIED CHARGE TO APPROP:",$J($FN(ACRX,"P",2),10)
 W !,"NET TO TRAVELER..........:"
 W:ACRX>ACRADV $J($FN(ACRX-ACRADV,"P",2),10)
 D PAUSE^ACRFWARN
 Q
EN11 ;EP;TO FIND TRAVEL ADVANCE AMOUNT AND AMOUNT OWED TO TRAVELER
 S ACRADV=$S($D(^ACRDOC(ACRDOCDA,"TO")):$P(^("TO"),U,25),1:0)
 S (ACRX,ACRSSDA)=0
 F ACRI=1:1:3 D
 .S ACRSSDA=$O(^ACRSS("E",ACRDOCDA,ACRI,0))
 .S:ACRSSDA ACRX=ACRX+$P(^ACRSS(ACRSSDA,"DT"),U,4)
 D ALTOT
 I $P($G(^ACRSYS(1,400)),U,4) S ACRX=ACRX+$$TMFEE^ACRFSS42(ACRDOCDA)
 S ACRX=ACRX-$S($P(^ACRDOC(ACRDOCDA,"TOAU"),U,5)=1:0,1:$G(ACRALTOT))
 Q
ALTOT ;EP;TO CALCULATE TOTAL AIRLINE EXPENSE FOR A TRAVEL DOCUMENT
 S ACRALTOT=0
 Q:'$G(ACRDOCDA)
 N ACRALDA
 S ACRALDA=0
 F  S ACRALDA=$O(^ACRAL("E",ACRDOCDA,ACRALDA)) Q:'ACRALDA  D
 .S ACRALTOT=ACRALTOT+$P($G(^ACRAL(ACRALDA,"DT")),U,9)
 Q
EN2 ;EP;TO DETERMINE TRAINING TRAVEL EXPENSES
 S (ACR1,ACR2,ACR3,ACR4,ACR5,ACR6)=0
 G:'$D(^ACRDOC(ACRDOCDA,"TRNGTO")) EN21
 S ACRTNGTV=$P(^ACRDOC(ACRDOCDA,"TRNGTO"),U)
 G:'ACRTNGTV EN21
 G:'$D(^ACRDOC(ACRTNGTV,0)) EN21
 S ACRTNGTV=$P(^ACRDOC(ACRTNGTV,0),U,5)
 G:'ACRTNGTV EN21
 N X
 F X=1:1:3 S @("ACR"_X)=$O(^ACRSS("E",ACRTNGTV,X,0))
 F X=1:1:3 S @("ACR"_X)=$P($G(^ACRSS(+@("ACR"_X),"DT")),U,4)
EN21 S (ACR4,ACR5)=$P(^ACRDOC(ACRDOCDA,0),U,5)
 S ACR4=$O(^ACRSS("E",+ACR4,1,0))
 S ACR4=$P($G(^ACRSS(+ACR4,"DT")),U,4)
 S ACR5=$O(^ACRSS("E",+ACR5,2,0))
 S ACR5=$P($G(^ACRSS(+ACR5,"DT")),U,4)
 F X=1:1:5 S ACR6=$G(ACR6)+@("ACR"_X)
 F X=1:1:6 S @("ACR"_X)=$FN(@("ACR"_X),"P",2)
 Q