source: WorldVistAEHR/trunk/r/IFCAP-PRC-PRX--PRCA--PRCN/PRCHQ12A.m@ 1710

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

initial load of WorldVistAEHR

File size: 8.7 KB
RevLine 
[613]1PRCHQ12A ;(WASH IRMFO)/LKG-RFQ QUOTE VIEW ;8/6/96 20:44
2 ;;5.1;IFCAP;;Oct 20, 2000
3 ;Per VHA Directive 10-93-142, this routine should not be modified.
4BUILD(PRCVEN,PRCDA,PRCDA2,PRCTITLE) ;Entry for building Quote report
5 N PRCDA3,PRCDA4,PRCF,PRCI,PRCITMDA,PRCJ,PRCK,PRCL,PRCLN,PRCAR,PRCRFQ,PRCSP,PRCT
6 N DA,DIC,DIQ,DR,DIWL,DIWR,DIWF,X,Y,PRCDASH S $P(PRCDASH,"-",80)=""
7 K ^TMP($J,"RPT") S PRCRFQ=$P(^PRC(444,PRCDA,0),U),$P(PRCSP," ",81)=""
8 S (PRCF,DIC)=$P($P(PRCVEN,"(",2),","),DR=".01;4.8;5;18.3;38;46",DA=$P(PRCVEN,";")
9 S DIQ="PRCAR(" K ^UTILITY("DIQ1",$J) D EN^DIQ1 K DIQ,DR,^UTILITY("DIQ1",$J)
10 S PRCLN="Quote from Dun # "_PRCAR(PRCF,DA,18.3)_" for RFQ #: "_PRCRFQ
11 S PRCTITLE=$$CENTER(PRCLN),PRCJ=0
12 S PRCLN="Vendor: "_PRCAR(PRCF,DA,.01),PRCLN=$$PAD(PRCLN,50)
13 S PRCLN=PRCLN_"Tax ID: "_PRCAR(PRCF,DA,38)
14 S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,79)
15 S PRCLN="Voice Phone #: "_PRCAR(PRCF,DA,5),PRCLN=$$PAD(PRCLN,50)
16 S PRCLN=PRCLN_"Fax #: "_PRCAR(PRCF,DA,46)
17 S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,79)
18 S PRCLN="Contact: "_PRCAR(PRCF,DA,4.8)
19 S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,79)
20 S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(" ",79)
21 K PRCAR,DA,DIC,DIQ,^UTILITY("DIQ1",$J)
22 S DIC=444,DR=24,DA=PRCDA,DA(444.024)=PRCDA2,DR(444.024)="1;2;3;4;5;6;7;8;10;15"
23 S DIQ="PRCAR(" D EN^DIQ1 K DIC,DR,DA,^UTILITY("DIQ1",$J)
24 S PRCLN="Sellers's Ref #: "_PRCAR(444.024,PRCDA2,1)
25 S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,79)
26 S PRCLN="Quote Contact: "_PRCAR(444.024,PRCDA2,4),PRCLN=$$PAD(PRCLN,50)
27 S PRCLN=PRCLN_"Phone #: "_PRCAR(444.024,PRCDA2,5)
28 S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,79)
29 S PRCLN="Government Contract: "_PRCAR(444.024,PRCDA2,10)
30 S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,79)
31 S PRCLN="Effective Date: "_PRCAR(444.024,PRCDA2,2),PRCLN=$$PAD(PRCLN,39)
32 S PRCLN=PRCLN_"Receipt Date/Time: "_PRCAR(444.024,PRCDA2,3)
33 S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,79)
34 S PRCLN="FOB: "_PRCAR(444.024,PRCDA2,6),PRCLN=$$PAD(PRCLN,39)
35 S PRCLN=PRCLN_"Total of Lines: "_$J($FN(PRCAR(444.024,PRCDA2,15),"",2),9)
36 S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,79)
37 S PRCLN="Number of Items in RFQ: "_($P($G(^PRC(444,PRCDA,2,0)),U,4)+0)
38 S PRCLN=$$PAD(PRCLN,39)_"S/H Charges: "_$J($FN(PRCAR(444.024,PRCDA2,7)+0,"",2),12)
39 S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,79)
40 S PRCLN="Number of Items Quoted: "_($P($G(^PRC(444,PRCDA,8,PRCDA2,3,0)),U,4)+0)
41 S PRCLN=$$PAD(PRCLN,39)_"Quote Total: "_$J($FN(PRCAR(444.024,PRCDA2,8),"",2),12)
42 S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,79)
43 K PRCAR
44 S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD("Prompt Pay Terms: ",79)
45 S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(" Term / % Days",79)
46 S PRCDA3=0
47 F S PRCDA3=$O(^PRC(444,PRCDA,8,PRCDA2,2,PRCDA3)) Q:PRCDA3'?1.N D
48 . K ^UTILITY("DIQ1",$J),DA,DR,PRCAR,DIQ,DIC
49 . S DIC=444,DR=24,DA=PRCDA,DA(444.024)=PRCDA2,DR(444.024)=9
50 . S DA(444.025)=PRCDA3,DR(444.025)=".01;1",DIQ="PRCAR("
51 . D EN^DIQ1 K DIC,DR,DA,DIQ,^UTILITY("DIQ1",$J)
52 . S PRCLN=$$PAD(" ",5)_PRCAR(444.025,PRCDA3,.01),PRCLN=$$PAD(PRCLN,18)
53 . S PRCLN=PRCLN_$J(PRCAR(444.025,PRCDA3,1),3)
54 . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,79)
55 . K PRCAR
56 K ^UTILITY("DIQ1",$J) S PRCDA3=0
57 F S PRCDA3=$O(^PRC(444,PRCDA,8,PRCDA2,3,PRCDA3)) Q:PRCDA3'?1.N D
58 . S DIC=444,DR=24,DA=PRCDA,DA(444.024)=PRCDA2,DR(444.024)=11
59 . S DA(444.026)=PRCDA3,DIQ="PRCAR("
60 . S DR(444.026)=".01;1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16;18"
61 . D EN^DIQ1 K DIC,DR,DA,DIQ,^UTILITY("DIQ1",$J)
62 . S PRCLN="RFQ Line #: "_PRCAR(444.026,PRCDA3,.01),PRCLN=$$PAD(PRCLN,79)
63 . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=PRCLN
64 . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=PRCDASH
65 . S PRCLN=$$PAD("| RFQ Requirements",78)_"|"
66 . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=PRCLN
67 . S PRCITMDA=$O(^PRC(444,PRCDA,2,"B",PRCAR(444.026,PRCDA3,.01),""))
68 . I PRCITMDA="" S PRCLN="| **** Line Item #"_PRCAR(444.026,PRCDA3,.01)_" was not in the Request ****",PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,78)_"|"
69 . I PRCITMDA]"" D
70 . . S PRCLN=$$PAD("| Item Description:",78)_"|"
71 . . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=PRCLN
72 . . K ^UTILITY($J,"W") S PRCK=0,DIWL=1,DIWR=70,DIWF=""
73 . . F S PRCK=$O(^PRC(444,PRCDA,2,PRCITMDA,2,PRCK)) Q:+PRCK'=PRCK D
74 . . . Q:'$D(^PRC(444,PRCDA,2,PRCITMDA,2,PRCK,0)) S X=^(0)
75 . . . D ^DIWP
76 . . S PRCT=$G(^UTILITY($J,"W",1))
77 . . F PRCI=1:1:PRCT D
78 . . . S PRCLN="| "_$G(^UTILITY($J,"W",1,PRCI,0))
79 . . . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,78)_"|"
80 . . K ^UTILITY($J,"W"),DIWL,DIWR,DIWF
81 . . S PRCLN="| FOB: "_$S($P($G(^PRC(444,PRCDA,1)),U)="O":"ORIGIN",1:"DESTINATION")
82 . . S PRCLN=$$PAD(PRCLN,30),PRCI=$G(^PRC(444,PRCDA,2,PRCITMDA,0))
83 . . S PRCLN=PRCLN_"Quantity: "_$FN($P(PRCI,U,2)+0,"",2),PRCLN=$$PAD(PRCLN,60)
84 . . S PRCLN=PRCLN_"Unit: "_$S($P(PRCI,U,3)]"":$P($G(^PRCD(420.5,$P(PRCI,U,3),0)),U),1:"")
85 . . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,78)_"|"
86 . . S PRCK=$G(^PRC(444,PRCDA,2,PRCITMDA,3))
87 . . I $P(PRCK,U)]"",$P(PRCK,U,2)]"" D
88 . . . S PRCL=$P(PRCK,U,10)
89 . . . I PRCL="" D
90 . . . . S PRCL=$O(^PRCS(410,$P(PRCK,U),"IT","B",$P(PRCK,U,2),"")) Q:PRCL=""
91 . . . . S PRCL=$P($G(^PRCS(410,$P(PRCK,U),"IT",PRCL,0)),U,7)
92 . . . S PRCLN="| Unit Price: "_$FN(PRCL,"",4),PRCLN=$$PAD(PRCLN,40)
93 . . . S PRCLN=PRCLN_"Total Cost: "_$FN($P(PRCI,U,2)*PRCL,"",2)
94 . . . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,78)_"|"
95 . . S PRCLN="| Natl Stock #: "_$P(PRCI,U,6),PRCLN=$$PAD(PRCLN,40)
96 . . S PRCLN=PRCLN_"Mfg Part #: "_$P(PRCI,U,9),PRCLN=$$PAD(PRCLN,78)_"|"
97 . . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=PRCLN
98 . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=PRCDASH
99 . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD("Quote Information for this Line Item",79)
100 . S PRCLN="Vendor's Product #: "_PRCAR(444.026,PRCDA3,1)
101 . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,79)
102 . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD("Description: ",79)
103 . S PRCDA4=0,DIWL=1,DIWR=70,DIWF="" K ^UTILITY($J,"W")
104 . F S PRCDA4=$O(^PRC(444,PRCDA,8,PRCDA2,3,PRCDA3,2,PRCDA4)) Q:PRCDA4="" D
105 . . Q:'$D(^PRC(444,PRCDA,8,PRCDA2,3,PRCDA3,2,PRCDA4,0)) S X=^(0)
106 . . D ^DIWP
107 . S PRCT=$G(^UTILITY($J,"W",1))
108 . F PRCI=1:1:PRCT D
109 . . S PRCLN=" "_$G(^UTILITY($J,"W",1,PRCI,0))
110 . . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,79)
111 . K ^UTILITY($J,"W"),DIWL,DIWR,DIWF
112 . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(" ",79)
113 . S PRCLN="FOB: "_PRCAR(444.026,PRCDA3,11),PRCLN=$$PAD(PRCLN,40)
114 . S PRCLN=PRCLN_"Hazmat Code: "_PRCAR(444.026,PRCDA3,12)
115 . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,79)
116 . S PRCLN="Govt Contract: "_PRCAR(444.026,PRCDA3,16),PRCLN=$$PAD(PRCLN,50)
117 . S PRCLN=PRCLN_"Quantity: "_PRCAR(444.026,PRCDA3,2)
118 . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,79)
119 . S PRCLN="Unit of Purchase: "_PRCAR(444.026,PRCDA3,3),PRCLN=$$PAD(PRCLN,40)
120 . S PRCLN=PRCLN_"Unit Cost: "_PRCAR(444.026,PRCDA3,13)
121 . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,79)
122 . S PRCLN="Volume Discount %: "_PRCAR(444.026,PRCDA3,14),PRCLN=$$PAD(PRCLN,40)
123 . S PRCLN=PRCLN_"Volume Discount Amount: "_PRCAR(444.026,PRCDA3,15)
124 . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,79)
125 . S PRCLN="Net Line Amount: "_PRCAR(444.026,PRCDA3,18)
126 . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,79)
127 . S PRCLN="Natl Stock #: "_PRCAR(444.026,PRCDA3,5),PRCLN=$$PAD(PRCLN,40)
128 . S PRCLN=PRCLN_"Federal Supply Class: "_PRCAR(444.026,PRCDA3,4)
129 . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,79)
130 . S PRCLN="Natl Drug Code: "_PRCAR(444.026,PRCDA3,7),PRCLN=$$PAD(PRCLN,40)
131 . S PRCLN=PRCLN_"Mfg Part #: "_PRCAR(444.026,PRCDA3,8)
132 . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,79)
133 . S PRCLN="Lot #: "_PRCAR(444.026,PRCDA3,9),PRCLN=$$PAD(PRCLN,40)
134 . S PRCLN=PRCLN_"Serial #: "_PRCAR(444.026,PRCDA3,10)
135 . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,79)
136 . S PRCLN="SIC Code: "_$E(PRCAR(444.026,PRCDA3,6),1,68)
137 . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,79)
138 . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD("Delivery Schedules: ",79)
139 . S PRCDA4=0 K ^UTILITY("DIQ1",$J),PRCAR,DIC,DR,DIQ,DA
140 . F S PRCDA4=$O(^PRC(444,PRCDA,8,PRCDA2,3,PRCDA3,3,PRCDA4)) Q:PRCDA4'?1.N D
141 . . S DIC=444,DR=24,DA=PRCDA,DA(444.024)=PRCDA2,DR(444.024)=11
142 . . S DA(444.026)=PRCDA3,DR(444.026)=17,DA(444.027)=PRCDA4,DR(444.027)=".01;1;2;3"
143 . . S DIQ="PRCAR(" D EN^DIQ1 K DIC,DR,DA,DIQ,^UTILITY("DIQ1",$J)
144 . . S PRCLN=" Schedule #: "_PRCAR(444.027,PRCDA4,.01),PRCLN=$$PAD(PRCLN,40)
145 . . S PRCLN=PRCLN_"Date: "_PRCAR(444.027,PRCDA4,1)
146 . . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,79)
147 . . S PRCLN=" Quantity: "_PRCAR(444.027,PRCDA4,2),PRCLN=$$PAD(PRCLN,40)
148 . . S PRCLN=PRCLN_"Unit of Purchase: "_PRCAR(444.027,PRCDA4,3)
149 . . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(PRCLN,79)
150 . . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(" ",79)
151 . . K PRCAR
152 . S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD(" ",79)
153 S PRCJ=PRCJ+1,^TMP($J,"RPT",PRCJ)=$$PAD("* End of Quote *",79)
154 Q
155PAD(X,Y) ;Pad on right with spaces to specified length
156 S X=X_$E(PRCSP,$L(X)+1,Y)
157 Q X
158CENTER(X) ;Center Text
159 S X=$E(PRCSP,1,79-$L(X)\2)_X,X=$$PAD(X,79)
160 Q X
Note: See TracBrowser for help on using the repository browser.