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

PRCNREQQ.m

Go to the documentation of this file.
  1. PRCNREQQ ;SSI/ALA-Line Item Quantity Edit ;[ 08/05/96 5:51 PM ]
  1. ;;1.0;Equipment/Turn-In Request;**5**;Sep 13, 1996
  1. I +X'=X!(X>9999)!(X<1)!(X?.E1"."1N.N) K X Q
  1. S PRVQTY=$P($G(^PRCN(413,DA(1),1,DA,0)),U,5)
  1. I $P(^PRCN(413,DA(1),0),U,9)'="R" G EXIT
  1. I PRVQTY="" G EXIT
  1. S RDI=DA,RDA=DA(1),TDA=$P(^PRCN(413,RDA,0),U,11),PRCNCMR=$P(^(0),U,16)
  1. S NQTY=X I $G(NEW)'="" G EXIT
  1. I NQTY>PRVQTY D GRT G EXIT
  1. I NQTY<PRVQTY D LES
  1. EXIT K PRVQTY,NUM,TTDA,TDA,RDA,RDI,NN,NQTY,NM,QTY
  1. Q
  1. GRT ; If the quantity increased and type is replacement
  1. W !!,"You have increased your requested quantity. This request type is "
  1. W !,"a 'REPLACEMENT'. You must have a selected replacement item from the"
  1. W !,"Inventory file for each individual quantity of a line item."
  1. W !,"You must ADD a replacement item for each additional quantity requested."
  1. W !!,"Do you wish to continue" D YN^DICN I %<0!(%=2) K X Q
  1. I %=0 G GRT
  1. ; Go add replacement items
  1. S NM=$P($G(^PRCN(413.1,TDA,1,0)),U,3)
  1. I NM="" S ^PRCN(413.1,TDA,1,0)="^413.11IPA^^"
  1. D CT I NQTY=NUM W !,"Equal quantity to replacement items already!" Q
  1. S QTY=NQTY,PRCNTYP=$P(^PRCN(413,RDA,1,RDI,0),U,12) D RP2^PRCNREQN D CT I NUM<NQTY W !,"Not enough replacement items" G GRT
  1. S X=NQTY
  1. Q
  1. LES ; If the quantity decreased and type is replacement
  1. N DV
  1. W !!,"You have decreased your requested quantity. This request type is "
  1. W !,"a 'REPLACEMENT'. You must have a selected replacement item from the"
  1. W !,"Inventory file for each individual quantity of a line item."
  1. W !,"You must DELETE a replacement item for each decremented quantity requested."
  1. W !!,"Do you wish to continue" D YN^DICN I %<0!(%=2) K X Q
  1. I %=0 G LES
  1. ; Go to edit and prompt for '@'
  1. S QTY=NQTY D CT S TTDA=TDA D EN1^PRCNREQE S TDA=TTDA D CT S $P(^PRCN(413.1,TDA,1,0),U,3,4)=NUM_U_NUM
  1. I NUM>NQTY W !!,"You didn't delete any items. Please try again." G LES
  1. Q
  1. CT S NUM=0,NN="" F S NN=$O(^PRCN(413.1,TDA,1,"AC",RDI,NN)) Q:NN="" S NUM=NUM+1
  1. Q