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

ACRFFDH1.m

Go to the documentation of this file.
ACRFFDH1 ;IHS/OIRM/DSD/AEF - continuation of ACRFFDH [ 10/27/2004   4:18 PM ]
 ;;2.1;ADMIN RESOURCE MGT SYSTEM;**13**;NOV 05, 2001
 ;;SPECIAL DIAGNOSTIC REPORTS
 ;
 ;
EN ;EP -- MAIN ENTRY POINT
 ;
 N ALLOW,APPROP,DATA,DEPT,OUT,PAGE,SUBALLOW,X,Y
 D PRT
 Q
PRT ;----- PRINT THE REPORT
 D P
 Q
P ;----- LOOP THROUGH APPROPRIATION SUBSCRIPT
 ;
 S APPROP=0 F  S APPROP=$O(^TMP("ACRFFDH",$J,1,APPROP)) Q:'APPROP  D ONE(APPROP) Q:$G(OUT)
 Q
ONE(X) ;EP -- PRINT STRUCTURE OF ONE APPROPRIATION
 ;
 ;      X  =  APPROPRIATION IEN
 ;
 D P^ACRFFDH(X)
 D HDR
 Q:$G(OUT)
 W !,"APPROPRIATION:",?16,"("_APPROP("D","IEN")_") ",?25,APPROP("D","NAME")
 D WRITE(APPROP("D","FY"),APPROP("D","CREATE FY"),APPROP("D","AMOUNT"))
 D A(APPROP("D","IEN"))
 Q
A(X) ;----- LOOP THROUGH ALLOWANCE SUBSCRIPT
 ;
 ;      X  =  APPROPRIATION IEN
 ;
 S APPROP=X
 S ALLOW=0 F  S ALLOW=$O(^TMP("ACRFFDH",$J,1,APPROP,2,ALLOW)) Q:'ALLOW  D  Q:$G(OUT)
 . D A^ACRFFDH(ALLOW)
 . I $Y>(IOSL-5) D HDR Q:$G(OUT)
 . W !,"  ALLOWANCE:",?16,"("_ALLOW("D","IEN")_") ",?25,ALLOW("D","NAME")
 . D WRITE(ALLOW("D","FY"),ALLOW("D","CREATE FY"),ALLOW("D","AMOUNT"))
 . D S(ALLOW("D","IEN"))
 Q
S(X) ;----- LOOP THROUGH SUB ALLOWANCE SUBSCRIPT
 ;
 ;      X  =  ALLOWANCE IEN
 ;
 S ALLOW=X
 S SUBALLOW=0 F  S SUBALLOW=$O(^TMP("ACRFFDH",$J,1,APPROP,2,ALLOW,3,SUBALLOW)) Q:'SUBALLOW  D  Q:$G(OUT)
 . D S^ACRFFDH(SUBALLOW)
 . I $Y>(IOSL-5) D HDR Q:$G(OUT)
 . W !,"    SUBALLOW:",?16,"("_SUBALLOW("D","IEN")_") ",?25,SUBALLOW("D","NAME")
 . D WRITE(SUBALLOW("D","FY"),SUBALLOW("D","CREATE FY"),SUBALLOW("D","AMOUNT"))
 . D D(SUBALLOW("D","IEN"))
 Q
D(X) ;----- LOOP THROUGH DEPARTMENT SUBSCRIPT
 ;
 ;      X  =  SUB-ALLOWANCE IEN
 ;
 S SUBALLOW=X
 S DEPT=0 F  S DEPT=$O(^TMP("ACRFFDH",$J,1,APPROP,2,ALLOW,3,SUBALLOW,4,DEPT)) Q:'DEPT  D  Q:$G(OUT)
 . D D^ACRFFDH(DEPT)
 . I $Y>(IOSL-5) D HDR Q:$G(OUT)
 . W !,"      DEPT:",?16,"("_DEPT("D","IEN")_") ",?25,DEPT("D","NAME")
 . D WRITE(DEPT("D","FY"),DEPT("D","CREATE FY"),DEPT("D","AMOUNT"))
 Q
WRITE(FY,NFY,AMT)  ;
 ;----- WRITES DATA
 ;
 W ?58,FY
 W ?63,$S(NFY=1:"Y",NFY=2:"N",1:"")
 W ?67,$J(AMT,12,2)
 Q
HDR ;----- WRITES HEADER
 ;
 N DIR
 I $E(IOST)="C",$G(PAGE) S DIR(0)="E" D ^DIR K DIR I 'Y S OUT=1 Q
 S PAGE=$G(PAGE)+1
 W @IOF
 W !,"DISTRIBUTION OF FUNDS HIERARCHICAL STRUCTURE"
 W ?49,$$NOW
 W "   PAGE ",PAGE
 W !,"APPROPRIATION: "_APPROP("D","NAME")
 W !!,?58,"FY",?62,"NXT",?73,"AMOUNT"
 W !
 Q
NOW() ;EP -- RETURNS CURRENT DATE/TIME
 ;
 N %,%H,%I,X
 D NOW^%DTC
 S Y=DT
 X ^DD("DD")
 Q Y_"  "_$E($P(%,".",2),1,2)_":"_$E($P(%,".",2),3,4)
 ;
QUE(ZTRTN,ZTSAVE,ZTDESC)     ;EP;
 Q                      ;ACR*2.1*13.02 IM13574
 ;----- QUEUEING CODE
 ;
 N %ZIS,IO,POP,ZTIO,ZTSK
 S %ZIS="Q" D ^%ZIS Q:POP
 I $D(IO("Q")) K IO("Q") S ZTIO=ION_";"_IOST_";"_IOM_";"_IOSL D ^%ZTLOAD I $G(ZTSK) W !,"Task #",$G(ZTSK)," queued"
 E  D @ZTRTN
 Q