source: FOIAVistA/trunk/r/EQUIPMENT_TURN_IN_REQUEST-PRCN/PRCNREQQ.m@ 1791

Last change on this file since 1791 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 1.9 KB
Line 
1PRCNREQQ ;SSI/ALA-Line Item Quantity Edit ;[ 08/05/96 5:51 PM ]
2 ;;1.0;Equipment/Turn-In Request;**5**;Sep 13, 1996
3 I +X'=X!(X>9999)!(X<1)!(X?.E1"."1N.N) K X Q
4 S PRVQTY=$P($G(^PRCN(413,DA(1),1,DA,0)),U,5)
5 I $P(^PRCN(413,DA(1),0),U,9)'="R" G EXIT
6 I PRVQTY="" G EXIT
7 S RDI=DA,RDA=DA(1),TDA=$P(^PRCN(413,RDA,0),U,11),PRCNCMR=$P(^(0),U,16)
8 S NQTY=X I $G(NEW)'="" G EXIT
9 I NQTY>PRVQTY D GRT G EXIT
10 I NQTY<PRVQTY D LES
11EXIT K PRVQTY,NUM,TTDA,TDA,RDA,RDI,NN,NQTY,NM,QTY
12 Q
13GRT ; If the quantity increased and type is replacement
14 W !!,"You have increased your requested quantity. This request type is "
15 W !,"a 'REPLACEMENT'. You must have a selected replacement item from the"
16 W !,"Inventory file for each individual quantity of a line item."
17 W !,"You must ADD a replacement item for each additional quantity requested."
18 W !!,"Do you wish to continue" D YN^DICN I %<0!(%=2) K X Q
19 I %=0 G GRT
20 ; Go add replacement items
21 S NM=$P($G(^PRCN(413.1,TDA,1,0)),U,3)
22 I NM="" S ^PRCN(413.1,TDA,1,0)="^413.11IPA^^"
23 D CT I NQTY=NUM W !,"Equal quantity to replacement items already!" Q
24 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
25 S X=NQTY
26 Q
27LES ; If the quantity decreased and type is replacement
28 N DV
29 W !!,"You have decreased your requested quantity. This request type is "
30 W !,"a 'REPLACEMENT'. You must have a selected replacement item from the"
31 W !,"Inventory file for each individual quantity of a line item."
32 W !,"You must DELETE a replacement item for each decremented quantity requested."
33 W !!,"Do you wish to continue" D YN^DICN I %<0!(%=2) K X Q
34 I %=0 G LES
35 ; Go to edit and prompt for '@'
36 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
37 I NUM>NQTY W !!,"You didn't delete any items. Please try again." G LES
38 Q
39CT S NUM=0,NN="" F S NN=$O(^PRCN(413.1,TDA,1,"AC",RDI,NN)) Q:NN="" S NUM=NUM+1
40 Q
Note: See TracBrowser for help on using the repository browser.