[Home] [Help]
PACKAGE BODY: APPS.ARP_IER_PKG
Source
1 PACKAGE BODY ARP_IER_PKG as
2 /* $Header: ARXIIERB.pls 115.5 2003/10/10 14:31:05 mraymond ship $ */
3
4 --
5 -- PRIVATE Procedures/Functions
6 --
7
8 PG_DEBUG varchar2(1) := NVL(FND_PROFILE.value('AFLOG_ENABLED'), 'N');
9
10 PROCEDURE Check_Eff_Date_Overlap (
11 p_Rowid VARCHAR2,
12 p_Item_Id NUMBER,
13 p_Start_Date DATE,
14 p_End_Date DATE,
15 p_Location_Id_Segment_1 NUMBER,
16 p_Location_Id_Segment_2 NUMBER,
17 p_Location_Id_Segment_3 NUMBER,
18 p_Location_Id_Segment_4 NUMBER,
19 p_Location_Id_Segment_5 NUMBER,
20 p_Location_Id_Segment_6 NUMBER,
21 p_Location_Id_Segment_7 NUMBER,
22 p_Location_Id_Segment_8 NUMBER,
23 p_Location_Id_Segment_9 NUMBER,
24 p_Location_Id_Segment_10 NUMBER ) IS
25 l_nrecs number;
26
27 -- Get Exception with overlapping date
28 CURSOR Sel_Date_Overlap IS
29 Select 1
30 From RA_item_exception_rates
31 Where item_id = p_item_id
32 And nvl(location_id_segment_1,0) =
33 nvl(p_location_id_segment_1,0)
34 And nvl(location_id_segment_2,0) =
35 nvl(p_location_id_segment_2,0)
36 And nvl(location_id_segment_3,0) =
37 nvl(p_location_id_segment_3,0)
38 And nvl(location_id_segment_4,0) =
39 nvl(p_location_id_segment_4,0)
40 And nvl(location_id_segment_5,0) =
41 nvl(p_location_id_segment_5,0)
42 And nvl(location_id_segment_6,0) =
43 nvl(p_location_id_segment_6,0)
44 And nvl(location_id_segment_7,0) =
45 nvl(p_location_id_segment_7,0)
46 And nvl(location_id_segment_8,0) =
47 nvl(p_location_id_segment_8,0)
48 And nvl(location_id_segment_9,0) =
49 nvl(p_location_id_segment_9,0)
50 And nvl(location_id_segment_10,0) =
51 nvl(p_location_id_segment_10,0)
52 And ( p_start_date between
53 start_date AND nvl(end_date, p_start_date)
54 OR start_date between p_start_date AND
55 nvl(p_end_date, start_date) )
56 And ( p_rowid is null
57 OR rowid <> p_rowid );
58
59 BEGIN
60 -- Check if Dates overlap any existing rates for the
61 -- Item's Location authority.
62
63 If ( p_end_date is NULL OR (p_end_date >= p_start_date) ) Then
64
65 OPEN Sel_Date_Overlap;
66 FETCH Sel_Date_Overlap INTO l_nrecs;
67
68 If ( Sel_Date_Overlap%FOUND ) then
69
70 IF PG_DEBUG in ('Y', 'C') THEN
71 arp_util.debug('Check_Eff_Date_Overlap: ' || '-- FOUND Overlap ');
72 END IF;
73 CLOSE Sel_Date_Overlap;
74
75 Fnd_Message.Set_name('AR', 'AR_RATE_OVERLAP_DATE');
76 APP_EXCEPTION.Raise_Exception;
77 Else
78 CLOSE Sel_Date_Overlap;
79 End if;
80
81 Else
82 -- End Date < Start Date?
83 Fnd_Message.Set_name('AR', 'AR_VAL_START');
84 APP_EXCEPTION.Raise_Exception;
85 End if;
86
87 END Check_Eff_Date_Overlap;
88
89 --
90 -- PUBLIC Procedures/Functions
91 --
92
93
94 PROCEDURE Insert_Row(p_Rowid IN OUT NOCOPY VARCHAR2,
95 p_Item_Exception_Rate_Id IN OUT NOCOPY NUMBER,
96 p_Creation_Date DATE,
97 p_Created_By NUMBER,
98 p_Last_Update_Login NUMBER,
99 p_Last_Updated_By NUMBER,
100 p_Last_Update_Date DATE,
101 p_Item_Id NUMBER,
102 p_Rate_Context VARCHAR2,
103 p_Location1_Rate NUMBER,
104 p_Location2_Rate NUMBER,
105 p_Location3_Rate NUMBER,
106 p_Location4_Rate NUMBER,
107 p_Location5_Rate NUMBER,
108 p_Location6_Rate NUMBER,
109 p_Location7_Rate NUMBER,
110 p_Location8_Rate NUMBER,
111 p_Location9_Rate NUMBER,
112 p_Location10_Rate NUMBER,
113 p_Start_Date DATE,
114 p_End_Date DATE,
115 p_Attribute_Category VARCHAR2,
116 p_Attribute1 VARCHAR2,
117 p_Attribute2 VARCHAR2,
118 p_Attribute3 VARCHAR2,
119 p_Attribute4 VARCHAR2,
120 p_Attribute5 VARCHAR2,
121 p_Attribute6 VARCHAR2,
122 p_Attribute7 VARCHAR2,
123 p_Attribute8 VARCHAR2,
124 p_Attribute9 VARCHAR2,
125 p_Attribute10 VARCHAR2,
126 p_Attribute11 VARCHAR2,
127 p_Attribute12 VARCHAR2,
128 p_Attribute13 VARCHAR2,
129 p_Attribute14 VARCHAR2,
130 p_Attribute15 VARCHAR2,
131 p_Reason_Code VARCHAR2,
132 p_Location_Context VARCHAR2,
133 p_Location_Id_Segment_1 NUMBER,
134 p_Location_Id_Segment_2 NUMBER,
135 p_Location_Id_Segment_3 NUMBER,
136 p_Location_Id_Segment_4 NUMBER,
137 p_Location_Id_Segment_5 NUMBER,
138 p_Location_Id_Segment_6 NUMBER,
139 p_Location_Id_Segment_7 NUMBER,
140 p_Location_Id_Segment_8 NUMBER,
141 p_Location_Id_Segment_9 NUMBER,
142 p_Location_Id_Segment_10 NUMBER,
143 p_org_id NUMBER DEFAULT -1 -- Bug 3098063
144 ) IS
145 CURSOR C IS SELECT rowid FROM RA_ITEM_EXCEPTION_RATES
146 WHERE item_exception_rate_id = p_Item_Exception_Rate_Id;
147 CURSOR C2 IS SELECT ra_item_exception_rates_s.nextval FROM dual;
148 BEGIN
149
150 -- Check if Effective Dates overlap.
151 --
152 Check_Eff_Date_Overlap ( p_Rowid, p_Item_Id, p_Start_Date, p_End_Date,
153 p_Location_Id_Segment_1, p_Location_Id_Segment_2,
154 p_Location_Id_Segment_3, p_Location_Id_Segment_4,
155 p_Location_Id_Segment_5, p_Location_Id_Segment_6,
156 p_Location_Id_Segment_7, p_Location_Id_Segment_8,
157 p_Location_Id_Segment_9, p_Location_Id_Segment_10 );
158
159
160 if (p_Item_Exception_Rate_Id is NULL) then
161 OPEN C2;
162 FETCH C2 INTO p_Item_Exception_Rate_Id;
163 CLOSE C2;
164 end if;
165
166 INSERT INTO RA_ITEM_EXCEPTION_RATES(
167
168 item_exception_rate_id,
169 creation_date,
170 created_by,
171 last_update_login,
172 last_updated_by,
173 last_update_date,
174 item_id,
175 rate_context,
176 location1_rate,
177 location2_rate,
178 location3_rate,
179 location4_rate,
180 location5_rate,
181 location6_rate,
182 location7_rate,
183 location8_rate,
184 location9_rate,
185 location10_rate,
186 start_date,
187 end_date,
188 attribute_category,
189 attribute1,
190 attribute2,
191 attribute3,
192 attribute4,
193 attribute5,
194 attribute6,
195 attribute7,
196 attribute8,
197 attribute9,
198 attribute10,
199 attribute11,
200 attribute12,
201 attribute13,
202 attribute14,
203 attribute15,
204 reason_code,
205 location_context,
206 location_id_segment_1,
207 location_id_segment_2,
208 location_id_segment_3,
209 location_id_segment_4,
210 location_id_segment_5,
211 location_id_segment_6,
212 location_id_segment_7,
213 location_id_segment_8,
214 location_id_segment_9,
215 location_id_segment_10
216 ) VALUES (
217
218 p_Item_Exception_Rate_Id,
219 p_Creation_Date,
220 p_Created_By,
221 p_Last_Update_Login,
222 p_Last_Updated_By,
223 p_Last_Update_Date,
224 p_Item_Id,
225 p_Rate_Context,
226 p_Location1_Rate,
227 p_Location2_Rate,
228 p_Location3_Rate,
229 p_Location4_Rate,
230 p_Location5_Rate,
231 p_Location6_Rate,
232 p_Location7_Rate,
233 p_Location8_Rate,
234 p_Location9_Rate,
235 p_Location10_Rate,
236 p_Start_Date,
237 p_End_Date,
238 p_Attribute_Category,
239 p_Attribute1,
240 p_Attribute2,
241 p_Attribute3,
242 p_Attribute4,
243 p_Attribute5,
244 p_Attribute6,
245 p_Attribute7,
246 p_Attribute8,
247 p_Attribute9,
248 p_Attribute10,
249 p_Attribute11,
250 p_Attribute12,
251 p_Attribute13,
252 p_Attribute14,
253 p_Attribute15,
254 p_Reason_Code,
255 p_Location_Context,
256 p_Location_Id_Segment_1,
257 p_Location_Id_Segment_2,
258 p_Location_Id_Segment_3,
259 p_Location_Id_Segment_4,
260 p_Location_Id_Segment_5,
261 p_Location_Id_Segment_6,
262 p_Location_Id_Segment_7,
263 p_Location_Id_Segment_8,
264 p_Location_Id_Segment_9,
265 p_Location_Id_Segment_10
266
267 );
268
269 OPEN C;
270 FETCH C INTO p_Rowid;
271 if (C%NOTFOUND) then
272 CLOSE C;
273 Raise NO_DATA_FOUND;
274 end if;
275 CLOSE C;
276
277 -- Bug 3098063
278 -- Implemented eTax Synchronization Control Procedure
279 ZX_UPGRADE_CONTROL_PKG.SYNC_AR_TAX_EXCEPTIONS
280 (
281 P_Dml_Type => 'I',
282 P_Org_Id => P_org_id,
283 P_Item_Exception_Rate_Id => P_Item_Exception_Rate_Id,
284 P_Creation_Date => P_Creation_Date,
285 P_Created_By => P_Created_By,
286 P_Last_Update_Login => P_Last_Update_Login,
287 P_Last_Updated_By => P_Last_Updated_By,
288 P_Last_Update_Date => P_Last_Update_Date,
289 P_Item_Id => P_Item_Id,
290 P_Rate_Context => P_Rate_Context,
291 P_Location1_Rate => P_Location1_Rate,
292 P_Location2_Rate => P_Location2_Rate,
293 P_Location3_Rate => P_Location3_Rate,
294 P_Location4_Rate => P_Location4_Rate,
295 P_Location5_Rate => P_Location5_Rate,
296 P_Location6_Rate => P_Location6_Rate,
297 P_Location7_Rate => P_Location7_Rate,
298 P_Location8_Rate => P_Location8_Rate,
299 P_Location9_Rate => P_Location9_Rate,
300 P_Location10_Rate => P_Location10_Rate,
301 P_Start_Date => P_Start_Date,
302 P_End_Date => P_End_Date,
303 P_Attribute_Category => P_Attribute_Category,
304 P_Attribute1 => P_Attribute1,
305 P_Attribute2 => P_Attribute2,
306 P_Attribute3 => P_Attribute3,
307 P_Attribute4 => P_Attribute4,
308 P_Attribute5 => P_Attribute5,
309 P_Attribute6 => P_Attribute6,
310 P_Attribute7 => P_Attribute7,
311 P_Attribute8 => P_Attribute8,
312 P_Attribute9 => P_Attribute9,
313 P_Attribute10 => P_Attribute10,
314 P_Attribute11 => P_Attribute11,
315 P_Attribute12 => P_Attribute12,
316 P_Attribute13 => P_Attribute13,
317 P_Attribute14 => P_Attribute14,
318 P_Attribute15 => P_Attribute15,
319 P_Reason_Code => P_Reason_Code,
320 P_Location_Context => P_Location_Context,
321 P_Location_Id_Segment_1 => P_Location_Id_Segment_1,
322 P_Location_Id_Segment_2 => P_Location_Id_Segment_2,
323 P_Location_Id_Segment_3 => P_Location_Id_Segment_3,
324 P_Location_Id_Segment_4 => P_Location_Id_Segment_4,
325 P_Location_Id_Segment_5 => P_Location_Id_Segment_5,
326 P_Location_Id_Segment_6 => P_Location_Id_Segment_6,
327 P_Location_Id_Segment_7 => P_Location_Id_Segment_7,
328 P_Location_Id_Segment_8 => P_Location_Id_Segment_8,
329 P_Location_Id_Segment_9 => P_Location_Id_Segment_9,
330 P_Location_Id_Segment_10 => P_Location_Id_Segment_10
331 );
332
333 END Insert_Row;
334
335
336 PROCEDURE Lock_Row(p_Rowid VARCHAR2,
337 p_Item_Exception_Rate_Id NUMBER,
338 p_Item_Id NUMBER,
339 p_Rate_Context VARCHAR2,
340 p_Location1_Rate NUMBER,
341 p_Location2_Rate NUMBER,
342 p_Location3_Rate NUMBER,
343 p_Location4_Rate NUMBER,
344 p_Location5_Rate NUMBER,
345 p_Location6_Rate NUMBER,
346 p_Location7_Rate NUMBER,
347 p_Location8_Rate NUMBER,
348 p_Location9_Rate NUMBER,
349 p_Location10_Rate NUMBER,
350 p_Start_Date DATE,
351 p_End_Date DATE,
352 p_Attribute_Category VARCHAR2,
353 p_Attribute1 VARCHAR2,
354 p_Attribute2 VARCHAR2,
355 p_Attribute3 VARCHAR2,
356 p_Attribute4 VARCHAR2,
357 p_Attribute5 VARCHAR2,
358 p_Attribute6 VARCHAR2,
359 p_Attribute7 VARCHAR2,
360 p_Attribute8 VARCHAR2,
361 p_Attribute9 VARCHAR2,
362 p_Attribute10 VARCHAR2,
363 p_Attribute11 VARCHAR2,
364 p_Attribute12 VARCHAR2,
365 p_Attribute13 VARCHAR2,
366 p_Attribute14 VARCHAR2,
367 p_Attribute15 VARCHAR2,
368 p_Reason_Code VARCHAR2,
369 p_Location_Context VARCHAR2,
370 p_Location_Id_Segment_1 NUMBER,
371 p_Location_Id_Segment_2 NUMBER,
372 p_Location_Id_Segment_3 NUMBER,
373 p_Location_Id_Segment_4 NUMBER,
374 p_Location_Id_Segment_5 NUMBER,
375 p_Location_Id_Segment_6 NUMBER,
376 p_Location_Id_Segment_7 NUMBER,
377 p_Location_Id_Segment_8 NUMBER,
378 p_Location_Id_Segment_9 NUMBER,
379 p_Location_Id_Segment_10 NUMBER
380 ) IS
381 CURSOR C IS
382 SELECT *
383 FROM RA_ITEM_EXCEPTION_RATES
384 WHERE rowid = p_Rowid
385 FOR UPDATE of Item_Exception_Rate_Id NOWAIT;
386 Recinfo C%ROWTYPE;
387
388
389 BEGIN
390 OPEN C;
391 FETCH C INTO Recinfo;
392 if (C%NOTFOUND) then
393 CLOSE C;
394 FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_DELETED');
395 APP_EXCEPTION.Raise_Exception;
396 end if;
397 CLOSE C;
398 if ( (Recinfo.item_exception_rate_id = p_Item_Exception_Rate_Id)
399 AND (Recinfo.item_id = p_Item_Id)
400 AND (Recinfo.rate_context = p_Rate_Context)
401 AND ( (Recinfo.location1_rate = p_Location1_Rate)
402 OR ( (Recinfo.location1_rate IS NULL)
403 AND (p_Location1_Rate IS NULL)))
404 AND ( (Recinfo.location2_rate = p_Location2_Rate)
405 OR ( (Recinfo.location2_rate IS NULL)
406 AND (p_Location2_Rate IS NULL)))
407 AND ( (Recinfo.location3_rate = p_Location3_Rate)
408 OR ( (Recinfo.location3_rate IS NULL)
409 AND (p_Location3_Rate IS NULL)))
410 AND ( (Recinfo.location4_rate = p_Location4_Rate)
411 OR ( (Recinfo.location4_rate IS NULL)
412 AND (p_Location4_Rate IS NULL)))
413 AND ( (Recinfo.location5_rate = p_Location5_Rate)
414 OR ( (Recinfo.location5_rate IS NULL)
415 AND (p_Location5_Rate IS NULL)))
416 AND ( (Recinfo.location6_rate = p_Location6_Rate)
417 OR ( (Recinfo.location6_rate IS NULL)
418 AND (p_Location6_Rate IS NULL)))
419 AND ( (Recinfo.location7_rate = p_Location7_Rate)
420 OR ( (Recinfo.location7_rate IS NULL)
421 AND (p_Location7_Rate IS NULL)))
422 AND ( (Recinfo.location8_rate = p_Location8_Rate)
423 OR ( (Recinfo.location8_rate IS NULL)
424 AND (p_Location8_Rate IS NULL)))
425 AND ( (Recinfo.location9_rate = p_Location9_Rate)
426 OR ( (Recinfo.location9_rate IS NULL)
427 AND (p_Location9_Rate IS NULL)))
428 AND ( (Recinfo.location10_rate = p_Location10_Rate)
429 OR ( (Recinfo.location10_rate IS NULL)
430 AND (p_Location10_Rate IS NULL)))
431 AND (Recinfo.start_date = p_Start_Date)
432 AND ( (Recinfo.end_date = p_End_Date)
433 OR ( (Recinfo.end_date IS NULL)
434 AND (p_End_Date IS NULL)))
435 AND ( (Recinfo.attribute_category = p_Attribute_Category)
436 OR ( (Recinfo.attribute_category IS NULL)
437 AND (p_Attribute_Category IS NULL)))
438 AND ( (Recinfo.attribute1 = p_Attribute1)
439 OR ( (Recinfo.attribute1 IS NULL)
440 AND (p_Attribute1 IS NULL)))
441 AND ( (Recinfo.attribute2 = p_Attribute2)
442 OR ( (Recinfo.attribute2 IS NULL)
443 AND (p_Attribute2 IS NULL)))
444 AND ( (Recinfo.attribute3 = p_Attribute3)
445 OR ( (Recinfo.attribute3 IS NULL)
446 AND (p_Attribute3 IS NULL)))
447 AND ( (Recinfo.attribute4 = p_Attribute4)
448 OR ( (Recinfo.attribute4 IS NULL)
449 AND (p_Attribute4 IS NULL)))
450 AND ( (Recinfo.attribute5 = p_Attribute5)
451 OR ( (Recinfo.attribute5 IS NULL)
452 AND (p_Attribute5 IS NULL)))
453 AND ( (Recinfo.attribute6 = p_Attribute6)
454 OR ( (Recinfo.attribute6 IS NULL)
455 AND (p_Attribute6 IS NULL)))
456 AND ( (Recinfo.attribute7 = p_Attribute7)
457 OR ( (Recinfo.attribute7 IS NULL)
458 AND (p_Attribute7 IS NULL)))
459 AND ( (Recinfo.attribute8 = p_Attribute8)
460 OR ( (Recinfo.attribute8 IS NULL)
461 AND (p_Attribute8 IS NULL)))
462 AND ( (Recinfo.attribute9 = p_Attribute9)
463 OR ( (Recinfo.attribute9 IS NULL)
464 AND (p_Attribute9 IS NULL)))
465 AND ( (Recinfo.attribute10 = p_Attribute10)
466 OR ( (Recinfo.attribute10 IS NULL)
467 AND (p_Attribute10 IS NULL)))
468 AND ( (Recinfo.attribute11 = p_Attribute11)
469 OR ( (Recinfo.attribute11 IS NULL)
470 AND (p_Attribute11 IS NULL)))
471 AND ( (Recinfo.attribute12 = p_Attribute12)
472 OR ( (Recinfo.attribute12 IS NULL)
473 AND (p_Attribute12 IS NULL)))
474 AND ( (Recinfo.attribute13 = p_Attribute13)
475 OR ( (Recinfo.attribute13 IS NULL)
476 AND (p_Attribute13 IS NULL)))
477 AND ( (Recinfo.attribute14 = p_Attribute14)
478 OR ( (Recinfo.attribute14 IS NULL)
479 AND (p_Attribute14 IS NULL)))
480 AND ( (Recinfo.attribute15 = p_Attribute15)
481 OR ( (Recinfo.attribute15 IS NULL)
482 AND (p_Attribute15 IS NULL)))
483 AND (Recinfo.reason_code = p_Reason_Code)
484 AND (Recinfo.location_context = p_Location_Context)
485 AND ( (Recinfo.location_id_segment_1 = p_Location_Id_Segment_1)
486 OR ( (Recinfo.location_id_segment_1 IS NULL)
487 AND (p_Location_Id_Segment_1 IS NULL)))
488 AND ( (Recinfo.location_id_segment_2 = p_Location_Id_Segment_2)
489 OR ( (Recinfo.location_id_segment_2 IS NULL)
490 AND (p_Location_Id_Segment_2 IS NULL)))
491 AND ( (Recinfo.location_id_segment_3 = p_Location_Id_Segment_3)
492 OR ( (Recinfo.location_id_segment_3 IS NULL)
493 AND (p_Location_Id_Segment_3 IS NULL)))
494 AND ( (Recinfo.location_id_segment_4 = p_Location_Id_Segment_4)
495 OR ( (Recinfo.location_id_segment_4 IS NULL)
496 AND (p_Location_Id_Segment_4 IS NULL)))
497 AND ( (Recinfo.location_id_segment_5 = p_Location_Id_Segment_5)
498 OR ( (Recinfo.location_id_segment_5 IS NULL)
499 AND (p_Location_Id_Segment_5 IS NULL)))
500 AND ( (Recinfo.location_id_segment_6 = p_Location_Id_Segment_6)
501 OR ( (Recinfo.location_id_segment_6 IS NULL)
502 AND (p_Location_Id_Segment_6 IS NULL)))
503 AND ( (Recinfo.location_id_segment_7 = p_Location_Id_Segment_7)
504 OR ( (Recinfo.location_id_segment_7 IS NULL)
505 AND (p_Location_Id_Segment_7 IS NULL)))
506 AND ( (Recinfo.location_id_segment_8 = p_Location_Id_Segment_8)
507 OR ( (Recinfo.location_id_segment_8 IS NULL)
508 AND (p_Location_Id_Segment_8 IS NULL)))
509 AND ( (Recinfo.location_id_segment_9 = p_Location_Id_Segment_9)
510 OR ( (Recinfo.location_id_segment_9 IS NULL)
511 AND (p_Location_Id_Segment_9 IS NULL)))
512 AND ( (Recinfo.location_id_segment_10 = p_Location_Id_Segment_10)
513 OR ( (Recinfo.location_id_segment_10 IS NULL)
514 AND (p_Location_Id_Segment_10 IS NULL)))
515 ) then
516 return;
517 else
518 FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_CHANGED');
519 APP_EXCEPTION.Raise_Exception;
520 end if;
521 END Lock_Row;
522
523
524
525 PROCEDURE Update_Row(p_Rowid VARCHAR2,
526 p_Item_Exception_Rate_Id NUMBER,
527 p_Last_Update_Login NUMBER,
528 p_Last_Updated_By NUMBER,
529 p_Last_Update_Date DATE,
530 p_Item_Id NUMBER,
531 p_Rate_Context VARCHAR2,
532 p_Location1_Rate NUMBER,
533 p_Location2_Rate NUMBER,
534 p_Location3_Rate NUMBER,
535 p_Location4_Rate NUMBER,
536 p_Location5_Rate NUMBER,
537 p_Location6_Rate NUMBER,
538 p_Location7_Rate NUMBER,
539 p_Location8_Rate NUMBER,
540 p_Location9_Rate NUMBER,
541 p_Location10_Rate NUMBER,
542 p_Start_Date DATE,
543 p_End_Date DATE,
544 p_Attribute_Category VARCHAR2,
545 p_Attribute1 VARCHAR2,
546 p_Attribute2 VARCHAR2,
547 p_Attribute3 VARCHAR2,
548 p_Attribute4 VARCHAR2,
549 p_Attribute5 VARCHAR2,
550 p_Attribute6 VARCHAR2,
551 p_Attribute7 VARCHAR2,
552 p_Attribute8 VARCHAR2,
553 p_Attribute9 VARCHAR2,
554 p_Attribute10 VARCHAR2,
555 p_Attribute11 VARCHAR2,
556 p_Attribute12 VARCHAR2,
557 p_Attribute13 VARCHAR2,
558 p_Attribute14 VARCHAR2,
559 p_Attribute15 VARCHAR2,
560 p_Reason_Code VARCHAR2,
561 p_Location_Context VARCHAR2,
562 p_Location_Id_Segment_1 NUMBER,
563 p_Location_Id_Segment_2 NUMBER,
564 p_Location_Id_Segment_3 NUMBER,
565 p_Location_Id_Segment_4 NUMBER,
566 p_Location_Id_Segment_5 NUMBER,
567 p_Location_Id_Segment_6 NUMBER,
568 p_Location_Id_Segment_7 NUMBER,
569 p_Location_Id_Segment_8 NUMBER,
570 p_Location_Id_Segment_9 NUMBER,
571 p_Location_Id_Segment_10 NUMBER,
572 p_org_id NUMBER DEFAULT -1 -- Bug 3098063
573
574 ) IS
575 BEGIN
576
577 -- Check if Effective Dates overlap.
578 --
579 IF PG_DEBUG in ('Y', 'C') THEN
580 arp_util.debug('Update_Row: ' || '-- Checking Overlap ');
581 END IF;
582 Check_Eff_Date_Overlap ( p_Rowid, p_Item_Id, p_Start_Date, p_End_Date,
583 p_Location_Id_Segment_1, p_Location_Id_Segment_2,
584 p_Location_Id_Segment_3, p_Location_Id_Segment_4,
585 p_Location_Id_Segment_5, p_Location_Id_Segment_6,
586 p_Location_Id_Segment_7, p_Location_Id_Segment_8,
587 p_Location_Id_Segment_9, p_Location_Id_Segment_10 );
588
589 IF PG_DEBUG in ('Y', 'C') THEN
590 arp_util.debug('Update_Row: ' || '-- Updating Row');
591 arp_util.debug('Update_Row: ' || '-- p_Rowid = '||p_Rowid);
592 END IF;
593
594 UPDATE RA_ITEM_EXCEPTION_RATES
595 SET
596 item_exception_rate_id = p_Item_Exception_Rate_Id,
597 last_update_login = p_Last_Update_Login,
598 last_updated_by = p_Last_Updated_By,
599 last_update_date = p_Last_Update_Date,
600 item_id = p_Item_Id,
601 rate_context = p_Rate_Context,
602 location1_rate = p_Location1_Rate,
603 location2_rate = p_Location2_Rate,
604 location3_rate = p_Location3_Rate,
605 location4_rate = p_Location4_Rate,
606 location5_rate = p_Location5_Rate,
607 location6_rate = p_Location6_Rate,
608 location7_rate = p_Location7_Rate,
609 location8_rate = p_Location8_Rate,
610 location9_rate = p_Location9_Rate,
611 location10_rate = p_Location10_Rate,
612 start_date = p_Start_Date,
613 end_date = p_End_Date,
614 attribute_category = p_Attribute_Category,
615 attribute1 = p_Attribute1,
616 attribute2 = p_Attribute2,
617 attribute3 = p_Attribute3,
618 attribute4 = p_Attribute4,
619 attribute5 = p_Attribute5,
620 attribute6 = p_Attribute6,
621 attribute7 = p_Attribute7,
622 attribute8 = p_Attribute8,
623 attribute9 = p_Attribute9,
624 attribute10 = p_Attribute10,
625 attribute11 = p_Attribute11,
626 attribute12 = p_Attribute12,
627 attribute13 = p_Attribute13,
628 attribute14 = p_Attribute14,
629 attribute15 = p_Attribute15,
630 reason_code = p_Reason_Code,
631 location_context = p_Location_Context,
632 location_id_segment_1 = p_Location_Id_Segment_1,
633 location_id_segment_2 = p_Location_Id_Segment_2,
634 location_id_segment_3 = p_Location_Id_Segment_3,
635 location_id_segment_4 = p_Location_Id_Segment_4,
636 location_id_segment_5 = p_Location_Id_Segment_5,
637 location_id_segment_6 = p_Location_Id_Segment_6,
638 location_id_segment_7 = p_Location_Id_Segment_7,
639 location_id_segment_8 = p_Location_Id_Segment_8,
640 location_id_segment_9 = p_Location_Id_Segment_9,
641 location_id_segment_10 = p_Location_Id_Segment_10
642 WHERE rowid = p_Rowid;
643
644 if (SQL%NOTFOUND) then
645 Raise NO_DATA_FOUND;
646 end if;
647
648 -- Bug 3098063
649 -- Implemented eTax Synchronization Control Procedure
650 ZX_UPGRADE_CONTROL_PKG.SYNC_AR_TAX_EXCEPTIONS
651 (
652 P_Dml_Type => 'U',
653 P_Org_Id => P_org_id,
654 P_Item_Exception_Rate_Id => P_Item_Exception_Rate_Id,
655 P_Creation_Date => NULL,
656 P_Created_By => NULL,
657 P_Last_Update_Login => P_Last_Update_Login,
658 P_Last_Updated_By => P_Last_Updated_By,
659 P_Last_Update_Date => P_Last_Update_Date,
660 P_Item_Id => P_Item_Id,
661 P_Rate_Context => P_Rate_Context,
662 P_Location1_Rate => P_Location1_Rate,
663 P_Location2_Rate => P_Location2_Rate,
664 P_Location3_Rate => P_Location3_Rate,
665 P_Location4_Rate => P_Location4_Rate,
666 P_Location5_Rate => P_Location5_Rate,
667 P_Location6_Rate => P_Location6_Rate,
668 P_Location7_Rate => P_Location7_Rate,
669 P_Location8_Rate => P_Location8_Rate,
670 P_Location9_Rate => P_Location9_Rate,
671 P_Location10_Rate => P_Location10_Rate,
672 P_Start_Date => P_Start_Date,
673 P_End_Date => P_End_Date,
674 P_Attribute_Category => P_Attribute_Category,
675 P_Attribute1 => P_Attribute1,
676 P_Attribute2 => P_Attribute2,
677 P_Attribute3 => P_Attribute3,
678 P_Attribute4 => P_Attribute4,
679 P_Attribute5 => P_Attribute5,
680 P_Attribute6 => P_Attribute6,
681 P_Attribute7 => P_Attribute7,
682 P_Attribute8 => P_Attribute8,
683 P_Attribute9 => P_Attribute9,
684 P_Attribute10 => P_Attribute10,
685 P_Attribute11 => P_Attribute11,
686 P_Attribute12 => P_Attribute12,
687 P_Attribute13 => P_Attribute13,
688 P_Attribute14 => P_Attribute14,
689 P_Attribute15 => P_Attribute15,
690 P_Reason_Code => P_Reason_Code,
691 P_Location_Context => P_Location_Context,
692 P_Location_Id_Segment_1 => P_Location_Id_Segment_1,
693 P_Location_Id_Segment_2 => P_Location_Id_Segment_2,
694 P_Location_Id_Segment_3 => P_Location_Id_Segment_3,
695 P_Location_Id_Segment_4 => P_Location_Id_Segment_4,
696 P_Location_Id_Segment_5 => P_Location_Id_Segment_5,
697 P_Location_Id_Segment_6 => P_Location_Id_Segment_6,
698 P_Location_Id_Segment_7 => P_Location_Id_Segment_7,
699 P_Location_Id_Segment_8 => P_Location_Id_Segment_8,
700 P_Location_Id_Segment_9 => P_Location_Id_Segment_9,
701 P_Location_Id_Segment_10 => P_Location_Id_Segment_10
702 );
703
704
705 END Update_Row;
706
707
708 PROCEDURE Delete_Row(p_Rowid VARCHAR2) IS
709 BEGIN
710 DELETE FROM RA_ITEM_EXCEPTION_RATES
711 WHERE rowid = p_Rowid;
712
713 if (SQL%NOTFOUND) then
714 Raise NO_DATA_FOUND;
715 end if;
716 END Delete_Row;
717
718
719 END ARP_IER_PKG;