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

ACRFRCA.m

Go to the documentation of this file.
ACRFRCA ;IHS/OIRM/DSD/THL,AEF - REQUEST CONTROLLER AUDIT REPORTING; [ 11/01/2001   9:44 AM ]
 ;;2.1;ADMIN RESOURCE MGT SYSTEM;;NOV 05, 2001
 ;;UTILITY TO PRINT REQUEST SIGNATURE AUDIT REPORT
EN F  D EN1 Q:$D(ACRQUIT)!$D(ACROUT)
EXIT K ACR,ACRDOCDA,ACRAPDA,ACRQUIT,ACROUT,ACRRTN,ACRBEGIN,ACRBEG,ACREND,ACRAP0,ACRDOC,ACRREF,ACRREFDA,ACRDATE,ACRLIST,ACRRCODE,ACRRREF,ACRREQST,ACRDOC2
 K ^TMP("ACRRCA",$J)
 Q
EN1 D HEAD
 W !!,"Select range of dates for documents to include"
 W !,"on the FINAL SIGNATURE AUDIT REPORT:"
 W !
 D DATES^ACRFDATE
 Q:$D(ACRQUIT)!$D(ACROUT)
 I '$G(ACRBEGIN) S ACRQUIT="" Q
 D LIST
 Q:$D(ACRQUIT)!$D(ACROUT)
 D ZIS
 Q
ZIS ;
 S (ZTRTN,ACRRTN)="PRINT^ACRFRCA",ZTDESC="FINAL SIGNATURE AUDIT REPORT",ZTDTH=$H
 D ^ACRFZIS
 Q
