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

ACRFRR2.m

Go to the documentation of this file.
ACRFRR2 ;IHS/OIRM/DSD/THL,AEF - CANCEL ITEMS FROM RECEIVING REPORT;  [ 09/23/2005   9:44 AM ]
 ;;2.1;ADMIN RESOURCE MGT SYSTEM;**19**;NOV 05, 2001
 ;;CONTINUATION OF ACRFRR
CANCEL ;EP;
 N ACRCAN
 S DIR(0)="YO"
 S DIR("A")="Create PO for cancelled items"
 S DIR("B")="NO"
 W !
 D DIR^ACRFDIC
 S:Y'=1 ACRNEWPO=""
 S DIR(0)="LO^1:"_ACRSSMAX
 S DIR("A")="Cancel which items(s)"
 W !
 D DIR^ACRFDIC
 I 'Y!$D(ACRQUIT)!$D(ACROUT) K ACRQUIT Q
 N ACRY
 S ACRY=Y
 F ACRJ=1:1 S ACRSSDA=$P(ACRY,",",ACRJ) Q:'ACRSSDA  D  Q:$D(ACRQUIT)
 .I $D(^ACRRR("B",+ACRSS(ACRSSDA))) D  Q
 ..W *7,*7
 ..W !!,"Receiving action on file for item ",ACRSSDA,"."
 ..W !,"It cannot be cancelled."
 ..H 2
 ..S ACRQUIT=""
 .S ACRCAN($P(ACRSS(ACRSSDA),U))=""
 .K ^ACRSS("C",ACRDOCDA,$P(ACRSS(ACRSSDA),U))
 .K ^ACRSS("J",ACRDOCDA,$P(ACRSS(ACRSSDA),U))
 .K ^ACRSS("E",ACRDOCDA,+$G(^ACRSS($P(ACRSS(ACRSSDA),U),0)),$P(ACRSS(ACRSSDA),U))
 .S DA=+ACRSS(ACRSSDA)
 .S DIE="^ACRSS("
 .S DR="[ACR REJECTION/CANCELLATION]"
 .D DDS^ACRFDIC
 .Q:'$D(ACRSCREN)
 .K ACRSCREN
 .W !
 .D DIE^ACRFDIC
 .K ACREASON
 I $D(ACRQUIT) K ACRQUIT Q
 I $D(ACRNEWPO) K ACRNEWPO D DEL Q
 S ACRTXDA=$P(ACRDOC0,U,4)
 S ACRID=$P(ACRDOC0,U,14)
 S ACRTXPFX="PO"
 S (ACRREF,ACRREFX)=116
 S ACRREFDA=$O(^AUTTDOCR("B",ACRREF,0))
 S ACRCANDA=$P(ACROBL0,U,4)
 S (ACRLBDA,ACRZDA,ACRFDNO)=$P(ACROBL0,U,3)
 S ACRALWNO=$P(ACROBL0,U,8)
 S ACRSSADA=$P(ACROBL0,U,7)
 S ACRAPPDA=$P(ACROBL0,U,9)
 S ACRTXOBJ=$P(ACROBLDT,U,3)
 N X
 S X=+$G(^ACRDOC(ACRDOCDA,"PA"))
 ;S X=$P($G(^VA(200,+X,0)),U)  ;ACR*2.1*19.02 IM16848
 S X=$$NAME2^ACRFUTL1(+X)  ;ACR*2.1*19.02 IM16848
 S X=$P($P(X,",",2)," ")_" "_$P(X,",")
 W !!,"A new PO is being generated."
 W !,"This PO will be assigned to ",X," to process."
 W !,"Please contact this purchasing agent with any quesitons regarding this order."
 D EN^ACRFAUTO
 Q
DEL N ACRX
 S ACRX=0
 F  S ACRX=$O(ACRCAN(ACRX)) Q:'ACRX  D
 .S DA=ACRX
 .S DIE="^ACRSS("
 .S DR="13////0;16////0;16.1////0;18////0"
 .D DIE^ACRFDIC
 .K ^ACRSS("C",ACRDOCDA,ACRX),^ACRSS("J",ACRDOCDA,ACRX)
 Q