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

ACRFPAYS.m

Go to the documentation of this file.
ACRFPAYS ;IHS/OIRM/DSD/AEF - ASSIGN TREASURY SCHEDULE NUMBER;  [ 11/01/2001   9:44 AM ]
 ;;2.1;ADMIN RESOURCE MGT SYSTEM;;NOV 05, 2001
 ;;
SCHNO(ACRFYDA,ACRBATDA,ACRSNO,ACRQUIT) ;EP
 ;----- ASSIGN TREASURY SCHEDULE NUMBER
 ;
 ;      ACRFYDA  = BATCH FISCAL YEAR IEN
 ;      ACRBATDA = BATCH IEN
 ;
 N ACRAP,ACRAPDA,ACRFY,ACRSDFY
 K ACRSNO
 D SCHCHK^ACRFPAY6
 Q:$G(ACRSNO(1))]""!$D(ACRQUIT)!$D(ACROUT)
 ;
 D AP(.Y)
 I +Y'>0 S ACRQUIT="" Q
 S ACRAPDA=+Y
 S ACRAP=$P($G(^AUTTACPT(+ACRAPDA,0)),U)
 ;
 S ACRFY=$P($G(^AFSLAFP(ACRFYDA,0)),U)
 D SCHFY(ACRFY,.Y)
 Q:+Y'>0
 S ACRSDFY=+Y
 ;
 D SCHAP(ACRSDFY,ACRAPDA,.Y)
 Q:+Y'>0
 S ACRAPDA=+Y ;CHANGED TO SYS DEFAULTS AP IEN
 ;
 D NXTSCH(ACRFYDA,ACRSDFY,ACRAPDA,ACRAP,.ACRSNO,.ACRQUIT)
 Q
AP(Y) ;----- SELECT ACCOUNTING POINT
 ;
 N DIC,DTOUT,DUOUT,X
 S DIC="^AUTTACPT("
 S DIC(0)="AEMQZ"
 S DIC("A")="Which ACCOUNTING POINT: "
 I $P($G(^ACRSYS(1,"DT1")),U,13) S DIC("B")=$P($G(^("DT1")),U,13)
 D ^DIC
 Q
SCHFY(ACRFY,Y)     ;
 ;----- LOOKUP/ADD FISCAL YEAR IN SCHEDULE NUMBER SUBFILE OF FMS SYSTEM 
 ;      DEFAULTS FILE
 ;
 N DA,DIC,DLAYGO,X
 S Y=$O(^ACRSYS(1,50,"B",ACRFY,0))
 Q:+Y>0
 S DA(1)=1
 S DIC="^ACRSYS("_DA(1)_",50,"
 S DIC(0)="L"
 S DIC("P")=$P(^DD(9002199.2,5001,0),U,2)
 S DLAYGO=9002199.2
 S X=ACRFY
 K DD,DO
 D FILE^DICN
 Q
SCHAP(ACRFYDA,ACRAPDA,Y)     ;
 ;----- LOOKUP/ADD ACCOUNTING POINT IN SCHEDULE NUMBER SUBFILE OF FISCAL
 ;      YEAR SUBFILE OF FMS SYSTEM DEFAULTS FILE
 ;
 N DA,DIC,DLAYGO,X
 S Y=$O(^ACRSYS(1,50,ACRFYDA,1,"B",ACRAPDA,0))
 Q:+Y>0
 S DA(2)=1
 S DA(1)=ACRFYDA
 S DIC="^ACRSYS("_DA(2)_",50,"_DA(1)_",1,"
 S DIC(0)="L"
 S DIC("P")=$P(^DD(9002199.251,1,0),U,2)
 S DLAYGO=9002199.251
 S DIC("DR")="1////3000"
 S X=ACRAPDA
 K DD,DO
 D FILE^DICN
 Q
NXTSCH(ACRFYDA,ACRSDFY,ACRAPDA,ACRAP,ACRSNO,ACRQUIT)       ;
 ;----- GETS/UPDATES NEXT SCHEDULE NUMBER
 ;
 N ACRFY,DIE,DIR,DR,X,Y
 L +^ACRSYS(1,50,ACRSDFY,1,ACRAPDA,0):4
 S ACRFY=$P($G(^ACRSYS(1,50,ACRSDFY,0)),U)
 S ACRSNO=$P($G(^ACRSYS(1,50,ACRSDFY,1,ACRAPDA,0)),U,2)
 F  S ACRSNO=ACRSNO+1 Q:'$D(^AFSLAFP("M",ACRFY_ACRAP_ACRSNO,ACRFYDA))
 S ACRSNO(1)=ACRFY_ACRAP_ACRSNO
 W !!,"The next SCHEDULE NUMBER will be ",@ACRON,ACRSNO(1),@ACROF
 S DIR(0)="YO"
 S DIR("A")="Is this correct"
 S DIR("B")="NO"
 D ^DIR
 I 'Y K ACRSNO S ACRQUIT="" L -^ACRSYS(1,50,ACRSDFY,1,ACRAPDA,0) Q
 S DA(2)=1
 S DA(1)=ACRSDFY
 S DA=ACRAPDA
 S DIE="^ACRSYS("_DA(2)_",50,"_DA(1)_",1,"
 S DR="1////"_+ACRSNO
 D ^DIE
 L -^ACRSYS(1,50,ACRSDFY,1,ACRAPDA,0)
 Q