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

ACRFDHR4.m

Go to the documentation of this file.
ACRFDHR4 ;IHS/OIRM/DSD/THL,AEF - DHR REPORTS;  [ 11/01/2001   9:44 AM ]
 ;;2.1;ADMIN RESOURCE MGT SYSTEM;;NOV 05, 2001
 ;;PRINT DHR REPORTS
 Q
ACCRUAL ;EP;TO LIST ACCRUAL DHR'S
 D AEXIT
 D A1 Q:$D(ACRQUIT)!$D(ACROUT)
AEXIT K ACRQUIT,ACROUT,ACRDC
 K ^TMP("ACRACCRU",$J)
 Q
A1 W !!,"List ACCRUAL DHR's created between:"
 D ^ACRFDATE
 I '$G(ACRBEGIN)!'$G(ACREND) D  Q
 .W !!,"Both the BEGINNING and ENDING dates are required for this inquiry."
 .D PAUSE^ACRFWARN
 S (ACRRTN,ZTRTN)="APRINT^ACRFDHR4"
 S ZTDESC="ACCRUAL DHR SUMMARY"
 D ZIS
 Q
ZIS ;SELECT PRINTER
 D ^ACRFZIS
 Q
APRINT ;EP;TO PRINT ACCRUAL DHR SUMMARY
 I $E(IOST,1,2)="C-" D
 .W !!,"Please stand by."
 .W !,"It could take me a while to find all the ACCRUAL DHR's."
 N X,Y
 S ACRDATE=ACRBEGIN
 F  S ACRDATE=$O(^ACRDHR("D",ACRDATE)) Q:'ACRDATE!(ACRDATE>ACREND)  D
 .S ACRDHRDA=0
 .F  S ACRDHRDA=$O(^ACRDHR("D",ACRDATE,ACRDHRDA)) Q:'ACRDHRDA  I $P($G(^ACRDHR(ACRDHRDA,1)),U,3)]"","081091"[$P(^(1),U,3) S X=^(1),Y=$G(^(10)) D
 ..Q:$P(X,U,7)=""
 ..S ACRSSA=$S($P(Y,U,2)="":"NOT STATED",1:$P(Y,U,2))
 ..S ^TMP("ACRACCRU",$J,ACRSSA,$P(X,U,7),ACRDHRDA)=""
 I '$D(^TMP("ACRACCRU",$J)) D  Q
 .W !!,"NO ACCRUAL DHR'S ON FILE FOR SPECIFIED TIME PERIOD"
 .D PAUSE^ACRFWARN
 D AHEAD
 N ACRSSA,ACRSSAX,ACRTOT,ACRTTOT,ACRDOC,ACRDHRDA
 S (ACRSSA,ACRSSAX,ACRTOT,ACRTTOT)=""
 F  S ACRSSA=$O(^TMP("ACRACCRU",$J,ACRSSA)) Q:ACRSSA=""!$D(ACRQUIT)  D
 .I ACRSSA'=ACRSSAX D
 ..I ACRTOT D ATOT
 ..W !!?10,"SUB-SUB-ACTIVITY: ",ACRSSA
 ..S ACRSSAX=ACRSSA
 .S ACRDOC=""
 .F  S ACRDOC=$O(^TMP("ACRACCRU",$J,ACRSSA,ACRDOC)) Q:ACRDOC=""!$D(ACRQUIT)  D
 ..S ACRDHRDA=0
 ..F  S ACRDHRDA=$O(^TMP("ACRACCRU",$J,ACRSSA,ACRDOC,ACRDHRDA)) Q:'ACRDHRDA!$D(ACRQUIT)  D AP1
 F ACRTOT=ACRTOT,ACRTTOT D ATOT
 D PAUSE^ACRFWARN
 Q
ATOT ;
 W !?37,"---------------"
 W !?37,$J($FN(ACRTOT,"P,",2),14)
 S ACRTOT=0
 Q
AP1 ;PRINT EACH HDR SUMMARY
 N ACRX,X
 S ACRX=$G(^ACRDHR(ACRDHRDA,1))
 Q:ACRX=""
 S X=$P(ACRX,U,2)
 W !,$E(X,4,7),$E(X,2,3),?7,$P(ACRX,U,7),?18,$P(ACRX,U,3),$P(ACRX,U,4),$P(ACRX,U,5),?24,$P(ACRX,U,12),?32,$P(ACRX,U,13),?37,$J($FN($P(ACRX,U,14)/100,"P,",2),14)
 S ACRTOT=ACRTOT+($P(ACRX,U,14)/100)
 S ACRTTOT=ACRTTOT+($P(ACRX,U,14)/100)
 I IOSL-4<$Y D PAUSE^ACRFWARN Q:$D(ACRQUIT)  D AHEAD
 Q
AHEAD ;PRINT REPORT HEADER
 W @IOF
 W !?10,"ACCRUAL DHR SUMMARY"
 W !?10,"FOR ACCRUALS FROM: "
 S Y=ACRBEGIN
 X ^DD("DD")
 W Y
 S ACRDC=$G(ACRDC)+1
 W ?55,"PAGE: ",ACRDC
 W !?10,"FOR ACCRUALS TO..: "
 S Y=ACREND
 X ^DD("DD")
 W Y
 W !?10,"REPORT DATE......: "
 S Y=DT
 X ^DD("DD")
 W Y
 W $$DASH^ACRFMENU
 W !,"EFFECT",?7,"DOCUMENT",?18,"TRANS",?32,"OBJ"
 W !,"DATE",?7,"NUMBER",?18,"CODE",?24,"CAN",?32,"CODE",?40,"AMOUNT"
 W $$DASH^ACRFMENU
 Q