source: WorldVistAEHR/trunk/r/IFCAP-PRC-PRX--PRCA--PRCN/PRCHDSP4.m@ 1286

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

initial load of WorldVistAEHR

File size: 3.9 KB
Line 
1PRCHDSP4 ;WISC/DJM-PRINT AMENDMENT ;6/29/00 12:19
2V ;;5.1;IFCAP;**21**;Oct 20, 2000
3 ;Per VHA Directive 10-93-142, this routine should not be modified.
4 ;
5START(PRCHPO,PRCHAM) ;PRCHPO IS 442 INTERNAL ENTRY NUMBER FOR RECORD BEING AMENDED.
6 ;PRCHAM IS IEN AMENDMENT MULTIPLE WITHIN PRCHPO BEING AMENDED.
7 ;FIND OUT WHAT TYPES OF AMENDMENTS HAVE BEEN DONE TO BE ABLE TO
8 ;DETERMINE WHAT TO PRINT OUT.
9 N AMEND,GOTO
10 S AMEND=0 F S AMEND=$O(^PRC(442,PRCHPO,6,PRCHAM,3,"AC",AMEND)) Q:AMEND'>0 S GOTO="E"_+AMEND_"^PRCHDSP4" D @GOTO
11 D LCNT^PRCHPAM5(.LCNT) S LCNTX=LCNT I LCNT>37 S LCNT=LCNT-52
12 F Q:LCNT'>41 S LCNT=LCNT-56,PRCHPGT=PRCHPGT+1
13 S:LCNTX>37 PRCHPGT=PRCHPGT+1
14 Q
15 ;
16E20 ;SHIP TO Edit PRINT
17 N FIELD,CHANGE,CHANGES,OLD,NEW,LCNT,DATA,SITE
18 D LCNT^PRCHPAM5(.LCNT)
19 S FIELD=$O(^PRC(442,PRCHPO,6,PRCHAM,3,"AC",AMEND,0)) Q:FIELD'>0
20 S CHANGE=$O(^PRC(442,PRCHPO,6,PRCHAM,3,"AC",AMEND,FIELD,0)) Q:CHANGE'>0
21 S CHANGES=^PRC(442,PRCHPO,6,PRCHAM,3,CHANGE,0),OLD=^PRC(442,PRCHPO,6,PRCHAM,3,CHANGE,1,1,0)
22 S SHIP=$P($P(CHANGES,U,3),";")
23 I SHIP=5.4 D
24 .S SITE=$P($G(^PRC(442,PRCHPO,23)),U,7),SITE=$S($G(SITE)]"":SITE,1:$P($P(^PRC(442,PRCHPO,0),U),"-"))
25 .S OLD=$P(^PRC(411,SITE,1,OLD,0),U)
26 .S NEW=$P(^PRC(442,PRCHPO,1),U,3),NEW=$P(^PRC(411,SITE,1,NEW,0),U)
27 .Q
28 I SHIP=5.3 D
29 .S NEW=$P(^PRC(442,PRCHPO,1),U,12),NEW=$P(^PRC(440.2,NEW,0),U),NEW=$P($P(^DPT(NEW,0),U),",",2)_" "_$P($P(^DPT(NEW,0),U),",")
30 .S OLD=$P(^PRC(440.2,OLD,0),U),OLD=$P($P(^DPT(OLD,0),U),",",2)_" "_$P($P(^DPT(OLD,0),U),",")
31 .Q
32 D LINE^PRCHPAM5(.LCNT,2) S DATA="Ship to location "_OLD_" has been changed to "_NEW_"."
33 D DATA^PRCHPAM5(.LCNT,DATA),LCNT1^PRCHPAM5(LCNT)
34 Q
35E21 ;LINE ITEM Add PRINT
36 N FIELD,CHANGE,CHANGES,OLD,ITEM,ITEM0,ITEM1,LCNT,DATA,I,UOP
37 S FIELD=0 K ITEM D LCNT^PRCHPAM5(.LCNT)
38 F S FIELD=$O(^PRC(442,PRCHPO,6,PRCHAM,3,"AC",AMEND,FIELD)) Q:FIELD'>0 D
39 .S CHANGE=0 F S CHANGE=$O(^PRC(442,PRCHPO,6,PRCHAM,3,"AC",AMEND,FIELD,CHANGE)) Q:CHANGE'>0 D
40 ..S CHANGES=^PRC(442,PRCHPO,6,PRCHAM,3,CHANGE,0),OLD=^PRC(442,PRCHPO,6,PRCHAM,3,CHANGE,1,1,0)
41 ..S ITEM=$P(CHANGES,U,4) Q:$D(ITEM(ITEM)) S ITEM(ITEM)=1
42 ..S ITEM0=$G(^PRC(442,PRCHPO,2,ITEM,0))
43 ..I ITEM0="" Q
44 ..I $P(ITEM0,U,2)=0,$P(ITEM0,U,9)=0 Q
45 ..S ITEM1=$G(^PRC(442,PRCHPO,2,ITEM,1,1,0))
46 ..D LINE^PRCHPAM5(.LCNT,2) S DATA=" *ADDED THROUGH AMENDMENT*" D DATA^PRCHPAM5(.LCNT,DATA)
47 ..S DATA="Item No. "_$P(ITEM0,U)_" Item Master File No. "
48 ..S DATA=DATA_$P(ITEM0,U,5)_" BOC: "_+$P(ITEM0,U,4)
49 ..S DATA=DATA_" CONTRACT: "_$P($G(^PRC(442,PRCHPO,2,ITEM,2)),U,2)
50 ..D DATA^PRCHPAM5(.LCNT,DATA)
51 ..D NEW^PRCHDSP6
52 ..S UOP=$S($P(ITEM0,U,3)>0:$P($G(^PRCD(420.5,$P(ITEM0,U,3),0)),U),1:"")
53 ..S DATA=" Items per "_UOP_": "_$P(ITEM0,U,12)
54 ..F I=1:1:26-$L(DATA) S DATA=DATA_" "
55 ..S DATA=DATA_"NSN: "_$P(ITEM0,U,13) D DATA^PRCHPAM5(.LCNT,DATA)
56 ..I $P(ITEM0,U,6)]"" S DATA=" STK#: "_$P(ITEM0,U,6) D DATA^PRCHPAM5(.LCNT,DATA)
57 ..S UOP=$S($P(ITEM0,U,3)>0:$P($G(^PRCD(420.5,$P(ITEM0,U,3),0)),U),1:"")
58 ..S DATA=" "_$P(ITEM0,U,2)_" "_UOP_" at $"_$J($P(ITEM0,U,9),12,4)_" = $"_$J($P(ITEM0,U,2)*$P(ITEM0,U,9),9,2)
59 ..D DATA^PRCHPAM5(.LCNT,DATA),LCNT1^PRCHPAM5(LCNT)
60 Q
61 ;
62E22 ;LINE ITEM Delete PRINT
63 G E22^PRCHDSP5 ;NOT ENOUGH ROOM IN THIS ROUTINE.
64 ;
65E23 ;LINE ITEM Edit PRINT
66 G E23^PRCHDSP5
67 ;
68E24 ;SOURCE CODE Edit PRINT
69 G E24^PRCHDSP7
70 ;
71E25 ;Edit MAIL INVOICE TO PRINT
72 G E25^PRCHDSP6
73 ;
74E26 ;Edit METHOD OF PAYMENT PRINT
75 G E26^PRCHDSP6
76 ;
77E27 ;ADMINISTRATIVE CERTIFICATION Add PRINT
78 G E27^PRCHDSP6
79 ;
80E28 ;ADMINISTRATIVE CERTIFICATION Delete PRINT
81 G E28^PRCHDSP6
82 ;
83E29 ;EST. SHIPPING Edit PRINT
84 G E29^PRCHDSP6
85 ;
86E30 ;F.C.P. Edit PRINT
87 G E30^PRCHDSP7
88 ;
89E31 ;Change VENDOR PRINT
90 G E31^PRCHDSP7
91 ;
92E32 ;REPLACE P.O. NUMBER PRINT
93 G E32^PRCHDSP7
94 ;
95E33 ;PROMPT PAYMENT Edit PRINT
96 G E33^PRCHDSP7
97 ;
98E34 ;AUTHORITY Edit PRINT
99 G E34^PRCHDSP8
100 ;
101E35 ;F.O.B. Point PRINT
102 G E35^PRCHDSP8
103 ;
104E36 ;ITEM DISCOUNT Add/Edit PRINT
105 G E36^PRCHDSP8
106 ;
107E37 ;ITEM DISCOUNT Delete PRINT
108 G E37^PRCHDSP8
109 ;
110E98 ;DELIVERY DATE PRINT
111 Q
112E99 ;NET AMOUNT PRINT
113 Q
Note: See TracBrowser for help on using the repository browser.