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

PRCPSMA0.m

Go to the documentation of this file.
  1. PRCPSMA0 ;WISC/RFJ-isms adjustment transaction ;27 Apr 92
  1. ;;5.1;IFCAP;;Oct 20, 2000
  1. ;Per VHA Directive 10-93-142, this routine should not be modified.
  1. Q
  1. ;
  1. ADJUST(INVPTDA,ITEMDA,QTY,VALUE,AVGCOST,BACKORD) ;adjustment transaction
  1. ; invptda = inventory internal entry number
  1. ; itemda = item internal entry number
  1. ; qty = quantity adjustment
  1. ; value = value adjustment
  1. ; avgcost = (optional) use this avgcost if defined
  1. ; backord = set to null for version 4
  1. ;
  1. ; if qty, no value or avgcost.
  1. ; if value, use avgcost but no qty
  1. ;
  1. ; returns 'string("at")' of code sheet
  1. ;
  1. N NSN,SKU
  1. S NSN=$TR($$NSN^PRCPUX1(ITEMDA),"-"),SKU=$$SKU^PRCPUX1(INVPTDA,ITEMDA) I SKU["?"!(NSN="") S STRING("AT")="" Q
  1. I VALUE S VALUE=$P(VALUE,".")_$P($J(VALUE,0,2),".",2)
  1. I VALUE,'AVGCOST S AVGCOST=+$P($G(^PRCP(445,+INVPTDA,1,+ITEMDA,0)),"^",22)
  1. I AVGCOST S AVGCOST=$P(AVGCOST,".")_$P($J(AVGCOST,0,2),".",2)
  1. S STRING("AT")="AT^"_NSN_"^"_SKU_"^"_QTY_"^"_VALUE_"^"_AVGCOST_"^"_BACKORD_"^|"
  1. Q