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

ACRFPRCS.m

Go to the documentation of this file.
ACRFPRCS ;IHS/OIRM/DSD/THL,AEF - PROCESS PENDING DOCUMENTS;  [ 02/22/2007   9:44 AM ]
 ;;2.1;ADMIN RESOURCE MGT SYSTEM;**22**;NOV 05, 2001
 ;;ROUTINE TO CONTROL LISTING AND SIGNATURE PROCESS FOR ARMS DOCS
EN D EXIT^ACRFPRC2
 D ENA:$D(^ACRAPL("AC",DUZ))
EXIT D EXIT^ACRFPRC2
 K ACRREV
 ;I $D(ACRDTIME) S DTIME=ACRDTIME K ACRDTIME  ;ACR*2.1*22 SAC COMPLIANCE
 Q
ENA D RESP^ACRFPRC2
 N ACRREF,ACRDATA
 I $D(ACRCSI) S ACRREV="" F  D CSI^ACRFPRC2 Q:$D(ACRQUIT)!$D(ACROUT)  D
 .I '$D(^TMP("ACRDATA",$J))#2 D  Q
 ..W !!,"NO "_$P(ACRTX(ACRY),U,2)_" PENDING"
 ..H 2
 .I $D(^TMP("ACRDATA",$J))#2 D
 ..S DIR(0)="YO"
 ..S DIR("A")="Review Document in detail"
 ..S DIR("B")="NO"
 ..W !
 ..D DIR^ACRFDIC
 ..D EN2:Y=1
 ..K ACRDATA1
EN1 I '$D(ACRQUIT) F  D EN2 Q:$D(ACRQUIT)!$D(ACROUT)
 K ACRQUIT
 I '$D(ACROUT),$D(^TMP("ACRALTDT",$J)) D ^ACRFALT
 Q
EN2 ;
 D LOOKUP
EN21 ;EP;
 D SELECT:'$D(ACRQUIT)&ACRI
 I 'ACRI S ACRQUIT=""
 Q:$D(ACRQUIT)!$D(ACROUT)
 D EDIT^ACRFPRC9
 I $D(^ACROBL(ACRDOCDA,2)) D TREPORT^ACRFPRC4
 K ACRPSUM
 D APPROVE^ACRFPRC1:'$D(ACRCSI)
 K ACRQUIT
 Q
