ACRFDTP2 ;IHS/OIRM/DSD/THL,AEF - SET VARIABLES AND DISPLAY FINANCIAL DATA-ROUTINE 2; [ 11/01/2001 9:44 AM ]
;;2.1;ADMIN RESOURCE MGT SYSTEM;;NOV 05, 2001
;;CONTINUATION OF ACRFDTP
;;SET VARIABLES AND DISPLAY FINANCIAL DATA
EN ;EP;
Q:$D(ACRTRN)
S ACRFDNY=ACRY
S (ACRFD,ACRDISDA,ACRFDNDA)=DA
S ACRFDX=@ACRGREF@(DA,0)
S ACRFTOT=$P(ACRFDX,U,10)
S ACRFDX=$P(ACRFDX,U)
D TOT^ACRFDTP5
;;ACRFD=DFN OF THE ENTRY
;;ACRDISDA "
;;ACRFDNDA "
;;ACRFDX=TOTAL IN THE DISTRIBUTION
;;ACRGREF=GLOBAL NODE OF FUNDS SELECTED
;;ACRFTOT=TOTAL DISTRIBUTED
D AMEND^ACRFDTP5
S ACRFDNAM=ACRFDX
S ACRFDNDD=ACRFDX-ACRFTOT
;;ACRFDNAM=TOTAL IN THE DISTRIBUTION
;;ACRDNDD=UNDISTRIBUTED FUNDS
S ACRFDNPD=$P($S(ACRFDX>0:ACRFTOT/ACRFDX*100,ACRFTOT>0:100,1:0),".")
S:ACRFDNPD<0 ACRFDNPD=0
S ACRFDNPD=ACRFDNPD_"%"
;;ACRFDNPD=PERCENT OF DISTRIBUTED
S ACRFRM=$P($S(ACRFDX>0:((ACRFDX-ACRFTOT)/ACRFDX)*100,ACRFDX>0:100,1:0),".")
S:ACRFRM<0 ACRFRM=0
S ACRFRM=ACRFRM_"%"
;;ACRFRM=PERCENT OF REMAINING
S ACRFDNDT=$G(@ACRGREF@(DA,"DT"))
;;ACRFDNDT=VARIALBE CONTAINING ADDITIONAL INFO ON THE DISTRIBUTION
S ACRFDNFY=$S($P(ACRFDNDT,U)]"":$P(ACRFDNDT,U),1:"")
S ACRFDNQ=$S($P(ACRFDNDT,U,2)]"":$P(ACRFDNDT,U,2),1:"")
S ACRFDNRC=$S($P(ACRFDNDT,U,3)]"":$P(ACRFDNDT,U,3),1:"")
;;ACRFDNFY=FISCAL YEAR
;;ACRFDNQ=QUARTER
;;ACRFDNRC=RECURRING OR NON-RECURRING
S:ACRFDNRC]"" ACRFDNRC=$S($E(ACRFDNRC)="R":"RECURRING",1:"NON-RECRNG")
S ACRAPPDA=$S($P(ACRFDNDT,U,4)]"":$P(ACRFDNDT,U,4),1:"")
;;ACRAPPDA=DFN OF THE APPROPRIATION
S:ACRAPPDA]"" ACRFDNAP=$P(^AUTTPRO(ACRAPPDA,0),U)
;;ACRFDNAP=APPROPRIATION NUMBER
I ACRENTR1'["APP" D I 1
.S ACRALWDA=$S($P(ACRFDNDT,U,5)]"":$P(ACRFDNDT,U,5),1:"")
.S:ACRALWDA ACRFDNAL=$P(^AUTTALLW(ACRALWDA,0),U)
E S ACRFDNAL=""
;;ACRALWDA=DFN OF THE ALLOWANCE
;;ACRFDNAL=ALLOWANCE NUMBER
I ACRENTR1'["APP"&(ACRENTR1'["ALW") D I 1
.S ACRSSADA=$S($P(ACRFDNDT,U,8)]"":$P(ACRFDNDT,U,8),1:"")
.S:ACRSSADA ACRFDNSA=$P(^AUTTSSA(ACRSSADA,0),U)
E S ACRFDNSA=""
;;ACRSSADA=DFN OF THE SUB-SUB-ACTIVITY
;;ACRFDNSA=SUB-SUB-ACTIVITY
I ACRENTR1'["APP"&(ACRENTR1'["ALW") D I 1
.S ACRFDNCA=$S($P(ACRFDNDT,U,9)]"":$P(ACRFDNDT,U,9),1:"")
.I ACRFDNCA D
..S ACRFDNCA=$P(^AUTTCAN(ACRFDNCA,0),U)
..S ACRLCODE=$E(ACRFDNCA,4,5)
E S ACRFDNCA=""
;;ACRFDNCA=CAN NUMBER
I $D(@ACRGREF@(DA,"BA")) S ACRFDNAC=@ACRGREF@(DA,"BA")
E S ACRFDNAC="0^0^0"
;;ACRFDNAC=VARIABLE CONTAINS SUMMARY OF FUNDS BALANCE
S ACRFDNRQ=$S($P(ACRFDNAC,U,2)]"":$P(ACRFDNAC,U,2),1:0)
;;ACRFDNRQ=TOTAL REQUESTED
S ACRFDNSP=$S($P(ACRFDNAC,U,3)]"":$P(ACRFDNAC,U,3),1:0)
;;ACRFDNSP=TOTAL SPENT
S ACRFDNOB=$S($P(ACRFDNAC,U,5)]"":$P(ACRFDNAC,U,5),1:0)
;;ACRFDNOB=TOTAL OBLIGATED
S ACRFDNBA=ACRFDX-ACRFDNSP
S ACRFDNUR=ACRFDX-ACRFDNRQ
S ACRFDNUO=ACRFDX-ACRFDNOB
;;ACRFDNBA=TOTAL IN ACCOUNT-TOTAL SPENT
;;ACRFDNUR=TOTAL IN ACCOUNT-TOTAL UNREQUESTED
;;ACRFDNUO=TOTAL IN ACCOUNT-TOTAL OBLIGATED
D EOY^ACRFEOY
S ACRYRM=ACRYRM_"%"
;;ACRYRM=PERCENT OF CURRENT FISCAL YEAR REMAINING
Q
SUBHEAD ;EP;TO DISPLAY FINANCIAL DATA
I $D(ACRDISDA) D Q
.S DA=ACRDISDA
.N ACRGREF,ACRY
.D SET
.D EN
.D SUBHEAD1
SUBHEAD1 I $D(ACRNODIS) K ACRNODIS Q
;;ACRNODIS CONTROLS DISPLAY OR NO DISPLAY OF DISTRIBUTION
W !!?10,"Selected ",ACRFDNY
W ?$X+3,"(Number ",@ACRON,ACRFDNDA,@ACROF,")"
I $D(ACRFD0),$P(ACRFD0,U,12)]"" W ?$X+2,$P(ACRFD0,U,12)
SUBSET ;EP;
S ACRFDNQT=$S(ACRFDNQ=1:" FIRST",ACRFDNQ=2:" SECOND",ACRFDNQ=3:" THIRD",1:" FOURTH")
;;ACRFDQT=FISCAL YEAR QUARTER
;;THE NEXT SET OF VARIABLES (ACR0-ACR17) ARE USED FOR DISPLAY OF
;;DISTRIBUTION
S ACR0="!,""ALLOWANCE:"",@ACRON,$J($FN(ACRFDX,""P"",0),11),@ACROF"
S ACR14="!,""% UNCOMTD:"",@ACRON,$J(ACRFRM,11),@ACROF"
S ACR141="?$X+1,""% DSTBD:"",@ACRON,$J(ACRFDNPD,11),@ACROF"
S ACR15="?$X+1,""%FY RMG:"",@ACRON,$J(ACRYRM,11),@ACROF"
S ACR1="?$X+1,""DISTRBD:"",@ACRON,$J($FN(ACRFTOT,""P"",0),11),@ACROF"
S ACR2="!,""COMMITTED:"",@ACRON,$J($FN(ACRFDNRQ,""P"",0),11),@ACROF"
S ACR16="?$X+1,""OBLGATD:"",@ACRON,$J($FN(ACRFDNOB,""P"",0),11),@ACROF"
S ACR3="?$X+1,"" SPENT:"",@ACRON,$J($FN(ACRFDNSP,""P"",0),11),@ACROF"
S ACR4="?$X+1,""UNDSTRD:"",@ACRON,$J($FN(ACRFDNDD,""P"",0),11),@ACROF"
S ACR5="!,""UNCOMMTTD:"",@ACRON,$J($FN(ACRFDNUR,""P"",0),11),@ACROF"
S ACR17="?$X+1,""UNOBLTD:"",@ACRON,$J($FN(ACRFDNUO,""P"",0),11),@ACROF"
S ACR6="?$X+1,""UNSPENT:"",@ACRON,$J($FN(ACRFDNBA,""P"",0),11),@ACROF"
S ACR8="!?2,""QUARTER:"",@ACRON,$J(ACRFDNQT,11),@ACROF"
S ACR9="?$X+1,$J(""FY:"",8),@ACRON,$J(ACRFDNFY,11),@ACROF"
S ACR10="?$X+1,$J(""RECURRG:"",8),@ACRON,$J(ACRFDNRC,11),@ACROF"
I $G(ACRFDNAP)]"" S ACR11="!,""APPROP NO:"",@ACRON,$J(ACRFDNAP,11),@ACROF"
E S ACR11="!?$X"
I $G(ACRFDNAL)]"" S ACR12="?$X+1,$J(""ALLOWNC:"",8),@ACRON,$J(ACRFDNAL,11),@ACROF"
E S ACR12="?$X"
I $G(ACRFDNSA)]"" S ACR13="?$X+1,$J(""SUB-SUB:"",8),@ACRON,$J(ACRFDNSA,11),@ACROF"
E S ACR13="?$X"
I '$D(ACRDISDX) F ACRI=ACR0,ACR1,ACR4,ACR14,ACR141,ACR15,ACR2,ACR16,ACR3,ACR5,ACR17,ACR6,ACR11,ACR12,ACR13 W @ACRI
Q
SET S ACRGREF=$P($P(ACRDATA1,";;",3),"(")
S (ACRY,ACRTYPS)=$P(ACRDATA1,";;",2)
;ACRGREF GLOBAL NODE OF FUNDS SELECTED
Q
ACRFDTP2 ;IHS/OIRM/DSD/THL,AEF - SET VARIABLES AND DISPLAY FINANCIAL DATA-ROUTINE 2; [ 11/01/2001 9:44 AM ]
+1 ;;2.1;ADMIN RESOURCE MGT SYSTEM;;NOV 05, 2001
+2 ;;CONTINUATION OF ACRFDTP
+3 ;;SET VARIABLES AND DISPLAY FINANCIAL DATA
EN ;EP;
+1 IF $DATA(ACRTRN)
QUIT
+2 SET ACRFDNY=ACRY
+3 SET (ACRFD,ACRDISDA,ACRFDNDA)=DA
+4 SET ACRFDX=@ACRGREF@(DA,0)
+5 SET ACRFTOT=$PIECE(ACRFDX,U,10)
+6 SET ACRFDX=$PIECE(ACRFDX,U)
+7 DO TOT^ACRFDTP5
+8 ;;ACRFD=DFN OF THE ENTRY
+9 ;;ACRDISDA "
+10 ;;ACRFDNDA "
+11 ;;ACRFDX=TOTAL IN THE DISTRIBUTION
+12 ;;ACRGREF=GLOBAL NODE OF FUNDS SELECTED
+13 ;;ACRFTOT=TOTAL DISTRIBUTED
+14 DO AMEND^ACRFDTP5
+15 SET ACRFDNAM=ACRFDX
+16 SET ACRFDNDD=ACRFDX-ACRFTOT
+17 ;;ACRFDNAM=TOTAL IN THE DISTRIBUTION
+18 ;;ACRDNDD=UNDISTRIBUTED FUNDS
+19 SET ACRFDNPD=$PIECE($SELECT(ACRFDX>0:ACRFTOT/ACRFDX*100,ACRFTOT>0:100,1:0),".")
+20 IF ACRFDNPD<0
SET ACRFDNPD=0
+21 SET ACRFDNPD=ACRFDNPD_"%"
+22 ;;ACRFDNPD=PERCENT OF DISTRIBUTED
+23 SET ACRFRM=$PIECE($SELECT(ACRFDX>0:((ACRFDX-ACRFTOT)/ACRFDX)*100,ACRFDX>0:100,1:0),".")
+24 IF ACRFRM<0
SET ACRFRM=0
+25 SET ACRFRM=ACRFRM_"%"
+26 ;;ACRFRM=PERCENT OF REMAINING
+27 SET ACRFDNDT=$GET(@ACRGREF@(DA,"DT"))
+28 ;;ACRFDNDT=VARIALBE CONTAINING ADDITIONAL INFO ON THE DISTRIBUTION
+29 SET ACRFDNFY=$SELECT($PIECE(ACRFDNDT,U)]"":$PIECE(ACRFDNDT,U),1:"")
+30 SET ACRFDNQ=$SELECT($PIECE(ACRFDNDT,U,2)]"":$PIECE(ACRFDNDT,U,2),1:"")
+31 SET ACRFDNRC=$SELECT($PIECE(ACRFDNDT,U,3)]"":$PIECE(ACRFDNDT,U,3),1:"")
+32 ;;ACRFDNFY=FISCAL YEAR
+33 ;;ACRFDNQ=QUARTER
+34 ;;ACRFDNRC=RECURRING OR NON-RECURRING
+35 IF ACRFDNRC]""
SET ACRFDNRC=$SELECT($EXTRACT(ACRFDNRC)="R":"RECURRING",1:"NON-RECRNG")
+36 SET ACRAPPDA=$SELECT($PIECE(ACRFDNDT,U,4)]"":$PIECE(ACRFDNDT,U,4),1:"")
+37 ;;ACRAPPDA=DFN OF THE APPROPRIATION
+38 IF ACRAPPDA]""
SET ACRFDNAP=$PIECE(^AUTTPRO(ACRAPPDA,0),U)
+39 ;;ACRFDNAP=APPROPRIATION NUMBER
+40 IF ACRENTR1'["APP"
Begin DoDot:1
+41 SET ACRALWDA=$SELECT($PIECE(ACRFDNDT,U,5)]"":$PIECE(ACRFDNDT,U,5),1:"")
+42 IF ACRALWDA
SET ACRFDNAL=$PIECE(^AUTTALLW(ACRALWDA,0),U)
End DoDot:1
IF 1
+43 IF '$TEST
SET ACRFDNAL=""
+44 ;;ACRALWDA=DFN OF THE ALLOWANCE
+45 ;;ACRFDNAL=ALLOWANCE NUMBER
+46 IF ACRENTR1'["APP"&(ACRENTR1'["ALW")
Begin DoDot:1
+47 SET ACRSSADA=$SELECT($PIECE(ACRFDNDT,U,8)]"":$PIECE(ACRFDNDT,U,8),1:"")
+48 IF ACRSSADA
SET ACRFDNSA=$PIECE(^AUTTSSA(ACRSSADA,0),U)
End DoDot:1
IF 1
+49 IF '$TEST
SET ACRFDNSA=""
+50 ;;ACRSSADA=DFN OF THE SUB-SUB-ACTIVITY
+51 ;;ACRFDNSA=SUB-SUB-ACTIVITY
+52 IF ACRENTR1'["APP"&(ACRENTR1'["ALW")
Begin DoDot:1
+53 SET ACRFDNCA=$SELECT($PIECE(ACRFDNDT,U,9)]"":$PIECE(ACRFDNDT,U,9),1:"")
+54 IF ACRFDNCA
Begin DoDot:2
+55 SET ACRFDNCA=$PIECE(^AUTTCAN(ACRFDNCA,0),U)
+56 SET ACRLCODE=$EXTRACT(ACRFDNCA,4,5)
End DoDot:2
End DoDot:1
IF 1
+57 IF '$TEST
SET ACRFDNCA=""
+58 ;;ACRFDNCA=CAN NUMBER
+59 IF $DATA(@ACRGREF@(DA,"BA"))
SET ACRFDNAC=@ACRGREF@(DA,"BA")
+60 IF '$TEST
SET ACRFDNAC="0^0^0"
+61 ;;ACRFDNAC=VARIABLE CONTAINS SUMMARY OF FUNDS BALANCE
+62 SET ACRFDNRQ=$SELECT($PIECE(ACRFDNAC,U,2)]"":$PIECE(ACRFDNAC,U,2),1:0)
+63 ;;ACRFDNRQ=TOTAL REQUESTED
+64 SET ACRFDNSP=$SELECT($PIECE(ACRFDNAC,U,3)]"":$PIECE(ACRFDNAC,U,3),1:0)
+65 ;;ACRFDNSP=TOTAL SPENT
+66 SET ACRFDNOB=$SELECT($PIECE(ACRFDNAC,U,5)]"":$PIECE(ACRFDNAC,U,5),1:0)
+67 ;;ACRFDNOB=TOTAL OBLIGATED
+68 SET ACRFDNBA=ACRFDX-ACRFDNSP
+69 SET ACRFDNUR=ACRFDX-ACRFDNRQ
+70 SET ACRFDNUO=ACRFDX-ACRFDNOB
+71 ;;ACRFDNBA=TOTAL IN ACCOUNT-TOTAL SPENT
+72 ;;ACRFDNUR=TOTAL IN ACCOUNT-TOTAL UNREQUESTED
+73 ;;ACRFDNUO=TOTAL IN ACCOUNT-TOTAL OBLIGATED
+74 DO EOY^ACRFEOY
+75 SET ACRYRM=ACRYRM_"%"
+76 ;;ACRYRM=PERCENT OF CURRENT FISCAL YEAR REMAINING
+77 QUIT
SUBHEAD ;EP;TO DISPLAY FINANCIAL DATA
+1 IF $DATA(ACRDISDA)
Begin DoDot:1
+2 SET DA=ACRDISDA
+3 NEW ACRGREF,ACRY
+4 DO SET
+5 DO EN
+6 DO SUBHEAD1
End DoDot:1
QUIT
SUBHEAD1 IF $DATA(ACRNODIS)
KILL ACRNODIS
QUIT
+1 ;;ACRNODIS CONTROLS DISPLAY OR NO DISPLAY OF DISTRIBUTION
+2 WRITE !!?10,"Selected ",ACRFDNY
+3 WRITE ?$X+3,"(Number ",@ACRON,ACRFDNDA,@ACROF,")"
+4 IF $DATA(ACRFD0)
IF $PIECE(ACRFD0,U,12)]""
WRITE ?$X+2,$PIECE(ACRFD0,U,12)
SUBSET ;EP;
+1 SET ACRFDNQT=$SELECT(ACRFDNQ=1:" FIRST",ACRFDNQ=2:" SECOND",ACRFDNQ=3:" THIRD",1:" FOURTH")
+2 ;;ACRFDQT=FISCAL YEAR QUARTER
+3 ;;THE NEXT SET OF VARIABLES (ACR0-ACR17) ARE USED FOR DISPLAY OF
+4 ;;DISTRIBUTION
+5 SET ACR0="!,""ALLOWANCE:"",@ACRON,$J($FN(ACRFDX,""P"",0),11),@ACROF"
+6 SET ACR14="!,""% UNCOMTD:"",@ACRON,$J(ACRFRM,11),@ACROF"
+7 SET ACR141="?$X+1,""% DSTBD:"",@ACRON,$J(ACRFDNPD,11),@ACROF"
+8 SET ACR15="?$X+1,""%FY RMG:"",@ACRON,$J(ACRYRM,11),@ACROF"
+9 SET ACR1="?$X+1,""DISTRBD:"",@ACRON,$J($FN(ACRFTOT,""P"",0),11),@ACROF"
+10 SET ACR2="!,""COMMITTED:"",@ACRON,$J($FN(ACRFDNRQ,""P"",0),11),@ACROF"
+11 SET ACR16="?$X+1,""OBLGATD:"",@ACRON,$J($FN(ACRFDNOB,""P"",0),11),@ACROF"
+12 SET ACR3="?$X+1,"" SPENT:"",@ACRON,$J($FN(ACRFDNSP,""P"",0),11),@ACROF"
+13 SET ACR4="?$X+1,""UNDSTRD:"",@ACRON,$J($FN(ACRFDNDD,""P"",0),11),@ACROF"
+14 SET ACR5="!,""UNCOMMTTD:"",@ACRON,$J($FN(ACRFDNUR,""P"",0),11),@ACROF"
+15 SET ACR17="?$X+1,""UNOBLTD:"",@ACRON,$J($FN(ACRFDNUO,""P"",0),11),@ACROF"
+16 SET ACR6="?$X+1,""UNSPENT:"",@ACRON,$J($FN(ACRFDNBA,""P"",0),11),@ACROF"
+17 SET ACR8="!?2,""QUARTER:"",@ACRON,$J(ACRFDNQT,11),@ACROF"
+18 SET ACR9="?$X+1,$J(""FY:"",8),@ACRON,$J(ACRFDNFY,11),@ACROF"
+19 SET ACR10="?$X+1,$J(""RECURRG:"",8),@ACRON,$J(ACRFDNRC,11),@ACROF"
+20 IF $GET(ACRFDNAP)]""
SET ACR11="!,""APPROP NO:"",@ACRON,$J(ACRFDNAP,11),@ACROF"
+21 IF '$TEST
SET ACR11="!?$X"
+22 IF $GET(ACRFDNAL)]""
SET ACR12="?$X+1,$J(""ALLOWNC:"",8),@ACRON,$J(ACRFDNAL,11),@ACROF"
+23 IF '$TEST
SET ACR12="?$X"
+24 IF $GET(ACRFDNSA)]""
SET ACR13="?$X+1,$J(""SUB-SUB:"",8),@ACRON,$J(ACRFDNSA,11),@ACROF"
+25 IF '$TEST
SET ACR13="?$X"
+26 IF '$DATA(ACRDISDX)
FOR ACRI=ACR0,ACR1,ACR4,ACR14,ACR141,ACR15,ACR2,ACR16,ACR3,ACR5,ACR17,ACR6,ACR11,ACR12,ACR13
WRITE @ACRI
+27 QUIT
SET SET ACRGREF=$PIECE($PIECE(ACRDATA1,";;",3),"(")
+1 SET (ACRY,ACRTYPS)=$PIECE(ACRDATA1,";;",2)
+2 ;ACRGREF GLOBAL NODE OF FUNDS SELECTED
+3 QUIT