DBA Data[Home] [Help]

PACKAGE: APPS.PO_RELGEN_PKG

Source


1 PACKAGE PO_RELGEN_PKG AUTHID CURRENT_USER AS
2 /* $Header: porelges.pls 120.4.12020000.3 2013/02/10 17:27:55 vegajula ship $ */
3 
4 
5 /*  Declare cursor for requisition lines that meet the following criteria
6 
7     - the requisition lines must be on approved requisitions that are not
8       already on a PO or a release
9     - the requisition lines must not be cancelled or closed
10     - the requisition lines must be sourced to an approved and active blanket
11       that is not on hold
12     - the vendor associated with the blanket must be active, and must not be
13       on hold if vendors holds are enforced
14     - the autosource rule for the item must be active and the document
15       generation method must be either 'CREATE' or 'CREATE_AND_APPROVE'
16     - the amount (qty*price) must be greater than the minimum release amount
17       on the blanket line if one is specified
18 */
19 /** Bug 787120
20  *  bgu, June 09, 1999
21  *  Port bug fix 772055 to 11.5
22  */
23 /*
24 Bug # : 772055 - SVAIDYAN : Added condn. that the modified_by_agent_flag = 'N'
25       so that the req. lines modified thru autocreate form do not get processed.
26 */
27 /* Bug no 777230
28    In both the cursor requisition_lines_cursor and
29                       requisition_lines_cursor1
30    we were not checking the if the line of the blanket is cancelled
31    before allowing the release to be created.
32    Made the fix to check for that.nvl(pol.cancel_flag,'N') = 'N'
33 */
34 /* Bug no 996349
35    In both the cursor requisition_lines_cursor and
36                          requisition_lines_cursor1
37    we were not checking the if the line of the blanket line is finally closed
38    before allowing the release to be created.
39    Made the fix to check for that.
40           nvl(pol.closed_code,'OPEN') <> 'FINALLY CLOSED'
41 */
42 /* Bug #947709 - FRKHAN 8/4/99
43    'requisition_header_id' is added to  requisition_lines_cursor and
44    requisition_lines_cursor1.
45 */
46     /* Supplier PCard FPH. Get the pcard_id from the function
47      * po_pcard_pkg.get_valid_pcard_id.  This will fetch pcard_id
48      * if it is valid or null if it is not. The orderby is done
49      * in such a way that all the null pcard_ids and the non null
50      * pcard_ids are grouped together. This way all null will be
51      * grouped into one release. For the others all the same non null
52      * pcard_ids will be grouped into one.
53     */
54     cursor requisition_lines_cursor is
55           select porl.requisition_line_id requisition_line_id,
56                  poh.agent_id agent_id,
57                  porl.blanket_po_header_id blanket_po_header_id,
58                  pol.po_line_id blanket_po_line_id,
59                  poh.vendor_id vendor_id,
60                  poh.vendor_site_id vendor_site_id,
61                  nvl(poh.rate,1) rate,
62                  nvl(poh.rate_date,sysdate) rate_date,
63                  porl.last_updated_by last_updated_by,
64                  porl.last_update_login last_update_login,
65                  porl.destination_type_code destination_type_code,
66                  porl.item_id item_id,
67                  porl.unit_price unit_price,
68                  porl.quantity quantity,
69                  porl.need_by_date need_by_date,
70                  --togeorge 09/28/2000
71                  --added note to receiver
72                  porl.note_to_receiver note_to_receiver,
73                  porl.destination_organization_id destination_organization_id,
74                  porl.deliver_to_location_id deliver_to_location_id,
75                  porl.to_person_id deliver_to_person_id,
76                  decode(pad.doc_generation_method, 'CREATE_AND_APPROVE',
77                    decode(fsp.req_encumbrance_flag, 'Y', 'CREATE', 'CREATE_AND_APPROVE'),
78                         pad.doc_generation_method) doc_generation_method,
79                  porl.unit_meas_lookup_code req_uom,
80                  pol.unit_meas_lookup_code po_uom,
81                  prh.requisition_header_id requisition_header_id,
82                  porl.secondary_unit_of_measure secondary_unit_of_measure,
83                  porl.secondary_quantity secondary_quantity,
84                  porl.preferred_grade preferred_grade,  /* B1548597 OPM */
85                 decode(porl.pcard_flag,'N',null,'S',po_pcard_pkg.get_valid_pcard_id(-99999,porl.vendor_id,porl.vendor_site_id),'Y',po_pcard_pkg.get_valid_pcard_id(prh.pcard_id,porl.vendor_id,porl.vendor_site_id)) pcard_id,
86                  porl.vmi_flag,   -- VMI FPH
87                  porl.drop_ship_flag,   -- <DropShip FPJ>
88                  porl.org_id            -- <R12 MOAC>
89             from po_requisition_lines porl,
90                  po_requisition_headers prh,
91                  financials_system_parameters fsp,
92                  po_system_parameters psp,
93                  po_autosource_documents pad,
94                  po_autosource_rules par,
95                  po_headers poh,
96                  po_lines pol,
97                  po_vendors pov
98            where porl.requisition_header_id = prh.requisition_header_id
99              and prh.authorization_status = 'APPROVED'
100              and porl.line_location_id is null
101              and nvl(porl.cancel_flag,'N') = 'N'
102              and nvl(porl.closed_code,'OPEN') <> 'FINALLY CLOSED'
103              and nvl(porl.modified_by_agent_flag, 'N') = 'N'
104              and porl.blanket_po_header_id is not null
105              and porl.blanket_po_line_num is not null
106              and porl.unit_price is not null
107              and porl.item_id is not null
108              and porl.document_type_code = 'BLANKET'
109              and porl.blanket_po_header_id = poh.po_header_id
110              and pol.po_header_id = poh.po_header_id
111              and trunc(nvl(pol.expiration_date,sysdate+1)) > trunc(sysdate)
112              and nvl(pol.cancel_flag,'N') = 'N'
113              and nvl(pol.closed_code,'OPEN') <> 'FINALLY CLOSED'
114              and poh.type_lookup_code = 'BLANKET'
115              and poh.approved_flag = 'Y'
116              and nvl(poh.cancel_flag,'N') = 'N'
117 /* Bug 1128903
118    Modifying the AND condition to accomodate the need_by_date so that
119    documents effective for a future period can be chosen. */
120            and trunc(nvl(porl.need_by_date, sysdate))
121              between trunc(nvl(poh.start_date,nvl(porl.need_by_date, sysdate)))
122                    and trunc(nvl(poh.end_date,nvl(porl.need_by_date, sysdate)))
123              and nvl(poh.user_hold_flag,'N') = 'N'
124              and poh.vendor_id = pov.vendor_id
125              and trunc(sysdate) between trunc(nvl(pov.start_date_active,
126                                                                       sysdate))
127                                     and trunc(nvl(pov.end_date_active,sysdate))
128              and not(nvl(psp.enforce_vendor_hold_flag,'N') = 'Y'
129                      and nvl(pov.hold_flag,'N') = 'Y')
130              and porl.blanket_po_line_num = pol.line_num
131              and porl.blanket_po_header_id = pad.document_header_id
132              and pol.po_line_id = pad.document_line_id
133              and pad.doc_generation_method in ('CREATE','CREATE_AND_APPROVE')
134              and pad.autosource_rule_id = par.autosource_rule_id
135  /* Bug 1128903
136    Modifying the AND condition to accomodate the need_by_date so that
137    sourcing rules effective for a future period can be chosen. */
138              and trunc(nvl(porl.need_by_date, sysdate))
139                     between trunc(par.start_date)
140                     and trunc(nvl(par.end_date,nvl(porl.need_by_date, sysdate)))
141 -- Bug 2701147 START
142 -- We should compare the BPA line minimum release amount against the total
143 -- amount of all shipments for that line on the release. This is now done
144 -- in Check 12 of preapproval_checks.
145 --             and (porl.quantity * round(porl.unit_price/nvl(poh.rate,1),5)
146 --                                         >= nvl(pol.min_release_amount,0))
147 -- Bug 2701147 END
148         order by blanket_po_header_id,
149                  doc_generation_method,
150                  blanket_po_line_num,
151                 /* Supplier PCard FPH */
152                 decode(porl.pcard_flag,'N',null,'S',po_pcard_pkg.get_valid_pcard_id(-99999,porl.vendor_id,porl.vendor_site_id),'Y',po_pcard_pkg.get_valid_pcard_id(prh.pcard_id,porl.vendor_id,porl.vendor_site_id)),
153                  need_by_date, -- bug 2378110
154                  requisition_line_id
155         for update of porl.line_location_id;
156 
157     /*  Cursor requisition_lines_cursor1 selects requisition lines based on
158         the same criteria as requisition_lines_cursor except that it checks
159         the asl entry to determine the release generation method.  The gets
160         the asl entry based on the item/category on the req line and
161         vendor/site on the source document.
162     */
163 /*Bug 1790311:Before fix the following cursor was picking up a record from
164               po_asl_attributes even if there was no blanket attached to the
165               supplier line in the ASL.This caused duplicate shipments to be
166               created in the Release if there are two supplier lines in the
167               ASL.One with a supplier and null supplier site combination  and
168               the other with a supplier and a supplier site,attached to the same
169               blanket.Now adding the table po_asl_documents in the cursor and
170               adding a condition which checks whether a blanket has been
171               attached to a supplier line in the ASL.*/
172 
173 /*Bug 1916078. Pchintal. Reverted the fix done in bug 1361935, which was a forward port
174   from 11.0 and was causing a performance problem in 11.5. The performance with out this
175   fix is very good and the fix from bug 1361935 was causing a performance problem.
176 */
177 /* Bug 2008371. pchintal. Added the ORDERED hint and changed the order of
178   the tables in the from clause to improve the performance.
179 */
180 
181 /*Bug 2005755:
182 
183 1.Reverting the fix for bug 1790311.
184 2.Now a shipment will be created for all the valid supplier lines with null
185   supplier site.
186 3.A shipment will be created for a valid supplier line having a supplier site
187   only when there is no other supplier line is existing with the same supplier-
188   item combination having a null supplier site. */
189 
190 --bug2880298
191 --pass req_enc_flag and enforce_vendor_hold_flag information from the caller
192 --instead of getting them in the cursor itself to improve performance
193 /*bug12602301 starts:  Performance issue.
194  	 in order to determine the one particular entry from
195  	 the asl table the earlier cursor had many queries within itself
196  	 i.e subqueries. As a part of the fix all the conditions of the subqueries have been
197  	 incorporated in a single sql.This sql is in the function get_asl_id which retruns the asl_id
198  	 The precedence for picking up an asl entry is
199  	 1. Item level asl.
200  	 2. Category ASl
201  	 For each of the above
202  	 Local ASL will be preferred over global asl
203  	 Valid Vendor site will be preferred than vendor_site being null
204  	   */
205  	 FUNCTION get_asl_id( p_item_id IN po_requisition_lines_all.item_id%TYPE,
206  	                      p_category_id IN po_requisition_lines_all.category_id%TYPE,
207  	                      p_destination_organization_id      IN po_requisition_lines_all.destination_organization_id%TYPE,
208  	                      p_vendor_id IN po_headers_all.vendor_id%TYPE,
209  	                      p_vendor_site_id IN po_headers_all.vendor_site_id%TYPE) return number;
210     cursor requisition_lines_cursor1
211     ( p_req_enc_flag IN VARCHAR2,
212       p_enforce_vendor_hold_flag IN VARCHAR2
213     ) is
214           select /*+ FIRST_ROWS LEADING(PORL) */
215                  porl.requisition_line_id requisition_line_id,
216                  poh.agent_id agent_id,
217                  porl.blanket_po_header_id blanket_po_header_id,
218                  pol.po_line_id blanket_po_line_id,
219                  poh.vendor_id vendor_id,
220                  poh.vendor_site_id vendor_site_id,
221                  nvl(poh.rate,1) rate,
222                  nvl(poh.rate_date,sysdate) rate_date,
223                  porl.last_updated_by last_updated_by,
224                  porl.last_update_login last_update_login,
225                  porl.destination_type_code destination_type_code,
226                  porl.item_id item_id,
227                  porl.unit_price unit_price,
228                  porl.quantity quantity,
229                  porl.need_by_date need_by_date,
230                  --togeorge 09/28/2000
231                  --added note to receiver
232                  porl.note_to_receiver note_to_receiver,
233                  porl.destination_organization_id destination_organization_id,
234                  porl.deliver_to_location_id deliver_to_location_id,
235                  porl.to_person_id deliver_to_person_id,
236                   decode(paa.release_generation_method, 'CREATE_AND_APPROVE',
237 --                 decode(pad.doc_generation_method, 'CREATE_AND_APPROVE',
238                    DECODE (p_req_enc_flag, 'Y', 'CREATE',
239                                                 'CREATE_AND_APPROVE'),
240                         paa.release_generation_method) doc_generation_method,
241 --                        pad.doc_generation_method) doc_generation_method,
242                  porl.unit_meas_lookup_code req_uom,
243                  pol.unit_meas_lookup_code po_uom,
244                  prh.requisition_header_id requisition_header_id,
245                  porl.secondary_unit_of_measure secondary_unit_of_measure,
246                  porl.secondary_quantity secondary_quantity,
247                  porl.preferred_grade preferred_grade,  /* B1548597 OPM */
248                 /* Supplier PCard FPH */
249                 decode(porl.pcard_flag,'N',null,'S',po_pcard_pkg.get_valid_pcard_id(-99999,porl.vendor_id,porl.vendor_site_id),'Y',po_pcard_pkg.get_valid_pcard_id(prh.pcard_id,porl.vendor_id,porl.vendor_site_id)) pcard_id,
250                  porl.vmi_flag,   -- VMI FPH
251                  porl.drop_ship_flag,   -- <DropShip FPJ>
252                  porl.org_id            -- <R12 MOAC>
253          from     po_requisition_lines porl,
254                   po_requisition_headers prh,
255                   po_headers poh,
256                   po_vendors pov,
257                   po_lines pol,
258                   po_asl_attributes_val_v  paa    -- Bug: 1945461
259 --bug  2005755                  po_asl_documents pod             -- Bug 1790311
260 --                 po_autosource_documents pad,
261 --                 po_autosource_rules par,
262            where porl.requisition_header_id = prh.requisition_header_id
263              -- <REQINPOOL>: removed parameters made redundant by new
264 	     and nvl(prh.authorization_status,'INCOMPLETE') = 'APPROVED'     --Bug: 14052972
265              -- reqs_in_pool_flag def
266              and nvl(porl.reqs_in_pool_flag,'N') = 'Y'      /* Requisition To Sourcing FPH  */
267              -- <REQINPOOL END>
268              and porl.source_type_code = 'VENDOR'
269              and porl.blanket_po_header_id is not null
270              and porl.blanket_po_line_num is not null
271              and porl.unit_price is not null
272              and porl.item_id is not null
273              and porl.document_type_code = 'BLANKET'
274              and porl.blanket_po_header_id = poh.po_header_id
275              and pol.po_header_id = poh.po_header_id
276              and trunc(nvl(pol.expiration_date,sysdate+1)) >= trunc(sysdate) --Bug 5636580 , Modified so that we can Create Releases for a Blanket
277                                                                              --Purchase Agreement which has the line level expiration date as Current date
278              and nvl(pol.cancel_flag,'N') = 'N'
279              and nvl(pol.closed_code,'OPEN') <> 'FINALLY CLOSED'
280              and poh.type_lookup_code = 'BLANKET'
281              and nvl(poh.global_agreement_flag,'N') = 'N'   -- FPI GA
282              and poh.approved_flag = 'Y'
283              and nvl(poh.cancel_flag,'N') = 'N'
284 /* Bug 1128903
285    Modifying the AND condition to accomodate the need_by_date so that
286    documents effective for a future period can be fixed. */
287 
288 /* Bug 2402167: In order to allow releases to be created even if the need by date
289    is after the blanket's expiry date, modifying the condition put in by 1128903.
290    Now, it allows release to be created as long as:
291    1. blanket is not ALREADY expired.
292    2. blanket is becoming effective on or before the need by date. */
293 --           and trunc(nvl(porl.need_by_date, sysdate))
294 --            between trunc(nvl(poh.start_date,nvl(porl.need_by_date, sysdate)))
295 --             and trunc(nvl(poh.end_date,nvl(porl.need_by_date, sysdate)))
296 
297 
298 /* Bug 3397912: Requisition lines without need-by dates were being missed by
299  * this cursor, because one of the need-by dates below was missing an NVL(...,sysdate).
300  * All porl.need_by_date items should now have NVL() around them in this query.
301  */
302 
303              and trunc(nvl(poh.end_date, sysdate + 1)) >= trunc(sysdate)
304              and trunc(nvl(poh.start_date, NVL(porl.need_by_date,SYSDATE) - 1))
305                                       <= trunc(nvl(porl.need_by_date, sysdate))
306 -- Bug 2402167.end
307 
308              and nvl(poh.user_hold_flag,'N') = 'N'
309              and poh.vendor_id = pov.vendor_id
310              and trunc(sysdate) between trunc(nvl(pov.start_date_active,
311                                                                       sysdate))
312                                     and trunc(nvl(pov.end_date_active,sysdate))
313              and not(p_enforce_vendor_hold_flag = 'Y'  -- bug2880298
314                      and nvl(pov.hold_flag,'N') = 'Y')
315              and porl.blanket_po_line_num = pol.line_num
316 			  --bug 12602301 starts
317 			  AND paa.vendor_id = poh.vendor_id
318  	             AND paa.asl_id = po_relgen_pkg.get_asl_id(porl.item_id,porl.category_id,porl.destination_organization_id,
319  	                                               poh.vendor_id, poh.vendor_site_id)
320 
321  	              /*and (paa.item_id = porl.item_id
322                or (paa.item_id IS NULL
323                      AND porl.category_id = paa.category_id
324                   --Bug#2279155 start
325                      and not exists
326                  (select 'commodity level ASL should be used
327                           only if there is no item level ASL'
328                     from po_asl_attributes_val_v paa4
329                    where paa4.item_id=porl.item_id
330                      and paa4.vendor_id=paa.vendor_id
331                      and nvl(paa4.vendor_site_id,-1)=nvl(paa.vendor_site_id,-1)
332                      AND paa4.using_organization_id in (-1,porl.destination_organization_id))
333                   --Bug#2279155 end
334                   )
335                  )
336 				--Bug2005755 and pod.asl_id=paa.asl_id   --Bug 1790311
337 				--Bug2005755 and porl.blanket_po_header_id=pod.document_header_id --Bug 1790311
338 				--Bug2005755 and pol.po_line_id= pod.document_line_id  --Bug 1790311
339 				--Bug2005755and pod.using_organization_id=paa.using_organization_id--Bug 1790311
340 							 and paa.vendor_id = poh.vendor_id
341 
342 				--start of bug Bug2005755
343 							 and (paa.vendor_site_id is null or
344 				  ( poh.vendor_site_id = paa.vendor_site_id and
345 					not exists
346 					(SELECT 'select supplier line with null supplier site'
347 					 FROM    po_asl_attributes_val_v paa3
348 					 WHERE   nvl(paa.item_id, -1) = nvl(paa3.item_id, -1)
349 					 AND     nvl(paa.category_id, -1) = nvl(paa3.category_id, -1)
350 					 AND     paa.vendor_id = paa3.vendor_id
351 					 AND     paa3.vendor_site_id is null
352 					 AND paa3.using_organization_id in (-1,porl.destination_organization_id)
353 				/*
354 					Bug 4001367 : Duplicate shipments were created for the requisition line
355 					sourced to a source document associated with the supplier and site and
356 					the release generation method set to 'Automatic' and also
357 					another ASL existed for the same supplier without supplier site and Release
358 					Generation method set to 'Automatic Release/Review'. We also need to add
359 					a check for release generation method CREATE(Automatic Release/Review)
360 
361 					 AND paa3.release_generation_method in ('CREATE_AND_APPROVE','CREATE'))))
362             --end of bug 2005755
363              and paa.using_organization_id =
364                         (SELECT  max(paa2.using_organization_id)
365                          FROM         po_asl_attributes_val_v paa2
366                          WHERE   nvl(paa.item_id, -1) = nvl(paa2.item_id, -1)
367                          AND         nvl(paa.category_id, -1) = nvl(paa2.category_id, -1)
368                          AND         paa.vendor_id = paa2.vendor_id
369                          AND         nvl(paa.vendor_site_id, -1) = nvl(paa2.vendor_site_id, -1)
370                          AND     paa2.using_organization_id in (-1,porl.destination_organization_id))
371              and paa.release_generation_method in ('CREATE','CREATE_AND_APPROVE')   */
372               --bug 12602301 ends
373 --             and porl.blanket_po_header_id = pad.document_header_id
374 --             and pol.po_line_id = pad.document_line_id
375 --             and pad.doc_generation_method in ('CREATE','CREATE_AND_APPROVE')
376 --             and pad.autosource_rule_id = par.autosource_rule_id
377 --             and trunc(sysdate) between trunc(par.start_date)
378 --                                    and trunc(nvl(par.end_date,sysdate))
379 -- Bug 2701147 START
380 -- We should compare the BPA line minimum release amount against the total
381 -- amount of all shipments for that line on the release. This is now done
382 -- in Check 12 of preapproval_checks.
383 --             and (porl.quantity * round(porl.unit_price/nvl(poh.rate,1),5)
384 --                                         >= nvl(pol.min_release_amount,0))
385 -- Bug 2701147 END
386              and nvl(paa.consigned_from_supplier_flag, 'N') = 'N'
387 -- Bug 3411766 START
388 -- We should not select the lines which are created in iProcurement with
389 -- emergency PO number.
390              and prh.emergency_po_num is null
391 -- Bug 3411766 END
392         order by blanket_po_header_id,
393                  doc_generation_method,
394                  blanket_po_line_num,
395                  /* Supplier PCard FPH */
396                 decode(porl.pcard_flag,'N',null,'S',po_pcard_pkg.get_valid_pcard_id(-99999,porl.vendor_id,porl.vendor_site_id),'Y',po_pcard_pkg.get_valid_pcard_id(prh.pcard_id,porl.vendor_id,porl.vendor_site_id)),
397                  need_by_date, -- bug 2378110
398                  requisition_line_id
399         for update of porl.line_location_id;
400 
401 /* Declare cursor for the receiving controls */
402 
403 TYPE rcv_control_type IS RECORD
404 (inspection_required_flag   po_system_parameters.inspection_required_flag%type
405                                                                        := null,
406  receipt_required_flag      po_system_parameters.receiving_flag%type := null,
407  days_early_receipt_allowed rcv_parameters.days_early_receipt_allowed%type
408                                                                        :=null,
409  days_late_receipt_allowed  rcv_parameters.days_late_receipt_allowed%type
410                                                                        := null,
411  enforce_ship_to_location   rcv_parameters.enforce_ship_to_location_code%type
412                                                                        := null,
413  receiving_routing_id       rcv_parameters.receiving_routing_id%type
414                                                                        :=null,
415  qty_rcv_tolerance          rcv_parameters.qty_rcv_tolerance%type
416                                                                         :=null,
417  receipt_days_exception_code rcv_parameters.receipt_days_exception_code%type
418                                                                         :=null,
419  qty_rcv_exception_code rcv_parameters.qty_rcv_exception_code%type
420                                                                         :=null,
421  allow_substitute_receipts_flag rcv_parameters.allow_substitute_receipts_flag%type
422                                                                         :=null,
423  invoice_close_tolerance    po_system_parameters.invoice_close_tolerance%type
424                                                                        := null,
425  receipt_close_tolerance    po_system_parameters.receive_close_tolerance%type
426                                                                        := null);
427 
428 /* Declare global variables */
429 
430 x_inventory_org_id       number := 0;
431 x_expense_accrual_code   po_system_parameters.expense_accrual_code%type;
432 x_po_release_id          number := 0;
433 x_line_location_id       number := 0;
434 x_authorization_status   po_releases.authorization_status%type;
435 msgbuf                   varchar2(200);
436 x_period_name            gl_period_statuses.period_name%type;
437 
438 /* Declare procedures and associated parameters */
439 
440 /* Bug 1834138. pchintal. Added 2 new global variables to calculate the
441 shipment number. This was done as a part of improving the performance of
442 the create releases process.
443 */
444 
445 Gpo_release_id_prev      number := 0;
446 Gship_num_prev           number := 0;
447 
448 
449 PROCEDURE CREATE_RELEASES;
450 
451 PROCEDURE CREATE_RELEASE_HEADER(req_line IN requisition_lines_cursor%rowtype);
452 
453 PROCEDURE CREATE_RELEASE_SHIPMENT(req_line IN requisition_lines_cursor%rowtype);
454 
455 PROCEDURE OE_DROP_SHIP(req_line IN requisition_lines_cursor%rowtype);
456 
457 PROCEDURE MAINTAIN_SUPPLY(req_line IN requisition_lines_cursor%rowtype);
458 
459 PROCEDURE GET_RCV_CONTROLS(req_line IN requisition_lines_cursor%rowtype,
460                            rcv_controls IN OUT NOCOPY rcv_control_type);
461 
462 PROCEDURE GET_INVOICE_MATCH_OPTION(req_line IN requisition_lines_cursor%rowtype,
463                                  x_invoice_match_option OUT NOCOPY varchar2);
464 
465 PROCEDURE WRAPUP(req_line IN requisition_lines_cursor%rowtype);
466 
467 FUNCTION GET_BEST_PRICE(req_line IN requisition_lines_cursor%rowtype,
468                                x_conversion_rate IN number,
469                                x_ship_to_location_id IN number) return number;
470 
471 -- <INBOUND LOGISITCS PFJ START>
472 -------------------------------------------------------------------------------
473 --Start of Comments
474 --Name: create_deliveryrecord
475 --Pre-reqs:
476 --  None.
477 --Modifies:
478 --  l_fte_rec
479 --Locks:
480 --  None.
481 --Function:
482 --  Call FTE's API to create delivery record for Approved Blanket Release
483 --Parameters:
484 --IN:
485 --p_release_id
486 --  Corresponding to po_release_id
487 --Testing:
488 --  Pass in po_release_id for an approved release.
489 --End of Comments
490 -------------------------------------------------------------------------------
491 
492 PROCEDURE create_deliveryrecord(p_release_id IN NUMBER);
493 
494 -- <INBOUND LOGISITCS PFJ END>
495 
496 END PO_RELGEN_PKG;