| 1 | PRCFFUB ;WISC/SJG-OBLIGATION ERROR PROCESSING REBUILD ;7/24/00  23:12 | 
|---|
| 2 | V ;;5.1;IFCAP;;Oct 20, 2000 | 
|---|
| 3 | ;Per VHA Directive 10-93-142, this routine should not be modified. | 
|---|
| 4 | ; | 
|---|
| 5 | ; Routine to handle special processing for the rebuild/transmit for | 
|---|
| 6 | ; MO/SO cancellation documents. | 
|---|
| 7 | ; | 
|---|
| 8 | ;  Subroutine EN sets the value of XRBLD = | 
|---|
| 9 | ; 1 if the selected transaction to be rebuilt is an MO.X, SO.X or AR.X | 
|---|
| 10 | ; 2 if the selected transaction is an MO.E, SO.E, AR.E associated with | 
|---|
| 11 | ; an amendment that generated cancellation transactions | 
|---|
| 12 | EN ; | 
|---|
| 13 | N XFLAG | 
|---|
| 14 | Q:MODDOC=""  ; no batch number, this is not an amendment | 
|---|
| 15 | S XFLAG=$$GETTXNS^PRCFFERT(PO,PRCFA("AMEND#"),PRCFA("MP")) | 
|---|
| 16 | I $P(XFLAG,"^",5)'=1,$P(XFLAG,"^",1)="" QUIT  ; this amendment has no cancels associated with it (if SO.E exists, it was created via an amendment) | 
|---|
| 17 | S DESC=$G(GECSDATA(2100.1,GECSDATA,4,"E")) | 
|---|
| 18 | Q:DESC="" | 
|---|
| 19 | I DESC["Decrease"!(DESC["Cancellation") D | 
|---|
| 20 | . S XRBLD=1 | 
|---|
| 21 | . K MSG W ! | 
|---|
| 22 | . S MSG(1)="You are attempting to retransmit an FMS Document with a document action of 'X'." | 
|---|
| 23 | . S MSG(2)="An FMS document with a document action of 'X' will decrease this obligation" | 
|---|
| 24 | . S MSG(3)="to $0.00 or cancel this obligation from FMS.",MSG(3.5)=" " | 
|---|
| 25 | . S MSG(4)="Please use extreme caution with these documents!" | 
|---|
| 26 | . D EN^DDIOL(.MSG) W ! K MSG | 
|---|
| 27 | I DESC["Amendment" D | 
|---|
| 28 | . S XRBLD=2 | 
|---|
| 29 | . I $P(XFLAG,"^",5)'=1 D  Q | 
|---|
| 30 | . . K MSG W ! | 
|---|
| 31 | . . S MSG(1)="This document was created from a 'Replace PO Number' amendment.  Please" | 
|---|
| 32 | . . S MSG(2)="verify the 'X' action documents for "_$P(^PRC(442,$P(^PRC(442,+PO,23),"^",3),0),"^",1)_" have been accepted." | 
|---|
| 33 | . . I $P(PRCFA("GECS"),"^")="AR" S MSG(3)="If the SO original was not accepted, this AR will reject." | 
|---|
| 34 | . . D EN^DDIOL(.MSG) W ! K MSG | 
|---|
| 35 | . K MSG W ! | 
|---|
| 36 | . S MSG(1)="Before proceeding with this rebuild, please ensure that the previous" | 
|---|
| 37 | . S MSG(2)="'X' action documents have been accepted in FMS.  Otherwise, this document" | 
|---|
| 38 | . S MSG(3)="will reject because an obligation already exists under this PAT number." | 
|---|
| 39 | . I $P(PRCFA("GECS"),"^")="AR" D | 
|---|
| 40 | . . S MSG(2)="'X' actions and SO original were accepted in FMS.  Otherwise, this AR" | 
|---|
| 41 | . . S MSG(3)="may reject or not accrue the correct version of the intended document." | 
|---|
| 42 | . D EN^DDIOL(.MSG) W ! K MSG | 
|---|
| 43 | QUIT | 
|---|
| 44 | ; | 
|---|
| 45 | GO ; rebuild the selected transaction now | 
|---|
| 46 | S FMSSEC=$$SEC1^PRC0C(PRC("SITE")) | 
|---|
| 47 | S TYPE=PRCFA("TT") | 
|---|
| 48 | ; | 
|---|
| 49 | GO0 I XRBLD=1 D | 
|---|
| 50 | . S (PRCFA("MOD"),PRCFA("CANCEL"))="X^2^Cancellation Entry" | 
|---|
| 51 | . S FMSMOD=$P(PRCFA("MOD"),U) | 
|---|
| 52 | . S TAG=$E(DESC,1) | 
|---|
| 53 | . I TAG="D" S DESC="Decrease Obligation Amount of "_TYPE | 
|---|
| 54 | . I TAG="C" S DESC="Cancellation of "_TYPE | 
|---|
| 55 | . S DESC=DESC_" Obligation Document Rebuild/Transmit" | 
|---|
| 56 | ; | 
|---|
| 57 | I XRBLD=2 D | 
|---|
| 58 | . S PRCFA("MOD")="E^0^Original Entry (Amended)" | 
|---|
| 59 | . S PRCFA("CANCEL")="X^2^Cancellation Entry" | 
|---|
| 60 | . S TAG="A" | 
|---|
| 61 | . S DESC="Purchase Order Amendment Rebuild/Transmit" | 
|---|
| 62 | ; | 
|---|
| 63 | D REBUILD^GECSUFM1(GECSDATA,"I",FMSSEC,"Y",DESC) | 
|---|
| 64 | S GECSFMS("DA")=GECSDATA | 
|---|
| 65 | I TAG="D" D DEC^PRCFFU8 ; (decrease) | 
|---|
| 66 | I TAG="C" D CANC^PRCFFU8 ; (cancel) | 
|---|
| 67 | I TAG="A" D ^PRCFFM1M ; (original - amended) | 
|---|
| 68 | ; | 
|---|
| 69 | GOUT KILL DESC,FMSSEC | 
|---|
| 70 | QUIT | 
|---|
| 71 | ; | 
|---|
| 72 | LOOP ; Check for any 'X' docs -- this subroutine deleted by patch PRC*5*179 | 
|---|
| 73 | ; routine could incorrectly label future amendments as cancel associated | 
|---|
| 74 | ;N LOOP,N0,FMSDOC S LOOP=0 | 
|---|
| 75 | ;F  S LOOP=$O(^PRC(442,+PO,10,LOOP)) Q:LOOP'>0  D | 
|---|
| 76 | ;.S N0=^PRC(442,+PO,10,LOOP,0),FMSDOC=$P(N0,".",1,2) | 
|---|
| 77 | ;.I FMSDOC["X" S XFLAG=1 | 
|---|
| 78 | ;.Q | 
|---|
| 79 | ;Q | 
|---|