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

PRCFFUB.m

Go to the documentation of this file.
  1. PRCFFUB ;WISC/SJG-OBLIGATION ERROR PROCESSING REBUILD ;7/24/00 23:12
  1. V ;;5.1;IFCAP;;Oct 20, 2000
  1. ;Per VHA Directive 10-93-142, this routine should not be modified.
  1. ;
  1. ; Routine to handle special processing for the rebuild/transmit for
  1. ; MO/SO cancellation documents.
  1. ;
  1. ; Subroutine EN sets the value of XRBLD =
  1. ; 1 if the selected transaction to be rebuilt is an MO.X, SO.X or AR.X
  1. ; 2 if the selected transaction is an MO.E, SO.E, AR.E associated with
  1. ; an amendment that generated cancellation transactions
  1. EN ;
  1. N XFLAG
  1. Q:MODDOC="" ; no batch number, this is not an amendment
  1. S XFLAG=$$GETTXNS^PRCFFERT(PO,PRCFA("AMEND#"),PRCFA("MP"))
  1. 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)
  1. S DESC=$G(GECSDATA(2100.1,GECSDATA,4,"E"))
  1. Q:DESC=""
  1. I DESC["Decrease"!(DESC["Cancellation") D
  1. . S XRBLD=1
  1. . K MSG W !
  1. . S MSG(1)="You are attempting to retransmit an FMS Document with a document action of 'X'."
  1. . S MSG(2)="An FMS document with a document action of 'X' will decrease this obligation"
  1. . S MSG(3)="to $0.00 or cancel this obligation from FMS.",MSG(3.5)=" "
  1. . S MSG(4)="Please use extreme caution with these documents!"
  1. . D EN^DDIOL(.MSG) W ! K MSG
  1. I DESC["Amendment" D
  1. . S XRBLD=2
  1. . I $P(XFLAG,"^",5)'=1 D Q
  1. . . K MSG W !
  1. . . S MSG(1)="This document was created from a 'Replace PO Number' amendment. Please"
  1. . . S MSG(2)="verify the 'X' action documents for "_$P(^PRC(442,$P(^PRC(442,+PO,23),"^",3),0),"^",1)_" have been accepted."
  1. . . I $P(PRCFA("GECS"),"^")="AR" S MSG(3)="If the SO original was not accepted, this AR will reject."
  1. . . D EN^DDIOL(.MSG) W ! K MSG
  1. . K MSG W !
  1. . S MSG(1)="Before proceeding with this rebuild, please ensure that the previous"
  1. . S MSG(2)="'X' action documents have been accepted in FMS. Otherwise, this document"
  1. . S MSG(3)="will reject because an obligation already exists under this PAT number."
  1. . I $P(PRCFA("GECS"),"^")="AR" D
  1. . . S MSG(2)="'X' actions and SO original were accepted in FMS. Otherwise, this AR"
  1. . . S MSG(3)="may reject or not accrue the correct version of the intended document."
  1. . D EN^DDIOL(.MSG) W ! K MSG
  1. QUIT
  1. ;
  1. GO ; rebuild the selected transaction now
  1. S FMSSEC=$$SEC1^PRC0C(PRC("SITE"))
  1. S TYPE=PRCFA("TT")
  1. ;
  1. GO0 I XRBLD=1 D
  1. . S (PRCFA("MOD"),PRCFA("CANCEL"))="X^2^Cancellation Entry"
  1. . S FMSMOD=$P(PRCFA("MOD"),U)
  1. . S TAG=$E(DESC,1)
  1. . I TAG="D" S DESC="Decrease Obligation Amount of "_TYPE
  1. . I TAG="C" S DESC="Cancellation of "_TYPE
  1. . S DESC=DESC_" Obligation Document Rebuild/Transmit"
  1. ;
  1. I XRBLD=2 D
  1. . S PRCFA("MOD")="E^0^Original Entry (Amended)"
  1. . S PRCFA("CANCEL")="X^2^Cancellation Entry"
  1. . S TAG="A"
  1. . S DESC="Purchase Order Amendment Rebuild/Transmit"
  1. ;
  1. D REBUILD^GECSUFM1(GECSDATA,"I",FMSSEC,"Y",DESC)
  1. S GECSFMS("DA")=GECSDATA
  1. I TAG="D" D DEC^PRCFFU8 ; (decrease)
  1. I TAG="C" D CANC^PRCFFU8 ; (cancel)
  1. I TAG="A" D ^PRCFFM1M ; (original - amended)
  1. ;
  1. GOUT KILL DESC,FMSSEC
  1. QUIT
  1. ;
  1. LOOP ; Check for any 'X' docs -- this subroutine deleted by patch PRC*5*179
  1. ; routine could incorrectly label future amendments as cancel associated
  1. ;N LOOP,N0,FMSDOC S LOOP=0
  1. ;F S LOOP=$O(^PRC(442,+PO,10,LOOP)) Q:LOOP'>0 D
  1. ;.S N0=^PRC(442,+PO,10,LOOP,0),FMSDOC=$P(N0,".",1,2)
  1. ;.I FMSDOC["X" S XFLAG=1
  1. ;.Q
  1. ;Q