| 1 | PRCHDAM2 ;WISC/DJM-PRINT AMENDMENT, ROUTINE #2 ;9/15/95 11:41 AM
|
---|
| 2 | V ;;5.1;IFCAP;**21**;Oct 20, 2000
|
---|
| 3 | ;Per VHA Directive 10-93-142, this routine should not be modified.
|
---|
| 4 | ;
|
---|
| 5 | E22 ;LINE ITEM Delete PRINT
|
---|
| 6 | N FIELD,CHANGE,CHANGES,OLD,ITEM,ITEM0,ITEM1,ITEM2,LCNT,DATA,I,UOP
|
---|
| 7 | S FIELD=0 K ITEM D LCNT^PRCHDAM4(.LCNT)
|
---|
| 8 | F S FIELD=$O(^PRC(443.6,PRCHPO,6,PRCHAM,3,"AC",AMEND,FIELD)) Q:FIELD'>0 D
|
---|
| 9 | .S CHANGE=0 F S CHANGE=$O(^PRC(443.6,PRCHPO,6,PRCHAM,3,"AC",AMEND,FIELD,CHANGE)) Q:CHANGE'>0 D
|
---|
| 10 | ..S CHANGES=^PRC(443.6,PRCHPO,6,PRCHAM,3,CHANGE,0),OLD=^PRC(443.6,PRCHPO,6,PRCHAM,3,CHANGE,1,1,0)
|
---|
| 11 | ..S ITEM=$P(CHANGES,U,4) Q:$D(ITEM(ITEM)) S ITEM(ITEM)=1
|
---|
| 12 | ..S ITEM0=$G(^PRC(443.6,PRCHPO,2,ITEM,0))
|
---|
| 13 | ..I ITEM0="" Q
|
---|
| 14 | ..S ITEM1=$G(^PRC(443.6,PRCHPO,2,ITEM,1,1,0))
|
---|
| 15 | ..D LINE^PRCHDAM4(.LCNT,2) S DATA="The following line item has been cancelled:" D DATA^PRCHDAM4(.LCNT,DATA)
|
---|
| 16 | ..S DATA="Item No. "_$P(ITEM0,U)_" Item Master File No. "
|
---|
| 17 | ..S DATA=DATA_$P(ITEM0,U,5)_" BOC: "_+$P(ITEM0,U,4)
|
---|
| 18 | ..S DATA=DATA_" CONTRACT: "_$P($G(^PRC(443.6,PRCHPO,2,ITEM,2)),U,2)
|
---|
| 19 | ..D DATA^PRCHDAM4(.LCNT,DATA)
|
---|
| 20 | ..D NEW^PRCHDAM4
|
---|
| 21 | ..S UOP=$S($P(ITEM0,U,3)>0:$P($G(^PRCD(420.5,$P(ITEM0,U,3),0)),U),1:"")
|
---|
| 22 | ..S DATA=" Items per "_UOP_": "_$P(ITEM0,U,12)
|
---|
| 23 | ..F I=1:1:26-$L(DATA) S DATA=DATA_" "
|
---|
| 24 | ..S DATA=DATA_"NSN: "_$P(ITEM0,U,13) D DATA^PRCHDAM4(.LCNT,DATA)
|
---|
| 25 | ..I $P(ITEM0,U,6)]"" S DATA=" STK#: "_$P(ITEM0,U,6) D DATA^PRCHDAM4(.LCNT,DATA)
|
---|
| 26 | ..S QTY=$$FETCH(2,ITEM)
|
---|
| 27 | ..S AUC=$$FETCH(5,ITEM)
|
---|
| 28 | ..S UOP=$S($P(ITEM0,U,3)>0:$P($G(^PRCD(420.5,$P(ITEM0,U,3),0)),U),1:"")
|
---|
| 29 | ..S DATA=" "_QTY_" "_UOP_" at $"_$J(AUC,12,4)_" = $"_$J(QTY*AUC,9,2) D DATA^PRCHDAM4(.LCNT,DATA),LCNT1^PRCHDAM4(LCNT)
|
---|
| 30 | Q
|
---|
| 31 | ;
|
---|
| 32 | E23 ;LINE ITEM Edit PRINT
|
---|
| 33 | N FIELD,CHANGE,CHANGES,IMF,BOC,OLD,ITEM,ITEM0,ITEM1,ITEMZ,QTY,AUC,UOP,UOP1,NSN,UCF,LCNT,DATA,DES,VAL,PRCHLN,ABC,VSN,CON442,CON4436
|
---|
| 34 | S FIELD=0 K ITEM D LCNT^PRCHDAM4(.LCNT)
|
---|
| 35 | F S FIELD=$O(^PRC(443.6,PRCHPO,6,PRCHAM,3,"AC",AMEND,FIELD)) Q:FIELD'>0 D
|
---|
| 36 | .S CHANGE=0 F S CHANGE=$O(^PRC(443.6,PRCHPO,6,PRCHAM,3,"AC",AMEND,FIELD,CHANGE)) Q:CHANGE'>0 D
|
---|
| 37 | ..S CHANGES=^PRC(443.6,PRCHPO,6,PRCHAM,3,CHANGE,0),OLD=^PRC(443.6,PRCHPO,6,PRCHAM,3,CHANGE,1,1,0)
|
---|
| 38 | ..S ITEM=$P(CHANGES,U,4) Q:$D(ITEM(ITEM)) S ITEM(ITEM)=1
|
---|
| 39 | ..S ITEM0=$G(^PRC(443.6,PRCHPO,2,ITEM,0))
|
---|
| 40 | ..I ITEM0="" Q
|
---|
| 41 | ..I $P(ITEM0,U,2)=0,$P(ITEM0,U,9)=0 Q
|
---|
| 42 | ..S CON4436=$P($G(^PRC(443.6,PRCHPO,2,ITEM,2)),U,2)
|
---|
| 43 | ..S CON442=$P($G(^PRC(442,PRCHPO,2,ITEM,2)),U,2)
|
---|
| 44 | ..S ITEM1=$G(^PRC(443.6,PRCHPO,2,ITEM,1,1,0))
|
---|
| 45 | ..S (ABC,DES)=$$FETCH(1,ITEM) S PRCHLN=VAL
|
---|
| 46 | ..S IMF=$$FETCH(1.5,ITEM) I IMF'>0 S IMF=$P(ITEM0,U,5)
|
---|
| 47 | ..S BOC=+$$FETCH(3.5,ITEM) I BOC'>0 S BOC=+$P(ITEM0,U,4)
|
---|
| 48 | ..S QTY=$$FETCH(2,ITEM) I QTY'>0 S QTY=$P(ITEM0,U,2)
|
---|
| 49 | ..S AUC=$$FETCH(5,ITEM) I AUC="" S AUC=$P(ITEM0,U,9)
|
---|
| 50 | ..S UOP=$$FETCH(3,ITEM) I UOP'>0 S UOP=$P(ITEM0,U,3)
|
---|
| 51 | ..S NSN=$$FETCH(9.5,ITEM) I NSN="" S NSN=$P(ITEM0,U,13)
|
---|
| 52 | ..S UCF=$$FETCH(3.1,ITEM) I UCF'>0 S UCF=$P(ITEM0,U,12)
|
---|
| 53 | ..S VSN=$$FETCH(9,ITEM) I VSN="" S VSN=$P(ITEM0,U,6)
|
---|
| 54 | ..D LINE^PRCHDAM4(.LCNT,2)
|
---|
| 55 | ..S DATA="**Currently:" D DATA^PRCHDAM4(.LCNT,DATA)
|
---|
| 56 | ..S DATA="Item No. "_$P(ITEM0,U)_" Item Master File No. "_IMF_" BOC: "_BOC_" CONTRACT: "_CON442 D DATA^PRCHDAM4(.LCNT,DATA)
|
---|
| 57 | ..I $L(ABC)>0 D OLD^PRCHDAM4
|
---|
| 58 | ..I $L(ABC)'>0 S ITEMZ=ITEM1 D NEW^PRCHDAM4
|
---|
| 59 | ..S UOP1=$S($L(UOP)>0:$P($G(^PRCD(420.5,UOP,0)),U),1:"")
|
---|
| 60 | ..S DATA=" Items per "_UOP1_": "_UCF
|
---|
| 61 | ..F I=1:1:26-$L(DATA) S DATA=DATA_" "
|
---|
| 62 | ..S DATA=DATA_"NSN: "_NSN D DATA^PRCHDAM4(.LCNT,DATA)
|
---|
| 63 | ..I $L(VSN)>0 S DATA=" STK#: "_VSN D DATA^PRCHDAM4(.LCNT,DATA)
|
---|
| 64 | ..S UOP1=$S($L(UOP)>0:$P($G(^PRCD(420.5,UOP,0)),U),1:"")
|
---|
| 65 | ..S DATA=" "_QTY_" "_UOP1_" at $"_$J(AUC,12,4)_" = $"_$J(QTY*AUC,9,2) D DATA^PRCHDAM4(.LCNT,DATA)
|
---|
| 66 | ..S DATA=" " D DATA^PRCHDAM4(.LCNT,DATA)
|
---|
| 67 | ..S DATA=" **Will now be AMENDED to read:" D DATA^PRCHDAM4(.LCNT,DATA)
|
---|
| 68 | ..S DATA="Item No. "_$P(ITEM0,U)_" Item Master File No. "
|
---|
| 69 | ..S DATA=DATA_$P(ITEM0,U,5)_" BOC: "_+$P(ITEM0,U,4)_" CONTRACT: "
|
---|
| 70 | ..S DATA=DATA_CON4436 D DATA^PRCHDAM4(.LCNT,DATA)
|
---|
| 71 | ..S:$D(ITEMZ) ITEM1=ITEMZ D NEW^PRCHDAM4
|
---|
| 72 | ..S UOP1=$S($P(ITEM0,U,3)>0:$P($G(^PRCD(420.5,$P(ITEM0,U,3),0)),U),1:"")
|
---|
| 73 | ..S DATA=" Items per "_UOP1_": "_$P(ITEM0,U,12)
|
---|
| 74 | ..F I=1:1:26-$L(DATA) S DATA=DATA_" "
|
---|
| 75 | ..S DATA=DATA_"NSN: "_$P(ITEM0,U,13) D DATA^PRCHDAM4(.LCNT,DATA)
|
---|
| 76 | ..I $P(ITEM0,U,6)]"" S DATA=" STK#: "_$P(ITEM0,U,6) D DATA^PRCHDAM4(.LCNT,DATA)
|
---|
| 77 | ..S UOP1=$S($P(ITEM0,U,3)>0:$P($G(^PRCD(420.5,$P(ITEM0,U,3),0)),U),1:"")
|
---|
| 78 | ..S DATA=" "_$P(ITEM0,U,2)_" "_UOP1_" $"_$J($P(ITEM0,U,9),12,4)_" = $"_$J($P(ITEM0,U,2)*$P(ITEM0,U,9),9,2)
|
---|
| 79 | ..D DATA^PRCHDAM4(.LCNT,DATA),LCNT1^PRCHDAM4(LCNT)
|
---|
| 80 | Q
|
---|
| 81 | ;
|
---|
| 82 | FETCH(FIELD,ITEM) ;EXTRINSIC FUNCTION TO RETURN THE 'VALUE' FOR A FIELD FROM 'LINE ITEM
|
---|
| 83 | ;AMENDMENT' OPTIONS.
|
---|
| 84 | N VAL1
|
---|
| 85 | S VAL=0 F S VAL=$O(^PRC(443.6,PRCHPO,6,PRCHAM,3,"AC",21,FIELD,VAL)) Q:VAL'>0 S VAL1=$P(^PRC(443.6,PRCHPO,6,PRCHAM,3,VAL,0),U,4) I VAL1=ITEM S VAL1=0 G EXIT
|
---|
| 86 | S VAL=0 F S VAL=$O(^PRC(443.6,PRCHPO,6,PRCHAM,3,"AC",22,FIELD,VAL)) Q:VAL'>0 S VAL1=$P(^PRC(443.6,PRCHPO,6,PRCHAM,3,VAL,0),U,4) I VAL1=ITEM D G EXIT
|
---|
| 87 | .S VAL1=^PRC(443.6,PRCHPO,6,PRCHAM,3,VAL,1,1,0)
|
---|
| 88 | .Q
|
---|
| 89 | S VAL=0 F S VAL=$O(^PRC(443.6,PRCHPO,6,PRCHAM,3,"AC",23,FIELD,VAL)) Q:VAL'>0 S VAL1=$P(^PRC(443.6,PRCHPO,6,PRCHAM,3,VAL,0),U,4) I VAL1=ITEM D G EXIT
|
---|
| 90 | .S VAL1=^PRC(443.6,PRCHPO,6,PRCHAM,3,VAL,1,1,0)
|
---|
| 91 | .Q
|
---|
| 92 | S VAL1=""
|
---|
| 93 | EXIT Q VAL1
|
---|