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

ACRFDIS.m

Go to the documentation of this file.
ACRFDIS ;IHS/OIRM/DSD/THL,AEF - ENTER DISTRIBUTION OF DEPARTMENT ACCOUNT; [ 11/01/2001   9:44 AM ]
 ;;2.1;ADMIN RESOURCE MGT SYSTEM;;NOV 05, 2001
 ;;ROUTINE USED TO ENTER DISTRIBUTION OF DEPARTMENT ACCOUNT
EN N ACRI,ACRJ
 F  D EN1 Q:$D(ACRQUIT)!$D(ACROUT)
EXIT K ACR,ACRX,ACRLBDA,ACRALCDA,ACROBJ,ACROBJDA,ACRQUIT,ACRDA,ACRA,ACRMAX,ACRQUIT,ACRQUIT,ACRCANDA
 Q
EN1 D DISPLAY
 D ENTER
 Q
DISPLAY W @IOF
 D:$D(ACRDISP) SUBHEAD^ACRFDTP2
 W !
 K ACR,ACRX
 D HEAD
 D OCDIS
 S ACRJ=0
 F ACRI=1:1 D  Q:$D(ACRQUIT)!$D(ACROUT)
 .D LIST
 .D PAUSE:ACRI#10=0
 K ACRQUIT
 Q
LIST I '$D(ACRX(ACRI)) S ACRQUIT="" Q
 S ACRJ=ACRI
 D W
 Q:'$D(ACRX(ACRJ+1))
 S ACRJ=ACRI+10
 D W:$D(ACRX(ACRJ))
 Q
W I ACRJ=ACRI D
 .W !,ACRJ
 .W ?4
 I ACRJ'=ACRI D
 .W ?40,"| ",ACRJ
 .W ?46
 W $E($P(ACRX(ACRJ),U,5),1,4)
 W ?$X+1,$J($P($P(ACRX(ACRJ),U),"."),9)
 W ?$X+1,$J($P($P(ACRX(ACRJ),U,2),"."),7)
 W ?$X+1,$J($P($P(ACRX(ACRJ),U,4),"."),7)
 Q
OC2 S ACRA=$O(ACR(ACRX,0))
 F ACRI=1:1:4 S ACRI(ACRI)=$P(ACR(ACRX,ACRA),U,ACRI)
 Q
ENTER S DIR(0)="SO^1:Add DISTRIBUTION;2:Change DISTRIBUTION"
 S DIR("A")="Which one"
 D DIR^ACRFDIC
 Q:$D(ACRQUIT)!$D(ACROUT)
 N ACRY
 S ACRY=Y
 D:ACRY=1 NEW
 D:ACRY=2 MOD
 Q
NEW S DIC="^AUTTOBJC("
 S DIC(0)="AEMQZ"
 S DIC("A")="Which OBJECT CODE: "
 W !
 D DIC^ACRFDIC
 I $E(X)[U!(Y<1) S ACRQUIT="" Q
 S ACROBJDA=+Y,ACROBJ=Y(0,0)_" "
 I $D(ACR(ACROBJ)) D W1 Q
 S DIR(0)="YO"
 S DIR("A")="ADD a DISTRIBUTION for OBJECT CODE "_ACROBJ
 W !
 D DIR^ACRFDIC
 Q:Y'=1
 S X=0.00
 S DIC="^ACRFDIS("
 S DIC(0)="L"
 S DIC("DR")="1////0.00;2////0.00;3////0.00;.02////"_DT_";.09////"_ACRFDNFY_";.03////"_ACROBJDA_";.05////"_ACRALCDA_";.06////"_ACRCANDA_";.07////"_ACRSSADA_";.08////"_ACRALWDA_";.04////"_ACRLBDA
 D FILE^ACRFDIC
 S DA=+Y
 S DIE="^ACRFDIS("
 S DR=".01NEW DISTRIBUTION....: ;.02////"_DT
 W !!
 S ACR="!,""AMOUNT AVAILABLE....: "",@ACRON,$J($FN(ACRFDNDD,""P"",2),10),@ACROF"
 W @ACR
 D DIE^ACRFDIC
 Q
MOD S DIR(0)="NO^1:"_ACRMAX
 S DIR("A")="Which one"
 W !
 D DIR^ACRFDIC
 I $D(ACRQUIT)!$D(ACROUT) K ACRQUIT Q
 S ACRY=Y
 S ACRA=$P(ACRX(ACRY),U,3)
 S ACROBJ=$P(^AUTTOBJC($P(^ACRFDIS(ACRA,0),U,3),0),U)
 W !!?5,"CURRENT DISTRIBUTION FOR THIS OBJECT CODE FOR THIS DEPARTMENT ACCOUNT"
 W !?5,"----------------------------------------------------------------"
 W !?10,"OBJT"
 W !?10,"CLSS"
 W ?16,"DISTRIBTION"
 W !?10,"----"
 W ?16,"-----------"
 W !?10,ACROBJ
 W ?16,$J($P(^ACRFDIS(ACRA,0),U),11)
 S DA=ACRA
 S DIE="^ACRFDIS("
 S DR=".01NEW DISTRIBUTION...."
 S ACR="!,""AMOUNT AVAILABLE....: "",@ACRON,$J($FN(ACRFDNDD,""P"",2),10),@ACROF"
 W !!
 W @ACR
 D DIE^ACRFDIC
 Q
PAUSE S DIR(0)="YO"
 S DIR("A")="         List more OBJECT CODES"
 S DIR("B")="NO"
 W !
 D DIR^ACRFDIC
 I Y=1 D  Q
 .S ACRI=ACRI+10
 .D HEAD
 S ACRQUIT=""
 Q
OCDIS S ACRA=0
 F ACRJ=1:1 S ACRA=$O(^ACRFDIS("LB",ACRLBDA,ACRA)) Q:'ACRA  D OCDIS1
 S ACRMAX=ACRJ-1
 S ACRA=0
 F ACRJ=1:1 S ACRA=$O(ACR(ACRA)) Q:'ACRA  S ACRX(ACRJ)=ACR(ACRA)
 S ACRMAX=ACRJ-1
 Q
OCDIS1 S ACR=$P(^AUTTOBJC($P(^ACRFDIS(ACRA,0),U,3),0),U)_" "
 S:'$D(ACR(ACR)) ACR(ACR)="^^"_ACRA_"^^"_ACR
 D OCDIS2
 Q
OCDIS2 S $P(ACR(ACR),U)=$P(ACR(ACR),U)+$P(^ACRFDIS(ACRA,0),U)
 F ACRI=2,4 S $P(ACR(ACR),U,ACRI)=$P(ACR(ACR),U,ACRI)+$P($G(^ACRFDIS(ACRA,"BA")),U,ACRI)
 Q
 W ?11,"Y-T-D"
 W ?40,"|"
 W ?46,"OBJT"
 W ?53,"Y-T-D"
 W !,"NO."
 W ?4,"CLSS"
 W ?9,"DISTRIBTN"
 W ?19,"PENDNG"
 W ?27,"OBLGTED"
 W ?40,"| NO."
 W ?46,"CLSS"
 W ?51,"DISTRIBTN"
 W ?61,"PENDNG"
 W ?69,"OBLGTED"
 W !,"---"
 W ?4,"----"
 W ?9,"---------"
 W ?19,"-------"
 W ?27,"-------"
 W ?40,"| ---"
 W ?46,"----"
 W ?51,"---------"
 W ?61,"-------"
 W ?69,"-------"
 Q
W1 W !!,*7,"A distribution for this OBJECT CODE already exists."
 H 2
 Q