PRINT ;EP;TO PRINT AUDIT REPORT
 K ^TMP("ACRRCA",$J)
 D:ACRLIST="LIST" PHEAD
 S ACRBEG=ACRBEGIN-.001,ACREND=ACREND+.999999
 F  S ACRBEG=$O(^ACRAPVS("F",ACRBEG)) Q:'ACRBEG!(ACRBEG>ACREND)!$D(ACRQUIT)!$D(ACROUT)  D
 .S ACRAPDA=0
 .F  S ACRAPDA=$O(^ACRAPVS("F",ACRBEG,ACRAPDA)) Q:'ACRAPDA!(ACRBEG>ACREND)!$D(ACRQUIT)!$D(ACROUT)  I $P($G(^ACRAPVS(ACRAPDA,"DT")),U,5)="Y" S ACRAP0=^(0),ACRDATE=$P($P(^("DT"),U,4),".") D:ACRDATE
 ..Q:'$D(^ACRDOC(+ACRAP0,0))
 ..S ACRREFDA=$P(ACRAP0,U,6)
 ..I ACRREFDA S ACRREF=$P(^AUTTDOCR(ACRREFDA,0),U)
 ..E  S ACRREF=999
 ..S ACRDOC=$S(ACRREF'=103&(ACRREF'=349)&(ACRREF'=326)&(ACRREF'=210):$P(^ACRDOC(+ACRAP0,0),U),$P(^ACRDOC(+ACRAP0,0),U,2)]"":$P(^(0),U,2),1:$P(^ACRDOC(+ACRAP0,0),U))
 ..S ^TMP("ACRRCA",$J,ACRDATE,ACRREF,ACRDOC,ACRAPDA)=+ACRAP0
 S ACRDATE=0
 F  S ACRDATE=$O(^TMP("ACRRCA",$J,ACRDATE)) Q:'ACRDATE!$D(ACRQUIT)!$D(ACROUT)  D
 .S ACRRREF=0
 .F  S ACRRREF=$O(^TMP("ACRRCA",$J,ACRDATE,ACRRREF)) Q:'ACRRREF!$D(ACRQUIT)!$D(ACROUT)  D
 ..I ACRRCODE'="ALL",ACRRCODE'=ACRRREF Q
 ..W:ACRLIST="LIST" !!,"REFERENCE CODE: ",ACRRREF
 ..S ACRDOC2=""
 ..F  S ACRDOC2=$O(^TMP("ACRRCA",$J,ACRDATE,ACRRREF,ACRDOC2)) Q:ACRDOC2=""!$D(ACRQUIT)!$D(ACROUT)  D
 ...S ACRAPDA=0
 ...F  S ACRAPDA=$O(^TMP("ACRRCA",$J,ACRDATE,ACRRREF,ACRDOC2,ACRAPDA)) Q:'ACRAPDA!$D(ACRQUIT)!$D(ACROUT)  I $P($G(^ACRAPVS(ACRAPDA,"DT")),U,5)="Y" D
 ....S D0=$S(ACRLIST="LIST":ACRAPDA,1:+$G(^ACRAPVS(ACRAPDA,0)))
 ....I ACRLIST="DOCUMENTS" S ACRREQST="",ACRREFX=ACRRREF,ACRDOCDA=D0 D ^ACRFQ Q
 ....I ACRLIST="LIST" D ^ACRPRCA
 ....I ACRLIST["^DHR" D
 .....S ACRDOCDA=+^ACRAPVS(ACRAPDA,0)
 .....Q:$E(^ACROBL(ACRDOCDA,"APV"))'="A"
 .....D SETDOC^ACRFEA1
 .....S (ACRREF,ACRREFX)=ACRRREF
 .....N ACRRCODE
 .....D ^ACRFDHR
 .....W !!,"NEW DHR CREATED."
 ....I $G(IOSL)-5<$Y D PAUSE^ACRFWARN,PHEAD:'$D(ACRQUIT)&'$D(ACROUT)
 I ACRLIST="LIST",$E($G(IOST),1,2)="C-" W !,"END OF REPORT..." D PAUSE^ACRFWARN
 K ACRQUIT
 Q
PHEAD ;
 D HEAD,H1
 W !!,"DOCUMENT NO."
 W ?17,"STATUS"
 W ?26,"NAME"
 W ?48,"DATE"
 W ?58,"TYPE OF APPROVAL"
 W !,"---------------  -------  --------------------  --------  -----------------"
 Q
 W @IOF
 W !?20,"****************************"
 W !?20,"FINAL SIGNATURE AUDIT REPORT"
 W !?20,"****************************"
 Q
H1 S Y=DT
 X ^DD("DD")
 W !?20,"REPORT DATE........: ",Y
 S Y=ACRBEGIN
 X ^DD("DD")
 W !?20,"SIGNATURES STARTING: ",Y
 S Y=ACREND
 X ^DD("DD")
 W !?20,"SIGNATURES ENDING..: ",Y
 Q
LIST ;DETERMINE IF LIST OF DOCUMENTS OR ALL DOCUMENTS SHOULD BE PRINTED
 S DIR(0)="SO^1:Print List of Signed Documents;2:Print a copy of each Signed Document"
 S DIR("A")="Which print option"
 S DIR("B")=1
 W !
 D DIR^ACRFDIC
 I $G(Y)'=1&($G(Y)'=2) S ACRQUIT="" Q
 S ACRLIST=$S(Y=1:"LIST",1:"DOCUMENTS")
 S DIR(0)="SO^1:Print "_ACRLIST_" for ALL Reference Codes;2:Print "_ACRLIST_" for one Reference code only"
 S DIR("B")=1
 W !
 D DIR^ACRFDIC
 I $G(Y)'=1&($G(Y)'=2) S ACRQUIT="" Q
 S ACRRCODE=$S(Y=1:"ALL",1:"")
 I $D(ACRDHRZ) S ACRLIST=ACRLIST_"^DHR"
 Q:ACRRCODE="ALL"
 S DIR(0)="SO^116:REQUISITION;103:PURCHASE ORDER;349:CONTRACT;326:TRIBAL CONTRACT;210:FEDSTRIP/SUPPLY CENTER ORDER;130:TRAVEL ORDER;600:TRAVEL VOUCHER;148:TRAINING REQUEST"
 S DIR("A")="Which REFERENCE CODE"
 W !
 D DIR^ACRFDIC
 I $G(Y)'?3N S ACRQUIT="" Q
 S ACRRCODE=Y
 Q