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

PRCPWPLB.m

Go to the documentation of this file.
PRCPWPLB ;WISC/RFJ-whse post issue book (build array)               ;13 Jan 94
 ;;5.1;IFCAP;;Oct 20, 2000
 ;Per VHA Directive 10-93-142, this routine should not be modified.
 Q
 ;
 ;
REBUILD ;  rebuild array
 K ^TMP($J,"PRCPWPLM"),^TMP($J,"PRCPWPLMLIST"),PRCPFERR
 N DATA,IBQTY,INVDATA,ITEMDA,LINE,LINEDA,ONHAND,QTYOUT,QTYPOST,STATUS,UNITCOST,X
 S LINE=0
 S LINEDA=0 F  S LINEDA=$O(^PRCS(410,PRCPDA,"IT",LINEDA)) Q:'LINEDA  S DATA=$G(^(LINEDA,0)) I DATA'="" D
 .   S ITEMDA=+$P(DATA,"^",5),IBQTY=+$P(DATA,"^",2),QTYOUT=$P(DATA,"^",2)-$P(DATA,"^",12),STATUS=$P(DATA,"^",14)
 .   S INVDATA=$G(^PRCP(445,PRCPINPT,1,ITEMDA,0)),ONHAND=+$P(INVDATA,"^",7)
 .   S UNITCOST=$P(INVDATA,"^",22) S:$P(INVDATA,"^",15)>UNITCOST UNITCOST=$P(INVDATA,"^",15) S:$P(DATA,"^",7)>UNITCOST UNITCOST=$P(DATA,"^",7)
 .   S QTYPOST=+$G(^TMP($J,"PRCPWPLMPOST",LINEDA))
 .   S LINE=LINE+1
 .   D SET(LINEDA,LINE,1,80,IORVON,IORVOFF)
 .   D SET($$DESCR^PRCPUX1(PRCPINPT,ITEMDA),LINE,6,23)
 .   D SET($J(ITEMDA,6),LINE,24,29)
 .   D SET($J($$UNIT^PRCPUX1(PRCPINPT,ITEMDA,"/"),7),LINE,30,36)
 .   D SET($J(ONHAND,10),LINE,37,46)
 .   D SET($J(UNITCOST,10,2),LINE,47,56)
 .   D SET($J(IBQTY,8),LINE,57,64)
 .   D SET($J(QTYOUT,8),LINE,65,72)
 .   D SET($J(QTYPOST,8),LINE,73,80)
 .   I $G(PRCPFNSN) S LINE=LINE+1 D SET("NSN: "_$$NSN^PRCPUX1(ITEMDA),LINE,6,80)
 .   I STATUS'="" S QTYOUT=0,%="ITEM IS CANCELLED"_$S(STATUS["S":" AND SUBSTITUTED WITH LINE #(S): "_$P(STATUS,",",2,99),1:"") S LINE=LINE+1 D SET(%,LINE,6,80)
 .   I STATUS="",QTYPOST D
 .   .   I INVDATA="" S PRCPFERR=1,LINE=LINE+1 D SET("ERROR: ITEM NOT STORED IN WAREHOUSE INVENTORY POINT",LINE,6,80,IORVON,IORVOFF)
 .   .   I $$NSN^PRCPUX1(ITEMDA)="" S PRCPFERR=1,LINE=LINE+1 D SET("ERROR: NSN IS MISSING FROM ITEM MASTER FILE",LINE,6,80,IORVON,IORVOFF)
 .   .   I '$P(INVDATA,"^",14)!('$P(INVDATA,"^",5)) S PRCPFERR=1,LINE=LINE+1 D SET("ERROR: UNIT OF ISSUE IS MISSING FOR THE WAREHOUSE INVENTORY POINT",LINE,6,80,IORVON,IORVOFF)
 .   I INVDATA'="",ONHAND-QTYPOST<0 S LINE=LINE+1 D SET("WARNING: AFTER POSTING, QUANTITY ONHAND WILL BE LESS THAN ZERO",LINE,6,80,IORVON,IORVOFF)
 .   S ^TMP($J,"PRCPWPLMLIST",LINEDA)=ITEMDA_"^"_QTYOUT
 S VALMCNT=LINE
 Q
 ;
 ;
SET(STRING,LINE,COLUMN,CLREND,ON,OFF)  ;  set array
 I '$D(@VALMAR@(LINE,0)) D SET^VALM10(LINE,$J("",80))
 D SET^VALM10(LINE,$$SETSTR^VALM1(STRING,@VALMAR@(LINE,0),COLUMN,CLREND))
 I $G(ON)]""!($G(OFF)]"") D CNTRL^VALM10(LINE,COLUMN,$L(STRING),ON,OFF)
 Q