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

ACRFWARN.m

Go to the documentation of this file.
ACRFWARN ;IHS/OIRM/DSD/THL,AEF - WARNING AND MESSAGES;  [ 1/31/2007  10:19 AM ]
 ;;2.1;ADMIN RESOURCE MGT SYSTEM;**5,19,22**;NOV 05, 2001
 ;;ROUTINE USED TO DISPLAY AND PROCESS VARIOUS WARNINGS AND MESSAGES
EXCTOT ;EP;
 W @IOF
 W *7,*7
 D WARNING
 W !!,"The total ",ACRFDNY," available has been exceeded."
 W !,"The sum of all entries must not exceed the total ",ACRFDNY," available."
 D DIK^ACRFDIC
 S ACRQUIT=""
 D PAUSE
 Q
MAX ;EP;
 Q:X<ACRTXLIM+1
 W !!?10,X," is over your procurement limit (",ACRTXLIM,")"
 K X
 Q
MESSAGE ;EP;
 W !!,"One moment please, message being delivered."
 S ACRCNG=$G(^ACRAPVS(ACRAPDA,"CNG"))
 S ACRRSN=$G(^ACRAPVS(ACRAPDA,"RSN"))
 S ACRAPV=$E(^ACRAPVS(ACRAPDA,"DT"))
 S ^ACROBL(ACRDOCDA,"CNG")=ACRCNG
 S ^ACROBL(ACRDOCDA,"RSN")=ACRRSN
 S XMB(1)="Document no. "_ACRDOC_" ("_$P(^ACRDOC(ACRDOCDA,0),U,14)_") ,was "_$S(ACRAPV="A":"APPROVED",1:"DISAPPROVD")_" by "
 ;S XMB(2)=$P(^VA(200,$P(^ACRAPVS(ACRAPDA,"DT"),U,2),0),U)  ;ACR*2.1*19.02 IM16848
 S XMB(2)=$$NAME2^ACRFUTL1($P(^ACRAPVS(ACRAPDA,"DT"),U,2))  ;ACR*2.1*19.02 IM16848
 S XMB(2)=$P($P(XMB(2),",",2)," ")_" "_$P(XMB(2),",")
 S XMB(3)=$P(^ACRAPVT($P(^ACRAPVS(ACRAPDA,0),U,3),0),U)
 S XMB(3)=$P($P(XMB(3),",",2)," ")_" "_$P(XMB(3),",")
 S XMB(2)=XMB(2)_" as the "_XMB(3)
 S XMB(3)="  "
 S XMB(4)="Information which needs to be changed:"
 I ACRCNG]"" D
 .N ACRI
 .F ACRI=1:1:5 S:$P(ACRCNG,U,ACRI)]"" XMB(ACRI+4)=$P(ACRCNG,U,ACRI)
 S XMB(10)="  "
 S XMB(11)="Reason for change: "
 I ACRRSN]"" D
 .N ACRI
 .F ACRI=1:1:5 S:$P(ACRRSN,U,ACRI)]"" XMB(ACRI+11)=$P(ACRRSN,U,ACRI)
 S XMDUZ=.5
 S XMTEXT="XMB("
 S XMSUB="REQUEST COMMENT/DISAPPROVAL NOTIFICATION"
 S XMB="ACR REQUEST STATUS"
 D ^XMD
 K ACRAPV,ACRCNG,ACRRSN,XMB,XMDUZ,XMSUB,XMY,XMTEXT
 Q
CHECK ;EP;
 N X,Y
 K ACRQUIT,ACROUT
 Q:'$G(ACRDOCDA)!'$D(ACRFDNAM)                 ;ACR*2.1*5.06
 S:'$G(ACRLBDA) ACRLBDA=$P(^ACRDOC(ACRDOCDA,0),U,6)
 Q:'ACRLBDA
 Q:$P(^ACRLOCB(ACRLBDA,0),U,21)=1  S X=$P(^(0),U,21)
 Q:'$P($G(^ACRSYS(1,"DT1")),U,3)  S Y=$P(^("DT1"),U,3)
 I Y=2,X'=2 Q
 Q:$P(^ACRLOCB(ACRLBDA,"BA"),U,2)<(ACRFDNAM+.01)
 W *7,*7
 D WARNING
 W !!?10,"THE ",@ACRON,$FN(ACRFDNAM,"P,",2),@ACROF," ALLOCATED TO THIS BUDGET HAS BEEN EXCEEDED."
 W !?10,"REVIEW THIS ACCOUNT WITH THE FINANCIAL MANAGEMENT OFFICER"
 I $D(ACRAPCHK)#2 D PAUSE^ACRFWARN S ACROUT="" Q
 S DIR(0)="YO"
 S DIR("A",1)="Edit/Delete "_$S(ACRREF=130!(ACRREF=600):"Travel Days",ACRREF=148:"Training Expenses",1:"Items")
 S DIR("A")="to DECREASE the cost"
 S DIR("B")="NO"
 W !
 D DIR^ACRFDIC
 I Y'=1 S (ACRQUIT,ACROUT)="" Q
 K ACRQUIT,ACROUT
 Q