LOOKUP ;LOOKUP OF DOCUMENTS WHICH NEED CURRENT USER'S SIGNATURE
 ;DOCUMENTS PENDING SIGNATURE OF CURRENT USER OR ALTERNATE
 ;KILL ANXT CROSSREFERENCE DURING LOOKUP IF IT IS INAPPROPRIATE
 S ACRI=0
 S ACRDUZ=DUZ
 K ^TMP("ACRDATA",$J,DUZ)
 I $D(^TMP("ACRDATA",$J,ACRDUZ)) D RELIST^ACRFPRC4 G LX
 S ACRAPVT=0
 K ^TMP("ACRALT",$J),^TMP("ACRALTDT",$J)
 F  S ACRAPVT=$O(^ACRAPVS("ANXT",ACRAPVT)) Q:'ACRAPVT  D
 .W "."
 .S ACRINDV=0
 .F  S ACRINDV=$O(^ACRAPVS("ANXT",ACRAPVT,ACRINDV)) Q:'ACRINDV  I $D(^ACRAPL("AC",ACRINDV,ACRAPVT)) S ACRAPLDA=$O(^(ACRAPVT,0)) D:ACRAPLDA
 ..S ACRAPLDT=+$G(^ACRAPL(ACRAPLDA,0))_U_$G(^ACRAPL(ACRAPLDA,"DT"))
 ..Q:(U_ACRAPLDT_U)'[(U_DUZ_U)
 ..S ACRAPDA=0
 ..F  S ACRAPDA=$O(^ACRAPVS("ANXT",ACRAPVT,ACRINDV,ACRAPDA)) Q:'ACRAPDA  D:DT+1>$P($G(^(ACRAPDA)),U,2)
 ...S ACRAP0=$G(^ACRAPVS(ACRAPDA,0))
 ...S ACRAPDT=$G(^ACRAPVS(ACRAPDA,"DT"))
 ...Q:DT<$P(ACRAPDT,U,8)
 ...I $P(ACRAPDT,U)]""!($P(ACRAPDT,U,3)="")!('$D(^ACRAPVS("AB",+ACRAP0,ACRAPDA))) D  Q
 ....K ^ACRAPVS("ANXT",ACRAPVT,ACRINDV,ACRAPDA)
 ....N ACRDOCDA
 ....S ACRDOCDA=+ACRAP0
 ....D EN1^ACRFNXT
 ...S ACRDATE=$P(ACRAPDT,U,3)
 ...D LIST^ACRFPRC4
 I '$D(ACRESIG),$D(^TMP("ACRDATE",$J,DUZ))!$D(^TMP("ACRALTDT",$J)) D  Q:$D(ACROUT)
 .D ESIG^ACRFPRC4
 .I $D(ACRQUIT)!$D(ACROUT) S ACROUT="" K ACRESIG Q
 .;S ACRDTIME=DTIME  ;ACR*2.1*22 SAC COMPLIANCE
 .;S:DTIME<120 DTIME=120  ;ACR*2.1*22 SAC COMPLIANCE
 .D SECURITY^ACRFPRC4
 I '$D(^TMP("ACRDATE",$J,DUZ)) D  Q
 .W !!,@ACRON,"There are no DOCUMENTS pending for you.",@ACROF
 .W !
 .H 2
 .S ACRQUIT=""
 E  D RELIST^ACRFPRC4
LX D LIST2
 Q
SELECT ;SELECT DOCUMENT TO BE REVIEWED FOR APPROVAL
 S DIR(0)="FOA^1:15"
 S DIR("A",1)="Enter a Sequence NO. (1 to "_ACRMAX_")"
 S DIR("A")="or enter the DOCUMENT NUMBER: "
 S DIR("?",1)="Enter the number listed under column 'NO.' of the document you want to approve,"
 S DIR("?",2)="or enter the DOCUMENT NUMBER of the document you want to review."
 S DIR("?")="Select a number from 1 to "_ACRMAX
 W !
 D DIR^ACRFDIC
 I $D(ACRQUIT)!$D(ACROUT)!'$D(^TMP("ACRDATA",$J,ACRDUZ,$S(X]"":X,1:0))) S ACRI="" Q
 N ACRENTRY,ACRDOC
 S (ACRJJ,ACRX)=X
 S ACRENTRY="OBLAMT"
 S X=^TMP("ACRDATA",$J,ACRDUZ,ACRX)
 I $L(ACRJJ)>8 S ACRJJ=$P(X,U,10)
 S (ACRZDA,DA,ACRDOCDA)=$P(X,U)
 S ACRTXTYP=$P(X,U,3)
 S ACRAPDA=$P(X,U,4)
 D SETDOC^ACRFEA1
 S ACRREFX=ACRREF
 K ACRSIGN
 S ACR=0
 F  S ACR=$O(^ACRAPVS("AB",ACRZDA,ACR)) Q:'ACR  I ACRAPDA'=ACR,$D(^ACRAPVS(ACR,0)),$D(^ACRAPVS(ACR,"DT")) D
 .S ACRAPV0=^ACRAPVS(ACR,0),ACRAPVDT=^ACRAPVS(ACR,"DT")
 .I "^1^2^5^36^40^43^"[(U_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U,28)=0 W ?4,"NR"
 E  W ?4,$$TOT(+$G(^ACRAPVS(+ACRAPDA,0)))
 W ?7,ACRDOC
 W ?24,ACRID
 Q:'$D(^TMP("ACRDATA",$J,ACRDUZ,ACRII))
 S X=^TMP("ACRDATA",$J,ACRDUZ,ACRII)
 S ACRDOC=$P(X,U,5)
 S ACRID=$P(X,U,6)
 S ACRAPDA=$P(X,U,4)
 W ?40,"|",$J((ACRII),2)
 K ACRQUIT
 S X=0
 F  S X=$O(^ACRAPVS(ACRAPDA,1,X)) Q:'X  I $D(^ACRAPVS(ACRAPDA,1,X,"CNG"))!$D(^ACRAPVS(ACRAPDA,1,X,"RSN"))!$D(^ACRAPVS(ACRAPDA,1,X,"RESP")) S ACRQUIT="" Q
 I $D(ACRQUIT) K ACRQUIT W ?45,"**"
 I $P($G(^ACRAPVS(+ACRAPDA,0)),U,11) W ?4,"TA"
 I $P($G(^ACRDOC(+$G(^ACRAPVS(+ACRAPDA,0)),0)),U,28)=0 W ?45,"NR"
 I "130^600^"[(U_ACRREF_U) W ?4,$$TOT(+$G(^ACRAPVS(+ACRAPDA,0)))
 W ?48,ACRDOC
 W ?65,ACRID
 Q
ACRREV ;EP;FOR DOCUMENT APPROVAL
 ;CALLED FROM ENTRY ACTION OF ACRMENU
 Q:$D(ACRNOFM)  ;ACR*2.1*22.03 IM22653
 D TE^ACRFPRC9
 S:$D(ACRDOCDA) ACRDOCXX=ACRDOCDA
 D HOME^ACRFMENU:'$D(ACRON)
 S ACRREV=""
 W !!,"One moment, please."
 W !!,"I need to review all documents pending for approval"
 W !,"to determine if there are any which you need to sign."
 W !!
 D EN
 K ACRREV
 S:$D(ACRDOCXX) ACRDOCDA=ACRDOCXX
 K ACRDOCXX
 Q
ACRCSI ;EP;TO PRINT STATUS OF DOCUMENTS
 N ACRENTRY
 S ACRENTRY="OBLAMT"
 S ACRENTR1="LOCBAMT"
 S (ACRREV,ACRCSI)=""
 D EN
 Q
SPSUM ;EP;TO REVIEW SMALL PURCHASE SUMMARY
 S DIR(0)="YO"
 S DIR("A")="Review Small Purchase Summary"
 S DIR("B")="NO"
 W !
 D DIR^ACRFDIC
 Q:$D(ACRQUIT)!$D(ACROUT)!(Y'=1)
 W !!
 N DXS,DIP,DC,DN
 D ^ACGPSP
 D PAUSE^ACRFWARN
 Q
TOT(X) ;DETERMINE IF TRAVEL ORDER IS ZERO AMOUNT
 Q:'X
 N Y,Z
 S (Y,Z)=0
 F  S Y=$O(^ACRSS("J",X,Y)) Q:'Y  S Z=Z+$P($G(^ACRSS(Y,"DT")),U,4)
 I Z<1 S Z="ZZ"
 E  S Z=""
 Q Z