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

ACRFNY1.m

Go to the documentation of this file.
ACRFNY1 ;IHS/OIRM/DSD/THL,AEF - CREATE FINANCIAL ACCOUNTS FOR THE NEW FISCAL YEAR, ALL ACCOUNTS;  [ 11/01/2001   9:44 AM ]
 ;;2.1;ADMIN RESOURCE MGT SYSTEM;;NOV 05, 2001
 ;;ROUTINE TO CREATE FINANCIAL ACCOUNTS FOR THE NEW FISCAL YEAR
CREATE ;EP;TO CREATE NEXT FY ACCOUNTS
 S ACR1=0
 F  S ACR1=$O(^TMP("ACRAPP",$J,ACR1)) Q:'ACR1  D
 .I '$P(^ACRAPP(ACR1,0),U,6),'$P(^(0),U,7),$P(^(0),U,16)=1 D APPC I 1
 .I '$P(^ACRAPP(ACR1,0),U,6),'$P(^(0),U,7),$P(^(0),U,16)'=1 S ACRAPP=ACR1
 .S ACRAPP=$P(^ACRAPP(ACR1,0),U,7)
 .Q:'$G(ACRAPP)
 .S ACR2=0
 .F  S ACR2=$O(^TMP("ACRAPP",$J,ACR1,ACR2)) Q:'ACR2  D
 ..I '$P(^ACRALW(ACR2,0),U,6),'$P(^(0),U,7),$P(^(0),U,16)=1 D ALWC I 1
 ..E  I '$P(^ACRALW(ACR2,0),U,6),'$P(^(0),U,7),$P(^(0),U,16)'=1 S ACRALW=ACR2
 ..E  S ACRALW=$P(^ACRALW(ACR2,0),U,7)
 ..Q:'$G(ACRALW)
 ..S ACR3=0
 ..F  S ACR3=$O(^TMP("ACRAPP",$J,ACR1,ACR2,ACR3)) Q:'ACR3  D
 ...I '$P(^ACRALC(ACR3,0),U,6),'$P(^(0),U,7),$P(^(0),U,16)=1 D ALCC I 1
 ...E  I '$P(^ACRALC(ACR3,0),U,6),'$P(^(0),U,7),$P(^(0),U,16)'=1 S ACRALC=ACR3
 ...E  S ACRALC=$P(^ACRALC(ACR3,0),U,7)
 ...Q:'$G(ACRALC)
 ...S ACR4=0
 ...F  S ACR4=$O(^TMP("ACRAPP",$J,ACR1,ACR2,ACR3,ACR4)) Q:'ACR4  D
 ....I '$P(^ACRLOCB(ACR4,0),U,6),'$P(^(0),U,7),$P(^(0),U,16)=1 D ADAC
 Q
APPC ;CREATE APPROPRIATION
 S X=0
 S DIC="^ACRAPP("
 S DIC(0)="L"
 D FILE^ACRFDIC
 W !,"NEW APPROPRIATION ",+Y," CREATED FOR APPROPRIATION: ",ACR1
 S (DA,ACRAPP,ACRNEWDA)=+Y
 S ^ACRAPP(ACRNEWDA,0)=^ACRAPP(ACR1,0)
 S $P(^ACRAPP(ACRNEWDA,0),U,2)=ACRAPPDA
 S ^ACRAPP(ACRNEWDA,"DT")=^ACRAPP(ACR1,"DT")
 S ^ACRAPP(ACRNEWDA,"CMT")=$G(^ACRAPP(ACR1,"CMT"))
 S ^ACRAPP(ACRNEWDA,"PURP")=$G(^ACRAPP(ACR1,"PURP"))
 S X=^ACRAPP(ACRNEWDA,"DT")
 S $P(X,U,10)=""
 S $P(X,U,11)=""
 S ^ACRAPP(ACRNEWDA,"DT")=X
 S %X="^ACRAPP("_ACR1_",""SC"","
 S %Y="^ACRAPP("_ACRNEWDA_",""SC"","
 S (ACRDIK,DIK)="^ACRAPP("
 S ACROLD=ACR1
 D DIK
 S ACRTOT=+^ACRAPP(ACRNEWDA,0)
 D APPC1
 S DA=ACR1
 S DIE="^ACRAPP("
 S DR=".06////1;.07////"_ACRNEWDA
 D DIE^ACRFDIC
 S DA=ACRNEWDA
 S DIE="^ACRAPP("
 S DR="10////"_ACRFYNEW_";.15////"_ACR1
 D DIE^ACRFDIC
 Q
