VistA-WorldVistAEHR/r/IFCAP-PRC-PRX--PRCA--PRCN/PRCVFMS1.m

33 lines
1.9 KiB
Mathematica

PRCVFMS1 ;WOIFO/LKG-GENERATE IV FROM COTS INV TRANS ;4/12/05 14:10
;;5.1;IFCAP;**81**;Oct 20, 2000
;Per VHA Directive 10-93-142, this routine should not be modified.
Q
; PRCNODE = First subscript of the ^TMP global used to exchange data
; PRCPDA = IEN of Original Issue Book entry in File #410
; PRCPFMOD = Document Action ("E":Original; "M":Modification)
; PRCPPSTA = Primary Inventory Point's Station Number
; PRCPPFCP = Primary Inventory Point's Fund Control Point
; PRCPPBFY = Primary Inventory Point FCP's Beginning Budget Fiscal Year
; PRCPWSTA = Warehouse's Station Number
; PRCPWFCP = Warehouse's Fund Control Point
; PRCPWBFY = Warehouse FCP's Beginning Budget Fiscal Year
ENT(PRCNODE,PRCPDA) ;Entry point
N PRCPFMOD,PRC1,PRC2,PRCPWSTA,PRCPWFCP,PRCPWBFY,PRCFY,PRCDAA,PRCSX1,PRCRI
N ACCT,BUYBFY,BUYEFY,BUYFUND,BUYJOB,BUYLINE,BUYTABLE,BUYXPROG,COSTCNTR,DATA,FMSLINE,GECSFMS,INVCOST,LINEDA,LINEDOC,PRCPFMS,PRCPSEC1,PROFIT,PROFLINE
N TOTAL,TRANDATE,TRANNO,TRANDA,TRANID,PRCPPSTA,PRCPPFCP,PRCPPBFY,PRC,PRCX
N SELBFY,SELEFY,SELFUND,SELLINE,SELTABLE,SELXPROG,SIGN,STACKDA,SUBACCT,VOUCHER
N GECSDATA,D,DIC
S PRC1=$G(^TMP(PRCNODE,$J,1)),PRC2=$G(^TMP(PRCNODE,$J,2))
S PRCPFMOD=$S($P(PRC1,"^",4)="E":0,1:1),(PRCPPSTA,PRCPWSTA)=$P(PRC1,"^")
S PRCPWFCP=$P(PRC2,"^"),PRCPPFCP=$P(PRC2,"^",2),TRANDATE=$P(PRC1,"^",5),TRANID=$P(PRC1,"^",2)
S TRANNO=$P($G(^PRCS(410,PRCPDA,0)),"^")
S PRCFY=$S($E(TRANDATE,4,5)<10:$E(TRANDATE,2,3),1:$E(101+$E(TRANDATE,2,3),2,3))
S PRCPPBFY=$$BBFY^PRCSUT(PRCPPSTA,PRCFY,PRCPPFCP,1),PRCPWBFY=$$BBFY^PRCSUT(PRCPWSTA,PRCFY,PRCPWFCP,1)
S TRANDA=0,TOTAL=0
F S TRANDA=$O(^TMP(PRCNODE,$J,3,TRANDA)) Q:+TRANDA'=TRANDA D
. N PRC445 S PRC445=$G(^TMP(PRCNODE,$J,3,TRANDA,0))
. S FMSLINE=$P(PRC445,"^"),PRCPFMS(FMSLINE)=$P(PRC445,"^",2)_"^"_$P(PRC445,"^",3)_"^"_$P(PRC445,"^",4)_"^"_($P(PRC445,"^",5)-$P(PRC445,"^",4))
. S TOTAL=TOTAL+$P(PRC445,"^",5)
D IVCOTS^PRCPSFIV
Q $S($G(GECSFMS("DA"))>0:1,1:0)