Changeset 636 for FOIAVistA/tag/r/IFCAP-PRC-PRX--PRCA--PRCN/PRCHMA.m
- Timestamp:
- Dec 4, 2009, 8:26:01 PM (14 years ago)
- Location:
- FOIAVistA/tag/r
- Files:
-
- 1 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
FOIAVistA/tag/r/IFCAP-PRC-PRX--PRCA--PRCN/PRCHMA.m
r628 r636 1 1 PRCHMA ;WISC/AKS-Amend to PO, req ;6/10/96 14:07 2 ;;5.1;IFCAP;**21,79,100,113**;Oct 20, 2000;Build 4 3 ;Per VHA Directive 2004-038, this routine should not be modified. 4 REQ N PRCHREQ 2 ;;5.1;IFCAP;**21,79,100**;Oct 20, 2000 3 ;Per VHA Directive 10-93-142, this routine should not be modified. 4 REQ ;Req. 5 N PRCHREQ 5 6 S PRCHREQ=1 6 PO N PRCF,RETURN,PRCHAM,PRCHPO,PRCHNEW,OUT,CAN,PRCHAU,PRCHER,PRCHON,A,B,ER,FL,FIS,DELIVER,PRCHAMDA,PRCHAV,PRCHL1,PRCHLN,PRCHRET,LCNT 7 N PRCHL2,ROU,DIC,I,PRCHAMT,PRCHAREC,PRCHEDI,X,Y,PRCHN,PRCHO,SFUND,PRCHX,PRCHIMP,PRCHNRQ,PRCHP,REPO,PRCHNORE,%,%A,%B,D0,D1,J 7 PO ;PO 8 N PRCF,RETURN,PRCHAM,PRCHPO,PRCHNEW,OUT,CAN,PRCHAU,PRCHER,PRCHON 9 N A,B,ER,FL,FIS,DELIVER,PRCHAMDA,PRCHAV,PRCHL1,PRCHLN,PRCHRET,LCNT 10 N PRCHL2,ROU,DIC,I,PRCHAMT,PRCHAREC,PRCHEDI,X,Y,PRCHN,PRCHO,SFUND 11 N PRCHX,PRCHIMP,PRCHNRQ,PRCHP,REPO,PRCHNORE,%,%A,%B,D0,D1,J 8 12 N PRCFL,MSG 9 13 LOOP D KILL^PRCHMA1 S PRCHNEW="",PRCHNORE=1,CAN=0 10 ; See routine PRCHAMXA for information on variable PRCHNORE and undefined DIK, var PRCHPO is the basic premise of locks applied to amendments 14 ; 15 ; See routine PRCHAMXA for information on variable PRCHNORE and for 16 ; incidence of undefined DIK variable errors. 17 ; The var PRCHPO is the basic premise of locks applied to amendments. 18 ; Anytime amend module is accessed add +lock & save po# in PRCENTRY. 19 ; 11 20 S PRCF("X")="S" D ^PRCFSITE Q:'$D(PRC("SITE")) 12 ; Lock simultaneous entry of users in amend. module for the same record. Var Y is saved in PRCHPO at the end of GETPO subrtn, when we start 21 ; 22 ; Lock simultaneous entry of users in amend. module for the same record. 23 ; Var Y is saved in PRCHPO at the end of GETPO subrtn, when we start 13 24 ; the process(AMENDNO) of amending the record we must have var PRCHPO. 25 ; 14 26 S PRCFL=0 15 27 W !! D GETPO^PRCHAMU 16 ; If no record is selected or time-out or up-arrow out then exit without unlocking a record. 28 ; If no record is selected or time-out or up-arrow out then exit 29 ; without unlocking a record. 17 30 I $D(DTOUT)!$D(DUOUT)!$G(OUT)=1 G EXIT1 18 31 I PRCFL=1 G LOOP … … 33 46 . I $G(PRCHAMDA)=31 D MSG^PRCHAMU Q 34 47 . I $G(PRCHAMDA)=24,$G(X)=2 D MSG1^PRCHAMU S SCE=1 Q 48 ; 35 49 I $P(^PRC(443.6,PRCHPO,6,PRCHAM,0),U,4)=5!($P(^(0),U,4)=15) S CAN=1 36 50 I $D(DTOUT)!($D(DUOUT)) G EXIT 37 51 I $G(NOCAN)=1 G ASK 38 52 G:$P($G(^PRC(443.6,PRCHPO,6,PRCHAM,3,0)),U,4)'>1 EXIT 39 CAN1 S BFLAG=0 40 S:$P($G(^PRC(443.6,PRCHPO,1)),U,7)'=6 BFLAG=1 41 I $P($G(^PRC(443.6,PRCHPO,1)),U,7)=6 D 42 .S THISHLD=0 43 .F S THISHLD=$O(^PRC(443.6,PRCHPO,2,THISHLD)) Q:'THISHLD!(BFLAG=1) D 44 ..S:$P($G(^PRC(443.6,PRCHPO,2,THISHLD,2)),U,2)'="" BFLAG=1 45 .Q:BFLAG=1 46 .S THISHLD=0 47 .F S THISHLD=$O(^PRC(442,PRCHPO,2,THISHLD)) Q:'THISHLD!(BFLAG=1) D 48 ..S:$P($G(^PRC(442,PRCHPO,2,THISHLD,2)),U,2)'="" BFLAG=1 49 W:BFLAG=0 !,"This is now a contract order. You must add a contract to this orders item(s)",!,"before approving the amendment.",! 50 G:BFLAG=0 EXIT 51 D:BFLAG=1 UPDATE^PRCHAMU G:$D(Y) EXIT 53 CAN1 D UPDATE^PRCHAMU G:$D(Y) EXIT 52 54 CHK I '$$VERIFY^PRCHES5(PRCHPO) W !!,?5,"This purchase order has been tampered with.",!,?5,"Please notify IFCAP APPLICATION COORDINATOR." G EXIT 53 55 I $P($G(^PRC(443.6,PRCHPO,6,PRCHAM,1)),U,4)']"" W !!,?5,"There is no Amendment Status." D … … 66 68 ...S J=0 S J=$O(^PRC(443.6,PRCHPO,2,PRCH,1,J)) I J'>0 D:LCNT>END TOP W !!,?5,"Line item ",+$P(PRCHLN,U)," is missing its description!",$C(7) S PRCHER="",LCNT=LCNT+2 67 69 ...I $P($G(^PRC(442,PRCHPO,23)),U,11)="D",$P($G(^PRC(443.6,PRCHPO,2,PRCH,2)),U,2)="" D:LCNT>END TOP W !!,?5,"Line item ",+$P(PRCHLN,U)," is missing contract number.",$C(7) S PRCHER="",LCNT=LCNT+2 68 ...; PRC*5.1*79 - Check line items of PC orders with source code=6 to make sure that a contract number is entered 70 ...; PRC*5.1*79 - Check line items of PC orders with source code=6 to 71 ...; make sure that a contract number is entered 69 72 ...D PCD^PRCHMA1 70 73 ...Q … … 72 75 .I $D(PRCHER) I LCNT>END N DIR S DIR(0)="E" D ^DIR S LCNT=1 73 76 .Q 77 ;PRC*5.1*100: check line items without an FSC or PSC 74 78 D EN106^PRCHNPO7 I $G(ERROR)=1 G EXIT 75 79 I $P($G(^PRC(443.6,PRCHPO,0)),U,13)>0 I $P($G(^PRC(443.6,PRCHPO,23)),U)="" W !!,?5,"This amendment has Est. Shipping and/or Handling charges without any",!,?5,"Est. Shipping BOC." S PRCHER="" 76 80 I $P($G(^PRC(443.6,PRCHPO,6,PRCHAM,0)),U,4)=5!($P($G(^(0)),U,4)=15) S CAN=1 77 81 I $G(CAN)'=1 D CHECK^PRCHAMDF(PRCHPO,PRCHAM,.PRCHER) 82 ; 83 ; Change below to allow checks for monthly limits in file #440.5 before 84 ; completion of the amendment. 85 ; 78 86 I $G(PRCHAUTH)=1!($P($G(^PRC(443.6,PRCHPO,0)),U,2)=25) S FILE=443.6 D I $G(ERROR) S PRCHER="" K ERROR,FILE 79 87 .D ^PRCHSF3 … … 107 115 .D REMOVE^PRCSC2(PP410),ENCODE^PRCSC2(PP410,DUZ,.MESSAGE) K MESSAGE 108 116 .I '$G(PRCPROST) W !?3,"SEND TO SUPPLY " S PRCHQ="^PRCHPAM",D0=PRCHPO,D1=PRCHAM D ^PRCHQUE 109 .; Update file #440.5 after amendment has been approved. Consider orders created and amended in the same month and year and the user either 110 .; cancels the order or enters other type of amendment that changes the final amount of the order. No credit is given for orders from a 117 .; 118 .; Update file #440.5 after amendment has been approved. Consider orders 119 .; created and amended in the same month and year and the user either 120 .; cancels the order or enters other type of amendment that changes the 121 .; final amount of the order. No credit is given for orders from a 111 122 .; previous month and year. DT is the current date, system-supplied. 123 .; 112 124 .S PRCHCD=$P($G(^PRC(442,PRCHPO,23)),U,8) 113 125 .S PRCNODE=$G(^PRC(442,PRCHPO,6,0)),PRCAMD=$P(PRCNODE,U,3) … … 132 144 S SFUND="" I $P($G(^PRC(443.6,PRCHPO,0)),U,19)=2 D SUPP^PRCFFM2M S SFUND=1 133 145 I SFUND=1 W !?3,"SEND TO SUPPLY " S PRCHQ="^PRCHPAM",D0=PRCHPO,D1=PRCHAM D ^PRCHQUE 146 ; 134 147 D SOURCE^PRCHAMU:$G(SCE) 135 148 G EXIT 136 ENC S ER=0 149 ; 150 ENC ;Can 151 S ER=0 137 152 D CAN^PRCHMA3 138 153 I $G(NOCAN)=1 W !?5,$S($D(PRCHREQ):"REQUISITION",1:"PURCHASE ORDER")_" HAS BEEN RECEIVED, CANNOT CANCEL !",$C(7) S ER=1 Q … … 149 164 S PRCHAMT=-$P(^PRC(443.6,PRCHPO,0),U,15) W ! 150 165 QUIT 151 APP S %A=" Approve Amendment number "_PRCHAM_": ",%B="",%=$S($G(PRCPROST):1,1:2) D ^PRCFYN 166 APP ;App,pr 167 S %A=" Approve Amendment number "_PRCHAM_": ",%B="",%=$S($G(PRCPROST):1,1:2) D ^PRCFYN 152 168 Q 153 REV N PRCH 169 REV ;Rev 170 N PRCH 154 171 S %=1,%B="",%A=" Review Amendment " D ^PRCHSF3 W ! D ^PRCFYN 155 172 I %=1 S D0=PRCHPO,D1=PRCHAM,PRCH="^PRC(443.6," D ^PRCHDAM 156 173 Q 157 EXIT L -^PRC(442,PRCENTRY) 174 EXIT ;Ex 175 L -^PRC(442,PRCENTRY) 158 176 EXIT1 K ERROR,FIS,REPO,DEL 159 177 QUIT:$G(PRCPROST) 160 178 I $G(OUT)'=1 G LOOP 161 179 QUIT 162 FLAG I $G(FLAG)=1 K FLAG Q 180 ; 181 FLAG ; 182 I $G(FLAG)=1 K FLAG Q 163 183 Q 164 NOSIGN S $P(^PRC(443.6,PRCHPO,6,PRCHAM,0),U,4)=PRCHAU 184 NOSIGN ; 185 S $P(^PRC(443.6,PRCHPO,6,PRCHAM,0),U,4)=PRCHAU 165 186 NOSIGN1 S DA(1)=PRCHPO,DIE="^PRC(443.6,"_DA(1)_",6,",DA=PRCHAM,DR="9///@" 166 187 D ^DIE K DIE,DA,DR
Note:
See TracChangeset
for help on using the changeset viewer.