APPC1 ;CALCULATE RECURRING TOTAL
 N ACRX
 S ACRX=0
 F  S ACRX=$O(^ACRAPP("ORIG",ACR1,ACRX)) Q:'ACRX  I $P(^ACRAPP(ACRX,0),U,6)'=1,$P($G(^ACRAPP(ACRX,"DT")),U,3)="R" S ACRTOT=ACRTOT+^ACRAPP(ACRX,0)
 Q
ALWC ;CREATE ALLOWANCE
 S X=0
 S DIC="^ACRALW("
 S DIC(0)="L"
 D FILE^ACRFDIC
 W !,"NEW ALLOWANCE ",+Y," CREATED FOR ALLOWANCE: ",ACR2
 S (DA,ACRALW,ACRNEWDA)=+Y
 S ^ACRALW(ACRNEWDA,0)=^ACRALW(ACR2,0)
 S ^ACRALW(ACRNEWDA,"DT")=^ACRALW(ACR2,"DT")
 S $P(^ACRALW(ACRNEWDA,"DT"),U,4)=ACRAPPDA
 S ^ACRALW(ACRNEWDA,"CMT")=$G(^ACRALW(ACR2,"CMT"))
 S ^ACRALW(ACRNEWDA,"PURP")=$G(^ACRALW(ACR2,"PURP"))
 S X=^ACRALW(ACRNEWDA,0)
 S $P(X,U,2)=ACRAPP
 S $P(X,U,10)=""
 S $P(X,U,11)=""
 S ^ACRALW(ACRNEWDA,0)=X
 S %X="^ACRALW("_(ACR2)_",""SC"","
 S %Y="^ACRALW("_ACRNEWDA_",""SC"","
 S (ACRDIK,DIK)="^ACRALW("
 S ACROLD=ACR2
 D DIK
 S ACRTOT=+^ACRALW(ACRNEWDA,0)
 D ALWC1
 S DA=ACR2
 S DIE="^ACRALW("
 S DR=".06////1;.07////"_ACRNEWDA
 D DIE^ACRFDIC
 S DA=ACRNEWDA
 S DIE="^ACRALW("
 S DR="10////"_ACRFYNEW_";.15////"_ACR2
 D DIE^ACRFDIC
 Q
ALWC1 ;CALCULATE RECURRING TOTAL
 N ACRX
 S ACRX=0
 F  S ACRX=$O(^ACRALW("ORIG",ACR2,ACRX)) Q:'ACRX  I $P(^ACRALW(ACRX,0),U,6)'=1,$P($G(^ACRALW(ACRX,"DT")),U,3)="R" S ACRTOT=ACRTOT+^ACRALW(ACRX,0)
 Q
ALCC ;CREATE SUB-ALLOWANCE
 S X=0
 S DIC="^ACRALC("
 S DIC(0)="L"
 D FILE^ACRFDIC
 W !,"NEW SUB-ALLOWANCE ",+Y," CREATED FOR SUB-ALLOWANCE: ",ACR3
 S (DA,ACRALC,ACRNEWDA)=+Y
 S ^ACRALC(ACRNEWDA,0)=^ACRALC(ACR3,0)
 S ^ACRALC(ACRNEWDA,"DT")=^ACRALC(ACR3,"DT")
 S $P(^ACRALC(ACRNEWDA,"DT"),U,4)=ACRAPPDA
 S ^ACRALC(ACRNEWDA,"CMT")=$G(^ACRALC(ACR3,"CMT"))
 S ^ACRALC(ACRNEWDA,"PURP")=$G(^ACRALC(ACR3,"PURP"))
 S X=^ACRALC(ACRNEWDA,0)
 S $P(X,U,2)=ACRAPP
 S $P(X,U,3)=ACRALW
 S $P(X,U,10)=""
 S $P(X,U,11)=""
 S ^ACRALC(ACRNEWDA,0)=X
 S %X="^ACRALC("_(ACR3)_",""SC"","
 S %Y="^ACRALC("_ACRNEWDA_",""SC"","
 S (ACRDIK,DIK)="^ACRALC("
 S ACROLD=ACR3
 D DIK
 S ACRTOT=+^ACRALC(ACRNEWDA,0)
 D ALCC1
 S DA=ACR3
 S DIE="^ACRALC("
 S DR=".06////1;.07////"_ACRNEWDA
 D DIE^ACRFDIC
 S DA=ACRNEWDA
 S DIE="^ACRALC("
 S DR="10////"_ACRFYNEW_";.15////"_ACR3
 D DIE^ACRFDIC
 Q
