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

ACRFDTP4.m

Go to the documentation of this file.
ACRFDTP4 ;IHS/OIRM/DSD/THL,AEF - ACRFDTP CON'T;  [ 07/20/2006   9:44 AM ]
 ;;2.1;ADMIN RESOURCE MGT SYSTEM;**20**;NOV 05, 2001
 ;;CONTINUATION OF ACRFDTP TO DISPLAY FINANCIAL DATA AND ACCOUNTS
DISP ;EP;
OBLAMT I '$D(^ACROBL(ACRFD,0))!'$D(^ACROBL(ACRFD,"DT")) D  Q
 .S (DA,ACRFD2)=ACRFD
 .S DIK="^ACROBL("
 .D DIK^ACRFDIC
 .S DA=ACRFD
 .S DIK="^ACRDOC("
 .D DIK^ACRFDIC
 .S ACRDA=0
 .F  S ACRDA=$O(^ACRSS("C",ACRFD,ACRDA)) Q:'ACRDA  D
 ..S DA=ACRDA
 ..S DIK="^ACRSS("
 ..D DIK^ACRFDIC
 .S ACRJ=ACRJ-1
 S ACRDISA=""
 I $D(^ACRAPVS("AB",ACRFD)) D
 .S ACR=0
 .F  S ACR=$O(^ACRAPVS("AB",ACRFD,ACR)) Q:'ACR  D
 ..I $D(^ACRAPVS(ACR,"DT")),$P(^("DT"),U)="D" S ACRDISA="D"
 I ACRDISA="",$E(^ACRDOC(ACRFD,"DT"),1,3)="1^0" S ACRDISA="*"
 S ACRFD2=$S($P(^ACRDOC(ACRFD,0),U,2)]""&($D(ACRPO)!$D(ACRPOA)):$P(^(0),U,2),1:$P(^(0),U))
 S ACRID=$E($P(^ACRDOC(ACRDOCDA,0),U,14),1,16)
 S ACR(ACRJ)=ACRFD_U_U_(ACRFD2)_U_ACRID_U_ACRDISA_U_U_$P($G(^ACRDOC(ACRFD,"REQ2")),U,6)
 Q
LOCBAMT N ACRFY
 S ACRFD0=$G(^ACRLOCB(ACRFD,0))
 S ACRFDT=$G(^ACRLOCB(ACRFD,"DT"))
 S ACRCANDA=$P(ACRFDT,U,9)
 S ACRFY=$P(ACRFDT,U)
 S ACRSSADA=$P(ACRFDT,U,8)
 S ACRALCDA=$P(ACRFD0,U,4)
 S ACRFD3=$S(ACRSSADA:$P(^AUTTSSA(ACRSSADA,0),U,4),1:"XX")
 S ACRFD2=$S(ACRCANDA:$P(^AUTTCAN(ACRCANDA,0),U),1:"<UNDEF>")
 S ACRFDX=$S($P(ACRFD0,U,5):$P(^AUTTPRG($P(ACRFD0,U,5),0),U)_" ("_$P(^(0),U,2)_")",1:"** NO DEPARTMENT LISTED **")
 S ACR(ACRJ)=ACRFD_U_ACRFD1_U_(ACRFD2)_U_U_ACRFDX_U_ACRCANDA_U_(ACRFD3)_U_$S(ACRFY]"":ACRFY,1:"**")
 Q
ALCAMT S ACRFD0=^ACRALC(ACRFD,0)
 S ACRFDT=^ACRALC(ACRFD,"DT")
 S ACRFY=$P(ACRFDT,U)
 S ACRFD2=$S($P(ACRFDT,U,5):$P(^AUTTALLW($P(ACRFDT,U,5),0),U),1:"XX")
 S ACRFDX=$E($P(ACRFD0,U,12),1,18)
 S ACRFD3=$S($P(ACRFDT,U,8):$P(^AUTTSSA($P(ACRFDT,U,8),0),U),1:"XX")
 S ACR(ACRJ)=ACRFD_U_ACRFD1_U_(ACRFD2)_U_(ACRFD3)_U_ACRFDX_U_$S(ACRFY]"":ACRFY,1:"**")
 Q
ALLAMT S ACRFDT=$G(^ACRALW(ACRFD,"DT"))
 S ACRFY=$P(ACRFDT,U)
 S ACRFDX=$E($P(^ACRALW(ACRFD,0),U,12),1,18)
 S ACRFD2=$S($P(ACRFDT,U,5):$P(^AUTTALLW($P(ACRFDT,U,5),0),U),1:"XXXXX")
 S ACRFD3=$S($P(ACRFDT,U,8):$P(^AUTTSSA($P(ACRFDT,U,8),0),U),1:"XX")
 S ACR(ACRJ)=ACRFD_U_ACRFD1_U_(ACRFD2)_U_(ACRFD3)_U_ACRFDX_U_$S(ACRFY]"":ACRFY,1:"**")
 Q
