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

ACRFCAL1.m

Go to the documentation of this file.
ACRFCAL1 ;IHS/OIRM/DSD/THL,AEF - RECALCULATE FMS DISTRIBUTION FIL;  [ 11/01/2001   9:44 AM ]
 ;;2.1;ADMIN RESOURCE MGT SYSTEM;;NOV 05, 2001
 ;;ROUTINE USED TO RECALCULATE ALL FINANCIAL TRANSACTIONS
EN D SUPP
 D REQ
 Q
SUPP ;CHECKS THROUGH ALL SERVICES/SUPPLIES IN THE 'ACRSS(' GLOBAL TO ENSURE
 ;EACH IS A COMPLETE RECORD
 Q
 I $E($G(IOST),1,2)="C-" W !!,"Data integrity check.  Please wait."
 S ACRDA=0
 F  S ACRDA=$O(^ACRSS(ACRDA)) Q:'ACRDA  D
 .S (ACRSSDA,DA)=ACRDA
 .D SSCHK^ACRFSSA Q
 .I $D(ACRQUIT)!$D(ACROUT) K ACRQUIT Q
 .F ACRI=13,18,16 D
 ..S DA=ACRSSDA
 ..S DIK(1)=ACRI_U_1
 ..S DIK="^ACRSS("
 ..D EN1^DIK
 Q
REQ ;CHECKS ALL ITEMS REQUESTED ON EACH REQUEST AND RESETS THE AMOUNT
 ;REQUESTED, OBLIGATED AND SPENT FOR THE REQUEST
 I $E($G(IOST),1,2)="C-" D
 .W !!,"Recalculating all requested items.  Please wait."
 S ACRDA=0
 F  S ACRDA=$O(^ACROBL(ACRDA)) Q:'ACRDA  D
 .S DA=ACRDA
 .L +^ACROBL(DA):4 Q:'$T
 .S $P(^ACROBL(DA,0),U)=0
 .S $P(^ACROBL(DA,"DT"),U,4)=0
 .S $P(^ACROBL(DA,"DT"),U,2)=0
 .S (ACRREQ,ACROBL,ACRSPT,ACRX)=0
 .F  S ACRX=$O(^ACRSS("J",DA,ACRX)) Q:'ACRX  D
 ..S ACRREQ=ACRREQ+$P($G(^ACRSS(ACRX,"DT")),U,4)
 ..S ACROBL=ACROBL+$P($G(^ACRSS(ACRX,"DT")),U,9)
 ..S ACRSPT=ACRSPT+$P($G(^ACRSS(ACRX,"DT")),U,21)
 .S $P(^ACROBL(DA,0),U)=ACRREQ
 .S $P(^ACROBL(DA,"DT"),U,4)=ACROBL
 .S $P(^ACROBL(DA,"DT"),U,2)=ACRSPT
 .L -^ACROBL(DA):0
 Q