ALCC1 ;CALCULATE RECURRING TOTAL
 N ACRX
 S ACRX=0
 F  S ACRX=$O(^ACRALC("ORIG",ACR3,ACRX)) Q:'ACRX  I $P(^ACRALC(ACRX,0),U,6)'=1,$P($G(^ACRALC(ACRX,"DT")),U,3)="R" S ACRTOT=ACRTOT+^ACRALC(ACRX,0)
 Q
ADAC ;CREATE DEPARTMENT ACCOUNT
 S X=0
 S DIC="^ACRLOCB("
 S DIC(0)="L"
 D FILE^ACRFDIC
 W !,"NEW DEPARTMENT ACCOUNT ",+Y," CREATED FOR DEPARTMENT ACCOUNT: ",ACR4
 S (DA,ACRDAC,ACRNEWDA)=+Y
 S ^ACRLOCB(ACRNEWDA,0)=^ACRLOCB(ACR4,0)
 S ^ACRLOCB(ACRNEWDA,"DT")=^ACRLOCB(ACR4,"DT")
 S $P(^ACRLOCB(ACRNEWDA,"DT"),U,4)=ACRAPPDA
 S ^ACRLOCB(ACRNEWDA,"CMT")=$G(^ACRLOCB(ACR4,"CMT"))
 S ^ACRLOCB(ACRNEWDA,"PURP")=$G(^ACRLOCB(ACR4,"PURP"))
 S X=^ACRLOCB(ACRNEWDA,0)
 S $P(X,U,2)=ACRAPP
 S $P(X,U,3)=ACRALW
 S $P(X,U,4)=ACRALC
 S $P(X,U,10)=""
 S $P(X,U,11)=""
 S ^ACRLOCB(ACRNEWDA,0)=X
 S %X="^ACRLOCB("_ACR4_",""CC"","
 S %Y="^ACRLOCB("_ACRNEWDA_",""CC"","
 D %XY^%RCR
 S %X="^ACRLOCB("_ACR4_",2,"
 S %Y="^ACRLOCB("_ACRNEWDA_",2,"
 D %XY^%RCR
 S %X="^ACRLOCB("_ACR4_",""SC"","
 S %Y="^ACRLOCB("_ACRNEWDA_",""SC"","
 S (ACRDIK,DIK)="^ACRLOCB("
 S ACROLD=ACR4
 D DIK
 S ACRTOT=+^ACRLOCB(ACRNEWDA,0)
 D ADAC1
 S DA=ACR4
 S DIE="^ACRLOCB("
 S DR=".06////1;.07////"_ACRNEWDA
 D DIE^ACRFDIC
 S DA=ACRNEWDA
 S DIE="^ACRLOCB("
 S DR="10////"_ACRFYNEW_";.15////"_ACR4
 D DIE^ACRFDIC
 Q
ADAC1 ;CALCULATE RECURRING TOTAL
 N ACRX
 S ACRX=0
 F  S ACRX=$O(^ACRLOCB("ORIG",ACR4,ACRX)) Q:'ACRX  I $P(^ACRLOCB(ACRX,0),U,6)'=1,$P($G(^ACRLOCB(ACRX,"DT")),U,3)="R" S ACRTOT=ACRTOT+^ACRLOCB(ACRX,0)
 Q
DIK ;RE-INDEX NEWLY CREATED ACCOUNTS
 D %XY^%RCR
 S DA(1)=ACRNEWDA
 D IX1^ACRFDIC
 I $D(ACRMM) D UP^ACRFNY2
 Q