APPAMT S ACRFD2=$P(^AUTTPRO($P(^ACRAPP(ACRFD,0),U,2),0),U)
 S ACR(ACRJ)=ACRFD_U_ACRFD1_U_(ACRFD2)_"^^^"_$S($P(^ACRAPP(ACRFD,"DT"),U)]"":$P(^("DT"),U),1:"**")
 Q
EDIC ;EP;
 D:$G(ACRI)>9 CHOOSE Q:$D(ACRQUIT)!$D(ACROUT)
 K ACRXACT,ACRI
 S DIC=ACRDIC
 S DIC("A")=ACRDIC("A")
 S DIC(0)=ACRDIC(0)
 S DIC("DR")="",D=ACRD
 D DIC^ACRFDIC:ACRDIC(0)["M"
 D IX^ACRFDIC:ACRDIC(0)'["M"
 I $E(X)=U!(X="")!(Y<1) S (ACRQUIT,ACROUT)="" K ACRFD,ACRFDNA Q
 I ACRDIC(0)["N",$P(Y,U,3)'=1,X,+Y'=+X S Y=+X
 S (DA,ACRZDA,ACRFDNO)=+Y
 S ACRFDNA=Y(0,0)
 S ACRZY=Y
 Q:'$D(@(ACRDIC_DA_",0)"))
 S ACRFD0=@(ACRDIC_DA_",0)")
 I $P(Y,U,3)'=1 D ICHECK
 I $D(ACRQUIT) S (ACRQUIT,ACROUT)="" K ACRFD,ACRFDNA Q
 I $P(Y,U,3)=1,ACRDIC'["OBL" D
 .S X=DUZ
 .S DIC=ACRDIC_DA_",""SC"","
 .S DIC(0)="L"
 .S DA(1)=DA
 .S:'$D(@(DIC_"0)")) @(DIC_"0)")="^"_$S(ACRDIC["ACRAPP":9002185.01,ACRDIC["ACRALW":9002186.01,ACRDIC["ACRALC":9002187.04,1:9002188.04)_"P"
 .D FILE^ACRFDIC
 I ACRENTR1["LOCB" D  Q:$D(ACRQUIT)
 .S ACRAPP=$P(^ACRLOCB(DA,"DT"),U,4)
 .S ACRAPP=$P(^AUTTPRO(ACRAPP,0),U)
 .S:$E(ACRAPP,3)="X" ACRXACT=""
 .D LBCHK
 .Q:$D(ACRQUIT)
 .D CALC
 I $D(ACRSOF)!$D(ACRSOFT) S ACRQUIT="" Q
 F ACRI="APP","ALLAMT","ALCAMT" D:ACRENTRY[ACRI&($P(ACRZY,U,3)=1) EDIC1
 I ACRENTRY["OBLA" D  Q:$D(ACRQUIT)
 .S ACRCANDA=$P(^ACRLOCB(ACRZDA,"DT"),U,9)
 .S ACRPODA=$P($G(^ACRCAN(ACRCANDA,"DFLT1")),U,15)
 .S ACRADA=$P($G(^ACRPO(+ACRPODA,0)),U,19)
 .;I 'ACRPODA!'ACRADA D                 ; ACR*2.1*20.13  IM20924
 .I 'ACRPODA!'ACRADA D  Q               ; ACR*2.1*20.13  IM20924
 ..W !!,"The DEFAULT DATA including defining the PURCHASING OFFICE for this CAN"
 ..W !,"has not been completed."
 ..W !!,"Please report this to your ARMS Manager immediately."
 ..D PAUSE^ACRFWARN
 ..S (ACRQUIT,ACROUT)=""
 .D LBCHK
 D EN^ACRFDTP2
 S ACRDISP=""
 Q
SOF ;EP;FOR STATUS OF FUNDS
 D:'$D(ACRSOFX) DETAIL^ACRFSOF
 Q:$D(ACRQUIT)!$D(ACROUT)
 S:$D(ACRDTAIL) ZTSAVE("ACRDTAIL")=""
 S ACRRTN="^ACRFSOF"
 S ZTDESC="STATUS OF FUNDS REPORT"
 D ^ACRFZIS
 K ACRFDNO
 Q
EDIC1 S ACRFINSS=""
 S DA=ACRZDA
 S DIE=ACRDIE
 S DR=ACRDR_";2////0;3////0;800////N"
 D DIE^ACRFDIC
 S DA=ACRZDA
 Q
ICHECK ;INTEGRITY CHECK FOR FUNDS
 K ACR
 S X=@(ACRDIC_DA_",""DT"")")
 I ACRDIC["LOCB",$P(X,U)="" S ACR(Y)="FISCAL YEAR"
 I ACRDIC'["ACRAPP" D
 .F Y=3,4,5,8 I $P(X,U,Y)="" D
 ..S ACR(Y)=$S(Y=3:"RECUR/NON-RECUR",Y=4:"APPROPRIATION NO.",Y=5:"ALLOWANCE",1:"SUB-SUB-ACTIVITY")
 Q:'$D(ACR)#2
 W *7,*7
 W !!,"The entry you selected has the following missing data."
 W !
 S ACR=0
 F  S ACR=$O(ACR(ACR)) Q:'ACR  W !?10,ACR(ACR)
 W !!,"This entry cannot be used until missing data has been corrected."
 D PAUSE^ACRFWARN
 S ACRQUIT=""
 Q
CALC N ACR,X,I,ACRDT
 Q:ACRENTR1["LOCB"
 F I=4,21,9 S X(I)=0
 S ACR=0
 F  S ACR=$O(^ACRSS("F",ACRZDA,ACR)) Q:'ACR  D
 .I $D(^ACRSS(ACR,"DT")) S ACRDT=^("DT") D
 ..F I=4,21,9 S X(I)=X(I)+$P(ACRDT,U,I)
 F I=2,3,5 S $P(ACRFDNAC,U,I)=X($S(I=2:4,I=3:21,1:9))
 S DA=ACRZDA
 S DIE="^ACRLOCB("
 S DR="2////"_X(4)_";3////"_X(21)_";7////"_X(9)
 D DIE^ACRFDIC
 S DA=ACRZDA
 Q
CHOOSE ;EP;TO CHOOSE LOOKUP FORMAT
 S DIR(0)="SO^1:By ID NO.;2:By DEPARTMENT Name;3:By CAN NO."
 S:ACRDIC["ACRAPP" DIR(0)="SO^1:By ID NO.;2:Appropriation Number"
 S:ACRDIC["ACRAL" DIR(0)="SO^1:By ID NO.;2:Location Name;3:Allowance"
 S DIR("A")="Select Account by"
 S DIR("B")="By ID NO."
 D DIR^ACRFDIC
 Q:$D(ACRQUIT)!$D(ACROUT)
 I +Y<1 S ACRQUIT="" Q
 I Y=1 S:ACRDIC'["ACRAPP" ACRDIC(0)="AENQZ" S ACRDIC("A")="ID NO.: ",(ACRD,D)="B"
 I Y=2 D
 .S:ACRDIC'["ACRAPP" ACRDIC(0)="AEQZ"
 .S:ACRDIC'["ACRAPP" ACRDIC("A")="DEPARTMENT/LOCATION Name: "
 .S:ACRDIC["ACRAPP" ACRDIC("A")="Appropriation NO.: "
 .I ACRDIC["ACRAPP" S ACRD="C"
 .I ACRDIC["ACRALW" S ACRD="D"
 .I ACRDIC["ACRALC" S ACRD="C"
 .I ACRDIC["ACRLOCB" S ACRD="DEPT"
 I Y=3 D
 .S:ACRDIC'["ACRAPP" ACRDIC(0)="AEQZ"
 .S ACRDIC("A")="Allowance NO.: "
 .I ACRDIC["ACRALW" S ACRD="C"
 .I ACRDIC["ACRALC" S ACRD="E"
 .I ACRDIC["ACRLOCB" S ACRD="DCAN",ACRDIC("A")="CAN NO.: "
 W !
 Q
LBCHK ;CHECK DEPARTMENT ACCOUNT FOR REQUIRED DATA
 K ACRQUIT
 W !
 S ACRDT=$G(^ACRLOCB(ACRZDA,"DT"))
 I ACRDT="" W !,"Department Account information" S ACRQUIT=""
 I $P(ACRDT,U)="" W !,"Fiscal Year" S ACRQUIT=""
 I $P(ACRDT,U,4)="" W:$D(ACRQUIT) " and" W !,"Appropriation information" S ACRQUIT=""
 I $P(ACRDT,U,5)="" W:$D(ACRQUIT) " and" W !,"Allowance information" S ACRQUIT=""
 I $P(ACRDT,U,8)="" W:$D(ACRQUIT) " and" W !,"Sub-Sub-Activity information" S ACRQUIT=""
 I $P(ACRDT,U,9)="" W:$D(ACRQUIT) " and" W !,"Common Accounting Number" S ACRQUIT=""
 I $P(ACRDT,U,11)="" W:$D(ACRQUIT) " and" W !,"Location Code information" S ACRQUIT=""
 I $P(ACRDT,U,15)=""&($P($G(^ACRLOCB(ACRZDA,3)),U)="") W:$D(ACRQUIT) " and" W !,"Cost Center and/or Project Number information" S ACRQUIT=""
 I $D(ACRQUIT) D
 .W " MISSING in"
 .W !!,"Department Account ID NO. ",ACRZDA
 .W !,"(Sub-Allowance ID NO. ",$P(^ACRLOCB(ACRZDA,0),U,4)
 .D PAUSE^ACRFWARN
 .S (ACRQUIT,ACROUT)=""
 Q