[Home] [Help]
PACKAGE BODY: APPS.ARP_UPDATE_LINE_COVER
Source
1 PACKAGE BODY ARP_UPDATE_LINE_COVER AS
2 /* $Header: ARTCTLUB.pls 120.7 2005/10/07 18:34:58 ralat ship $ */
3
4 /*===========================================================================+
5 | PROCEDURE |
6 | update_line_cover |
7 | |
8 | DESCRIPTION |
9 | Converts column parameters to a line record and |
10 | updates a line. |
11 | |
12 | SCOPE - PUBLIC |
13 | |
14 | EXETERNAL PROCEDURES/FUNCTIONS ACCESSED |
15 | arp_util.debug |
16 | |
17 | ARGUMENTS : IN: |
18 | p_form_name |
19 | p_form_version |
20 | p_customer_trx_line_id |
21 | p_foreign_currency_code |
22 | p_exchange_rate |
23 | p_recalculate_tax_flag |
24 | p_rerun_autoacc_flag |
25 | p_customer_trx_id |
26 | p_line_number |
27 | p_line_type |
28 | p_quantity_credited |
29 | p_quantity_invoiced |
30 | p_quantity_ordered |
31 | p_unit_selling_price |
32 | p_unit_standard_price |
33 | p_extended_amount |
34 | p_memo_line_id |
35 | p_inventory_item_id |
36 | p_item_exception_rate_id |
37 | p_description |
38 | p_item_context |
39 | p_initial_customer_trx_line_id |
40 | p_link_to_cust_trx_line_id |
41 | p_previous_customer_trx_id |
42 | p_prev_customer_trx_line_id |
43 | p_accounting_rule_id |
44 | p_autorule_complete_flag |
45 | p_autorule_duration_processed |
46 | p_reason_code |
47 | p_last_period_to_credit |
48 | p_sales_order |
49 | p_sales_order_date |
50 | p_sales_order_line |
51 | p_sales_order_revision |
52 | p_sales_order_source |
53 | p_vat_tax_id |
54 | p_tax_exempt_flag |
55 | p_sales_tax_id |
56 | p_location_segment_id |
57 | p_tax_exempt_number |
58 | p_tax_exempt_reason_code |
59 | p_tax_vendor_return_code |
60 | p_taxable_flag |
61 | p_tax_exemption_id |
62 | p_tax_precedence |
63 | p_tax_rate |
64 | p_uom_code |
65 | p_autotax |
66 | p_movement_id |
67 | p_default_ussgl_trx_code |
68 | p_default_ussgl_trx_code_cntxt |
69 | p_interface_line_context |
70 | p_interface_line_attribute1 |
71 | p_interface_line_attribute2 |
72 | p_interface_line_attribute3 |
73 | p_interface_line_attribute4 |
74 | p_interface_line_attribute5 |
75 | p_interface_line_attribute6 |
76 | p_interface_line_attribute7 |
77 | p_interface_line_attribute8 |
78 | p_interface_line_attribute9 |
79 | p_interface_line_attribute10 |
80 | p_interface_line_attribute11 |
81 | p_interface_line_attribute12 |
82 | p_interface_line_attribute13 |
83 | p_interface_line_attribute14 |
84 | p_interface_line_attribute15 |
85 | p_attribute_category |
86 | p_attribute1 |
87 | p_attribute2 |
88 | p_attribute3 |
89 | p_attribute4 |
90 | p_attribute5 |
91 | p_attribute6 |
92 | p_attribute7 |
93 | p_attribute8 |
94 | p_attribute9 |
95 | p_attribute10 |
96 | p_attribute11 |
97 | p_attribute12 |
98 | p_attribute13 |
99 | p_attribute14 |
100 | p_attribute15 |
101 | p_gross_extended_amount |
102 | p_gross_unit_selling_price |
103 | p_amount_includes_tax_flag |
104 | p_warehouse_id |
105 | p_translated_description |
106 | p_ship_to_customer_id |
107 | p_ship_to_site_use_id |
108 | p_ship_to_contact_id |
109 | p_tax_classification_code |
110 | p_rule_end_date |
111 | OUT: |
112 | p_status |
113 | p_net_extended_amount |
114 | p_net_unit_selling_price |
115 | IN/ OUT: |
116 | p_accounting_rule_duration |
117 | p_rule_start_date |
118 | p_gl_date |
119 | p_trx_date |
120 | |
121 | RETURNS : NONE |
122 | |
123 | NOTES |
124 | |
125 | MODIFICATION HISTORY |
126 | 29-NOV-95 Martin Johnson Created |
127 | 17-JAN-96 Martin Johnson Changed parameters |
128 | p_accounting_rule_duration and |
129 | p_rule_start_date to be IN OUT NOCOPY |
130 | 13-FEB-96 Martin Johnson Added IN OUT NOCOPY parameters |
131 | p_gl_date and p_trx_date |
132 | 20-MAY-96 Martin Johnson BugNo:356814. Added OUT NOCOPY |
133 | parameter p_status |
134 | Rel. 11 Changes: |
135 | |
136 | 28-JUL-97 OSTEINME added new parameters for Rel.11: |
137 | p_header_currency_code |
138 | p_header_exchange_rate |
139 | p_gross_extended_amount |
140 | p_gross_unit_selling_price |
141 | p_amount_includes_tax_flag |
142 | changed parameters to OUT: |
143 | p_net_extended_amount |
144 | p_net_unit_selling_price |
145 | |
146 | Rel 11.5 Changes: |
147 | 10-JAN-99 Saloni Shah added warehouse_id |
148 | 22-MAR-99 Debbie Jancis added translated description for MLS |
149 | 18-APR-05 Debbie Jancis ETax added additional ship to id's |
150 | for ship to at the line level |
151 | |
152 +===========================================================================*/
153
154 PG_DEBUG varchar2(1) := NVL(FND_PROFILE.value('AFLOG_ENABLED'), 'N');
155
156 /* Bug 3567353 */
157 pg_base_precision fnd_currencies.precision%type;
158 pg_base_min_acc_unit fnd_currencies.minimum_accountable_unit%type;
159 pg_trx_header_level_rounding ar_system_parameters.trx_header_level_rounding%type;
160
161 PROCEDURE update_line_cover(
162 p_form_name IN varchar2,
163 p_form_version IN number,
164 p_customer_trx_line_id IN
165 ra_customer_trx_lines.customer_trx_line_id%type,
166 p_foreign_currency_code IN
167 fnd_currencies.currency_code%type,
168 p_exchange_rate IN
169 ra_customer_trx.exchange_rate%type,
170 p_recalculate_tax_flag IN boolean,
171 p_rerun_autoacc_flag IN boolean,
172 p_customer_trx_id IN
173 ra_customer_trx_lines.customer_trx_id%type,
174 p_line_number IN
175 ra_customer_trx_lines.line_number%type,
176 p_line_type IN
177 ra_customer_trx_lines.line_type%type,
178 p_quantity_credited IN
179 ra_customer_trx_lines.quantity_credited%type,
180 p_quantity_invoiced IN
181 ra_customer_trx_lines.quantity_invoiced%type,
182 p_quantity_ordered IN
183 ra_customer_trx_lines.quantity_ordered%type,
184 p_unit_standard_price IN
185 ra_customer_trx_lines.unit_standard_price%type,
186 p_memo_line_id IN
187 ra_customer_trx_lines.memo_line_id%type,
188 p_inventory_item_id IN
189 ra_customer_trx_lines.inventory_item_id%type,
190 p_item_exception_rate_id IN
191 ra_customer_trx_lines.item_exception_rate_id%type,
192 p_description IN
193 ra_customer_trx_lines.description%type,
194 p_item_context IN
195 ra_customer_trx_lines.item_context%type,
196 p_initial_customer_trx_line_id IN
197 ra_customer_trx_lines.initial_customer_trx_line_id%type,
198 p_link_to_cust_trx_line_id IN
199 ra_customer_trx_lines.link_to_cust_trx_line_id%type,
200 p_previous_customer_trx_id IN
201 ra_customer_trx_lines.previous_customer_trx_id%type,
202 p_prev_customer_trx_line_id IN
203 ra_customer_trx_lines.previous_customer_trx_line_id%type,
204 p_accounting_rule_duration IN OUT NOCOPY
205 ra_customer_trx_lines.accounting_rule_duration%type,
206 p_accounting_rule_id IN
207 ra_customer_trx_lines.accounting_rule_id%type,
208 p_rule_start_date IN OUT NOCOPY
209 ra_customer_trx_lines.rule_start_date%type,
210 p_autorule_complete_flag IN
211 ra_customer_trx_lines.autorule_complete_flag%type,
212 p_autorule_duration_processed IN
213 ra_customer_trx_lines.autorule_duration_processed%type,
214 p_reason_code IN
215 ra_customer_trx_lines.reason_code%type,
216 p_last_period_to_credit IN
217 ra_customer_trx_lines.last_period_to_credit%type,
218 p_sales_order IN
219 ra_customer_trx_lines.sales_order%type,
220 p_sales_order_date IN
221 ra_customer_trx_lines.sales_order_date%type,
222 p_sales_order_line IN
223 ra_customer_trx_lines.sales_order_line%type,
224 p_sales_order_revision IN
225 ra_customer_trx_lines.sales_order_revision%type,
226 p_sales_order_source IN
227 ra_customer_trx_lines.sales_order_source%type,
228 p_vat_tax_id IN
229 ra_customer_trx_lines.vat_tax_id%type,
230 p_tax_exempt_flag IN
231 ra_customer_trx_lines.tax_exempt_flag%type,
232 p_sales_tax_id IN
233 ra_customer_trx_lines.sales_tax_id%type,
234 p_location_segment_id IN
235 ra_customer_trx_lines.location_segment_id%type,
236 p_tax_exempt_number IN
237 ra_customer_trx_lines.tax_exempt_number%type,
238 p_tax_exempt_reason_code IN
239 ra_customer_trx_lines.tax_exempt_reason_code%type,
240 p_tax_vendor_return_code IN
241 ra_customer_trx_lines.tax_vendor_return_code%type,
242 p_taxable_flag IN
243 ra_customer_trx_lines.taxable_flag%type,
244 p_tax_exemption_id IN
245 ra_customer_trx_lines.tax_exemption_id%type,
246 p_tax_precedence IN
247 ra_customer_trx_lines.tax_precedence%type,
248 p_tax_rate IN
249 ra_customer_trx_lines.tax_rate%type,
250 p_uom_code IN
251 ra_customer_trx_lines.uom_code%type,
252 p_autotax IN
253 ra_customer_trx_lines.autotax%type,
254 p_movement_id IN
255 ra_customer_trx_lines.movement_id%type,
256 p_default_ussgl_trx_code IN
257 ra_customer_trx_lines.default_ussgl_transaction_code%type,
258 p_default_ussgl_trx_code_cntxt IN
259 ra_customer_trx_lines.default_ussgl_trx_code_context%type,
260 p_interface_line_context IN
261 ra_customer_trx_lines.interface_line_context%type,
262 p_interface_line_attribute1 IN
263 ra_customer_trx_lines.interface_line_attribute1%type,
264 p_interface_line_attribute2 IN
265 ra_customer_trx_lines.interface_line_attribute2%type,
266 p_interface_line_attribute3 IN
267 ra_customer_trx_lines.interface_line_attribute3%type,
268 p_interface_line_attribute4 IN
269 ra_customer_trx_lines.interface_line_attribute4%type,
270 p_interface_line_attribute5 IN
271 ra_customer_trx_lines.interface_line_attribute5%type,
272 p_interface_line_attribute6 IN
273 ra_customer_trx_lines.interface_line_attribute6%type,
274 p_interface_line_attribute7 IN
275 ra_customer_trx_lines.interface_line_attribute7%type,
276 p_interface_line_attribute8 IN
277 ra_customer_trx_lines.interface_line_attribute8%type,
278 p_interface_line_attribute9 IN
279 ra_customer_trx_lines.interface_line_attribute9%type,
280 p_interface_line_attribute10 IN
281 ra_customer_trx_lines.interface_line_attribute10%type,
282 p_interface_line_attribute11 IN
283 ra_customer_trx_lines.interface_line_attribute11%type,
284 p_interface_line_attribute12 IN
285 ra_customer_trx_lines.interface_line_attribute12%type,
286 p_interface_line_attribute13 IN
287 ra_customer_trx_lines.interface_line_attribute13%type,
288 p_interface_line_attribute14 IN
289 ra_customer_trx_lines.interface_line_attribute14%type,
290 p_interface_line_attribute15 IN
291 ra_customer_trx_lines.interface_line_attribute15%type,
292 p_attribute_category IN
293 ra_customer_trx_lines.attribute_category%type,
294 p_attribute1 IN
295 ra_customer_trx_lines.attribute1%type,
296 p_attribute2 IN
297 ra_customer_trx_lines.attribute2%type,
298 p_attribute3 IN
299 ra_customer_trx_lines.attribute3%type,
300 p_attribute4 IN
301 ra_customer_trx_lines.attribute4%type,
302 p_attribute5 IN
303 ra_customer_trx_lines.attribute5%type,
304 p_attribute6 IN
305 ra_customer_trx_lines.attribute6%type,
306 p_attribute7 IN
307 ra_customer_trx_lines.attribute7%type,
308 p_attribute8 IN
309 ra_customer_trx_lines.attribute8%type,
310 p_attribute9 IN
311 ra_customer_trx_lines.attribute9%type,
312 p_attribute10 IN
313 ra_customer_trx_lines.attribute10%type,
314 p_attribute11 IN
315 ra_customer_trx_lines.attribute11%type,
316 p_attribute12 IN
317 ra_customer_trx_lines.attribute12%type,
318 p_attribute13 IN
319 ra_customer_trx_lines.attribute13%type,
320 p_attribute14 IN
321 ra_customer_trx_lines.attribute14%type,
322 p_attribute15 IN
323 ra_customer_trx_lines.attribute15%type,
324 p_gl_date IN OUT NOCOPY
325 ra_cust_trx_line_gl_dist.gl_date%type,
326 p_trx_date IN OUT NOCOPY
327 ra_customer_trx.trx_date%type,
328 p_gross_unit_selling_price IN
329 ra_customer_trx_lines.unit_selling_price%type,
330 p_gross_extended_amount IN
331 ra_customer_trx_lines.extended_amount%type,
332 p_amount_includes_tax_flag IN
333 ra_customer_trx_lines.amount_includes_tax_flag%type,
334 p_net_unit_selling_price OUT NOCOPY
335 ra_customer_trx_lines.unit_selling_price%type,
336 p_net_extended_amount OUT NOCOPY
337 ra_customer_trx_lines.extended_amount%type,
338 p_status OUT NOCOPY
339 varchar2 ,
340 p_global_attribute_category IN
341 ra_customer_trx_lines.global_attribute_category%type,
342 p_global_attribute1 IN
343 ra_customer_trx_lines.global_attribute1%type,
344 p_global_attribute2 IN
345 ra_customer_trx_lines.global_attribute2%type,
346 p_global_attribute3 IN
347 ra_customer_trx_lines.global_attribute3%type,
348 p_global_attribute4 IN
349 ra_customer_trx_lines.global_attribute4%type,
350 p_global_attribute5 IN
351 ra_customer_trx_lines.global_attribute5%type,
352 p_global_attribute6 IN
353 ra_customer_trx_lines.global_attribute6%type,
354 p_global_attribute7 IN
355 ra_customer_trx_lines.global_attribute7%type,
356 p_global_attribute8 IN
357 ra_customer_trx_lines.global_attribute8%type,
358 p_global_attribute9 IN
359 ra_customer_trx_lines.global_attribute9%type,
360 p_global_attribute10 IN
361 ra_customer_trx_lines.global_attribute10%type,
362 p_global_attribute11 IN
363 ra_customer_trx_lines.global_attribute11%type,
364 p_global_attribute12 IN
365 ra_customer_trx_lines.global_attribute12%type,
366 p_global_attribute13 IN
367 ra_customer_trx_lines.global_attribute13%type,
368 p_global_attribute14 IN
369 ra_customer_trx_lines.global_attribute14%type,
370 p_global_attribute15 IN
371 ra_customer_trx_lines.global_attribute15%type,
372 p_global_attribute16 IN
373 ra_customer_trx_lines.global_attribute16%type,
374 p_global_attribute17 IN
375 ra_customer_trx_lines.global_attribute17%type,
376 p_global_attribute18 IN
377 ra_customer_trx_lines.global_attribute18%type,
378 p_global_attribute19 IN
379 ra_customer_trx_lines.global_attribute19%type,
380 p_global_attribute20 IN
381 ra_customer_trx_lines.global_attribute20%type,
382 p_warehouse_id IN
383 ra_customer_trx_lines.warehouse_id%type,
384 p_translated_description IN
385 ra_customer_trx_lines.translated_description%type,
386 p_payment_set_id IN ra_customer_trx_lines.payment_set_id%type,
387 p_ship_to_customer_id IN
388 ra_customer_trx_lines.ship_to_customer_id%type DEFAULT NULL,
389 p_ship_to_site_use_id IN
390 ra_customer_trx_lines.ship_to_site_use_id%type DEFAULT NULL,
391 p_ship_to_contact_id IN
392 ra_customer_trx_lines.ship_to_contact_id%type DEFAULT NULL,
393 p_tax_classification_code IN
394 ra_customer_Trx_lines.tax_classification_code%type DEFAULT NULL,
395 p_rule_end_date IN
396 ra_customer_Trx_lines.rule_end_date%type DEFAULT NULL
397 )
398
399 IS
400
401 l_line_rec ra_customer_trx_lines%rowtype;
402
403 /* bug 3567353 */
404 l_error_message VARCHAR2(128) := '';
405 l_dist_count NUMBER;
406 l_rules_check_flag VARCHAR2(1);
407
408 BEGIN
409
410 IF PG_DEBUG in ('Y', 'C') THEN
411 arp_util.debug('arp_update_line_cover.update_line_cover()+');
412 END IF;
413
414 /*------------------------------------------------+
415 | Populate the line record group with |
416 | the values passed in as parameters. |
417 +------------------------------------------------*/
418
419 arp_ctl_pkg.set_to_dummy(l_line_rec);
420
421 l_line_rec.customer_trx_id := p_customer_trx_id;
422 l_line_rec.payment_set_id := p_payment_set_id;
423 l_line_rec.line_number := p_line_number;
424 l_line_rec.line_type := p_line_type;
425 l_line_rec.quantity_credited := p_quantity_credited;
426 l_line_rec.quantity_invoiced := p_quantity_invoiced;
427 l_line_rec.quantity_ordered := p_quantity_ordered;
428 -- l_line_rec.unit_selling_price := p_unit_selling_price;
429 l_line_rec.unit_standard_price := p_unit_standard_price;
430 -- l_line_rec.extended_amount := p_extended_amount;
431 l_line_rec.memo_line_id := p_memo_line_id;
432 l_line_rec.inventory_item_id := p_inventory_item_id;
433 l_line_rec.item_exception_rate_id := p_item_exception_rate_id;
434 l_line_rec.description := p_description;
435 l_line_rec.item_context := p_item_context;
436
437 --
438 -- do not update, as the field is populated by insert procedure
439 --
440 --l_line_rec.initial_customer_trx_line_id := p_initial_customer_trx_line_id;
441
442 l_line_rec.link_to_cust_trx_line_id := p_link_to_cust_trx_line_id;
443 l_line_rec.previous_customer_trx_id := p_previous_customer_trx_id;
444 l_line_rec.previous_customer_trx_line_id := p_prev_customer_trx_line_id;
445 l_line_rec.accounting_rule_duration := p_accounting_rule_duration;
446 l_line_rec.accounting_rule_id := p_accounting_rule_id;
447 l_line_rec.rule_start_date := p_rule_start_date;
448 l_line_rec.autorule_complete_flag := p_autorule_complete_flag;
449 l_line_rec.autorule_duration_processed := p_autorule_duration_processed;
450 l_line_rec.reason_code := p_reason_code;
451 l_line_rec.last_period_to_credit := p_last_period_to_credit;
452 l_line_rec.sales_order := p_sales_order;
453 l_line_rec.sales_order_date := p_sales_order_date;
454 l_line_rec.sales_order_line := p_sales_order_line;
455 l_line_rec.sales_order_revision := p_sales_order_revision;
456 l_line_rec.sales_order_source := p_sales_order_source;
457 l_line_rec.vat_tax_id := p_vat_tax_id;
458 l_line_rec.tax_exempt_flag := p_tax_exempt_flag;
459 l_line_rec.sales_tax_id := p_sales_tax_id;
460 l_line_rec.location_segment_id := p_location_segment_id;
461 l_line_rec.tax_exempt_number := p_tax_exempt_number;
462 l_line_rec.tax_exempt_reason_code := p_tax_exempt_reason_code;
463 l_line_rec.tax_vendor_return_code := p_tax_vendor_return_code;
464 l_line_rec.taxable_flag := p_taxable_flag;
465 l_line_rec.tax_exemption_id := p_tax_exemption_id;
466 l_line_rec.tax_precedence := p_tax_precedence;
467 l_line_rec.tax_rate := p_tax_rate;
468 l_line_rec.uom_code := p_uom_code;
469 l_line_rec.autotax := p_autotax;
470 l_line_rec.movement_id := p_movement_id;
471 l_line_rec.default_ussgl_transaction_code :=
472 p_default_ussgl_trx_code;
473 l_line_rec.default_ussgl_trx_code_context :=
474 p_default_ussgl_trx_code_cntxt;
475 l_line_rec.interface_line_context := p_interface_line_context;
476 l_line_rec.interface_line_attribute1 := p_interface_line_attribute1;
477 l_line_rec.interface_line_attribute2 := p_interface_line_attribute2;
478 l_line_rec.interface_line_attribute3 := p_interface_line_attribute3;
479 l_line_rec.interface_line_attribute4 := p_interface_line_attribute4;
480 l_line_rec.interface_line_attribute5 := p_interface_line_attribute5;
481 l_line_rec.interface_line_attribute6 := p_interface_line_attribute6;
482 l_line_rec.interface_line_attribute7 := p_interface_line_attribute7;
483 l_line_rec.interface_line_attribute8 := p_interface_line_attribute8;
484 l_line_rec.interface_line_attribute9 := p_interface_line_attribute9;
485 l_line_rec.interface_line_attribute10 := p_interface_line_attribute10;
486 l_line_rec.interface_line_attribute11 := p_interface_line_attribute11;
487 l_line_rec.interface_line_attribute12 := p_interface_line_attribute12;
488 l_line_rec.interface_line_attribute13 := p_interface_line_attribute13;
489 l_line_rec.interface_line_attribute14 := p_interface_line_attribute14;
490 l_line_rec.interface_line_attribute15 := p_interface_line_attribute15;
491 l_line_rec.attribute_category := p_attribute_category;
492 l_line_rec.attribute1 := p_attribute1;
493 l_line_rec.attribute2 := p_attribute2;
494 l_line_rec.attribute3 := p_attribute3;
495 l_line_rec.attribute4 := p_attribute4;
496 l_line_rec.attribute5 := p_attribute5;
497 l_line_rec.attribute6 := p_attribute6;
498 l_line_rec.attribute7 := p_attribute7;
499 l_line_rec.attribute8 := p_attribute8;
500 l_line_rec.attribute9 := p_attribute9;
501 l_line_rec.attribute10 := p_attribute10;
502 l_line_rec.attribute11 := p_attribute11;
503 l_line_rec.attribute12 := p_attribute12;
504 l_line_rec.attribute13 := p_attribute13;
505 l_line_rec.attribute14 := p_attribute14;
506 l_line_rec.attribute15 := p_attribute15;
507
508 -- Rel. 11
509
510 l_line_rec.unit_selling_price := p_gross_unit_selling_price;
511 l_line_rec.extended_amount := p_gross_extended_amount;
512 l_line_rec.gross_unit_selling_price:= NULL;
513 l_line_rec.gross_extended_amount := NULL;
514 l_line_rec.amount_includes_tax_flag:= p_amount_includes_tax_flag;
515
516 -- Rel. 11 Changes: Global Desc. Flex.
517
518 l_line_rec.global_attribute_category := p_global_attribute_category;
519 l_line_rec.global_attribute1 := p_global_attribute1;
520 l_line_rec.global_attribute2 := p_global_attribute2;
521 l_line_rec.global_attribute3 := p_global_attribute3;
522 l_line_rec.global_attribute4 := p_global_attribute4;
523 l_line_rec.global_attribute5 := p_global_attribute5;
524 l_line_rec.global_attribute6 := p_global_attribute6;
525 l_line_rec.global_attribute7 := p_global_attribute7;
526 l_line_rec.global_attribute8 := p_global_attribute8;
527 l_line_rec.global_attribute9 := p_global_attribute9;
528 l_line_rec.global_attribute10 := p_global_attribute10;
529 l_line_rec.global_attribute11 := p_global_attribute11;
530 l_line_rec.global_attribute12 := p_global_attribute12;
531 l_line_rec.global_attribute13 := p_global_attribute13;
532 l_line_rec.global_attribute14 := p_global_attribute14;
533 l_line_rec.global_attribute15 := p_global_attribute15;
534 l_line_rec.global_attribute16 := p_global_attribute16;
535 l_line_rec.global_attribute17 := p_global_attribute17;
536 l_line_rec.global_attribute18 := p_global_attribute18;
537 l_line_rec.global_attribute19 := p_global_attribute19;
538 l_line_rec.global_attribute20 := p_global_attribute20;
539
540 -- Rel. 11.5 changes: Warehouse_id.
541 l_line_rec.warehouse_id := p_warehouse_id;
542 l_line_rec.translated_description := p_translated_description;
543
544 -- ETax - line level ship to information
545 l_line_rec.ship_to_customer_id := p_ship_to_customer_id;
546 l_line_rec.ship_to_site_use_id := p_ship_to_site_use_id;
547 l_line_rec.ship_to_contact_id := p_ship_to_contact_id;
548 l_line_rec.tax_classification_code := p_tax_classification_code;
549 l_line_rec.rule_end_date := p_rule_end_date;
550
551 /*-----------------------------------------------+
552 | Call the standard line entity handler |
553 +-----------------------------------------------*/
554
555 arp_process_line.update_line(
556 p_form_name,
557 p_form_version,
558 p_customer_trx_line_id,
559 l_line_rec,
560 p_foreign_currency_code,
561 p_exchange_rate,
562 p_recalculate_tax_flag,
563 p_rerun_autoacc_flag,
564 p_rule_start_date,
565 p_accounting_rule_duration,
566 p_gl_date,
567 p_trx_date,
568 p_status );
569
570 -- Rel. 11: Return new net amounts to form
571
572 p_net_extended_amount := l_line_rec.extended_amount;
573 p_net_unit_selling_price := l_line_rec.unit_selling_price;
574
575 /* bug 3567353 Call rounding */
576 IF p_rule_start_date IS NULL THEN
577 l_rules_check_flag := 'N';
578 ELSE
579 l_rules_check_flag := 'Y';
580 END IF;
581 IF arp_rounding.correct_dist_rounding_errors(
582 NULL,
583 l_line_rec.CUSTOMER_TRX_ID ,
584 p_customer_trx_line_id ,
585 l_dist_count,
586 l_error_message ,
587 pg_base_precision ,
588 pg_base_min_acc_unit ,
589 'ALL' ,
590 l_rules_check_flag,
591 'N' ,
592 pg_trx_header_level_rounding ,
593 'N',
594 'N') = 0 -- FALSE
595 THEN
596 arp_util.debug('EXCEPTION: arp_update_line_cover.update_line_cover()');
597 arp_util.debug(l_error_message);
598 fnd_message.set_name('AR', 'AR_PLCRE_FHLR_CCID');
599 APP_EXCEPTION.raise_exception;
600 END IF;
601
602 IF PG_DEBUG in ('Y', 'C') THEN
603 arp_util.debug('arp_update_line_cover.update_line_cover()-');
604 END IF;
605
606 EXCEPTION
607 WHEN OTHERS THEN
608
609 IF PG_DEBUG in ('Y', 'C') THEN
610 arp_util.debug('EXCEPTION: arp_update_line_cover.update_line_cover()');
611 arp_util.debug('------- parameters for update_line_cover() ' ||
612 '---------');
613 arp_util.debug('update_line_cover: ' || 'p_form_name = ' || p_form_name);
614 arp_util.debug('update_line_cover: ' || 'p_form_version = ' || p_form_version);
615 arp_util.debug('update_line_cover: ' || 'p_customer_trx_line_id = ' || p_customer_trx_line_id);
616 arp_util.debug('update_line_cover: ' || 'p_foreign_currency_code = ' || p_foreign_currency_code);
617 arp_util.debug('update_line_cover: ' || 'p_exchange_rate = ' || p_exchange_rate);
618 arp_util.debug('update_line_cover: ' || 'p_recalculate_tax_flag = ' ||
619 arp_trx_util.boolean_to_varchar2(p_recalculate_tax_flag));
620 arp_util.debug('update_line_cover: ' || 'p_rerun_autoacc_flag = ' ||
621 arp_trx_util.boolean_to_varchar2(p_rerun_autoacc_flag));
622 arp_util.debug('update_line_cover: ' || 'p_customer_trx_id = ' || p_customer_trx_id);
623 arp_util.debug('update_line_cover: ' || 'p_line_number = ' || p_line_number);
624 arp_util.debug('update_line_cover: ' || 'p_line_type = ' || p_line_type);
625 arp_util.debug('update_line_cover: ' || 'p_quantity_credited = ' || p_quantity_credited);
626 arp_util.debug('update_line_cover: ' || 'p_quantity_invoiced = ' || p_quantity_invoiced);
627 arp_util.debug('update_line_cover: ' || 'p_quantity_ordered = ' || p_quantity_ordered);
628 END IF;
629 -- arp_util.debug('p_net_unit_selling_price = ' || p_net_unit_selling_price);
630 IF PG_DEBUG in ('Y', 'C') THEN
631 arp_util.debug('update_line_cover: ' || 'p_unit_standard_price = ' || p_unit_standard_price);
632 END IF;
633 -- arp_util.debug('p_net_extended_amount = ' || p_net_extended_amount);
634 IF PG_DEBUG in ('Y', 'C') THEN
635 arp_util.debug('update_line_cover: ' || 'p_memo_line_id = ' || p_memo_line_id);
636 arp_util.debug('update_line_cover: ' || 'p_inventory_item_id = ' || p_inventory_item_id);
637 arp_util.debug('update_line_cover: ' || 'p_item_exception_rate_id = ' || p_item_exception_rate_id);
638 arp_util.debug('update_line_cover: ' || 'p_description = ' || p_description);
639 arp_util.debug('update_line_cover: ' || 'p_item_context = ' || p_item_context);
640 arp_util.debug('update_line_cover: ' || 'p_initial_customer_trx_line_id = ' ||
641 p_initial_customer_trx_line_id);
642 arp_util.debug('update_line_cover: ' || 'p_link_to_cust_trx_line_id = ' ||
643 p_link_to_cust_trx_line_id);
644 arp_util.debug('update_line_cover: ' || 'p_previous_customer_trx_id = ' ||
645 p_previous_customer_trx_id);
646 arp_util.debug('update_line_cover: ' || 'p_prev_customer_trx_line_id = ' ||
647 p_prev_customer_trx_line_id);
648 arp_util.debug('update_line_cover: ' || 'p_accounting_rule_duration = ' ||
649 p_accounting_rule_duration);
650 arp_util.debug('update_line_cover: ' || 'p_accounting_rule_id = ' || p_accounting_rule_id);
651 arp_util.debug('update_line_cover: ' || 'p_rule_start_date = ' || p_rule_start_date);
652 arp_util.debug('update_line_cover: ' || 'p_autorule_complete_flag = ' || p_autorule_complete_flag);
653 arp_util.debug('update_line_cover: ' || 'p_autorule_duration_processed = ' ||
654 p_autorule_duration_processed);
655 arp_util.debug('update_line_cover: ' || 'p_reason_code = ' || p_reason_code);
656 arp_util.debug('update_line_cover: ' || 'p_last_period_to_credit = ' || p_last_period_to_credit);
657 arp_util.debug('update_line_cover: ' || 'p_sales_order = ' || p_sales_order);
658 arp_util.debug('update_line_cover: ' || 'p_sales_order_date = ' || p_sales_order_date);
659 arp_util.debug('update_line_cover: ' || 'p_sales_order_line = ' || p_sales_order_line);
660 arp_util.debug('update_line_cover: ' || 'p_sales_order_revision = ' || p_sales_order_revision);
661 arp_util.debug('update_line_cover: ' || 'p_sales_order_source = ' || p_sales_order_source);
662 arp_util.debug('update_line_cover: ' || 'p_vat_tax_id = ' || p_vat_tax_id);
663 arp_util.debug('update_line_cover: ' || 'p_tax_exempt_flag = ' || p_tax_exempt_flag);
664 arp_util.debug('update_line_cover: ' || 'p_sales_tax_id = ' || p_sales_tax_id);
665 arp_util.debug('update_line_cover: ' || 'p_location_segment_id = ' || p_location_segment_id);
666 arp_util.debug('update_line_cover: ' || 'p_tax_exempt_number = ' || p_tax_exempt_number);
667 arp_util.debug('update_line_cover: ' || 'p_tax_exempt_reason_code = ' || p_tax_exempt_reason_code);
668 arp_util.debug('update_line_cover: ' || 'p_tax_vendor_return_code = ' || p_tax_vendor_return_code);
669 arp_util.debug('update_line_cover: ' || 'p_taxable_flag = ' || p_taxable_flag);
670 arp_util.debug('update_line_cover: ' || 'p_tax_exemption_id = ' || p_tax_exemption_id);
671 arp_util.debug('update_line_cover: ' || 'p_tax_precedence = ' || p_tax_precedence);
672 arp_util.debug('update_line_cover: ' || 'p_tax_rate = ' || p_tax_rate);
673 arp_util.debug('update_line_cover: ' || 'p_uom_code = ' || p_uom_code);
674 arp_util.debug('update_line_cover: ' || 'p_autotax = ' || p_autotax);
675 arp_util.debug('update_line_cover: ' || 'p_movement_id = ' || p_movement_id);
676 arp_util.debug('update_line_cover: ' || 'p_default_ussgl_trx_code = ' ||
677 p_default_ussgl_trx_code);
678 arp_util.debug('update_line_cover: ' || 'p_default_ussgl_trx_code_cntxt = ' ||
679 p_default_ussgl_trx_code_cntxt);
680 arp_util.debug('update_line_cover: ' || 'p_interface_line_context = ' || p_interface_line_context);
681 arp_util.debug('update_line_cover: ' || 'p_interface_line_attribute1 = ' ||
682 p_interface_line_attribute1);
683 arp_util.debug('update_line_cover: ' || 'p_interface_line_attribute2 = ' ||
684 p_interface_line_attribute2);
685 arp_util.debug('update_line_cover: ' || 'p_interface_line_attribute3 = ' ||
686 p_interface_line_attribute3);
687 arp_util.debug('update_line_cover: ' || 'p_interface_line_attribute4 = ' ||
688 p_interface_line_attribute4);
689 arp_util.debug('update_line_cover: ' || 'p_interface_line_attribute5 = ' ||
690 p_interface_line_attribute5);
691 arp_util.debug('update_line_cover: ' || 'p_interface_line_attribute6 = ' ||
692 p_interface_line_attribute6);
693 arp_util.debug('update_line_cover: ' || 'p_interface_line_attribute7 = ' ||
694 p_interface_line_attribute7);
695 arp_util.debug('update_line_cover: ' || 'p_interface_line_attribute8 = ' ||
696 p_interface_line_attribute8);
697 arp_util.debug('update_line_cover: ' || 'p_interface_line_attribute9 = ' ||
698 p_interface_line_attribute9);
699 arp_util.debug('update_line_cover: ' || 'p_interface_line_attribute10 = ' ||
700 p_interface_line_attribute10);
701 arp_util.debug('update_line_cover: ' || 'p_interface_line_attribute11 = ' ||
702 p_interface_line_attribute11);
703 arp_util.debug('update_line_cover: ' || 'p_interface_line_attribute12 = ' ||
704 p_interface_line_attribute12);
705 arp_util.debug('update_line_cover: ' || 'p_interface_line_attribute13 = ' ||
706 p_interface_line_attribute13);
707 arp_util.debug('update_line_cover: ' || 'p_interface_line_attribute14 = ' ||
708 p_interface_line_attribute14);
709 arp_util.debug('update_line_cover: ' || 'p_interface_line_attribute15 = ' ||
710 p_interface_line_attribute15);
711 arp_util.debug('update_line_cover: ' || 'p_attribute_category = ' || p_attribute_category);
712 arp_util.debug('update_line_cover: ' || 'p_attribute1 = ' || p_attribute1);
713 arp_util.debug('update_line_cover: ' || 'p_attribute2 = ' || p_attribute2);
714 arp_util.debug('update_line_cover: ' || 'p_attribute3 = ' || p_attribute3);
715 arp_util.debug('update_line_cover: ' || 'p_attribute4 = ' || p_attribute4);
716 arp_util.debug('update_line_cover: ' || 'p_attribute5 = ' || p_attribute5);
717 arp_util.debug('update_line_cover: ' || 'p_attribute6 = ' || p_attribute6);
718 arp_util.debug('update_line_cover: ' || 'p_attribute7 = ' || p_attribute7);
719 arp_util.debug('update_line_cover: ' || 'p_attribute8 = ' || p_attribute8);
720 arp_util.debug('update_line_cover: ' || 'p_attribute9 = ' || p_attribute9);
721 arp_util.debug('update_line_cover: ' || 'p_attribute10 = ' || p_attribute10);
722 arp_util.debug('update_line_cover: ' || 'p_attribute11 = ' || p_attribute11);
723 arp_util.debug('update_line_cover: ' || 'p_attribute12 = ' || p_attribute12);
724 arp_util.debug('update_line_cover: ' || 'p_attribute13 = ' || p_attribute13);
725 arp_util.debug('update_line_cover: ' || 'p_attribute14 = ' || p_attribute14);
726 arp_util.debug('update_line_cover: ' || 'p_attribute15 = ' || p_attribute15);
727 arp_util.debug('update_line_cover: ' || 'p_global_attribute_category = ' || p_global_attribute_category);
728 arp_util.debug('update_line_cover: ' || 'p_global_attribute1 = ' || p_global_attribute1);
729 arp_util.debug('update_line_cover: ' || 'p_global_attribute2 = ' || p_global_attribute2);
730 arp_util.debug('update_line_cover: ' || 'p_global_attribute3 = ' || p_global_attribute3);
731 arp_util.debug('update_line_cover: ' || 'p_global_attribute4 = ' || p_global_attribute4);
732 arp_util.debug('update_line_cover: ' || 'p_global_attribute5 = ' || p_global_attribute5);
733 arp_util.debug('update_line_cover: ' || 'p_global_attribute6 = ' || p_global_attribute6);
734 arp_util.debug('update_line_cover: ' || 'p_global_attribute7 = ' || p_global_attribute7);
735 arp_util.debug('update_line_cover: ' || 'p_global_attribute8 = ' || p_global_attribute8);
736 arp_util.debug('update_line_cover: ' || 'p_global_attribute9 = ' || p_global_attribute9);
737 arp_util.debug('update_line_cover: ' || 'p_global_attribute10 = ' || p_global_attribute10);
738 arp_util.debug('update_line_cover: ' || 'p_global_attribute11 = ' || p_global_attribute11);
739 arp_util.debug('update_line_cover: ' || 'p_global_attribute12 = ' || p_global_attribute12);
740 arp_util.debug('update_line_cover: ' || 'p_global_attribute13 = ' || p_global_attribute13);
741 arp_util.debug('update_line_cover: ' || 'p_global_attribute14 = ' || p_global_attribute14);
742 arp_util.debug('update_line_cover: ' || 'p_global_attribute15 = ' || p_global_attribute15);
743 arp_util.debug('update_line_cover: ' || 'p_global_attribute16 = ' || p_global_attribute16);
744 arp_util.debug('update_line_cover: ' || 'p_global_attribute17 = ' || p_global_attribute17);
745 arp_util.debug('update_line_cover: ' || 'p_global_attribute18 = ' || p_global_attribute18);
746 arp_util.debug('update_line_cover: ' || 'p_global_attribute19 = ' || p_global_attribute19);
747 arp_util.debug('update_line_cover: ' || 'p_global_attribute20 = ' || p_global_attribute20);
748 arp_util.debug('update_line_cover: ' || 'p_warehouse_id = ' || p_warehouse_id);
749 arp_util.debug('update_line_cover: ' || 'p_translated_description = ' || p_translated_description);
750 arp_util.debug('update_line_cover: ' || 'p_payment_set_id = ' || p_payment_set_id);
751 arp_util.debug('update_line_cover: ' || 'p_rule_end_date = ' || p_rule_end_date);
752 END IF;
753
754 RAISE;
755
756 END update_line_cover;
757
758 BEGIN
759 /* bug 3567353 */
760 pg_base_precision := arp_global.base_precision;
761 pg_base_min_acc_unit := arp_global.base_min_acc_unit;
762 pg_trx_header_level_rounding := arp_global.sysparam.trx_header_level_rounding;
763
764 END ARP_UPDATE_LINE_COVER;