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

ACRFPSR.m

Go to the documentation of this file.
ACRFPSR ;IHS/OIRM/DSD/THL,AEF - PENDING SIGNATURE REPORT; [ 09/23/2005   9:44 AM ]
 ;;2.1;ADMIN RESOURCE MGT SYSTEM;**19**;NOV 05, 2001
 ;;ROUTINE TO PRINT PENDING SIGNATURE REPORT
 D EXIT,CHOICE,EXIT
 Q
EN ;EP;TO PRINT LIST OF ALL DOCUMENTS WHICH NEED TO BE SIGNED
 D EN1
EXIT K ^TMP("ACRPSR",$J),^TMP("ACRINDV",$J),ACRTIME,ACRDOCDA,ACR0,ACRDT,ACRPO,ACRIN,ACRINDV,ACRAPDA,ACRDUZ,ACRAPVT,ACRLBDA,ACRDOC,ACRLB,ACRPODA,ACRPRTR,ACRX,ACRTODAY,ACRAPV,ACRINDVZ,ACRDEPTZ,ACRPOZ,ACRQUIT,ACROUT,ACRALLZ
 Q
EN1 ;EP;CHECK ALL DOCUMENTS PENDING A SIGNATURE
 S Y=DT
 X ^DD("DD")
 S ACRTODAY=Y
 S X=DT
 D DW^%DTC
 Q:"SATSUN"[$E(X,1,3)
 S ACRAPVT=0
 F  S ACRAPVT=$O(^ACRAPVS("ANXT",ACRAPVT)) Q:'ACRAPVT!$D(ACRQUIT)  D
 .S ACRDUZ=0
 .F  S ACRDUZ=$O(^ACRAPVS("ANXT",ACRAPVT,ACRDUZ)) Q:'ACRDUZ!$D(ACRQUIT)  D
 ..S ACRAPDA=0
 ..F  S ACRAPDA=$O(^ACRAPVS("ANXT",ACRAPVT,ACRDUZ,ACRAPDA)) Q:'ACRAPDA!$D(ACRQUIT)  I $D(^ACRAPVS(ACRAPDA,0)),$D(^ACRAPVS(ACRAPDA,"DT")) D EN2
 D:$D(^TMP("ACRPSR",$J))&'$D(ACRINDVZ) EN3
 I $D(^TMP("ACRINDV",$J)),$D(ACRALLZ)!$D(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ACRID
 S:$D(ACRALLZ)!($G(ACRINDVZ)=ACRDUZ) ^TMP("ACRINDV",$J,ACRPO,ACRINDV,ACRDOC)=ACRIN_U_ACRAPV_U_ACRID
 Q
EN3 ;PRINT LIST OF DOCUMENTS PENDING GREATER THAN SPECIFIED # OF DAYS BY
 ;DEPARTMENT ACCOUNT
 S ACRPODA=$S($D(ACRPOZ):ACRPOZ-1,1:0),ACRX=1
 F  S ACRPODA=$O(^TMP("ACRPSR",$J,ACRPODA)) Q:$D(ACRQUIT)!'ACRPODA!($G(ACRPOZ)&(ACRPODA<$G(ACRPOZ)))  I $D(^ACRPO(ACRPODA,0)) S ACRPRTR=$P(^(0),U,2),ACRPO=$P(^AUTTLOC(+^(0),0),U,2),ACRLBDA=0 D
 .Q:'ACRPRTR
 .I $D(ACRALLZ) S IOP=$P(^%ZIS(1,ACRPRTR,0),U),%ZIS="P" D ^%ZIS Q:POP
 .F  S ACRLBDA=$O(^TMP("ACRPSR",$J,ACRPODA,ACRLBDA)) Q:'ACRLBDA!$D(ACRQUIT)  I $D(^ACRLOCB(ACRLBDA,0)),$P(^(0),U,5) S ACRLB=$P(^AUTTPRG($P(^(0),U,5),0),U) D
 ..U IO
 ..D HEAD^ACRFPSR1
 ..S ACRINDV=""
 ..F  S ACRINDV=$O(^TMP("ACRPSR",$J,ACRPODA,ACRLBDA,ACRINDV)) Q:$D(ACRQUIT)!(ACRINDV="")!($D(ACRINDVZ)&(ACRINDV>$G(ACRINDVZ)))  D
 ...S ACRDOC=""
 ...F  S ACRDOC=$O(^TMP("ACRPSR",$J,ACRPODA,ACRLBDA,ACRINDV,ACRDOC)) Q:ACRDOC=""!$D(ACRQUIT)  N X S X=^(ACRDOC) D
 ....S ACRIN=$P(X,U),ACRAPV=$P(X,U,2),ACRID=$P(X,U,3)
 ....D W
 ..D PAUSE^ACRFWARN
 .D ^%ZISC
 Q
EN4 ;PRINT LIST OF DOCUMENTS PENDING GREATER THAN SPECIFIED # OF DAYS BY
 ;INDIVIDUAL
 S ACRPODA=$S($D(ACRPOZ):ACRPOZ,1:0),ACRX=2
 F  S ACRPODA=$O(^TMP("ACRINDV",$J,ACRPODA)) Q:'ACRPODA!$D(ACRQUIT)!($G(ACRPOZ)&(ACRPODA<$G(ACRPOZ)))  I $D(^ACRPO(ACRPODA,0)) D
 .S ACRPRTR=$P(^ACRPO(ACRPODA,0),U,2)
 .S ACRPO=$P(^AUTTLOC(+^(0),0),U,2)
 .S ACRLBDA=0
 .S ACRINDV=""
 .I $D(ACRALLZ) S IOP=$P(^%ZIS(1,ACRPRTR,0),U),%ZIS="P" D ^%ZIS Q:POP
 .U IO
 .D HEAD^ACRFPSR1:$D(ACRALL)
 .I $D(ACRINDVZ)
 .F  S ACRINDV=$O(^TMP("ACRINDV",$J,ACRPODA,ACRINDV)) Q:ACRINDV=""!$D(ACRQUIT)  D
 ..D:'$D(ACRALL) HEAD^ACRFPSR1
 ..N X
 ..S ACRDOC=""
 ..F  S ACRDOC=$O(^TMP("ACRINDV",$J,ACRPODA,ACRINDV,ACRDOC)) Q:ACRDOC=""!$D(ACRQUIT)  S X=^(ACRDOC) D
 ...S ACRIN=$P(X,U)
 ...S ACRAPV=$P(X,U,2)
 ...S ACRID=$P(X,U,3)
 ...D W
 .W:$D(ACRALL) @IOF
 .D ^%ZISC
 Q
W ;DISPLAY NAME, DOCUMENT NUMBER AND TIME RECEIVED FOR SIGNATURE
 W !?5,ACRINDV
 W ?27,ACRDOC
 W ?56,ACRID
 W !?27,ACRAPV
 W ?56,ACRIN
 I $D(IOSL),$Y>(IOSL-4) D
 .D PAUSE^ACRFWARN
 .D HEAD^ACRFPSR1
 Q
CHOICE ;EP;TO SELECT TYPE OF REPORT
 S DIR(0)="SO^1:All Reports;2:Purchasing Office;3:Selected Department;4:Individual ARMS User"
 S DIR("A")="Which Report"
 S DIR("B")="All Reports"
 W !
 D DIR^ACRFDIC
 Q:$D(ACRQUIT)!$D(ACROUT)!'+ACRY
 I ACRY=1 D  Q
 .S ACRALLZ=""
 .S ZTRTN="EN1^ACRFPSR"
 .S ION=""
 .D ZIS
 .D ZTLOAD^ACRFZIS
 I ACRY=2 D PO S ACRY=2
 I ACRY=3 D DEPT S ACRY=3
 I ACRY=4 D INDV S ACRY=4
 D ZIS
 Q
PO ;EP;
 S DIC="^ACRPO("
 S DIC(0)="AEMQZ"
 S DIC("A")="Which Purchasing Office: "
 W !
 D DIC^ACRFDIC
 Q:$D(ACRQUIT)!$D(ACROUT)!'+$G(Y)
 I +Y<0 S ACRQUIT="" Q
 S ACRPOZ=+Y
 Q
DEPT ;
 S DIC="^AUTTPRG("
 S DIC(0)="AEMQZ"
 S DIC("A")="Which Department.......: "
 W !
 D DIC^ACRFDIC
 Q:$D(ACRQUIT)!$D(ACROUT)!'+$G(Y)
 I +Y<0 S ACRQUIT="" Q
 S ACRDEPTZ=+Y
 Q
INDV ;
 S DIC="^ACRAU("
 S DIC(0)="AEMQZ"
 S DIC("A")="Which ARMS User........: "
 W !
 D DIC^ACRFDIC
 Q:$D(ACRQUIT)!$D(ACROUT)!'+$G(Y)
 I +Y<0 S ACRQUIT="" Q
 S ACRINDVZ=+Y
 Q
ZIS ;EP;TO SELECT SPECIFIC PRINTER
 S ACRRTN="EN1^ACRFPSR"
 S ZTDESC="PRINT UNSIGNED DOCUMENT REPORT"
 D ^ACRFZIS:'$D(ACRALLZ)
 Q