CHECK1 ;EP;
 Q:'$P(^ACRSYS(1,"DT"),U,99)
 W !!?10,*7,"YOU HAVE EXCEEDED YOUR PROCUREMENT LIMIT (",ACRTXLIM,".00)"
 W !?10,"THE LAST ITEM YOU ENTERED WILL BE DELETED.  MAKE THE NECESSARY"
 W !?10,"ADJUSTMETS TO KEEP THIS REQUEST WITHIN YOUR PROCUREMENT LIMIT."
 D PAUSE
 S DA=ACRSSDA
 S DIK="^ACRSS("
 D DIK^ACRFDIC
 Q
CHECKCC(ACRSSTOT) ;EP;                  ;ACR*2.1*5.17
 N X,Y
 K ACRQUIT,ACROUT
 W *7,*7
 D WARNING
 W !!?10,"THE TOTAL OF ",@ACRON,$FN(ACRSSTOT,"P,",2),@ACROF
 ;W "  EXCEEDS THE $2500.00 PER PURCHASE"  ;ACR*2.1*22.11j IM23064
 W "  EXCEEDS THE $3000.00 PER PURCHASE"  ;ACR*2.1*22.11j IM23064
 W !?10,"SPENDING LIMIT ALLOWED FOR A CREDIT CARD PURCHASE"
 ;I $D(ACRAPCHK)#2 D PAUSE^ACRFWARN S ACROUT="" Q
 S DIR(0)="YO"
 S DIR("A")="Edit/Delete Items to DECREASE the cost"
 S DIR("B")="NO"
 W !
 D DIR^ACRFDIC
 Q
PAUSE ;EP;
 Q:$E(IOST,1,2)'="C-"
 K DIR
P1 ;EP;
 W !
 S DIR(0)="EOA"
 S DIR("A")="Press RETURN to continue or '^' to exit. "
 D DIR^ACRFDIC
 S:$G(X)["^" DN=0,ACROUT=""
 Q
TOTAL ;EP;TO CALCULATE THE TOTAL DOLLARS OF A PO PLUS MODS
 ;ACRORIDA IS THE INTERNAL ENTRY NUMBER OF THE ORIGINAL DOCUMENT
 Q:'$D(ACRORIDA)
 K ACR
 S ACRSSTOT=0
 S ACR=ACRORIDA
 S ACR(ACRORIDA)=0
 D SSTOT
 S ACR=0
 F  S ACR=$O(^ACRDOC("MOD",ACRORIDA,ACR)) Q:'ACR  D SSTOT
 Q
SSTOT ;EP - TOTAL OF ALL OBLIGATED AMOUNTS FOR ALL ITEMS ON THE PO PLUS MODS
 N ACRSSDA
 S (ACRSSDA,ACRTOT,ACR(ACR))=0
 F  S ACRSSDA=$O(^ACRSS("J",ACR,ACRSSDA)) Q:'ACRSSDA  D
 .S ACRTOT=$P($G(^ACRSS(ACRSSDA,"DT")),U,4)
 .S ACRSSTOT=$G(ACRSSTOT)+ACRTOT
 .S ACR(ACR)=$G(ACR(ACR))+ACRTOT
 Q
EXTOT ;EP;WARNING MESSAGE IF TOTAL OBLIGATED EXCEEDS PROCUREMENT AUTHORITY
 Q:'$D(ACRSSTOT)
 N ACRLIM
 I ACRSSTOT>$P(^ACRSYS(1,"DT"),U,24) S ACRLIM=$P(^("DT"),U,24) D
 .W *7,*7
 .W !!,"The TOTAL DOLLAR VALUE of this action: ",@ACRON,$J($FN(ACRSSTOT,"P",2),12),@ACROF
 .W !,"Exceeds the Area Procurement limit of: ",@ACRON,$J($FN(ACRLIM,"P",2),12),@ACROF
 .W !!,"Ths summary of dollar amounts for the original action plus mods is listed below."
 .W !,"Consult with your Purchasing Office reqarding this action before proceeding."
 W !!?10,"PURCHASE ORDER"
 W ?30,"REQUISITION NUMBER"
 W ?50,"DOLLAR AMOUNT"
 W !?10,"--------------"
 W ?30,"------------------"
 W ?50,"-------------"
 S ACR=0
 F  S ACR=$O(ACR(ACR)) Q:'ACR  D
 .S ACR0=^ACRDOC(ACR,0),ACRTOT=ACR(ACR)
 .W !?10,$P(ACR0,U,2)
 .W ?30,$P(ACR0,U)
 .W ?50,$J($FN(ACRTOT,"P",2),12)
 Q
EXCEED ;EP;TO CALCULATE AND DISPLAY DATA FOR PO AND MODS WHICH EXCEED
 ;THE AREA PROCUREMENT LIMIT
 Q:"^116^204^103^"'[(U_$G(ACRREF)_U)
 Q:$P($G(^ACRDOC(ACRDOCDA,3)),U,13)
 S ACRORIDA=$S($P(^ACRDOC(ACRDOCDA,0),U,15):$P(^(0),U,15),1:ACRDOCDA)
 D TOTAL
 Q:$P(^ACRSYS(1,"DT"),U,24)+1>ACRSSTOT
 D EXTOT
 D PAUSE
 Q
WARNING ;EP;TO DISPLAY WARNING MESSAGE
 D B1^ACRFMENU
 N ACRI
 W !!
 F ACRI=1:1:6 W ?$X+5,"WARNING"
 D B2^ACRFMENU
 Q