DBA Data[Home] [Help]

PACKAGE BODY: APPS.OE_VERSION_BLANKET_COMP

Source


1 PACKAGE BODY OE_VERSION_BLANKET_COMP AS
2 /* $Header: OEXBCOMB.pls 120.3 2006/04/07 00:15:10 mbhoumik noship $ */
3 
4 PROCEDURE QUERY_HEADER_ROW
5 (p_header_id	                  NUMBER,
6  p_version	                  NUMBER,
7  p_phase_change_flag              VARCHAR2,
8  x_header_rec                     IN OUT NOCOPY OE_Blanket_PUB.Header_Rec_Type)
9 IS
10 l_org_id                NUMBER;
11 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
12 BEGIN
13  oe_debug_pub.add('l_debug_level'||l_debug_level );
14 IF l_debug_level > 0 THEN
15   oe_debug_pub.add('Entering OE_VERSION_BLANKET_COMP.QUERY_HEADER_ROW'||p_version );
16   oe_debug_pub.add('header' ||p_header_id);
17   oe_debug_pub.add('version' ||p_version);
18   oe_debug_pub.add('phase_change_flag' ||p_phase_change_flag);
19 END IF;
20     l_org_id := OE_GLOBALS.G_ORG_ID;
21 
22     IF l_org_id IS NULL THEN
23       OE_GLOBALS.Set_Context;
24       l_org_id := OE_GLOBALS.G_ORG_ID;
25     END IF;
26 
27     SELECT  ACCOUNTING_RULE_ID
28     ,       AGREEMENT_ID
29     ,       ATTRIBUTE1
30     ,       ATTRIBUTE10
31     ,       ATTRIBUTE11
32     ,       ATTRIBUTE12
33     ,       ATTRIBUTE13
34     ,       ATTRIBUTE14
35     ,       ATTRIBUTE15
36     ,       ATTRIBUTE16
37     ,       ATTRIBUTE17
38     ,       ATTRIBUTE18
39     ,       ATTRIBUTE19
40     ,       ATTRIBUTE20
41     ,       ATTRIBUTE2
42     ,       ATTRIBUTE3
43     ,       ATTRIBUTE4
44     ,       ATTRIBUTE5
45     ,       ATTRIBUTE6
46     ,       ATTRIBUTE7
47     ,       ATTRIBUTE8
48     ,       ATTRIBUTE9
49     ,       CONTEXT
50     ,       CREATED_BY
51     ,       CREATION_DATE
52     ,       CUST_PO_NUMBER
53     ,       DELIVER_TO_ORG_ID
54     ,       FREIGHT_TERMS_CODE
55     ,       header_id
56     ,       INVOICE_TO_ORG_ID
57     ,       INVOICING_RULE_ID
58     ,       LAST_UPDATED_BY
59     ,       LAST_UPDATE_DATE
60     ,       LAST_UPDATE_LOGIN
61     ,       bh.ORDER_NUMBER
62     ,       ORDER_TYPE_ID
63     ,       ORG_ID
64     ,       PAYMENT_TERM_ID
65     ,       PRICE_LIST_ID
66     ,       PROGRAM_APPLICATION_ID
67     ,       PROGRAM_ID
68     ,       PROGRAM_UPDATE_DATE
69     ,       REQUEST_ID
70     ,       SALESREP_ID
71     ,       SHIPPING_METHOD_CODE
72     ,       ship_from_org_id
73     ,       SHIP_TO_ORG_ID
74     ,       SOLD_TO_CONTACT_ID
75     ,       SOLD_TO_ORG_ID
76     ,       TRANSACTIONAL_CURR_CODE
77     ,       conversion_type_code
78     ,       LOCK_CONTROL
79     ,       VERSION_NUMBER
80     ,       SHIPPING_INSTRUCTIONS
81     ,       PACKING_INSTRUCTIONS
82     ,       START_DATE_ACTIVE
83     ,       END_DATE_ACTIVE
84     ,       on_hold_flag
85     ,       ENFORCE_PRICE_LIST_FLAG
86     ,       enforce_ship_to_flag
87     ,       enforce_invoice_to_flag
88     ,       enforce_freight_term_flag
89     ,       enforce_shipping_method_flag
90     ,       enforce_payment_term_flag
91     ,       enforce_accounting_rule_flag
92     ,       enforce_invoicing_rule_flag
93     ,       OVERRIDE_AMOUNT_FLAG
94     ,       BLANKET_MAX_AMOUNT
95     ,       BLANKET_MIN_AMOUNT
96     ,       RELEASED_AMOUNT
97     ,       FULFILLED_AMOUNT
98     ,       RETURNED_AMOUNT
99     ,       source_document_id
100     ,       source_document_type_id
101     ,       SALES_DOCUMENT_NAME
102     ,       TRANSACTION_PHASE_CODE
103     ,       USER_STATUS_CODE
104     ,       FLOW_STATUS_CODE
105     ,	    SUPPLIER_SIGNATURE
106     ,	    SUPPLIER_SIGNATURE_DATE
107     ,	    CUSTOMER_SIGNATURE
108     ,	    CUSTOMER_SIGNATURE_DATE
109     ,       sold_to_site_use_id
110     ,       draft_submitted_flag
111     ,       source_document_version_number
112     ,       new_price_list_id
113     ,       new_modifier_list_id
114     ,       default_discount_percent
115     ,       default_discount_amount
116     INTO x_header_rec.ACCOUNTING_RULE_ID
117     ,x_header_rec.AGREEMENT_ID
118     ,x_header_rec.ATTRIBUTE1
119     ,x_header_rec.ATTRIBUTE10
120     ,x_header_rec.ATTRIBUTE11
121     ,x_header_rec.ATTRIBUTE12
122     ,x_header_rec.ATTRIBUTE13
123     ,x_header_rec.ATTRIBUTE14
124     ,x_header_rec.ATTRIBUTE15
125     ,x_header_rec.ATTRIBUTE16
126     ,x_header_rec.ATTRIBUTE17
127     ,x_header_rec.ATTRIBUTE18
128     ,x_header_rec.ATTRIBUTE19
129     ,x_header_rec.ATTRIBUTE20
130     ,x_header_rec.ATTRIBUTE2
131     ,x_header_rec.ATTRIBUTE3
132     ,x_header_rec.ATTRIBUTE4
133     ,x_header_rec.ATTRIBUTE5
134     ,x_header_rec.ATTRIBUTE6
135     ,x_header_rec.ATTRIBUTE7
136     ,x_header_rec.ATTRIBUTE8
137     ,x_header_rec.ATTRIBUTE9
138     ,x_header_rec.CONTEXT
139     ,x_header_rec.CREATED_BY
140     ,x_header_rec.CREATION_DATE
141     ,x_header_rec.CUST_PO_NUMBER
142     ,x_header_rec.DELIVER_TO_ORG_ID
143     ,x_header_rec.FREIGHT_TERMS_CODE
144     ,x_header_rec.header_id
145     ,x_header_rec.INVOICE_TO_ORG_ID
146     ,x_header_rec.INVOICING_RULE_ID
147     ,x_header_rec.LAST_UPDATED_BY
148     ,x_header_rec.LAST_UPDATE_DATE
149     ,x_header_rec.LAST_UPDATE_LOGIN
150     ,x_header_rec.ORDER_NUMBER
151     ,x_header_rec.ORDER_TYPE_ID
152     ,x_header_rec.ORG_ID
153     ,x_header_rec.PAYMENT_TERM_ID
154     ,x_header_rec.PRICE_LIST_ID
155     ,x_header_rec.PROGRAM_APPLICATION_ID
156     ,x_header_rec.PROGRAM_ID
157     ,x_header_rec.PROGRAM_UPDATE_DATE
158     ,x_header_rec.REQUEST_ID
159     ,x_header_rec.SALESREP_ID
160     ,x_header_rec.SHIPPING_METHOD_CODE
161     ,x_header_rec.ship_from_org_id
162     ,x_header_rec.SHIP_TO_ORG_ID
163     ,x_header_rec.SOLD_TO_CONTACT_ID
164     ,x_header_rec.SOLD_TO_ORG_ID
165     ,x_header_rec.TRANSACTIONAL_CURR_CODE
166     ,x_header_rec.conversion_type_code
167     ,x_header_rec.LOCK_CONTROL
168     ,x_header_rec.VERSION_NUMBER
169     ,x_header_rec.SHIPPING_INSTRUCTIONS
170     ,x_header_rec.PACKING_INSTRUCTIONS
171     ,x_header_rec.START_DATE_ACTIVE
172     ,x_header_rec.END_DATE_ACTIVE
173     ,x_header_rec.on_hold_flag
174     ,x_header_rec.ENFORCE_PRICE_LIST_FLAG
175     ,x_header_rec.enforce_ship_to_flag
176     ,x_header_rec.enforce_invoice_to_flag
177     ,x_header_rec.enforce_freight_term_flag
178     ,x_header_rec.enforce_shipping_method_flag
179     ,x_header_rec.enforce_payment_term_flag
180     ,x_header_rec.enforce_accounting_rule_flag
181     ,x_header_rec.enforce_invoicing_rule_flag
182     ,x_header_rec.OVERRIDE_AMOUNT_FLAG
183     ,x_header_rec.BLANKET_MAX_AMOUNT
184     ,x_header_rec.BLANKET_MIN_AMOUNT
185     ,x_header_rec.RELEASED_AMOUNT
186     ,x_header_rec.FULFILLED_AMOUNT
187     ,x_header_rec.RETURNED_AMOUNT
188     ,x_header_rec.source_document_id
189     ,x_header_rec.source_document_type_id
190     ,x_header_rec.SALES_DOCUMENT_NAME
191     ,x_header_rec.TRANSACTION_PHASE_CODE
192     ,x_header_rec.USER_STATUS_CODE
193     ,x_header_rec.FLOW_STATUS_CODE
194     ,x_header_rec.SUPPLIER_SIGNATURE
195     ,x_header_rec.SUPPLIER_SIGNATURE_DATE
196     ,x_header_rec.CUSTOMER_SIGNATURE
197     ,x_header_rec.CUSTOMER_SIGNATURE_DATE
198     ,x_header_rec.sold_to_site_use_id
199     ,x_header_rec.draft_submitted_flag
200     ,x_header_rec.source_document_version_number
201     ,x_header_rec.new_price_list_id
202     ,x_header_rec.new_modifier_list_id
203     ,x_header_rec.default_discount_percent
204     ,x_header_rec.default_discount_amount
205     FROM    OE_BLANKET_HEADERS_HIST bh
206     WHERE   bh.header_id                = p_header_id
207       AND   bh.sales_document_type_code = 'B'
208       AND   bh.version_number           = p_version
209      AND    (PHASE_CHANGE_FLAG = p_phase_change_flag
210      OR     (nvl(p_phase_change_flag, 'NULL') <> 'Y'
211      AND     VERSION_FLAG = 'Y'));
212 
213 EXCEPTION
214     WHEN NO_DATA_FOUND THEN
215 	 null;
216     WHEN OTHERS THEN
217 
218         IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
219         THEN
220             OE_MSG_PUB.Add_Exc_Msg
221             (   G_PKG_NAME,
222                'Query_HEADER_Row'
223             );
224         END IF;
225 
226         RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
227 
228 END QUERY_HEADER_ROW;
229 
230 PROCEDURE QUERY_HEADER_TRANS_ROW
231 (p_header_id	                  NUMBER,
232  p_version	                  NUMBER,
233  x_header_rec                     IN OUT NOCOPY OE_Blanket_PUB.Header_Rec_Type)
234 IS
235 l_org_id                NUMBER;
236 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
237 BEGIN
238 
239 IF l_debug_level > 0 THEN
240   oe_debug_pub.add('Entering OE_BLKT_VERSION_COMPARISION.QUERY_HEADER_TRANS_ROW');
241   oe_debug_pub.add('header' ||p_header_id);
242   oe_debug_pub.add('version' ||p_version);
243 END IF;
244     l_org_id := OE_GLOBALS.G_ORG_ID;
245 
246     IF l_org_id IS NULL THEN
247       OE_GLOBALS.Set_Context;
248       l_org_id := OE_GLOBALS.G_ORG_ID;
249     END IF;
250 
251 
252     SELECT  ACCOUNTING_RULE_ID
253     ,       AGREEMENT_ID
254     ,       ATTRIBUTE1
255     ,       ATTRIBUTE10
256     ,       ATTRIBUTE11
257     ,       ATTRIBUTE12
258     ,       ATTRIBUTE13
259     ,       ATTRIBUTE14
260     ,       ATTRIBUTE15
261     ,       ATTRIBUTE16
262     ,       ATTRIBUTE17
263     ,       ATTRIBUTE18
264     ,       ATTRIBUTE19
265     ,       ATTRIBUTE20
266     ,       ATTRIBUTE2
267     ,       ATTRIBUTE3
268     ,       ATTRIBUTE4
269     ,       ATTRIBUTE5
270     ,       ATTRIBUTE6
271     ,       ATTRIBUTE7
272     ,       ATTRIBUTE8
273     ,       ATTRIBUTE9
274     ,       CONTEXT
275     ,       CREATED_BY
276     ,       CREATION_DATE
277     ,       CUST_PO_NUMBER
278     ,       DELIVER_TO_ORG_ID
279     ,       FREIGHT_TERMS_CODE
280     ,       header_id
281     ,       INVOICE_TO_ORG_ID
282     ,       INVOICING_RULE_ID
283     ,       LAST_UPDATED_BY
284     ,       LAST_UPDATE_DATE
285     ,       LAST_UPDATE_LOGIN
286     ,       bh.ORDER_NUMBER
287     ,       ORDER_TYPE_ID
288     ,       ORG_ID
289     ,       PAYMENT_TERM_ID
290     ,       PRICE_LIST_ID
291     ,       PROGRAM_APPLICATION_ID
292     ,       PROGRAM_ID
293     ,       PROGRAM_UPDATE_DATE
294     ,       REQUEST_ID
295     ,       SALESREP_ID
296     ,       SHIPPING_METHOD_CODE
297     ,       ship_from_org_id
298     ,       SHIP_TO_ORG_ID
299     ,       SOLD_TO_CONTACT_ID
300     ,       SOLD_TO_ORG_ID
301     ,       TRANSACTIONAL_CURR_CODE
302     ,       conversion_type_code
303     ,       LOCK_CONTROL
304     ,       VERSION_NUMBER
305     ,       SHIPPING_INSTRUCTIONS
306     ,       PACKING_INSTRUCTIONS
307     ,       START_DATE_ACTIVE
308     ,       END_DATE_ACTIVE
309     ,       on_hold_flag
310     ,       ENFORCE_PRICE_LIST_FLAG
311     ,       enforce_ship_to_flag
312     ,       enforce_invoice_to_flag
313     ,       enforce_freight_term_flag
314     ,       enforce_shipping_method_flag
315     ,       enforce_payment_term_flag
316     ,       enforce_accounting_rule_flag
317     ,       enforce_invoicing_rule_flag
318     ,       OVERRIDE_AMOUNT_FLAG
319     ,       BLANKET_MAX_AMOUNT
320     ,       BLANKET_MIN_AMOUNT
321     ,       RELEASED_AMOUNT
322     ,       FULFILLED_AMOUNT
323     ,       RETURNED_AMOUNT
324     ,       source_document_id
325     ,       source_document_type_id
326     ,       SALES_DOCUMENT_NAME
327     ,       TRANSACTION_PHASE_CODE
328     ,       USER_STATUS_CODE
329     ,       FLOW_STATUS_CODE
330     ,	    SUPPLIER_SIGNATURE
331     ,	    SUPPLIER_SIGNATURE_DATE
332     ,	    CUSTOMER_SIGNATURE
333     ,	    CUSTOMER_SIGNATURE_DATE
334     ,       sold_to_site_use_id
335     ,       draft_submitted_flag
336     ,       source_document_version_number
337     ,       new_price_list_id
338     ,       new_modifier_list_id
339     ,       default_discount_percent
340     ,       default_discount_amount
341     INTO
342     x_header_rec.ACCOUNTING_RULE_ID
343     ,x_header_rec.AGREEMENT_ID
344     ,x_header_rec.ATTRIBUTE1
345     ,x_header_rec.ATTRIBUTE10
346     ,x_header_rec.ATTRIBUTE11
347     ,x_header_rec.ATTRIBUTE12
348     ,x_header_rec.ATTRIBUTE13
349     ,x_header_rec.ATTRIBUTE14
350     ,x_header_rec.ATTRIBUTE15
351     ,x_header_rec.ATTRIBUTE16
352     ,x_header_rec.ATTRIBUTE17
353     ,x_header_rec.ATTRIBUTE18
354     ,x_header_rec.ATTRIBUTE19
355     ,x_header_rec.ATTRIBUTE20
356     ,x_header_rec.ATTRIBUTE2
357     ,x_header_rec.ATTRIBUTE3
358     ,x_header_rec.ATTRIBUTE4
359     ,x_header_rec.ATTRIBUTE5
360     ,x_header_rec.ATTRIBUTE6
361     ,x_header_rec.ATTRIBUTE7
362     ,x_header_rec.ATTRIBUTE8
363     ,x_header_rec.ATTRIBUTE9
364     ,x_header_rec.CONTEXT
365     ,x_header_rec.CREATED_BY
366     ,x_header_rec.CREATION_DATE
367     ,x_header_rec.CUST_PO_NUMBER
368     ,x_header_rec.DELIVER_TO_ORG_ID
369     ,x_header_rec.FREIGHT_TERMS_CODE
370     ,x_header_rec.header_id
371     ,x_header_rec.INVOICE_TO_ORG_ID
372     ,x_header_rec.INVOICING_RULE_ID
373     ,x_header_rec.LAST_UPDATED_BY
374     ,x_header_rec.LAST_UPDATE_DATE
375     ,x_header_rec.LAST_UPDATE_LOGIN
376     ,x_header_rec.ORDER_NUMBER
377     ,x_header_rec.ORDER_TYPE_ID
378     ,x_header_rec.ORG_ID
379     ,x_header_rec.PAYMENT_TERM_ID
380     ,x_header_rec.PRICE_LIST_ID
381     ,x_header_rec.PROGRAM_APPLICATION_ID
382     ,x_header_rec.PROGRAM_ID
383     ,x_header_rec.PROGRAM_UPDATE_DATE
384     ,x_header_rec.REQUEST_ID
385     ,x_header_rec.SALESREP_ID
386     ,x_header_rec.SHIPPING_METHOD_CODE
387     ,x_header_rec.ship_from_org_id
388     ,x_header_rec.SHIP_TO_ORG_ID
389     ,x_header_rec.SOLD_TO_CONTACT_ID
390     ,x_header_rec.SOLD_TO_ORG_ID
391     ,x_header_rec.TRANSACTIONAL_CURR_CODE
392     ,x_header_rec.conversion_type_code
393     ,x_header_rec.LOCK_CONTROL
394     ,x_header_rec.VERSION_NUMBER
395     ,x_header_rec.SHIPPING_INSTRUCTIONS
396     ,x_header_rec.PACKING_INSTRUCTIONS
397     ,x_header_rec.START_DATE_ACTIVE
398     ,x_header_rec.END_DATE_ACTIVE
399     ,x_header_rec.on_hold_flag
400     ,x_header_rec.ENFORCE_PRICE_LIST_FLAG
401     ,x_header_rec.enforce_ship_to_flag
402     ,x_header_rec.enforce_invoice_to_flag
403     ,x_header_rec.enforce_freight_term_flag
404     ,x_header_rec.enforce_shipping_method_flag
405     ,x_header_rec.enforce_payment_term_flag
406     ,x_header_rec.enforce_accounting_rule_flag
407     ,x_header_rec.enforce_invoicing_rule_flag
408     ,x_header_rec.OVERRIDE_AMOUNT_FLAG
409     ,x_header_rec.BLANKET_MAX_AMOUNT
410     ,x_header_rec.BLANKET_MIN_AMOUNT
411     ,x_header_rec.RELEASED_AMOUNT
412     ,x_header_rec.FULFILLED_AMOUNT
413     ,x_header_rec.RETURNED_AMOUNT
414     ,x_header_rec.source_document_id
415     ,x_header_rec.source_document_type_id
416     ,x_header_rec.SALES_DOCUMENT_NAME
417     ,x_header_rec.TRANSACTION_PHASE_CODE
418     ,x_header_rec.USER_STATUS_CODE
419     ,x_header_rec.FLOW_STATUS_CODE
420     ,x_header_rec. SUPPLIER_SIGNATURE
421     ,x_header_rec.SUPPLIER_SIGNATURE_DATE
422     ,x_header_rec.CUSTOMER_SIGNATURE
423     ,x_header_rec.CUSTOMER_SIGNATURE_DATE
424     ,x_header_rec.sold_to_site_use_id
425     ,x_header_rec.draft_submitted_flag
426     ,x_header_rec.source_document_version_number
427     ,x_header_rec.new_price_list_id
428     ,x_header_rec.new_modifier_list_id
429     ,x_header_rec.default_discount_percent
430     ,x_header_rec.default_discount_amount
431     FROM    OE_BLANKET_HEADERS bh, OE_BLANKET_HEADERS_EXT bhx
432     WHERE   bh.order_number             = bhx.order_number
433     AND     bh.sales_document_type_code = 'B'
434     AND     bh.HEADER_ID                = p_header_id
435     AND     bh.VERSION_NUMBER           = p_version;
436 
437 EXCEPTION
438     WHEN NO_DATA_FOUND THEN
439 	 null;
440     WHEN OTHERS THEN
441 
442         IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
443         THEN
444             OE_MSG_PUB.Add_Exc_Msg
445             (   G_PKG_NAME,
446                'Query_HEADER_TRANS_Row'
447             );
448         END IF;
449 
450         RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
451 
452 END QUERY_HEADER_TRANS_ROW;
453 
454 PROCEDURE COMPARE_HEADER_VERSIONS
455 (p_header_id	                  NUMBER,
456  p_prior_version                  NUMBER,
457  p_current_version                NUMBER,
458  p_next_version                   NUMBER,
459  g_max_version                    NUMBER,
460  g_trans_version                  NUMBER,
461  g_prior_phase_change_flag        VARCHAR2,
462  g_curr_phase_change_flag         VARCHAR2,
463  g_next_phase_change_flag         VARCHAR2,
464  x_header_changed_attr_tbl        IN OUT NOCOPY OE_VERSION_BLANKET_COMP.header_tbl_type)
465 IS
466 p_curr_rec                       OE_Blanket_PUB.Header_Rec_Type;
467 p_next_rec                       OE_Blanket_PUB.Header_Rec_Type;
468 p_prior_rec                      OE_Blanket_PUB.Header_Rec_Type;
469 
470 
471 v_totcol NUMBER:=10;
472 v_header_col VARCHAR2(50);
473 ind NUMBER;
474 prior_exists VARCHAR2(1) := 'N';
475 j NUMBER;
476 
477 x_deliver_to_address1          VARCHAR2(240);
478 x_deliver_to_address2          VARCHAR2(240);
479 x_deliver_to_address3          VARCHAR2(240);
480 x_deliver_to_address4          VARCHAR2(240);
481 x_deliver_to_location          VARCHAR2(240);
482 x_deliver_to_org               VARCHAR2(240);
483 x_deliver_to_city              VARCHAR2(240);
484 x_deliver_to_state             VARCHAR2(240);
485 x_deliver_to_postal_code       VARCHAR2(240);
486 x_deliver_to_country           VARCHAR2(240);
487 x_prior_deliver_to_address           VARCHAR2(2000);
488 x_current_deliver_to_address           VARCHAR2(2000);
489 x_next_deliver_to_address           VARCHAR2(2000);
490 x_invoice_to_address1          VARCHAR2(240);
491 x_invoice_to_address2          VARCHAR2(240);
492 x_invoice_to_address3          VARCHAR2(240);
493 x_invoice_to_address4          VARCHAR2(240);
494 x_invoice_to_location          VARCHAR2(240);
495 x_invoice_to_org               VARCHAR2(240);
496 x_invoice_to_city              VARCHAR2(240);
497 x_invoice_to_state             VARCHAR2(240);
498 x_invoice_to_postal_code       VARCHAR2(240);
499 x_invoice_to_country           VARCHAR2(240);
500 x_prior_invoice_to_address           VARCHAR2(2000);
501 x_current_invoice_to_address           VARCHAR2(2000);
502 x_next_invoice_to_address           VARCHAR2(2000);
503 x_ship_to_address1          VARCHAR2(240);
504 x_ship_to_address2          VARCHAR2(240);
505 x_ship_to_address3          VARCHAR2(240);
506 x_ship_to_address4          VARCHAR2(240);
507 x_ship_to_location          VARCHAR2(240);
508 x_ship_to_org               VARCHAR2(240);
509 x_ship_to_city              VARCHAR2(240);
510 x_ship_to_state             VARCHAR2(240);
511 x_ship_to_postal_code       VARCHAR2(240);
512 x_ship_to_country           VARCHAR2(240);
513 x_prior_ship_to_address           VARCHAR2(2000);
514 x_current_ship_to_address           VARCHAR2(2000);
515 x_next_ship_to_address           VARCHAR2(2000);
516 x_ship_from_address1          VARCHAR2(240);
517 x_ship_from_address2          VARCHAR2(240);
518 x_ship_from_address3          VARCHAR2(240);
519 x_ship_from_address4          VARCHAR2(240);
520 x_ship_from_location          VARCHAR2(240);
521 x_prior_ship_from_org               VARCHAR2(240);
522 x_current_ship_from_org               VARCHAR2(240);
523 x_next_ship_from_org               VARCHAR2(240);
524 x_ship_from_address           VARCHAR2(2000);
525 x_ship_from_address           VARCHAR2(2000);
526 x_ship_from_address           VARCHAR2(2000);
527 x_prior_customer_name               VARCHAR2(360);
528 x_current_customer_name               VARCHAR2(360);
529 x_next_customer_name               VARCHAR2(360);
530 x_customer_number             VARCHAR2(100);
531 x_sold_to_location_address1          VARCHAR2(240);
532 x_sold_to_location_address2          VARCHAR2(240);
533 x_sold_to_location_address3          VARCHAR2(240);
534 x_sold_to_location_address4          VARCHAR2(240);
535 x_sold_to_location                   VARCHAR2(240);
536 x_sold_to_location_city              VARCHAR2(240);
537 x_sold_to_location_state             VARCHAR2(240);
538 x_sold_to_location_postal_code       VARCHAR2(240);
539 x_sold_to_location_country           VARCHAR2(240);
540 x_prior_sold_to_location             VARCHAR2(2000);
541 x_current_sold_to_location           VARCHAR2(2000);
542 x_next_sold_to_location              VARCHAR2(2000);
543 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
544 BEGIN
545 
546 IF l_debug_level > 0 THEN
547   oe_debug_pub.add('Entering  COMPARE_HEADER_VERSIONS');
548   oe_debug_pub.add('header' ||p_header_id);
549   oe_debug_pub.add('prior version' ||p_prior_version);
550   oe_debug_pub.add('current version' ||p_current_version);
551   oe_debug_pub.add('next version' ||p_next_version);
552   oe_debug_pub.add('max version' ||g_max_version);
553   oe_debug_pub.add('trans version' ||g_trans_version);
554   oe_debug_pub.add('prior phase chagne' ||g_prior_phase_change_flag);
555   oe_debug_pub.add('curr phase chagne' ||g_curr_phase_change_flag);
556   oe_debug_pub.add('next phase chagne' ||g_next_phase_change_flag);
557 END IF;
558 
559 IF l_debug_level > 0 THEN
560   oe_debug_pub.add(' Querying prior version details');
561   oe_debug_pub.add('prior_versio' ||p_prior_version);
562 END IF;
563 IF p_prior_version IS NOT NULL THEN
564 OE_VERSION_BLANKET_COMP.QUERY_HEADER_ROW(p_header_id       => p_header_id,
565 			  p_version                        => p_prior_version,
566                           p_phase_change_flag              => g_prior_phase_change_flag,
567 			  x_header_rec                     => p_prior_rec);
568 END IF;
569 IF l_debug_level > 0 THEN
570   oe_debug_pub.add(' Querying current version details');
571   oe_debug_pub.add('current_versio' ||p_current_version);
572 END IF;
573 IF p_current_version IS NOT NULL THEN
574 OE_VERSION_BLANKET_COMP.QUERY_HEADER_ROW(p_header_id       => p_header_id,
575                           p_version                        => p_current_version,
576                           p_phase_change_flag              => g_curr_phase_change_flag,
577                           x_header_rec                     => p_curr_rec);
578 END IF;
579 IF l_debug_level > 0 THEN
580   oe_debug_pub.add(' Querying next/trans version details');
581   oe_debug_pub.add('next_version' ||p_next_version);
582   oe_debug_pub.add('trans_version' ||g_trans_version);
583 END IF;
584 IF p_next_version = g_trans_version then
585        IF g_trans_version is not null then
586        OE_VERSION_BLANKET_COMP.QUERY_HEADER_TRANS_ROW(p_header_id       => p_header_id,
587                           p_version                                     => g_trans_version,
588                           x_header_rec                                  => p_next_rec);
589         END IF;
590 ELSE
591       IF p_next_version IS NOT NULL THEN
592 OE_VERSION_BLANKET_COMP.QUERY_HEADER_ROW(p_header_id       => p_header_id,
593                           p_version                        => p_next_version,
594                           p_phase_change_flag              => g_next_phase_change_flag,
595                           x_header_rec                     => p_next_rec);
596      END IF;
597 END IF;
598 /*
599 dbms_output.put_line(' prior' ||p_prior_rec.ship_from_org_id);
600 dbms_output.put_line(' curr' ||p_curr_rec.ship_from_org_id);
601 dbms_output.put_line(' next' ||p_next_rec.ship_from_org_id);
602 */
603 IF v_totcol > 0 THEN
604 ind:=0;
605 IF l_debug_level > 0 THEN
606   oe_debug_pub.add('******BEFORE COMPARING HEADER ATTRIBUTES*************');
607   oe_debug_pub.add('current ind '|| ind);
608 END IF;
609 
610 /****************************/
611 /* START ACCOUNTING_RULE_ID*/
612 
613 prior_exists := 'N';
614 IF p_prior_version IS NOT NULL THEN
615 IF OE_Globals.Equal(
616        p_curr_rec.accounting_rule_id,
617        p_prior_rec.accounting_rule_id) THEN
618  null;
619 ELSE
620    ind := ind+1;
621    prior_exists := 'Y';
622    x_header_changed_attr_tbl(ind).attribute_name  := 'accounting_rule';
623    x_header_changed_attr_tbl(ind).current_id      := p_curr_rec.accounting_rule_id;
624    x_header_changed_attr_tbl(ind).current_value   := OE_ID_TO_VALUE.Accounting_Rule(p_curr_rec.accounting_rule_id);
625    x_header_changed_attr_tbl(ind).prior_id        := p_prior_rec.accounting_rule_id;
626    x_header_changed_attr_tbl(ind).prior_value     := OE_ID_TO_VALUE.Accounting_rule(p_prior_rec.accounting_rule_id);
627 END IF;
628 END IF; /*  PRIOR */
629 /****************************/
630 IF p_next_version IS NOT NULL THEN
631 IF OE_Globals.Equal(
632        p_curr_rec.accounting_rule_id,
633        p_next_rec.accounting_rule_id) THEN
634     IF prior_exists = 'Y' THEN
635    x_header_changed_attr_tbl(ind).next_value   := OE_ID_TO_VALUE.Accounting_Rule(p_curr_rec.accounting_rule_id);
636     END IF;
637 ELSE
638     IF prior_exists = 'N' THEN
639         ind := ind+1;
640     END IF;
641    x_header_changed_attr_tbl(ind).attribute_name := 'accounting_rule';
642    x_header_changed_attr_tbl(ind).prior_id        := p_prior_rec.accounting_rule_id;
643    x_header_changed_attr_tbl(ind).prior_value     := OE_ID_TO_VALUE.Accounting_rule(p_prior_rec.accounting_rule_id);
644    x_header_changed_attr_tbl(ind).current_id     := p_curr_rec.accounting_rule_id;
645    x_header_changed_attr_tbl(ind).current_value  := OE_ID_TO_VALUE.Accounting_Rule(p_curr_rec.accounting_rule_id);
646    x_header_changed_attr_tbl(ind).next_id      := p_next_rec.accounting_rule_id;
647    x_header_changed_attr_tbl(ind).next_value   := OE_ID_TO_VALUE.Accounting_Rule(p_next_rec.accounting_rule_id);
648 END IF;
649 END IF; /*  NEXT */
650 
651 /* END ACCOUNTING_RULE_ID*/
652 /****************************/
653 
654 /****************************/
655 /* START PAYMENT_TERM_ID*/
656 
657 prior_exists := 'N';
658 IF p_prior_version IS NOT NULL THEN
659 IF OE_Globals.Equal(
660        p_curr_rec.PAYMENT_TERM_ID,
661        p_prior_rec.PAYMENT_TERM_ID) THEN
662  null;
663 ELSE
664    ind := ind+1;
665    prior_exists := 'Y';
666    x_header_changed_attr_tbl(ind).attribute_name  := 'terms';
667    x_header_changed_attr_tbl(ind).current_id      := p_curr_rec.PAYMENT_TERM_ID;
668    x_header_changed_attr_tbl(ind).current_value   := OE_ID_TO_VALUE.PAYMENT_TERM(p_curr_rec.PAYMENT_TERM_ID);
669    x_header_changed_attr_tbl(ind).prior_id        := p_prior_rec.PAYMENT_TERM_ID;
670    x_header_changed_attr_tbl(ind).prior_value     := OE_ID_TO_VALUE.PAYMENT_TERM(p_prior_rec.PAYMENT_TERM_ID);
671 END IF;
672 END IF; /*  PRIOR */
673 /****************************/
674 IF p_next_version IS NOT NULL THEN
675 IF OE_Globals.Equal(
676        p_curr_rec.PAYMENT_TERM_ID,
677        p_next_rec.PAYMENT_TERM_ID) THEN
678     IF prior_exists = 'Y' THEN
679    x_header_changed_attr_tbl(ind).next_value   := OE_ID_TO_VALUE.PAYMENT_TERM(p_curr_rec.PAYMENT_TERM_ID);
680     END IF;
681 ELSE
682     IF prior_exists = 'N' THEN
683         ind := ind+1;
684     END IF;
685    x_header_changed_attr_tbl(ind).attribute_name := 'terms';
686    x_header_changed_attr_tbl(ind).prior_id        := p_prior_rec.PAYMENT_TERM_ID;
687    x_header_changed_attr_tbl(ind).prior_value     := OE_ID_TO_VALUE.PAYMENT_TERM(p_prior_rec.PAYMENT_TERM_ID);
688    x_header_changed_attr_tbl(ind).current_id     := p_curr_rec.PAYMENT_TERM_ID;
689    x_header_changed_attr_tbl(ind).current_value  := OE_ID_TO_VALUE.PAYMENT_TERM(p_curr_rec.PAYMENT_TERM_ID);
690    x_header_changed_attr_tbl(ind).next_id      := p_next_rec.PAYMENT_TERM_ID;
691    x_header_changed_attr_tbl(ind).next_value   := OE_ID_TO_VALUE.PAYMENT_TERM(p_next_rec.PAYMENT_TERM_ID);
692 END IF;
693 END IF; /*  NEXT */
694 
695 /* END PAYMENT_TERM_ID*/
696 /****************************/
697 
698 /****************************/
699 /* START agreement_id*/
700 
701 prior_exists := 'N';
702 IF p_prior_version IS NOT NULL THEN
703 IF OE_Globals.Equal(
704        p_curr_rec.agreement_id,
705        p_prior_rec.agreement_id) THEN
706  null;
707 ELSE
708    ind := ind+1;
709    prior_exists := 'Y';
710    x_header_changed_attr_tbl(ind).attribute_name  := 'agreement';
711    x_header_changed_attr_tbl(ind).current_id      := p_curr_rec.agreement_id;
712    x_header_changed_attr_tbl(ind).current_value   := OE_ID_TO_VALUE.Agreement(p_curr_rec.agreement_id);
713    x_header_changed_attr_tbl(ind).prior_id        := p_prior_rec.agreement_id;
714    x_header_changed_attr_tbl(ind).prior_value     := OE_ID_TO_VALUE.Agreement(p_prior_rec.agreement_id);
715 END IF;
716 END IF; /*  PRIOR */
717 /****************************/
718 IF p_next_version IS NOT NULL THEN
719 IF OE_Globals.Equal(
720        p_curr_rec.agreement_id,
721        p_next_rec.agreement_id) THEN
722     IF prior_exists = 'Y' THEN
723    x_header_changed_attr_tbl(ind).next_value   := OE_ID_TO_VALUE.Agreement(p_curr_rec.agreement_id);
724     END IF;
725 ELSE
726     IF prior_exists = 'N' THEN
727         ind := ind+1;
728     END IF;
729    x_header_changed_attr_tbl(ind).attribute_name := 'agreement';
730    x_header_changed_attr_tbl(ind).prior_id        := p_prior_rec.agreement_id;
731    x_header_changed_attr_tbl(ind).prior_value     := OE_ID_TO_VALUE.Agreement(p_prior_rec.agreement_id);
732    x_header_changed_attr_tbl(ind).current_id     := p_curr_rec.agreement_id;
733    x_header_changed_attr_tbl(ind).current_value  := OE_ID_TO_VALUE.Agreement(p_curr_rec.agreement_id);
734    x_header_changed_attr_tbl(ind).next_id      := p_next_rec.agreement_id;
735    x_header_changed_attr_tbl(ind).next_value   := OE_ID_TO_VALUE.Agreement(p_next_rec.agreement_id);
736 END IF; /*  NEXT */
737 END IF;
738 
739 /* END agreement_id*/
740 /****************************/
741 
742 /****************************/
743 /* START attribute1*/
744 
745 prior_exists := 'N';
746 IF p_prior_version IS NOT NULL THEN
747 IF OE_Globals.Equal(
748        p_curr_rec.attribute1,
749        p_prior_rec.attribute1) THEN
750  null;
751 ELSE
752    ind := ind+1;
753    prior_exists := 'Y';
754    x_header_changed_attr_tbl(ind).attribute_name  := 'attribute1';
755    x_header_changed_attr_tbl(ind).current_value      := p_curr_rec.attribute1;
756    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute1;
757 END IF;
758 END IF; /*  PRIOR */
759 /****************************/
760 IF p_next_version IS NOT NULL THEN
761 IF OE_Globals.Equal(
762        p_curr_rec.attribute1,
763        p_next_rec.attribute1) THEN
764     IF prior_exists = 'Y' THEN
765    x_header_changed_attr_tbl(ind).next_value      := p_curr_rec.attribute1;
766     END IF;
767 ELSE
768     IF prior_exists = 'N' THEN
769         ind := ind+1;
770     END IF;
771    x_header_changed_attr_tbl(ind).attribute_name := 'attribute1';
772    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute1;
773    x_header_changed_attr_tbl(ind).current_value     := p_curr_rec.attribute1;
774    x_header_changed_attr_tbl(ind).next_value      := p_next_rec.attribute1;
775 END IF; /*  NEXT */
776 END IF;
777 
778 /* END attribute1*/
779 /****************************/
780 
781 /****************************/
782 /* START attribute2*/
783 
784 prior_exists := 'N';
785 IF p_prior_version IS NOT NULL THEN
786 IF OE_Globals.Equal(
787        p_curr_rec.attribute2,
788        p_prior_rec.attribute2) THEN
789  null;
790 ELSE
791    ind := ind+1;
792    prior_exists := 'Y';
793    x_header_changed_attr_tbl(ind).attribute_name  := 'attribute2';
794    x_header_changed_attr_tbl(ind).current_value      := p_curr_rec.attribute2;
795    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute2;
796 END IF;
797 END IF; /*  PRIOR */
798 /****************************/
799 IF p_next_version IS NOT NULL THEN
800 IF OE_Globals.Equal(
801        p_curr_rec.attribute2,
802        p_next_rec.attribute2) THEN
803     IF prior_exists = 'Y' THEN
804    x_header_changed_attr_tbl(ind).next_value      := p_curr_rec.attribute2;
805     END IF;
806 ELSE
807     IF prior_exists = 'N' THEN
808         ind := ind+1;
809     END IF;
810    x_header_changed_attr_tbl(ind).attribute_name := 'attribute2';
811    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute2;
812    x_header_changed_attr_tbl(ind).current_value     := p_curr_rec.attribute2;
813    x_header_changed_attr_tbl(ind).next_value      := p_next_rec.attribute2;
814 END IF; /*  NEXT */
815 END IF;
816 
817 /* END attribute2*/
818 /****************************/
819 /****************************/
820 /* START attribute3*/
821 
822 prior_exists := 'N';
823 IF p_prior_version IS NOT NULL THEN
824 IF OE_Globals.Equal(
825        p_curr_rec.attribute3,
826        p_prior_rec.attribute3) THEN
827  null;
828 ELSE
829    ind := ind+1;
830    prior_exists := 'Y';
831    x_header_changed_attr_tbl(ind).attribute_name  := 'attribute3';
832    x_header_changed_attr_tbl(ind).current_value      := p_curr_rec.attribute3;
833    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute3;
834 END IF;
835 END IF; /*  PRIOR */
836 /****************************/
837 IF p_next_version IS NOT NULL THEN
838 IF OE_Globals.Equal(
839        p_curr_rec.attribute3,
840        p_next_rec.attribute3) THEN
841     IF prior_exists = 'Y' THEN
842    x_header_changed_attr_tbl(ind).next_value      := p_curr_rec.attribute3;
843     END IF;
844 ELSE
845     IF prior_exists = 'N' THEN
846         ind := ind+1;
847     END IF;
848    x_header_changed_attr_tbl(ind).attribute_name := 'attribute3';
849    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute3;
850    x_header_changed_attr_tbl(ind).current_value     := p_curr_rec.attribute3;
851    x_header_changed_attr_tbl(ind).next_value      := p_next_rec.attribute3;
852 END IF; /*  NEXT */
853 END IF;
854 
855 /* END attribute3*/
856 /****************************/
857 
858 /****************************/
859 /* START attribute4*/
860 
861 prior_exists := 'N';
862 IF p_prior_version IS NOT NULL THEN
863 IF OE_Globals.Equal(
864        p_curr_rec.attribute4,
865        p_prior_rec.attribute4) THEN
866  null;
867 ELSE
868    ind := ind+1;
869    prior_exists := 'Y';
870    x_header_changed_attr_tbl(ind).attribute_name  := 'attribute4';
871    x_header_changed_attr_tbl(ind).current_value      := p_curr_rec.attribute4;
872    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute4;
873 END IF;
874 END IF; /*  PRIOR */
875 /****************************/
876 IF p_next_version IS NOT NULL THEN
877 IF OE_Globals.Equal(
878        p_curr_rec.attribute4,
879        p_next_rec.attribute4) THEN
880     IF prior_exists = 'Y' THEN
881    x_header_changed_attr_tbl(ind).next_value      := p_curr_rec.attribute4;
882     END IF;
883 ELSE
884     IF prior_exists = 'N' THEN
885         ind := ind+1;
886     END IF;
887    x_header_changed_attr_tbl(ind).attribute_name := 'attribute4';
888    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute4;
889    x_header_changed_attr_tbl(ind).current_value     := p_curr_rec.attribute4;
890    x_header_changed_attr_tbl(ind).next_value      := p_next_rec.attribute4;
891 END IF; /*  NEXT */
892 END IF;
893 
894 /* END attribute4*/
895 /****************************/
896 /****************************/
897 /* START attribute5*/
898 
899 prior_exists := 'N';
900 IF p_prior_version IS NOT NULL THEN
901 IF OE_Globals.Equal(
902        p_curr_rec.attribute5,
903        p_prior_rec.attribute5) THEN
904  null;
905 ELSE
906    ind := ind+1;
907    prior_exists := 'Y';
908    x_header_changed_attr_tbl(ind).attribute_name  := 'attribute5';
909    x_header_changed_attr_tbl(ind).current_value      := p_curr_rec.attribute5;
910    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute5;
911 END IF;
912 END IF; /*  PRIOR */
913 /****************************/
914 IF p_next_version IS NOT NULL THEN
915 IF OE_Globals.Equal(
916        p_curr_rec.attribute5,
917        p_next_rec.attribute5) THEN
918     IF prior_exists = 'Y' THEN
919    x_header_changed_attr_tbl(ind).next_value      := p_curr_rec.attribute5;
920     END IF;
921 ELSE
922     IF prior_exists = 'N' THEN
923         ind := ind+1;
924     END IF;
925    x_header_changed_attr_tbl(ind).attribute_name := 'attribute5';
926    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute5;
927    x_header_changed_attr_tbl(ind).current_value     := p_curr_rec.attribute5;
928    x_header_changed_attr_tbl(ind).next_value      := p_next_rec.attribute5;
929 END IF; /*  NEXT */
930 END IF;
931 
932 /* END attribute5*/
933 /****************************/
934 
935 /****************************/
936 /* START attribute6*/
937 
938 prior_exists := 'N';
939 IF p_prior_version IS NOT NULL THEN
940 IF OE_Globals.Equal(
941        p_curr_rec.attribute6,
942        p_prior_rec.attribute6) THEN
943  null;
944 ELSE
945    ind := ind+1;
946    prior_exists := 'Y';
947    x_header_changed_attr_tbl(ind).attribute_name  := 'attribute6';
948    x_header_changed_attr_tbl(ind).current_value      := p_curr_rec.attribute6;
949    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute6;
950 END IF;
951 END IF; /*  PRIOR */
952 /****************************/
953 IF p_next_version IS NOT NULL THEN
954 IF OE_Globals.Equal(
955        p_curr_rec.attribute6,
956        p_next_rec.attribute6) THEN
957     IF prior_exists = 'Y' THEN
958    x_header_changed_attr_tbl(ind).next_value      := p_curr_rec.attribute6;
959     END IF;
960 ELSE
961     IF prior_exists = 'N' THEN
962         ind := ind+1;
963     END IF;
964    x_header_changed_attr_tbl(ind).attribute_name := 'attribute6';
965    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute6;
966    x_header_changed_attr_tbl(ind).current_value     := p_curr_rec.attribute6;
967    x_header_changed_attr_tbl(ind).next_value      := p_next_rec.attribute6;
968 END IF; /*  NEXT */
969 END IF;
970 
971 /* END attribute6*/
972 /****************************/
973 /****************************/
974 /* START attribute7*/
975 
976 prior_exists := 'N';
977 IF p_prior_version IS NOT NULL THEN
978 IF OE_Globals.Equal(
979        p_curr_rec.attribute7,
980        p_prior_rec.attribute7) THEN
981  null;
982 ELSE
983    ind := ind+1;
984    prior_exists := 'Y';
985    x_header_changed_attr_tbl(ind).attribute_name  := 'attribute7';
986    x_header_changed_attr_tbl(ind).current_value      := p_curr_rec.attribute7;
987    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute7;
988 END IF;
989 END IF; /*  PRIOR */
990 /****************************/
991 IF p_next_version IS NOT NULL THEN
992 IF OE_Globals.Equal(
993        p_curr_rec.attribute7,
994        p_next_rec.attribute7) THEN
995     IF prior_exists = 'Y' THEN
996    x_header_changed_attr_tbl(ind).next_value      := p_curr_rec.attribute7;
997     END IF;
998 ELSE
999     IF prior_exists = 'N' THEN
1000         ind := ind+1;
1001     END IF;
1002    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute7;
1003    x_header_changed_attr_tbl(ind).attribute_name := 'attribute7';
1004    x_header_changed_attr_tbl(ind).current_value     := p_curr_rec.attribute7;
1005    x_header_changed_attr_tbl(ind).next_value      := p_next_rec.attribute7;
1006 END IF; /*  NEXT */
1007 END IF;
1008 
1009 /* END attribute7*/
1010 /****************************/
1011 
1012 /****************************/
1013 /* START attribute8*/
1014 
1015 prior_exists := 'N';
1016 IF p_prior_version IS NOT NULL THEN
1017 IF OE_Globals.Equal(
1018        p_curr_rec.attribute8,
1019        p_prior_rec.attribute8) THEN
1020  null;
1021 ELSE
1022    ind := ind+1;
1023    prior_exists := 'Y';
1024    x_header_changed_attr_tbl(ind).attribute_name  := 'attribute8';
1025    x_header_changed_attr_tbl(ind).current_value      := p_curr_rec.attribute8;
1026    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute8;
1027 END IF;
1028 END IF; /*  PRIOR */
1029 /****************************/
1030 IF p_next_version IS NOT NULL THEN
1031 IF OE_Globals.Equal(
1032        p_curr_rec.attribute8,
1033        p_next_rec.attribute8) THEN
1034     IF prior_exists = 'Y' THEN
1035    x_header_changed_attr_tbl(ind).next_value      := p_curr_rec.attribute8;
1036     END IF;
1037 ELSE
1038     IF prior_exists = 'N' THEN
1039         ind := ind+1;
1040     END IF;
1041    x_header_changed_attr_tbl(ind).attribute_name := 'attribute8';
1042    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute8;
1043    x_header_changed_attr_tbl(ind).current_value     := p_curr_rec.attribute8;
1044    x_header_changed_attr_tbl(ind).next_value      := p_next_rec.attribute8;
1045 END IF; /*  NEXT */
1046 END IF;
1047 
1048 /* END attribute8*/
1049 /****************************/
1050 /****************************/
1051 /* START attribute9*/
1052 
1053 prior_exists := 'N';
1054 IF p_prior_version IS NOT NULL THEN
1055 IF OE_Globals.Equal(
1056        p_curr_rec.attribute9,
1057        p_prior_rec.attribute9) THEN
1058  null;
1059 ELSE
1060    ind := ind+1;
1061    prior_exists := 'Y';
1062    x_header_changed_attr_tbl(ind).attribute_name  := 'attribute9';
1063    x_header_changed_attr_tbl(ind).current_value      := p_curr_rec.attribute9;
1064    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute9;
1065 END IF;
1066 END IF; /*  PRIOR */
1067 /****************************/
1068 IF p_next_version IS NOT NULL THEN
1069 IF OE_Globals.Equal(
1070        p_curr_rec.attribute9,
1071        p_next_rec.attribute9) THEN
1072     IF prior_exists = 'Y' THEN
1073      x_header_changed_attr_tbl(ind).next_value      := p_curr_rec.attribute9;
1074     END IF;
1075 ELSE
1076     IF prior_exists = 'N' THEN
1077         ind := ind+1;
1078     END IF;
1079    x_header_changed_attr_tbl(ind).attribute_name := 'attribute9';
1080    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute9;
1081    x_header_changed_attr_tbl(ind).current_value     := p_curr_rec.attribute9;
1082    x_header_changed_attr_tbl(ind).next_value      := p_next_rec.attribute9;
1083 END IF; /*  NEXT */
1084 END IF;
1085 
1086 /* END attribute9*/
1087 /****************************/
1088 
1089 /****************************/
1090 /* START attribute10*/
1091 
1092 prior_exists := 'N';
1093 IF p_prior_version IS NOT NULL THEN
1094 IF OE_Globals.Equal(
1095        p_curr_rec.attribute10,
1096        p_prior_rec.attribute10) THEN
1097  null;
1098 ELSE
1099    ind := ind+1;
1100    prior_exists := 'Y';
1101    x_header_changed_attr_tbl(ind).attribute_name  := 'attribute10';
1102    x_header_changed_attr_tbl(ind).current_value      := p_curr_rec.attribute10;
1103    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute10;
1104 END IF;
1105 END IF; /*  PRIOR */
1106 /****************************/
1107 IF p_next_version IS NOT NULL THEN
1108 IF OE_Globals.Equal(
1109        p_curr_rec.attribute10,
1110        p_next_rec.attribute10) THEN
1111     IF prior_exists = 'Y' THEN
1112      x_header_changed_attr_tbl(ind).next_value      := p_curr_rec.attribute10;
1113     END IF;
1114 ELSE
1115     IF prior_exists = 'N' THEN
1116         ind := ind+1;
1117     END IF;
1118    x_header_changed_attr_tbl(ind).attribute_name := 'attribute10';
1119    x_header_changed_attr_tbl(ind).current_value     := p_curr_rec.attribute10;
1120    x_header_changed_attr_tbl(ind).next_value      := p_next_rec.attribute10;
1121 END IF; /*  NEXT */
1122 END IF;
1123 
1124 /* END attribute10*/
1125 /****************************/
1126 
1127 /****************************/
1128 /* START attribute11*/
1129 
1130 prior_exists := 'N';
1131 IF p_prior_version IS NOT NULL THEN
1132 IF OE_Globals.Equal(
1133        p_curr_rec.attribute11,
1134        p_prior_rec.attribute11) THEN
1135  null;
1136 ELSE
1137    ind := ind+1;
1138    prior_exists := 'Y';
1139    x_header_changed_attr_tbl(ind).attribute_name  := 'attribute11';
1140    x_header_changed_attr_tbl(ind).current_value      := p_curr_rec.attribute11;
1141    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute11;
1142 END IF;
1143 END IF; /*  PRIOR */
1144 /****************************/
1145 IF p_next_version IS NOT NULL THEN
1146 IF OE_Globals.Equal(
1147        p_curr_rec.attribute11,
1148        p_next_rec.attribute11) THEN
1149     IF prior_exists = 'Y' THEN
1150      x_header_changed_attr_tbl(ind).next_value      := p_curr_rec.attribute11;
1151     END IF;
1152 ELSE
1153     IF prior_exists = 'N' THEN
1154         ind := ind+1;
1155     END IF;
1156    x_header_changed_attr_tbl(ind).attribute_name := 'attribute11';
1157    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute10;
1158    x_header_changed_attr_tbl(ind).current_value     := p_curr_rec.attribute11;
1159    x_header_changed_attr_tbl(ind).next_value      := p_next_rec.attribute11;
1160 END IF; /*  NEXT */
1161 END IF;
1162 
1163 /* END attribute11*/
1164 /****************************/
1165 
1166 /****************************/
1167 /* START attribute12*/
1168 
1169 prior_exists := 'N';
1170 IF p_prior_version IS NOT NULL THEN
1171 IF OE_Globals.Equal(
1172        p_curr_rec.attribute12,
1173        p_prior_rec.attribute12) THEN
1174  null;
1175 ELSE
1176    ind := ind+1;
1177    prior_exists := 'Y';
1178    x_header_changed_attr_tbl(ind).attribute_name  := 'attribute12';
1179    x_header_changed_attr_tbl(ind).current_value      := p_curr_rec.attribute12;
1180    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute12;
1181 END IF;
1182 END IF; /*  PRIOR */
1183 /****************************/
1184 IF p_next_version IS NOT NULL THEN
1185 IF OE_Globals.Equal(
1186        p_curr_rec.attribute12,
1187        p_next_rec.attribute12) THEN
1188     IF prior_exists = 'Y' THEN
1189      x_header_changed_attr_tbl(ind).next_value      := p_curr_rec.attribute12;
1190     END IF;
1191 ELSE
1192     IF prior_exists = 'N' THEN
1193         ind := ind+1;
1194     END IF;
1195    x_header_changed_attr_tbl(ind).attribute_name := 'attribute12';
1196    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute12;
1197    x_header_changed_attr_tbl(ind).current_value     := p_curr_rec.attribute12;
1198    x_header_changed_attr_tbl(ind).next_value      := p_next_rec.attribute12;
1199 END IF; /*  NEXT */
1200 END IF;
1201 
1202 /* END attribute12*/
1203 /****************************/
1204 
1205 /****************************/
1206 /* START attribute13*/
1207 
1208 prior_exists := 'N';
1209 IF p_prior_version IS NOT NULL THEN
1210 IF OE_Globals.Equal(
1211        p_curr_rec.attribute13,
1212        p_prior_rec.attribute13) THEN
1213  null;
1214 ELSE
1215    ind := ind+1;
1216    prior_exists := 'Y';
1217    x_header_changed_attr_tbl(ind).attribute_name  := 'attribute13';
1218    x_header_changed_attr_tbl(ind).current_value      := p_curr_rec.attribute13;
1219    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute13;
1220 END IF;
1221 END IF; /*  PRIOR */
1222 /****************************/
1223 IF p_next_version IS NOT NULL THEN
1224 IF OE_Globals.Equal(
1225        p_curr_rec.attribute13,
1226        p_next_rec.attribute13) THEN
1227     IF prior_exists = 'Y' THEN
1228      x_header_changed_attr_tbl(ind).next_value      := p_curr_rec.attribute13;
1229     END IF;
1230 ELSE
1231     IF prior_exists = 'N' THEN
1232         ind := ind+1;
1233     END IF;
1234    x_header_changed_attr_tbl(ind).attribute_name := 'attribute13';
1235    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute13;
1236    x_header_changed_attr_tbl(ind).current_value     := p_curr_rec.attribute13;
1237    x_header_changed_attr_tbl(ind).next_value      := p_next_rec.attribute13;
1238 END IF;
1239 END IF; /*  NEXT */
1240 
1241 /* END attribute13*/
1242 /****************************/
1243 
1244 /****************************/
1245 /* START attribute14*/
1246 
1247 prior_exists := 'N';
1248 IF p_prior_version IS NOT NULL THEN
1249 IF OE_Globals.Equal(
1250        p_curr_rec.attribute14,
1251        p_prior_rec.attribute14) THEN
1252  null;
1253 ELSE
1254    ind := ind+1;
1255    prior_exists := 'Y';
1256    x_header_changed_attr_tbl(ind).attribute_name  := 'attribute14';
1257    x_header_changed_attr_tbl(ind).current_value      := p_curr_rec.attribute14;
1258    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute14;
1259 END IF;
1260 END IF; /*  PRIOR */
1261 /****************************/
1262 IF p_next_version IS NOT NULL THEN
1263 IF OE_Globals.Equal(
1264        p_curr_rec.attribute14,
1265        p_next_rec.attribute14) THEN
1266     IF prior_exists = 'Y' THEN
1267      x_header_changed_attr_tbl(ind).next_value      := p_curr_rec.attribute14;
1268     END IF;
1269 ELSE
1270     IF prior_exists = 'N' THEN
1271         ind := ind+1;
1272     END IF;
1273    x_header_changed_attr_tbl(ind).attribute_name := 'attribute14';
1274    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute14;
1275    x_header_changed_attr_tbl(ind).current_value     := p_curr_rec.attribute14;
1276    x_header_changed_attr_tbl(ind).next_value      := p_next_rec.attribute14;
1277 END IF; /*  NEXT */
1278 END IF;
1279 
1280 /* END attribute14*/
1281 /****************************/
1282 
1283 /****************************/
1284 /* START attribute15*/
1285 
1286 prior_exists := 'N';
1287 IF p_prior_version IS NOT NULL THEN
1288 IF OE_Globals.Equal(
1289        p_curr_rec.attribute15,
1290        p_prior_rec.attribute15) THEN
1291  null;
1292 ELSE
1293    ind := ind+1;
1294    prior_exists := 'Y';
1295    x_header_changed_attr_tbl(ind).attribute_name  := 'attribute15';
1296    x_header_changed_attr_tbl(ind).current_value      := p_curr_rec.attribute15;
1297    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute15;
1298 END IF;
1299 END IF; /*  PRIOR */
1300 /****************************/
1301 IF p_next_version IS NOT NULL THEN
1302 IF OE_Globals.Equal(
1303        p_curr_rec.attribute15,
1304        p_next_rec.attribute15) THEN
1305     IF prior_exists = 'Y' THEN
1306      x_header_changed_attr_tbl(ind).next_value      := p_curr_rec.attribute15;
1307     END IF;
1308 ELSE
1309     IF prior_exists = 'N' THEN
1310         ind := ind+1;
1311     END IF;
1312    x_header_changed_attr_tbl(ind).attribute_name := 'attribute15';
1313    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute15;
1314    x_header_changed_attr_tbl(ind).current_value     := p_curr_rec.attribute15;
1315    x_header_changed_attr_tbl(ind).next_value      := p_next_rec.attribute15;
1316 END IF; /*  NEXT */
1317 END IF;
1318 
1319 /* END attribute15*/
1320 /****************************/
1321 /****************************/
1322 /* START context*/
1323 
1324 prior_exists := 'N';
1325 IF p_prior_version IS NOT NULL THEN
1326 IF OE_Globals.Equal(
1327        p_curr_rec.context,
1328        p_prior_rec.context) THEN
1329  null;
1330 ELSE
1331    ind := ind+1;
1332    prior_exists := 'Y';
1333    x_header_changed_attr_tbl(ind).attribute_name  := 'context';
1334    x_header_changed_attr_tbl(ind).current_value      := p_curr_rec.context;
1335    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.context;
1336 END IF;
1337 END IF; /*  PRIOR */
1338 /****************************/
1339 IF p_next_version IS NOT NULL THEN
1340 IF OE_Globals.Equal(
1341        p_curr_rec.context,
1342        p_next_rec.context) THEN
1343     IF prior_exists = 'Y' THEN
1344       x_header_changed_attr_tbl(ind).next_value      := p_curr_rec.context;
1345     END IF;
1346 ELSE
1347     IF prior_exists = 'N' THEN
1348         ind := ind+1;
1349     END IF;
1350    x_header_changed_attr_tbl(ind).attribute_name := 'context';
1351    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.context;
1352    x_header_changed_attr_tbl(ind).current_value     := p_curr_rec.context;
1353    x_header_changed_attr_tbl(ind).next_value      := p_next_rec.context;
1354 END IF; /*  NEXT */
1355 END IF;
1356 
1357 /* END context*/
1358 /****************************/
1359 
1360 
1361 /****************************/
1362 /* START conversion_type_code*/
1363 
1364 prior_exists := 'N';
1365 IF p_prior_version IS NOT NULL THEN
1366 IF OE_Globals.Equal(
1367        p_curr_rec.conversion_type_code,
1368        p_prior_rec.conversion_type_code) THEN
1369  null;
1370 ELSE
1371    ind := ind+1;
1372    prior_exists := 'Y';
1373    x_header_changed_attr_tbl(ind).attribute_name  := 'conversion_type';
1374    x_header_changed_attr_tbl(ind).current_id      := p_curr_rec.conversion_type_code;
1375    x_header_changed_attr_tbl(ind).current_value   := OE_ID_TO_VALUE.Conversion_Type(p_curr_rec.conversion_type_code);
1376    x_header_changed_attr_tbl(ind).prior_id        := p_prior_rec.conversion_type_code;
1377    x_header_changed_attr_tbl(ind).prior_value     := OE_ID_TO_VALUE.Conversion_Type(p_prior_rec.conversion_type_code);
1378 END IF;
1379 END IF; /*  PRIOR */
1380 /****************************/
1381 IF p_next_version IS NOT NULL THEN
1382 IF OE_Globals.Equal(
1383        p_curr_rec.conversion_type_code,
1384        p_next_rec.conversion_type_code) THEN
1385     IF prior_exists = 'Y' THEN
1386    x_header_changed_attr_tbl(ind).next_value   := OE_ID_TO_VALUE.Conversion_Type(p_curr_rec.conversion_type_code);
1387     END IF;
1388 ELSE
1389     IF prior_exists = 'N' THEN
1390         ind := ind+1;
1391     END IF;
1392    x_header_changed_attr_tbl(ind).attribute_name := 'conversion_type';
1393    x_header_changed_attr_tbl(ind).prior_id        := p_prior_rec.conversion_type_code;
1394    x_header_changed_attr_tbl(ind).prior_value     := OE_ID_TO_VALUE.Conversion_Type(p_prior_rec.conversion_type_code);
1395    x_header_changed_attr_tbl(ind).current_id     := p_curr_rec.conversion_type_code;
1396    x_header_changed_attr_tbl(ind).current_value  := OE_ID_TO_VALUE.Conversion_Type(p_curr_rec.conversion_type_code);
1397    x_header_changed_attr_tbl(ind).next_id      := p_next_rec.conversion_type_code;
1398    x_header_changed_attr_tbl(ind).next_value   := OE_ID_TO_VALUE.Conversion_type(p_next_rec.conversion_type_code);
1399 END IF; /*  NEXT */
1400 END IF;
1401 
1402 /* END Conversion_Type_code*/
1403 /****************************/
1404 
1405 /****************************/
1406 /* START cust_po_number*/
1407 
1408 prior_exists := 'N';
1409 IF p_prior_version IS NOT NULL THEN
1410 IF OE_Globals.Equal(
1411        p_curr_rec.cust_po_number,
1412        p_prior_rec.cust_po_number) THEN
1413  null;
1414 ELSE
1415    ind := ind+1;
1416    prior_exists := 'Y';
1417    x_header_changed_attr_tbl(ind).attribute_name  := 'cust_po_number';
1418    x_header_changed_attr_tbl(ind).current_value      := p_curr_rec.cust_po_number;
1419    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.cust_po_number;
1420 END IF;
1421 END IF; /*  PRIOR */
1422 /****************************/
1423 IF p_next_version IS NOT NULL THEN
1424 IF OE_Globals.Equal(
1425        p_curr_rec.cust_po_number,
1426        p_next_rec.cust_po_number) THEN
1427     IF prior_exists = 'Y' THEN
1428      x_header_changed_attr_tbl(ind).next_value      := p_curr_rec.cust_po_number;
1429     END IF;
1430 ELSE
1431     IF prior_exists = 'N' THEN
1432         ind := ind+1;
1433     END IF;
1434    x_header_changed_attr_tbl(ind).attribute_name := 'cust_po_number';
1435    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.cust_po_number;
1436    x_header_changed_attr_tbl(ind).current_value     := p_curr_rec.cust_po_number;
1437    x_header_changed_attr_tbl(ind).next_value      := p_next_rec.cust_po_number;
1438 END IF; /*  NEXT */
1439 END IF;
1440 
1441 /* END cust_po_number*/
1442 /****************************/
1443 
1444 /****************************/
1445 /* START deliver_to_org_id*/
1446 
1447 prior_exists := 'N';
1448 IF p_prior_version IS NOT NULL THEN
1449 IF OE_Globals.Equal(
1450        p_curr_rec.deliver_to_org_id,
1451        p_prior_rec.deliver_to_org_id) THEN
1452  null;
1453 ELSE
1454    ind := ind+1;
1455    prior_exists := 'Y';
1456    x_header_changed_attr_tbl(ind).attribute_name  := 'deliver_to';
1457    if p_curr_rec.deliver_to_org_id is not null then
1458      OE_ID_TO_VALUE.deliver_To_Org
1459          (   p_deliver_to_org_id        => p_curr_rec.deliver_To_org_id
1460         , x_deliver_to_address1    => x_deliver_to_address1
1461         , x_deliver_to_address2    => x_deliver_to_address2
1462 	, x_deliver_to_address3    => x_deliver_to_address3
1463 	, x_deliver_to_address4    => x_deliver_to_address4
1464 	, x_deliver_to_location    => x_deliver_to_location
1465 	, x_deliver_to_org         => x_deliver_to_org
1466 	, x_deliver_to_city        => x_deliver_to_city
1467 	, x_deliver_to_state       => x_deliver_to_state
1468 	, x_deliver_to_postal_code => x_deliver_to_postal_code
1469 	, x_deliver_to_country     => x_deliver_to_country
1470           );
1471 
1472   select
1473     DECODE(x_deliver_to_location, NULL, NULL,x_deliver_to_location|| ', ') ||
1474     DECODE(x_deliver_to_address1, NULL, NULL,x_deliver_to_address1 || ', ') ||
1475     DECODE(x_deliver_to_address2, NULL, NULL,x_deliver_to_address3 || ', ') ||
1476     DECODE(x_deliver_to_address3, NULL, NULL,x_deliver_to_address3 || ', ') ||
1477     DECODE(x_deliver_to_address4, NULL, NULL,x_deliver_to_address4 || ', ') ||
1478     DECODE(x_deliver_to_city, NULL, NULL,x_deliver_to_city || ', ') ||
1479     DECODE(x_deliver_to_state, NULL, NULL,x_deliver_to_state || ', ') ||
1480     DECODE(x_deliver_to_postal_code, NULL, NULL,x_deliver_to_postal_code || ', ') ||
1481     DECODE(x_deliver_to_country, NULL,NULL,x_deliver_to_country)
1482         into x_current_deliver_to_address from dual;
1483 
1484    x_header_changed_attr_tbl(ind).current_id      := p_curr_rec.deliver_to_org_id;
1485    x_header_changed_attr_tbl(ind).current_value     := x_current_deliver_to_address;
1486 
1487        end if;
1488    if p_prior_rec.deliver_to_org_id is not null then
1489      OE_ID_TO_VALUE.deliver_To_Org
1490          (   p_deliver_to_org_id        => p_prior_rec.deliver_To_org_id
1491         , x_deliver_to_address1    => x_deliver_to_address1
1492         , x_deliver_to_address2    => x_deliver_to_address2
1493 	, x_deliver_to_address3    => x_deliver_to_address3
1494 	, x_deliver_to_address4    => x_deliver_to_address4
1495 	, x_deliver_to_location    => x_deliver_to_location
1496 	, x_deliver_to_org         => x_deliver_to_org
1497 	, x_deliver_to_city        => x_deliver_to_city
1498 	, x_deliver_to_state       => x_deliver_to_state
1499 	, x_deliver_to_postal_code => x_deliver_to_postal_code
1500 	, x_deliver_to_country     => x_deliver_to_country
1501           );
1502 
1503   select
1504     DECODE(x_deliver_to_location, NULL, NULL,x_deliver_to_location|| ', ') ||
1505     DECODE(x_deliver_to_address1, NULL, NULL,x_deliver_to_address1 || ', ') ||
1506     DECODE(x_deliver_to_address2, NULL, NULL,x_deliver_to_address3 || ', ') ||
1507     DECODE(x_deliver_to_address3, NULL, NULL,x_deliver_to_address3 || ', ') ||
1508     DECODE(x_deliver_to_address4, NULL, NULL,x_deliver_to_address4 || ', ') ||
1509     DECODE(x_deliver_to_city, NULL, NULL,x_deliver_to_city || ', ') ||
1510     DECODE(x_deliver_to_state, NULL, NULL,x_deliver_to_state || ', ') ||
1511     DECODE(x_deliver_to_postal_code, NULL, NULL,x_deliver_to_postal_code || ', ') ||
1512     DECODE(x_deliver_to_country, NULL,NULL,x_deliver_to_country)
1513         into x_prior_deliver_to_address from dual;
1514    x_header_changed_attr_tbl(ind).prior_id        := p_prior_rec.deliver_to_org_id;
1515    x_header_changed_attr_tbl(ind).prior_value     := x_prior_deliver_to_address;
1516        end if;
1517 END IF;
1518 END IF; /*  PRIOR */
1519 /****************************/
1520 IF p_next_version IS NOT NULL THEN
1521 IF OE_Globals.Equal(
1522        p_curr_rec.deliver_to_org_id,
1523        p_next_rec.deliver_to_org_id) THEN
1524     IF prior_exists = 'Y' THEN
1525       x_header_changed_attr_tbl(ind).next_value     := x_prior_deliver_to_address;
1526     END IF;
1527 ELSE
1528     IF prior_exists = 'N' THEN
1529         ind := ind+1;
1530     END IF;
1531    x_header_changed_attr_tbl(ind).attribute_name := 'deliver_to';
1532 
1533    if p_prior_rec.deliver_to_org_id is not null then
1534      OE_ID_TO_VALUE.deliver_To_Org
1535          (   p_deliver_to_org_id        => p_prior_rec.deliver_To_org_id
1536         , x_deliver_to_address1    => x_deliver_to_address1
1537         , x_deliver_to_address2    => x_deliver_to_address2
1538 	, x_deliver_to_address3    => x_deliver_to_address3
1539 	, x_deliver_to_address4    => x_deliver_to_address4
1540 	, x_deliver_to_location    => x_deliver_to_location
1541 	, x_deliver_to_org         => x_deliver_to_org
1542 	, x_deliver_to_city        => x_deliver_to_city
1543 	, x_deliver_to_state       => x_deliver_to_state
1544 	, x_deliver_to_postal_code => x_deliver_to_postal_code
1545 	, x_deliver_to_country     => x_deliver_to_country
1546           );
1547 
1548   select
1549     DECODE(x_deliver_to_location, NULL, NULL,x_deliver_to_location|| ', ') ||
1550     DECODE(x_deliver_to_address1, NULL, NULL,x_deliver_to_address1 || ', ') ||
1551     DECODE(x_deliver_to_address2, NULL, NULL,x_deliver_to_address3 || ', ') ||
1552     DECODE(x_deliver_to_address3, NULL, NULL,x_deliver_to_address3 || ', ') ||
1553     DECODE(x_deliver_to_address4, NULL, NULL,x_deliver_to_address4 || ', ') ||
1554     DECODE(x_deliver_to_city, NULL, NULL,x_deliver_to_city || ', ') ||
1555     DECODE(x_deliver_to_state, NULL, NULL,x_deliver_to_state || ', ') ||
1556     DECODE(x_deliver_to_postal_code, NULL, NULL,x_deliver_to_postal_code || ', ') ||
1557     DECODE(x_deliver_to_country, NULL,NULL,x_deliver_to_country)
1558         into x_prior_deliver_to_address from dual;
1559    x_header_changed_attr_tbl(ind).prior_id        := p_prior_rec.deliver_to_org_id;
1560    x_header_changed_attr_tbl(ind).prior_value     := x_prior_deliver_to_address;
1561 
1562        end if;
1563    if p_curr_rec.deliver_to_org_id is not null then
1564      OE_ID_TO_VALUE.deliver_To_Org
1565          (   p_deliver_to_org_id        => p_curr_rec.deliver_To_org_id
1566         , x_deliver_to_address1    => x_deliver_to_address1
1567         , x_deliver_to_address2    => x_deliver_to_address2
1568 	, x_deliver_to_address3    => x_deliver_to_address3
1569 	, x_deliver_to_address4    => x_deliver_to_address4
1570 	, x_deliver_to_location    => x_deliver_to_location
1571 	, x_deliver_to_org         => x_deliver_to_org
1572 	, x_deliver_to_city        => x_deliver_to_city
1573 	, x_deliver_to_state       => x_deliver_to_state
1574 	, x_deliver_to_postal_code => x_deliver_to_postal_code
1575 	, x_deliver_to_country     => x_deliver_to_country
1576           );
1577 
1578   select
1579     DECODE(x_deliver_to_location, NULL, NULL,x_deliver_to_location|| ', ') ||
1580     DECODE(x_deliver_to_address1, NULL, NULL,x_deliver_to_address1 || ', ') ||
1581     DECODE(x_deliver_to_address2, NULL, NULL,x_deliver_to_address3 || ', ') ||
1582     DECODE(x_deliver_to_address3, NULL, NULL,x_deliver_to_address3 || ', ') ||
1583     DECODE(x_deliver_to_address4, NULL, NULL,x_deliver_to_address4 || ', ') ||
1584     DECODE(x_deliver_to_city, NULL, NULL,x_deliver_to_city || ', ') ||
1585     DECODE(x_deliver_to_state, NULL, NULL,x_deliver_to_state || ', ') ||
1586     DECODE(x_deliver_to_postal_code, NULL, NULL,x_deliver_to_postal_code || ', ') ||
1587     DECODE(x_deliver_to_country, NULL,NULL,x_deliver_to_country)
1588         into x_current_deliver_to_address from dual;
1589    x_header_changed_attr_tbl(ind).current_id     := p_curr_rec.deliver_to_org_id;
1590    x_header_changed_attr_tbl(ind).current_value     := x_current_deliver_to_address;
1591        end if;
1592 
1593    if p_next_rec.deliver_to_org_id is not null then
1594      OE_ID_TO_VALUE.deliver_To_Org
1595          (   p_deliver_to_org_id        => p_next_rec.deliver_To_org_id
1596         , x_deliver_to_address1    => x_deliver_to_address1
1597         , x_deliver_to_address2    => x_deliver_to_address2
1598 	, x_deliver_to_address3    => x_deliver_to_address3
1599 	, x_deliver_to_address4    => x_deliver_to_address4
1600 	, x_deliver_to_location    => x_deliver_to_location
1601 	, x_deliver_to_org         => x_deliver_to_org
1602 	, x_deliver_to_city        => x_deliver_to_city
1603 	, x_deliver_to_state       => x_deliver_to_state
1604 	, x_deliver_to_postal_code => x_deliver_to_postal_code
1605 	, x_deliver_to_country     => x_deliver_to_country
1606           );
1607 
1608   select
1609     DECODE(x_deliver_to_location, NULL, NULL,x_deliver_to_location|| ', ') ||
1610     DECODE(x_deliver_to_address1, NULL, NULL,x_deliver_to_address1 || ', ') ||
1611     DECODE(x_deliver_to_address2, NULL, NULL,x_deliver_to_address3 || ', ') ||
1612     DECODE(x_deliver_to_address3, NULL, NULL,x_deliver_to_address3 || ', ') ||
1613     DECODE(x_deliver_to_address4, NULL, NULL,x_deliver_to_address4 || ', ') ||
1614     DECODE(x_deliver_to_city, NULL, NULL,x_deliver_to_city || ', ') ||
1615     DECODE(x_deliver_to_state, NULL, NULL,x_deliver_to_state || ', ') ||
1616     DECODE(x_deliver_to_postal_code, NULL, NULL,x_deliver_to_postal_code || ', ') ||
1617     DECODE(x_deliver_to_country, NULL,NULL,x_deliver_to_country)
1618         into x_next_deliver_to_address from dual;
1619    x_header_changed_attr_tbl(ind).next_id      := p_next_rec.deliver_to_org_id;
1620    x_header_changed_attr_tbl(ind).next_value     := x_next_deliver_to_address;
1621        end if;
1622 END IF; /*  NEXT */
1623 END IF;
1624 
1625 /* END deliver_to_org_id*/
1626 /****************************/
1627 
1628 
1629 /****************************/
1630 /* START freight_terms_code*/
1631 
1632 prior_exists := 'N';
1633 IF p_prior_version IS NOT NULL THEN
1634 IF OE_Globals.Equal(
1635        p_curr_rec.freight_terms_code,
1636        p_prior_rec.freight_terms_code) THEN
1637  null;
1638 ELSE
1639    ind := ind+1;
1640    prior_exists := 'Y';
1641    x_header_changed_attr_tbl(ind).attribute_name  := 'freight_terms';
1642    x_header_changed_attr_tbl(ind).current_id      := p_curr_rec.freight_terms_code;
1643    x_header_changed_attr_tbl(ind).current_value   := OE_ID_TO_VALUE.Freight_terms(p_curr_rec.freight_terms_code);
1644    x_header_changed_attr_tbl(ind).prior_id        := p_prior_rec.freight_terms_code;
1645    x_header_changed_attr_tbl(ind).prior_value     := OE_ID_TO_VALUE.Freight_terms(p_prior_rec.freight_terms_code);
1646 END IF;
1647 END IF; /*  PRIOR */
1648 /****************************/
1649 
1650 IF p_next_version IS NOT NULL THEN
1651 IF OE_Globals.Equal(
1652        p_curr_rec.freight_terms_code,
1653        p_next_rec.freight_terms_code) THEN
1654     IF prior_exists = 'Y' THEN
1655       x_header_changed_attr_tbl(ind).next_value   := OE_ID_TO_VALUE.Freight_terms(p_curr_rec.freight_terms_code);
1656     END IF;
1657 ELSE
1658     IF prior_exists = 'N' THEN
1659         ind := ind+1;
1660     END IF;
1661    x_header_changed_attr_tbl(ind).attribute_name := 'freight_terms';
1662    x_header_changed_attr_tbl(ind).prior_id        := p_prior_rec.freight_terms_code;
1663    x_header_changed_attr_tbl(ind).prior_value     := OE_ID_TO_VALUE.Freight_terms(p_prior_rec.freight_terms_code);
1664    x_header_changed_attr_tbl(ind).current_id     := p_curr_rec.freight_terms_code;
1665    x_header_changed_attr_tbl(ind).current_value  := OE_ID_TO_VALUE.Freight_terms(p_curr_rec.freight_terms_code);
1666    x_header_changed_attr_tbl(ind).next_id      := p_next_rec.freight_terms_code;
1667    x_header_changed_attr_tbl(ind).next_value   := OE_ID_TO_VALUE.Freight_terms(p_next_rec.freight_terms_code);
1668 END IF; /*  NEXT */
1669 END IF;
1670 
1671 /* END freight_terms_code*/
1672 /****************************/
1673 /****************************/
1674 /* START invoice_to_org_id*/
1675 
1676 prior_exists := 'N';
1677 IF p_prior_version IS NOT NULL THEN
1678 IF OE_Globals.Equal(
1679        p_curr_rec.invoice_to_org_id,
1680        p_prior_rec.invoice_to_org_id) THEN
1681  null;
1682 ELSE
1683    ind := ind+1;
1684    prior_exists := 'Y';
1685    x_header_changed_attr_tbl(ind).attribute_name  := 'invoice_to';
1686    if p_curr_rec.invoice_to_org_id is not null then
1687 
1688      OE_ID_TO_VALUE.invoice_to_Org
1689          (   p_invoice_to_org_id        => p_curr_rec.invoice_to_org_id
1690         , x_invoice_to_address1    => x_invoice_to_address1
1691         , x_invoice_to_address2    => x_invoice_to_address2
1692 	, x_invoice_to_address3    => x_invoice_to_address3
1693 	, x_invoice_to_address4    => x_invoice_to_address4
1694 	, x_invoice_to_location    => x_invoice_to_location
1695 	, x_invoice_to_org         => x_invoice_to_org
1696 	, x_invoice_to_city        => x_invoice_to_city
1697 	, x_invoice_to_state       => x_invoice_to_state
1698 	, x_invoice_to_postal_code => x_invoice_to_postal_code
1699 	, x_invoice_to_country     => x_invoice_to_country
1700           );
1701 
1702   select
1703     DECODE(x_invoice_to_location, NULL, NULL,x_invoice_to_location|| ', ') ||
1704     DECODE(x_invoice_to_address1, NULL, NULL,x_invoice_to_address1 || ', ') ||
1705     DECODE(x_invoice_to_address2, NULL, NULL,x_invoice_to_address3 || ', ') ||
1706     DECODE(x_invoice_to_address3, NULL, NULL,x_invoice_to_address3 || ', ') ||
1707     DECODE(x_invoice_to_address4, NULL, NULL,x_invoice_to_address4 || ', ') ||
1708     DECODE(x_invoice_to_city, NULL, NULL,x_invoice_to_city || ', ') ||
1709     DECODE(x_invoice_to_state, NULL, NULL,x_invoice_to_state || ', ') ||
1710     DECODE(x_invoice_to_postal_code, NULL, NULL,x_invoice_to_postal_code || ', ') ||
1711     DECODE(x_invoice_to_country, NULL,NULL,x_invoice_to_country)
1712         into x_current_invoice_to_address from dual;
1713    x_header_changed_attr_tbl(ind).current_id      := p_curr_rec.invoice_to_org_id;
1714 
1715    x_header_changed_attr_tbl(ind).current_value     := x_current_invoice_to_address;
1716        end if;
1717 
1718    if p_prior_rec.invoice_to_org_id is not null then
1719      OE_ID_TO_VALUE.invoice_to_Org
1720          (   p_invoice_to_org_id        => p_prior_rec.invoice_to_org_id
1721         , x_invoice_to_address1    => x_invoice_to_address1
1722         , x_invoice_to_address2    => x_invoice_to_address2
1723 	, x_invoice_to_address3    => x_invoice_to_address3
1724 	, x_invoice_to_address4    => x_invoice_to_address4
1725 	, x_invoice_to_location    => x_invoice_to_location
1726 	, x_invoice_to_org         => x_invoice_to_org
1727 	, x_invoice_to_city        => x_invoice_to_city
1728 	, x_invoice_to_state       => x_invoice_to_state
1729 	, x_invoice_to_postal_code => x_invoice_to_postal_code
1730 	, x_invoice_to_country     => x_invoice_to_country
1731           );
1732 
1733   select
1734     DECODE(x_invoice_to_location, NULL, NULL,x_invoice_to_location|| ', ') ||
1735     DECODE(x_invoice_to_address1, NULL, NULL,x_invoice_to_address1 || ', ') ||
1736     DECODE(x_invoice_to_address2, NULL, NULL,x_invoice_to_address3 || ', ') ||
1737     DECODE(x_invoice_to_address3, NULL, NULL,x_invoice_to_address3 || ', ') ||
1738     DECODE(x_invoice_to_address4, NULL, NULL,x_invoice_to_address4 || ', ') ||
1739     DECODE(x_invoice_to_city, NULL, NULL,x_invoice_to_city || ', ') ||
1740     DECODE(x_invoice_to_state, NULL, NULL,x_invoice_to_state || ', ') ||
1741     DECODE(x_invoice_to_postal_code, NULL, NULL,x_invoice_to_postal_code || ', ') ||
1742     DECODE(x_invoice_to_country, NULL,NULL,x_invoice_to_country)
1743         into x_prior_invoice_to_address from dual;
1744    x_header_changed_attr_tbl(ind).prior_value     := x_prior_invoice_to_address;
1745    x_header_changed_attr_tbl(ind).prior_id        := p_prior_rec.invoice_to_org_id;
1746        end if;
1747 END IF;
1748 END IF; /*  PRIOR */
1749 /****************************/
1750 
1751 IF p_next_version IS NOT NULL THEN
1752 IF OE_Globals.Equal(
1753        p_curr_rec.invoice_to_org_id,
1754        p_next_rec.invoice_to_org_id) THEN
1755     IF prior_exists = 'Y' THEN
1756      x_header_changed_attr_tbl(ind).next_value     := x_current_invoice_to_address;
1757     END IF;
1758 ELSE
1759     IF prior_exists = 'N' THEN
1760         ind := ind+1;
1761     END IF;
1762    x_header_changed_attr_tbl(ind).attribute_name := 'invoice_to';
1763 
1764    if p_prior_rec.invoice_to_org_id is not null then
1765      OE_ID_TO_VALUE.invoice_to_Org
1766          (   p_invoice_to_org_id        => p_prior_rec.invoice_to_org_id
1767         , x_invoice_to_address1    => x_invoice_to_address1
1768         , x_invoice_to_address2    => x_invoice_to_address2
1769 	, x_invoice_to_address3    => x_invoice_to_address3
1770 	, x_invoice_to_address4    => x_invoice_to_address4
1771 	, x_invoice_to_location    => x_invoice_to_location
1772 	, x_invoice_to_org         => x_invoice_to_org
1773 	, x_invoice_to_city        => x_invoice_to_city
1774 	, x_invoice_to_state       => x_invoice_to_state
1775 	, x_invoice_to_postal_code => x_invoice_to_postal_code
1776 	, x_invoice_to_country     => x_invoice_to_country
1777           );
1778 
1779   select
1780     DECODE(x_invoice_to_location, NULL, NULL,x_invoice_to_location|| ', ') ||
1781     DECODE(x_invoice_to_address1, NULL, NULL,x_invoice_to_address1 || ', ') ||
1782     DECODE(x_invoice_to_address2, NULL, NULL,x_invoice_to_address3 || ', ') ||
1783     DECODE(x_invoice_to_address3, NULL, NULL,x_invoice_to_address3 || ', ') ||
1784     DECODE(x_invoice_to_address4, NULL, NULL,x_invoice_to_address4 || ', ') ||
1785     DECODE(x_invoice_to_city, NULL, NULL,x_invoice_to_city || ', ') ||
1786     DECODE(x_invoice_to_state, NULL, NULL,x_invoice_to_state || ', ') ||
1787     DECODE(x_invoice_to_postal_code, NULL, NULL,x_invoice_to_postal_code || ', ') ||
1788     DECODE(x_invoice_to_country, NULL,NULL,x_invoice_to_country)
1789         into x_prior_invoice_to_address from dual;
1790    x_header_changed_attr_tbl(ind).prior_id        := p_prior_rec.invoice_to_org_id;
1791    x_header_changed_attr_tbl(ind).prior_value     := x_prior_invoice_to_address;
1792        end if;
1793 
1794    if p_curr_rec.invoice_to_org_id is not null then
1795      OE_ID_TO_VALUE.invoice_to_Org
1796          (   p_invoice_to_org_id        => p_curr_rec.invoice_to_org_id
1797         , x_invoice_to_address1    => x_invoice_to_address1
1798         , x_invoice_to_address2    => x_invoice_to_address2
1799 	, x_invoice_to_address3    => x_invoice_to_address3
1800 	, x_invoice_to_address4    => x_invoice_to_address4
1801 	, x_invoice_to_location    => x_invoice_to_location
1802 	, x_invoice_to_org         => x_invoice_to_org
1803 	, x_invoice_to_city        => x_invoice_to_city
1804 	, x_invoice_to_state       => x_invoice_to_state
1805 	, x_invoice_to_postal_code => x_invoice_to_postal_code
1806 	, x_invoice_to_country     => x_invoice_to_country
1807           );
1808 
1809   select
1810     DECODE(x_invoice_to_location, NULL, NULL,x_invoice_to_location|| ', ') ||
1811     DECODE(x_invoice_to_address1, NULL, NULL,x_invoice_to_address1 || ', ') ||
1812     DECODE(x_invoice_to_address2, NULL, NULL,x_invoice_to_address3 || ', ') ||
1813     DECODE(x_invoice_to_address3, NULL, NULL,x_invoice_to_address3 || ', ') ||
1814     DECODE(x_invoice_to_address4, NULL, NULL,x_invoice_to_address4 || ', ') ||
1815     DECODE(x_invoice_to_city, NULL, NULL,x_invoice_to_city || ', ') ||
1816     DECODE(x_invoice_to_state, NULL, NULL,x_invoice_to_state || ', ') ||
1817     DECODE(x_invoice_to_postal_code, NULL, NULL,x_invoice_to_postal_code || ', ') ||
1818     DECODE(x_invoice_to_country, NULL,NULL,x_invoice_to_country)
1819         into x_current_invoice_to_address from dual;
1820    x_header_changed_attr_tbl(ind).current_id     := p_curr_rec.invoice_to_org_id;
1821    x_header_changed_attr_tbl(ind).current_value     := x_current_invoice_to_address;
1822        end if;
1823 
1824    if p_next_rec.invoice_to_org_id is not null then
1825      OE_ID_TO_VALUE.invoice_to_Org
1826          (   p_invoice_to_org_id        => p_next_rec.invoice_to_org_id
1827         , x_invoice_to_address1    => x_invoice_to_address1
1828         , x_invoice_to_address2    => x_invoice_to_address2
1829 	, x_invoice_to_address3    => x_invoice_to_address3
1830 	, x_invoice_to_address4    => x_invoice_to_address4
1831 	, x_invoice_to_location    => x_invoice_to_location
1832 	, x_invoice_to_org         => x_invoice_to_org
1833 	, x_invoice_to_city        => x_invoice_to_city
1834 	, x_invoice_to_state       => x_invoice_to_state
1835 	, x_invoice_to_postal_code => x_invoice_to_postal_code
1836 	, x_invoice_to_country     => x_invoice_to_country
1837           );
1838 
1839   select
1840     DECODE(x_invoice_to_location, NULL, NULL,x_invoice_to_location|| ', ') ||
1841     DECODE(x_invoice_to_address1, NULL, NULL,x_invoice_to_address1 || ', ') ||
1842     DECODE(x_invoice_to_address2, NULL, NULL,x_invoice_to_address3 || ', ') ||
1843     DECODE(x_invoice_to_address3, NULL, NULL,x_invoice_to_address3 || ', ') ||
1844     DECODE(x_invoice_to_address4, NULL, NULL,x_invoice_to_address4 || ', ') ||
1845     DECODE(x_invoice_to_city, NULL, NULL,x_invoice_to_city || ', ') ||
1846     DECODE(x_invoice_to_state, NULL, NULL,x_invoice_to_state || ', ') ||
1847     DECODE(x_invoice_to_postal_code, NULL, NULL,x_invoice_to_postal_code || ', ') ||
1848     DECODE(x_invoice_to_country, NULL,NULL,x_invoice_to_country)
1849         into x_next_invoice_to_address from dual;
1850    x_header_changed_attr_tbl(ind).next_id      := p_next_rec.invoice_to_org_id;
1851    x_header_changed_attr_tbl(ind).next_value     := x_next_invoice_to_address;
1852        end if;
1853 END IF;
1854 END IF; /*  NEXT */
1855 
1856 /* END invoice_to_org_id*/
1857 /****************************/
1858 
1859 /****************************/
1860 /* START invoicing_rule_id*/
1861 
1862 prior_exists := 'N';
1863 IF p_prior_version IS NOT NULL THEN
1864 IF OE_Globals.Equal(
1865        p_curr_rec.invoicing_rule_id,
1866        p_prior_rec.invoicing_rule_id) THEN
1867  null;
1868 ELSE
1869    ind := ind+1;
1870    prior_exists := 'Y';
1871    x_header_changed_attr_tbl(ind).attribute_name  := 'invoicing_rule';
1872    x_header_changed_attr_tbl(ind).current_id      := p_curr_rec.invoicing_rule_id;
1873    x_header_changed_attr_tbl(ind).current_value   := OE_ID_TO_VALUE.Invoicing_Rule(p_curr_rec.invoicing_rule_id);
1874    x_header_changed_attr_tbl(ind).prior_id        := p_prior_rec.invoicing_rule_id;
1875    x_header_changed_attr_tbl(ind).prior_value     := OE_ID_TO_VALUE.Invoicing_Rule(p_prior_rec.invoicing_rule_id);
1876 END IF;
1877 END IF; /*  PRIOR */
1878 /****************************/
1879 IF p_next_version IS NOT NULL THEN
1880 IF OE_Globals.Equal(
1881        p_curr_rec.invoicing_rule_id,
1882        p_next_rec.invoicing_rule_id) THEN
1883     IF prior_exists = 'Y' THEN
1884    x_header_changed_attr_tbl(ind).next_value   := OE_ID_TO_VALUE.Invoicing_Rule(p_curr_rec.invoicing_rule_id);
1885     END IF;
1886 ELSE
1887     IF prior_exists = 'N' THEN
1888         ind := ind+1;
1889     END IF;
1890    x_header_changed_attr_tbl(ind).attribute_name := 'invoicing_rule';
1891    x_header_changed_attr_tbl(ind).prior_id        := p_prior_rec.invoicing_rule_id;
1892    x_header_changed_attr_tbl(ind).prior_value     := OE_ID_TO_VALUE.Invoicing_Rule(p_prior_rec.invoicing_rule_id);
1893    x_header_changed_attr_tbl(ind).current_id     := p_curr_rec.invoicing_rule_id;
1894    x_header_changed_attr_tbl(ind).current_value  := OE_ID_TO_VALUE.Invoicing_Rule(p_curr_rec.invoicing_rule_id);
1895    x_header_changed_attr_tbl(ind).next_id      := p_next_rec.invoicing_rule_id;
1896    x_header_changed_attr_tbl(ind).next_value   := OE_ID_TO_VALUE.Invoicing_Rule(p_next_rec.invoicing_rule_id);
1897 END IF; /*  NEXT */
1898 END IF;
1899 
1900 /* END invoicing_rule_id*/
1901 /****************************/
1902 
1903 /****************************/
1904 /* START order_number*/
1905 
1906 prior_exists := 'N';
1907 IF p_prior_version IS NOT NULL THEN
1908 IF OE_Globals.Equal(
1909        p_curr_rec.order_number,
1910        p_prior_rec.order_number) THEN
1911  null;
1912 ELSE
1913    ind := ind+1;
1914    prior_exists := 'Y';
1915    x_header_changed_attr_tbl(ind).attribute_name  := 'order_number';
1916    x_header_changed_attr_tbl(ind).current_value      := p_curr_rec.order_number;
1917    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.order_number;
1918 END IF;
1919 END IF; /*  PRIOR */
1920 /****************************/
1921 IF p_next_version IS NOT NULL THEN
1922 IF OE_Globals.Equal(
1923        p_curr_rec.order_number,
1924        p_next_rec.order_number) THEN
1925     IF prior_exists = 'Y' THEN
1926      x_header_changed_attr_tbl(ind).next_value      := p_curr_rec.order_number;
1927     END IF;
1928 ELSE
1929     IF prior_exists = 'N' THEN
1930         ind := ind+1;
1931     END IF;
1932    x_header_changed_attr_tbl(ind).attribute_name := 'order_number';
1933    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.order_number;
1934    x_header_changed_attr_tbl(ind).current_value     := p_curr_rec.order_number;
1935    x_header_changed_attr_tbl(ind).next_value      := p_next_rec.order_number;
1936 END IF; /*  NEXT */
1937 END IF;
1938 
1939 /* END order_number*/
1940 /****************************/
1941 /****************************/
1942 /* START order_type_id*/
1943 
1944 prior_exists := 'N';
1945 IF p_prior_version IS NOT NULL THEN
1946 IF OE_Globals.Equal(
1947        p_curr_rec.order_type_id,
1948        p_prior_rec.order_type_id) THEN
1949  null;
1950 ELSE
1951    ind := ind+1;
1952    prior_exists := 'Y';
1953    x_header_changed_attr_tbl(ind).attribute_name  := 'order_type';
1954    x_header_changed_attr_tbl(ind).current_id      := p_curr_rec.order_type_id;
1955    x_header_changed_attr_tbl(ind).current_value   := OE_ID_TO_VALUE.order_Type(p_curr_rec.order_type_id);
1956    x_header_changed_attr_tbl(ind).prior_id        := p_prior_rec.order_type_id;
1957    x_header_changed_attr_tbl(ind).prior_value     := OE_ID_TO_VALUE.order_Type(p_prior_rec.order_type_id);
1958 END IF;
1959 END IF; /*  PRIOR */
1960 /****************************/
1961 IF p_next_version IS NOT NULL THEN
1962 IF OE_Globals.Equal(
1963        p_curr_rec.order_type_id,
1964        p_next_rec.order_type_id) THEN
1965     IF prior_exists = 'Y' THEN
1966      x_header_changed_attr_tbl(ind).next_value   := OE_ID_TO_VALUE.order_Type(p_curr_rec.order_type_id);
1967     END IF;
1968 ELSE
1969     IF prior_exists = 'N' THEN
1970         ind := ind+1;
1971     END IF;
1972    x_header_changed_attr_tbl(ind).attribute_name := 'order_type';
1973    x_header_changed_attr_tbl(ind).prior_id        := p_prior_rec.order_type_id;
1974    x_header_changed_attr_tbl(ind).prior_value     := OE_ID_TO_VALUE.order_Type(p_prior_rec.order_type_id);
1975    x_header_changed_attr_tbl(ind).current_id     := p_curr_rec.order_type_id;
1976    x_header_changed_attr_tbl(ind).current_value  := OE_ID_TO_VALUE.order_Type(p_curr_rec.order_type_id);
1977    x_header_changed_attr_tbl(ind).next_id      := p_next_rec.order_type_id;
1978    x_header_changed_attr_tbl(ind).next_value   := OE_ID_TO_VALUE.order_Type(p_next_rec.order_type_id);
1979 END IF;
1980 END IF; /*  NEXT */
1981 
1982 /* END order_type_id*/
1983 /****************************/
1984 /****************************/
1985 /* START PRICE_LIST_ID*/
1986 
1987 prior_exists := 'N';
1988 IF p_prior_version IS NOT NULL THEN
1989 IF OE_Globals.Equal(
1990        p_curr_rec.PRICE_LIST_ID,
1991        p_prior_rec.PRICE_LIST_ID) THEN
1992  null;
1993 ELSE
1994    ind := ind+1;
1995    prior_exists := 'Y';
1996    x_header_changed_attr_tbl(ind).attribute_name  := 'PRICE_LIST_NAME';
1997    x_header_changed_attr_tbl(ind).current_id      := p_curr_rec.PRICE_LIST_ID;
1998    x_header_changed_attr_tbl(ind).current_value   := OE_ID_TO_VALUE.PRICE_LIST(p_curr_rec.PRICE_LIST_ID);
1999    x_header_changed_attr_tbl(ind).prior_id        := p_prior_rec.PRICE_LIST_ID;
2000    x_header_changed_attr_tbl(ind).prior_value     := OE_ID_TO_VALUE.PRICE_LIST(p_prior_rec.PRICE_LIST_ID);
2001 END IF;
2002 END IF; /*  PRIOR */
2003 /****************************/
2004 IF p_next_version IS NOT NULL THEN
2005 IF OE_Globals.Equal(
2006        p_curr_rec.PRICE_LIST_ID,
2007        p_next_rec.PRICE_LIST_ID) THEN
2008     IF prior_exists = 'Y' THEN
2009    x_header_changed_attr_tbl(ind).next_value   := OE_ID_TO_VALUE.PRICE_LIST(p_curr_rec.PRICE_LIST_ID);
2010     END IF;
2011 ELSE
2012     IF prior_exists = 'N' THEN
2013         ind := ind+1;
2014     END IF;
2015    x_header_changed_attr_tbl(ind).attribute_name := 'PRICE_LIST_NAME';
2016    x_header_changed_attr_tbl(ind).prior_id        := p_prior_rec.PRICE_LIST_ID;
2017    x_header_changed_attr_tbl(ind).prior_value     := OE_ID_TO_VALUE.PRICE_LIST(p_prior_rec.PRICE_LIST_ID);
2018    x_header_changed_attr_tbl(ind).current_id     := p_curr_rec.PRICE_LIST_ID;
2019    x_header_changed_attr_tbl(ind).current_value  := OE_ID_TO_VALUE.PRICE_LIST(p_curr_rec.PRICE_LIST_ID);
2020    x_header_changed_attr_tbl(ind).next_id      := p_next_rec.PRICE_LIST_ID;
2021    x_header_changed_attr_tbl(ind).next_value   := OE_ID_TO_VALUE.PRICE_LIST(p_next_rec.PRICE_LIST_ID);
2022 END IF; /*  NEXT */
2023 END IF;
2024 
2025 /* END PRICE_LIST_ID*/
2026 /****************************/
2027 
2028 /****************************/
2029 /* START SALESREP_ID*/
2030 
2031 prior_exists := 'N';
2032 IF p_prior_version IS NOT NULL THEN
2033 IF OE_Globals.Equal(
2034        p_curr_rec.SALESREP_ID,
2035        p_prior_rec.SALESREP_ID) THEN
2036  null;
2037 ELSE
2038    ind := ind+1;
2039    prior_exists := 'Y';
2040    x_header_changed_attr_tbl(ind).attribute_name  := 'SALESREP';
2041    x_header_changed_attr_tbl(ind).current_id      := p_curr_rec.SALESREP_ID;
2042    x_header_changed_attr_tbl(ind).current_value   := OE_ID_TO_VALUE.SALESREP(p_curr_rec.SALESREP_ID);
2043    x_header_changed_attr_tbl(ind).prior_id        := p_prior_rec.SALESREP_ID;
2044    x_header_changed_attr_tbl(ind).prior_value     := OE_ID_TO_VALUE.SALESREP(p_prior_rec.SALESREP_ID);
2045 END IF;
2046 END IF; /*  PRIOR */
2047 /****************************/
2048 IF p_next_version IS NOT NULL THEN
2049 IF OE_Globals.Equal(
2050        p_curr_rec.SALESREP_ID,
2051        p_next_rec.SALESREP_ID) THEN
2052     IF prior_exists = 'Y' THEN
2053    x_header_changed_attr_tbl(ind).next_value   := OE_ID_TO_VALUE.SALESREP(p_curr_rec.SALESREP_ID);
2054     END IF;
2055 ELSE
2056     IF prior_exists = 'N' THEN
2057         ind := ind+1;
2058     END IF;
2059    x_header_changed_attr_tbl(ind).attribute_name := 'SALESREP';
2060    x_header_changed_attr_tbl(ind).prior_id        := p_prior_rec.SALESREP_ID;
2061    x_header_changed_attr_tbl(ind).prior_value     := OE_ID_TO_VALUE.SALESREP(p_prior_rec.SALESREP_ID);
2062    x_header_changed_attr_tbl(ind).current_id     := p_curr_rec.SALESREP_ID;
2063    x_header_changed_attr_tbl(ind).current_value  := OE_ID_TO_VALUE.SALESREP(p_curr_rec.SALESREP_ID);
2064    x_header_changed_attr_tbl(ind).next_id      := p_next_rec.SALESREP_ID;
2065    x_header_changed_attr_tbl(ind).next_value   := OE_ID_TO_VALUE.SALESREP(p_next_rec.SALESREP_ID);
2066 END IF; /*  NEXT */
2067 END IF;
2068 
2069 /* END SALESREP_ID*/
2070 /****************************/
2071 /****************************/
2072 /* START SHIPPING_METHOD_CODE*/
2073 
2074 prior_exists := 'N';
2075 IF p_prior_version IS NOT NULL THEN
2076 IF OE_Globals.Equal(
2077        p_curr_rec.SHIPPING_METHOD_CODE,
2078        p_prior_rec.SHIPPING_METHOD_CODE) THEN
2079  null;
2080 ELSE
2081    ind := ind+1;
2082    prior_exists := 'Y';
2083    x_header_changed_attr_tbl(ind).attribute_name  := 'SHIPPING_METHOD';
2084    x_header_changed_attr_tbl(ind).current_id      := p_curr_rec.SHIPPING_METHOD_CODE;
2085    x_header_changed_attr_tbl(ind).current_value   := OE_ID_TO_VALUE.ship_method(p_curr_rec.SHIPPING_METHOD_CODE);
2086    x_header_changed_attr_tbl(ind).prior_id        := p_prior_rec.SHIPPING_METHOD_CODE;
2087    x_header_changed_attr_tbl(ind).prior_value     := OE_ID_TO_VALUE.ship_method(p_prior_rec.SHIPPING_METHOD_CODE);
2088 END IF;
2089 END IF; /*  PRIOR */
2090 /****************************/
2091 IF p_next_version IS NOT NULL THEN
2092 IF OE_Globals.Equal(
2093        p_curr_rec.SHIPPING_METHOD_CODE,
2094        p_next_rec.SHIPPING_METHOD_CODE) THEN
2095     IF prior_exists = 'Y' THEN
2096    x_header_changed_attr_tbl(ind).next_value   := OE_ID_TO_VALUE.ship_method(p_curr_rec.SHIPPING_METHOD_CODE);
2097     END IF;
2098 ELSE
2099     IF prior_exists = 'N' THEN
2100         ind := ind+1;
2101     END IF;
2102    x_header_changed_attr_tbl(ind).attribute_name := 'SHIPPING_METHOD';
2103    x_header_changed_attr_tbl(ind).prior_id        := p_prior_rec.SHIPPING_METHOD_CODE;
2104    x_header_changed_attr_tbl(ind).prior_value     := OE_ID_TO_VALUE.ship_method(p_prior_rec.SHIPPING_METHOD_CODE);
2105    x_header_changed_attr_tbl(ind).current_id     := p_curr_rec.SHIPPING_METHOD_CODE;
2106    x_header_changed_attr_tbl(ind).current_value  := OE_ID_TO_VALUE.ship_method(p_curr_rec.SHIPPING_METHOD_CODE);
2107    x_header_changed_attr_tbl(ind).next_id      := p_next_rec.SHIPPING_METHOD_CODE;
2108    x_header_changed_attr_tbl(ind).next_value   := OE_ID_TO_VALUE.ship_method(p_next_rec.SHIPPING_METHOD_CODE);
2109 END IF; /*  NEXT */
2110 END IF;
2111 
2112 /* END SHIPPING_METHOD_CODE*/
2113 /****************************/
2114 
2115 /****************************/
2116 /* START ship_from_org_id*/
2117 
2118 prior_exists := 'N';
2119 IF p_prior_version IS NOT NULL THEN
2120 IF OE_Globals.Equal(
2121        p_curr_rec.ship_from_org_id,
2122        p_prior_rec.ship_from_org_id) THEN
2123  null;
2124 ELSE
2125    ind := ind+1;
2126    prior_exists := 'Y';
2127    x_header_changed_attr_tbl(ind).attribute_name  := 'Warehouse';
2128    if p_curr_rec.ship_from_org_id is not null then
2129      OE_ID_TO_VALUE.ship_from_Org
2130          (   p_ship_from_org_id        => p_curr_rec.ship_from_org_id
2131         , x_ship_from_address1    => x_ship_from_address1
2132         , x_ship_from_address2    => x_ship_from_address2
2133 	, x_ship_from_address3    => x_ship_from_address3
2134 	, x_ship_from_address4    => x_ship_from_address4
2135 	, x_ship_from_location    => x_ship_from_location
2136 	, x_ship_from_org         => x_current_ship_from_org
2137           );
2138 /*
2139   select
2140     DECODE(x_ship_from_location, NULL, NULL,x_ship_from_location|| ', ') ||
2141     DECODE(x_ship_from_address1, NULL, NULL,x_ship_from_address1 || ', ') ||
2142     DECODE(x_ship_from_address2, NULL, NULL,x_ship_from_address3 || ', ') ||
2143     DECODE(x_ship_from_address3, NULL, NULL,x_ship_from_address3 || ', ') ||
2144     DECODE(x_ship_from_address4, NULL, NULL,x_ship_from_address4 || ', ')
2145         into x_current_ship_from_address from dual;
2146 */
2147    x_header_changed_attr_tbl(ind).current_id      := p_curr_rec.ship_from_org_id;
2148    x_header_changed_attr_tbl(ind).current_value     := x_current_ship_from_org;
2149 
2150        end if;
2151    if p_prior_rec.ship_from_org_id is not null then
2152      OE_ID_TO_VALUE.ship_from_Org
2153          (   p_ship_from_org_id        => p_prior_rec.ship_from_org_id
2154         , x_ship_from_address1    => x_ship_from_address1
2155         , x_ship_from_address2    => x_ship_from_address2
2156 	, x_ship_from_address3    => x_ship_from_address3
2157 	, x_ship_from_address4    => x_ship_from_address4
2158 	, x_ship_from_location    => x_ship_from_location
2159 	, x_ship_from_org         => x_prior_ship_from_org
2160           );
2161 /*
2162   select
2163     DECODE(x_ship_from_location, NULL, NULL,x_ship_from_location|| ', ') ||
2164     DECODE(x_ship_from_address1, NULL, NULL,x_ship_from_address1 || ', ') ||
2165     DECODE(x_ship_from_address2, NULL, NULL,x_ship_from_address3 || ', ') ||
2166     DECODE(x_ship_from_address3, NULL, NULL,x_ship_from_address3 || ', ') ||
2167     DECODE(x_ship_from_address4, NULL, NULL,x_ship_from_address4 || ', ')
2168         into x_prior_ship_from_address from dual;
2169 */
2170    x_header_changed_attr_tbl(ind).prior_id        := p_prior_rec.ship_from_org_id;
2171    x_header_changed_attr_tbl(ind).prior_value     := x_prior_ship_from_org;
2172        end if;
2173 END IF;
2174 END IF; /*  PRIOR */
2175 /****************************/
2176 
2177 IF p_next_version IS NOT NULL THEN
2178 IF OE_Globals.Equal(
2179        p_curr_rec.ship_from_org_id,
2180        p_next_rec.ship_from_org_id) THEN
2181     IF prior_exists = 'Y' THEN
2182      x_header_changed_attr_tbl(ind).next_value     := x_current_ship_from_org;
2183     END IF;
2184 ELSE
2185     IF prior_exists = 'N' THEN
2186         ind := ind+1;
2187     END IF;
2188    x_header_changed_attr_tbl(ind).attribute_name := 'Warehouse';
2189 
2190    if p_prior_rec.ship_from_org_id is not null then
2191      OE_ID_TO_VALUE.ship_from_Org
2192          (   p_ship_from_org_id        => p_prior_rec.ship_from_org_id
2193         , x_ship_from_address1    => x_ship_from_address1
2194         , x_ship_from_address2    => x_ship_from_address2
2195 	, x_ship_from_address3    => x_ship_from_address3
2196 	, x_ship_from_address4    => x_ship_from_address4
2197 	, x_ship_from_location    => x_ship_from_location
2198 	, x_ship_from_org         => x_prior_ship_from_org
2199           );
2200 /*
2201   select
2202     DECODE(x_ship_from_location, NULL, NULL,x_ship_from_location|| ', ') ||
2203     DECODE(x_ship_from_address1, NULL, NULL,x_ship_from_address1 || ', ') ||
2204     DECODE(x_ship_from_address2, NULL, NULL,x_ship_from_address3 || ', ') ||
2205     DECODE(x_ship_from_address3, NULL, NULL,x_ship_from_address3 || ', ') ||
2206     DECODE(x_ship_from_address4, NULL, NULL,x_ship_from_address4 || ', ')
2207         into x_prior_ship_from_address from dual;
2208 */
2209    x_header_changed_attr_tbl(ind).prior_id        := p_prior_rec.ship_from_org_id;
2210    x_header_changed_attr_tbl(ind).prior_value     := x_prior_ship_from_org;
2211        end if;
2212    if p_curr_rec.ship_from_org_id is not null then
2213      OE_ID_TO_VALUE.ship_from_Org
2214          (   p_ship_from_org_id        => p_curr_rec.ship_from_org_id
2215         , x_ship_from_address1    => x_ship_from_address1
2216         , x_ship_from_address2    => x_ship_from_address2
2217 	, x_ship_from_address3    => x_ship_from_address3
2218 	, x_ship_from_address4    => x_ship_from_address4
2219 	, x_ship_from_location    => x_ship_from_location
2220 	, x_ship_from_org         => x_current_ship_from_org
2221           );
2222 /*
2223   select
2224     DECODE(x_ship_from_location, NULL, NULL,x_ship_from_location|| ', ') ||
2225     DECODE(x_ship_from_address1, NULL, NULL,x_ship_from_address1 || ', ') ||
2226     DECODE(x_ship_from_address2, NULL, NULL,x_ship_from_address3 || ', ') ||
2227     DECODE(x_ship_from_address3, NULL, NULL,x_ship_from_address3 || ', ') ||
2228     DECODE(x_ship_from_address4, NULL, NULL,x_ship_from_address4 || ', ')
2229         into x_current_ship_from_address from dual;
2230 */
2231    x_header_changed_attr_tbl(ind).current_id     := p_curr_rec.ship_from_org_id;
2232    x_header_changed_attr_tbl(ind).current_value     := x_current_ship_from_org;
2233        end if;
2234 
2235    if p_next_rec.ship_from_org_id is not null then
2236      OE_ID_TO_VALUE.ship_from_Org
2237          (   p_ship_from_org_id        => p_next_rec.ship_from_org_id
2238         , x_ship_from_address1    => x_ship_from_address1
2239         , x_ship_from_address2    => x_ship_from_address2
2240 	, x_ship_from_address3    => x_ship_from_address3
2241 	, x_ship_from_address4    => x_ship_from_address4
2242 	, x_ship_from_location    => x_ship_from_location
2243 	, x_ship_from_org         => x_next_ship_from_org
2244           );
2245 /*
2246   select
2247     DECODE(x_ship_from_location, NULL, NULL,x_ship_from_location|| ', ') ||
2248     DECODE(x_ship_from_address1, NULL, NULL,x_ship_from_address1 || ', ') ||
2249     DECODE(x_ship_from_address2, NULL, NULL,x_ship_from_address3 || ', ') ||
2250     DECODE(x_ship_from_address3, NULL, NULL,x_ship_from_address3 || ', ') ||
2251     DECODE(x_ship_from_address4, NULL, NULL,x_ship_from_address4 || ', ')
2252         into x_next_ship_from_address from dual;
2253 */
2254    x_header_changed_attr_tbl(ind).next_id      := p_next_rec.ship_from_org_id;
2255    x_header_changed_attr_tbl(ind).next_value     := x_next_ship_from_org;
2256        end if;
2257 END IF; /*  NEXT */
2258 END IF;
2259 
2260 /* END ship_from_org_id*/
2261 /****************************/
2262 
2263 /****************************/
2264 /* START ship_to_org_id*/
2265 
2266 prior_exists := 'N';
2267 IF p_prior_version IS NOT NULL THEN
2268 IF OE_Globals.Equal(
2269        p_curr_rec.ship_to_org_id,
2270        p_prior_rec.ship_to_org_id) THEN
2271  null;
2272 ELSE
2273    ind := ind+1;
2274    prior_exists := 'Y';
2275    x_header_changed_attr_tbl(ind).attribute_name  := 'ship_to';
2276    if p_curr_rec.ship_to_org_id is not null then
2277      OE_ID_TO_VALUE.ship_to_Org
2278          (   p_ship_to_org_id        => p_curr_rec.ship_to_org_id
2279         , x_ship_to_address1    => x_ship_to_address1
2280         , x_ship_to_address2    => x_ship_to_address2
2281 	, x_ship_to_address3    => x_ship_to_address3
2282 	, x_ship_to_address4    => x_ship_to_address4
2283 	, x_ship_to_location    => x_ship_to_location
2284 	, x_ship_to_org         => x_ship_to_org
2285 	, x_ship_to_city        => x_ship_to_city
2286 	, x_ship_to_state       => x_ship_to_state
2287 	, x_ship_to_postal_code => x_ship_to_postal_code
2288 	, x_ship_to_country     => x_ship_to_country
2289           );
2290 
2291   select
2292     DECODE(x_ship_to_location, NULL, NULL,x_ship_to_location|| ', ') ||
2293     DECODE(x_ship_to_address1, NULL, NULL,x_ship_to_address1 || ', ') ||
2294     DECODE(x_ship_to_address2, NULL, NULL,x_ship_to_address3 || ', ') ||
2295     DECODE(x_ship_to_address3, NULL, NULL,x_ship_to_address3 || ', ') ||
2296     DECODE(x_ship_to_address4, NULL, NULL,x_ship_to_address4 || ', ') ||
2297     DECODE(x_ship_to_city, NULL, NULL,x_ship_to_city || ', ') ||
2298     DECODE(x_ship_to_state, NULL, NULL,x_ship_to_state || ', ') ||
2299     DECODE(x_ship_to_postal_code, NULL, NULL,x_ship_to_postal_code || ', ') ||
2300     DECODE(x_ship_to_country, NULL,NULL,x_ship_to_country)
2301         into x_current_ship_to_address from dual;
2302 
2303    x_header_changed_attr_tbl(ind).current_id      := p_curr_rec.ship_to_org_id;
2304    x_header_changed_attr_tbl(ind).current_value     := x_current_ship_to_address;
2305        end if;
2306 
2307    if p_prior_rec.ship_to_org_id is not null then
2308      OE_ID_TO_VALUE.ship_to_Org
2309          (   p_ship_to_org_id        => p_prior_rec.ship_to_org_id
2310         , x_ship_to_address1    => x_ship_to_address1
2311         , x_ship_to_address2    => x_ship_to_address2
2312 	, x_ship_to_address3    => x_ship_to_address3
2313 	, x_ship_to_address4    => x_ship_to_address4
2314 	, x_ship_to_location    => x_ship_to_location
2315 	, x_ship_to_org         => x_ship_to_org
2316 	, x_ship_to_city        => x_ship_to_city
2317 	, x_ship_to_state       => x_ship_to_state
2318 	, x_ship_to_postal_code => x_ship_to_postal_code
2319 	, x_ship_to_country     => x_ship_to_country
2320           );
2321 
2322   select
2323     DECODE(x_ship_to_location, NULL, NULL,x_ship_to_location|| ', ') ||
2324     DECODE(x_ship_to_address1, NULL, NULL,x_ship_to_address1 || ', ') ||
2325     DECODE(x_ship_to_address2, NULL, NULL,x_ship_to_address3 || ', ') ||
2326     DECODE(x_ship_to_address3, NULL, NULL,x_ship_to_address3 || ', ') ||
2327     DECODE(x_ship_to_address4, NULL, NULL,x_ship_to_address4 || ', ') ||
2328     DECODE(x_ship_to_city, NULL, NULL,x_ship_to_city || ', ') ||
2329     DECODE(x_ship_to_state, NULL, NULL,x_ship_to_state || ', ') ||
2330     DECODE(x_ship_to_postal_code, NULL, NULL,x_ship_to_postal_code || ', ') ||
2331     DECODE(x_ship_to_country, NULL,NULL,x_ship_to_country)
2332         into x_prior_ship_to_address from dual;
2333    x_header_changed_attr_tbl(ind).prior_id        := p_prior_rec.ship_to_org_id;
2334    x_header_changed_attr_tbl(ind).prior_value     := x_prior_ship_to_address;
2335        end if;
2336 END IF;
2337 END IF; /*  PRIOR */
2338 /****************************/
2339 
2340 IF p_next_version IS NOT NULL THEN
2341 IF OE_Globals.Equal(
2342        p_curr_rec.ship_to_org_id,
2343        p_next_rec.ship_to_org_id) THEN
2344     IF prior_exists = 'Y' THEN
2345       x_header_changed_attr_tbl(ind).next_value     := x_current_ship_to_address;
2346     END IF;
2347 ELSE
2348     IF prior_exists = 'N' THEN
2349         ind := ind+1;
2350     END IF;
2351    x_header_changed_attr_tbl(ind).attribute_name := 'ship_to';
2352 
2353    if p_prior_rec.ship_to_org_id is not null then
2354      OE_ID_TO_VALUE.ship_to_Org
2355          (   p_ship_to_org_id        => p_prior_rec.ship_to_org_id
2356         , x_ship_to_address1    => x_ship_to_address1
2357         , x_ship_to_address2    => x_ship_to_address2
2358 	, x_ship_to_address3    => x_ship_to_address3
2359 	, x_ship_to_address4    => x_ship_to_address4
2360 	, x_ship_to_location    => x_ship_to_location
2361 	, x_ship_to_org         => x_ship_to_org
2362 	, x_ship_to_city        => x_ship_to_city
2363 	, x_ship_to_state       => x_ship_to_state
2364 	, x_ship_to_postal_code => x_ship_to_postal_code
2365 	, x_ship_to_country     => x_ship_to_country
2366           );
2367 
2368   select
2369     DECODE(x_ship_to_location, NULL, NULL,x_ship_to_location|| ', ') ||
2370     DECODE(x_ship_to_address1, NULL, NULL,x_ship_to_address1 || ', ') ||
2371     DECODE(x_ship_to_address2, NULL, NULL,x_ship_to_address3 || ', ') ||
2372     DECODE(x_ship_to_address3, NULL, NULL,x_ship_to_address3 || ', ') ||
2373     DECODE(x_ship_to_address4, NULL, NULL,x_ship_to_address4 || ', ') ||
2374     DECODE(x_ship_to_city, NULL, NULL,x_ship_to_city || ', ') ||
2375     DECODE(x_ship_to_state, NULL, NULL,x_ship_to_state || ', ') ||
2376     DECODE(x_ship_to_postal_code, NULL, NULL,x_ship_to_postal_code || ', ') ||
2377     DECODE(x_ship_to_country, NULL,NULL,x_ship_to_country)
2378         into x_prior_ship_to_address from dual;
2379    x_header_changed_attr_tbl(ind).prior_id        := p_prior_rec.ship_to_org_id;
2380    x_header_changed_attr_tbl(ind).prior_value     := x_prior_ship_to_address;
2381        end if;
2382 
2383    if p_curr_rec.ship_to_org_id is not null then
2384      OE_ID_TO_VALUE.ship_to_Org
2385          (   p_ship_to_org_id        => p_curr_rec.ship_to_org_id
2386         , x_ship_to_address1    => x_ship_to_address1
2387         , x_ship_to_address2    => x_ship_to_address2
2388 	, x_ship_to_address3    => x_ship_to_address3
2389 	, x_ship_to_address4    => x_ship_to_address4
2390 	, x_ship_to_location    => x_ship_to_location
2391 	, x_ship_to_org         => x_ship_to_org
2392 	, x_ship_to_city        => x_ship_to_city
2393 	, x_ship_to_state       => x_ship_to_state
2394 	, x_ship_to_postal_code => x_ship_to_postal_code
2395 	, x_ship_to_country     => x_ship_to_country
2396           );
2397 
2398   select
2399     DECODE(x_ship_to_location, NULL, NULL,x_ship_to_location|| ', ') ||
2400     DECODE(x_ship_to_address1, NULL, NULL,x_ship_to_address1 || ', ') ||
2401     DECODE(x_ship_to_address2, NULL, NULL,x_ship_to_address3 || ', ') ||
2402     DECODE(x_ship_to_address3, NULL, NULL,x_ship_to_address3 || ', ') ||
2403     DECODE(x_ship_to_address4, NULL, NULL,x_ship_to_address4 || ', ') ||
2404     DECODE(x_ship_to_city, NULL, NULL,x_ship_to_city || ', ') ||
2405     DECODE(x_ship_to_state, NULL, NULL,x_ship_to_state || ', ') ||
2406     DECODE(x_ship_to_postal_code, NULL, NULL,x_ship_to_postal_code || ', ') ||
2407     DECODE(x_ship_to_country, NULL,NULL,x_ship_to_country)
2408         into x_current_ship_to_address from dual;
2409    x_header_changed_attr_tbl(ind).current_id     := p_curr_rec.ship_to_org_id;
2410    x_header_changed_attr_tbl(ind).current_value     := x_current_ship_to_address;
2411        end if;
2412 
2413    if p_next_rec.ship_to_org_id is not null then
2414      OE_ID_TO_VALUE.ship_to_Org
2415          (   p_ship_to_org_id        => p_next_rec.ship_to_org_id
2416         , x_ship_to_address1    => x_ship_to_address1
2417         , x_ship_to_address2    => x_ship_to_address2
2418 	, x_ship_to_address3    => x_ship_to_address3
2419 	, x_ship_to_address4    => x_ship_to_address4
2420 	, x_ship_to_location    => x_ship_to_location
2421 	, x_ship_to_org         => x_ship_to_org
2422 	, x_ship_to_city        => x_ship_to_city
2423 	, x_ship_to_state       => x_ship_to_state
2424 	, x_ship_to_postal_code => x_ship_to_postal_code
2425 	, x_ship_to_country     => x_ship_to_country
2426           );
2427 
2428   select
2429     DECODE(x_ship_to_location, NULL, NULL,x_ship_to_location|| ', ') ||
2430     DECODE(x_ship_to_address1, NULL, NULL,x_ship_to_address1 || ', ') ||
2431     DECODE(x_ship_to_address2, NULL, NULL,x_ship_to_address3 || ', ') ||
2432     DECODE(x_ship_to_address3, NULL, NULL,x_ship_to_address3 || ', ') ||
2433     DECODE(x_ship_to_address4, NULL, NULL,x_ship_to_address4 || ', ') ||
2434     DECODE(x_ship_to_city, NULL, NULL,x_ship_to_city || ', ') ||
2435     DECODE(x_ship_to_state, NULL, NULL,x_ship_to_state || ', ') ||
2436     DECODE(x_ship_to_postal_code, NULL, NULL,x_ship_to_postal_code || ', ') ||
2437     DECODE(x_ship_to_country, NULL,NULL,x_ship_to_country)
2438         into x_next_ship_to_address from dual;
2439    x_header_changed_attr_tbl(ind).next_id      := p_next_rec.ship_to_org_id;
2440    x_header_changed_attr_tbl(ind).next_value     := x_next_ship_to_address;
2441        end if;
2442 END IF; /*  NEXT */
2443 END IF;
2444 
2445 /* END ship_to_org_id*/
2446 /****************************/
2447 
2448 /****************************/
2449 /* START sold_TO_CONTACT_ID*/
2450 
2451 prior_exists := 'N';
2452 IF p_prior_version IS NOT NULL THEN
2453 IF OE_Globals.Equal(
2454        p_curr_rec.sold_to_contact_id,
2455        p_prior_rec.sold_to_contact_id) THEN
2456  null;
2457 ELSE
2458    ind := ind+1;
2459    prior_exists := 'Y';
2460    x_header_changed_attr_tbl(ind).attribute_name  := 'sold_to_contact';
2461    x_header_changed_attr_tbl(ind).current_id      := p_curr_rec.sold_to_contact_id;
2462    x_header_changed_attr_tbl(ind).current_value   := OE_ID_TO_VALUE.sold_To_Contact(p_curr_rec.sold_to_contact_id);
2463    x_header_changed_attr_tbl(ind).prior_id      := p_prior_rec.sold_to_contact_id;
2464    x_header_changed_attr_tbl(ind).prior_value   := OE_ID_TO_VALUE.sold_To_Contact(p_prior_rec.sold_to_contact_id);
2465 END IF;
2466 END IF; /*  PRIOR */
2467 /****************************/
2468 IF p_next_version IS NOT NULL THEN
2469 IF OE_Globals.Equal(
2470        p_curr_rec.sold_to_contact_id,
2471        p_next_rec.sold_to_contact_id) THEN
2472     IF prior_exists = 'Y' THEN
2473      x_header_changed_attr_tbl(ind).next_value   := OE_ID_TO_VALUE.sold_To_Contact(p_curr_rec.sold_to_contact_id);
2474     END IF;
2475 ELSE
2476     IF prior_exists = 'N' THEN
2477         ind := ind+1;
2478     END IF;
2479    x_header_changed_attr_tbl(ind).attribute_name   := 'sold_to_contact';
2480    x_header_changed_attr_tbl(ind).prior_id      := p_prior_rec.sold_to_contact_id;
2481    x_header_changed_attr_tbl(ind).prior_value   := OE_ID_TO_VALUE.sold_To_Contact(p_prior_rec.sold_to_contact_id);
2482    x_header_changed_attr_tbl(ind).current_id   := p_curr_rec.sold_to_contact_id;
2483    x_header_changed_attr_tbl(ind).current_value   := OE_ID_TO_VALUE.sold_To_Contact(p_curr_rec.sold_to_contact_id);
2484    x_header_changed_attr_tbl(ind).next_id   := p_next_rec.sold_to_contact_id;
2485    x_header_changed_attr_tbl(ind).next_value   := OE_ID_TO_VALUE.sold_To_Contact(p_next_rec.sold_to_contact_id);
2486 END IF; /*  NEXT */
2487 END IF;
2488 
2489 /* END sold_to_contact_id*/
2490 /****************************/
2491 
2492 /****************************/
2493 /* START SOLD_TO_ORG_ID*/
2494 
2495 prior_exists := 'N';
2496 IF p_prior_version IS NOT NULL THEN
2497 IF OE_Globals.Equal(
2498        p_curr_rec.SOLD_TO_ORG_ID,
2499        p_prior_rec.SOLD_TO_ORG_ID) THEN
2500  null;
2501 ELSE
2502    ind := ind+1;
2503    prior_exists := 'Y';
2504    x_header_changed_attr_tbl(ind).attribute_name  := 'SOLD_TO';
2505    If p_curr_rec.sold_to_org_id is not NULL THEN
2506    OE_ID_TO_VALUE.Sold_To_Org(p_sold_to_org_id => p_curr_rec.SOLD_TO_ORG_ID,
2507 		              x_org            => x_current_customer_name,
2508 			      x_customer_number=> x_customer_number);
2509    x_header_changed_attr_tbl(ind).current_id      := p_curr_rec.SOLD_TO_ORG_ID;
2510    x_header_changed_attr_tbl(ind).current_value   := x_current_customer_name;
2511    END IF;
2512    If p_prior_rec.sold_to_org_id is not NULL THEN
2513    OE_ID_TO_VALUE.Sold_To_Org(p_sold_to_org_id => p_prior_rec.SOLD_TO_ORG_ID,
2514 		              x_org            => x_prior_customer_name,
2515 			      x_customer_number=> x_customer_number);
2516    x_header_changed_attr_tbl(ind).prior_id        := p_prior_rec.SOLD_TO_ORG_ID;
2517    x_header_changed_attr_tbl(ind).prior_value   := x_prior_customer_name;
2518    END IF;
2519 END IF;
2520 END IF; /*  PRIOR */
2521 /****************************/
2522 IF p_next_version IS NOT NULL THEN
2523 IF OE_Globals.Equal(
2524        p_curr_rec.SOLD_TO_ORG_ID,
2525        p_next_rec.SOLD_TO_ORG_ID) THEN
2526     IF prior_exists = 'Y' THEN
2527    x_header_changed_attr_tbl(ind).next_value   := x_current_customer_name;
2528     END IF;
2529 ELSE
2530     IF prior_exists = 'N' THEN
2531         ind := ind+1;
2532     END IF;
2533    x_header_changed_attr_tbl(ind).attribute_name := 'SOLD_TO';
2534    If p_prior_rec.sold_to_org_id is not NULL THEN
2535    OE_ID_TO_VALUE.Sold_To_Org(p_sold_to_org_id => p_prior_rec.SOLD_TO_ORG_ID,
2536 		              x_org            => x_prior_customer_name,
2537 			      x_customer_number=> x_customer_number);
2538    x_header_changed_attr_tbl(ind).prior_id     := p_prior_rec.SOLD_TO_ORG_ID;
2539    x_header_changed_attr_tbl(ind).prior_value  := x_prior_customer_name;
2540    END IF;
2541    If p_curr_rec.sold_to_org_id is not NULL THEN
2542    OE_ID_TO_VALUE.Sold_To_Org(p_sold_to_org_id => p_curr_rec.SOLD_TO_ORG_ID,
2543 		              x_org            => x_current_customer_name,
2544 			      x_customer_number=> x_customer_number);
2545    x_header_changed_attr_tbl(ind).current_id     := p_curr_rec.SOLD_TO_ORG_ID;
2546    x_header_changed_attr_tbl(ind).current_value  := x_current_customer_name;
2547    END IF;
2548    If p_next_rec.sold_to_org_id is not NULL THEN
2549    OE_ID_TO_VALUE.Sold_To_Org(p_sold_to_org_id => p_next_rec.SOLD_TO_ORG_ID,
2550 		              x_org            => x_next_customer_name,
2551 			      x_customer_number=> x_customer_number);
2552    x_header_changed_attr_tbl(ind).next_id      := p_next_rec.SOLD_TO_ORG_ID;
2553    x_header_changed_attr_tbl(ind).next_value   := x_next_customer_name;
2554    END IF;
2555 END IF; /*  NEXT */
2556 END IF;
2557 
2558 /* END SOLD_TO_ORG_ID*/
2559 /****************************/
2560 
2561 /****************************/
2562 /* START TRANSACTIONAL_CURR_CODE*/
2563 
2564 prior_exists := 'N';
2565 IF p_prior_version IS NOT NULL THEN
2566 IF OE_Globals.Equal(
2567        p_curr_rec.TRANSACTIONAL_CURR_CODE,
2568        p_prior_rec.TRANSACTIONAL_CURR_CODE) THEN
2569  null;
2570 ELSE
2571    ind := ind+1;
2572    prior_exists := 'Y';
2573    x_header_changed_attr_tbl(ind).attribute_name  := 'TRANSACTIONAL_CURR_CODE';
2574    x_header_changed_attr_tbl(ind).current_value      := p_curr_rec.TRANSACTIONAL_CURR_CODE;
2575    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.TRANSACTIONAL_CURR_CODE;
2576 END IF;
2577 END IF; /*  PRIOR */
2578 /****************************/
2579 IF p_next_version IS NOT NULL THEN
2580 IF OE_Globals.Equal(
2581        p_curr_rec.TRANSACTIONAL_CURR_CODE,
2582        p_next_rec.TRANSACTIONAL_CURR_CODE) THEN
2583     IF prior_exists = 'Y' THEN
2584      x_header_changed_attr_tbl(ind).next_value      := p_curr_rec.TRANSACTIONAL_CURR_CODE;
2585     END IF;
2586 ELSE
2587     IF prior_exists = 'N' THEN
2588         ind := ind+1;
2589     END IF;
2590    x_header_changed_attr_tbl(ind).attribute_name := 'TRANSACTIONAL_CURR_CODE';
2591    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.TRANSACTIONAL_CURR_CODE;
2592    x_header_changed_attr_tbl(ind).current_value     := p_curr_rec.TRANSACTIONAL_CURR_CODE;
2593    x_header_changed_attr_tbl(ind).next_value      := p_next_rec.TRANSACTIONAL_CURR_CODE;
2594 END IF; /*  NEXT */
2595 END IF;
2596 
2597 /* END TRANSACTIONAL_CURR_CODE*/
2598 /****************************/
2599 
2600 /****************************/
2601 /* START shipping_instructions*/
2602 
2603 prior_exists := 'N';
2604 IF p_prior_version IS NOT NULL THEN
2605 IF OE_Globals.Equal(
2606        p_curr_rec.shipping_instructions,
2607        p_prior_rec.shipping_instructions) THEN
2608  null;
2609 ELSE
2610    ind := ind+1;
2611    prior_exists := 'Y';
2612    x_header_changed_attr_tbl(ind).attribute_name  := 'shipping_instructions';
2613    x_header_changed_attr_tbl(ind).current_value      := p_curr_rec.shipping_instructions;
2614    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.shipping_instructions;
2615 END IF;
2616 END IF; /*  PRIOR */
2617 /****************************/
2618 IF p_next_version IS NOT NULL THEN
2619 IF OE_Globals.Equal(
2620        p_curr_rec.shipping_instructions,
2621        p_next_rec.shipping_instructions) THEN
2622     IF prior_exists = 'Y' THEN
2623    x_header_changed_attr_tbl(ind).next_value      := p_curr_rec.shipping_instructions;
2624     END IF;
2625 ELSE
2626     IF prior_exists = 'N' THEN
2627         ind := ind+1;
2628     END IF;
2629    x_header_changed_attr_tbl(ind).attribute_name := 'shipping_instructions';
2630    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.shipping_instructions;
2631    x_header_changed_attr_tbl(ind).current_value     := p_curr_rec.shipping_instructions;
2632    x_header_changed_attr_tbl(ind).next_value      := p_next_rec.shipping_instructions;
2633 END IF; /*  NEXT */
2634 END IF;
2635 
2636 /* END shipping_instructions*/
2637 /****************************/
2638 
2639 /****************************/
2640 /* START packing_instructions*/
2641 
2642 prior_exists := 'N';
2643 IF p_prior_version IS NOT NULL THEN
2644 IF OE_Globals.Equal(
2645        p_curr_rec.packing_instructions,
2646        p_prior_rec.packing_instructions) THEN
2647  null;
2648 ELSE
2649    ind := ind+1;
2650    prior_exists := 'Y';
2651    x_header_changed_attr_tbl(ind).attribute_name  := 'packing_instructions';
2652    x_header_changed_attr_tbl(ind).current_value      := p_curr_rec.packing_instructions;
2653    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.packing_instructions;
2654 END IF;
2655 END IF; /*  PRIOR */
2656 /****************************/
2657 IF p_next_version IS NOT NULL THEN
2658 IF OE_Globals.Equal(
2659        p_curr_rec.packing_instructions,
2660        p_next_rec.packing_instructions) THEN
2661     IF prior_exists = 'Y' THEN
2662    x_header_changed_attr_tbl(ind).next_value      := p_curr_rec.packing_instructions;
2663     END IF;
2664 ELSE
2665     IF prior_exists = 'N' THEN
2666         ind := ind+1;
2667     END IF;
2668    x_header_changed_attr_tbl(ind).attribute_name := 'packing_instructions';
2669    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.packing_instructions;
2670    x_header_changed_attr_tbl(ind).current_value     := p_curr_rec.packing_instructions;
2671    x_header_changed_attr_tbl(ind).next_value      := p_next_rec.packing_instructions;
2672 END IF; /*  NEXT */
2673 END IF;
2674 
2675 /* END packing_instructions*/
2676 /****************************/
2677 
2678 /****************************/
2679 /* START flow_status_code*/
2680 
2681 prior_exists := 'N';
2682 IF p_prior_version IS NOT NULL THEN
2683 IF OE_Globals.Equal(
2684        p_curr_rec.flow_status_code,
2685        p_prior_rec.flow_status_code) THEN
2686  null;
2687 ELSE
2688    ind := ind+1;
2689    prior_exists := 'Y';
2690    x_header_changed_attr_tbl(ind).attribute_name  := 'flow_status';
2691    x_header_changed_attr_tbl(ind).current_id      := p_curr_rec.flow_status_code;
2692    x_header_changed_attr_tbl(ind).current_value   := OE_ID_TO_VALUE.flow_status(p_curr_rec.flow_status_code);
2693    x_header_changed_attr_tbl(ind).prior_id        := p_prior_rec.flow_status_code;
2694    x_header_changed_attr_tbl(ind).prior_value     := OE_ID_TO_VALUE.flow_status(p_prior_rec.flow_status_code);
2695 END IF;
2696 END IF; /*  PRIOR */
2697 /****************************/
2698 IF p_next_version IS NOT NULL THEN
2699 IF OE_Globals.Equal(
2700        p_curr_rec.flow_status_code,
2701        p_next_rec.flow_status_code) THEN
2702     IF prior_exists = 'Y' THEN
2703    x_header_changed_attr_tbl(ind).next_value   := OE_ID_TO_VALUE.flow_status(p_curr_rec.flow_status_code);
2704     END IF;
2705 ELSE
2706     IF prior_exists = 'N' THEN
2707         ind := ind+1;
2708     END IF;
2709    x_header_changed_attr_tbl(ind).attribute_name := 'flow_status';
2710    x_header_changed_attr_tbl(ind).prior_id        := p_prior_rec.flow_status_code;
2711    x_header_changed_attr_tbl(ind).prior_value     := OE_ID_TO_VALUE.flow_status(p_prior_rec.flow_status_code);
2712    x_header_changed_attr_tbl(ind).current_id     := p_curr_rec.flow_status_code;
2713    x_header_changed_attr_tbl(ind).current_value  := OE_ID_TO_VALUE.flow_status(p_curr_rec.flow_status_code);
2714    x_header_changed_attr_tbl(ind).next_id      := p_next_rec.flow_status_code;
2715    x_header_changed_attr_tbl(ind).next_value   := OE_ID_TO_VALUE.flow_status(p_next_rec.flow_status_code);
2716 END IF;
2717 END IF; /*  NEXT */
2718 
2719 /* END flow_status_code*/
2720 /****************************/
2721 
2722 /****************************/
2723 /* START sales_document_name*/
2724 
2725 prior_exists := 'N';
2726 IF p_prior_version IS NOT NULL THEN
2727 IF OE_Globals.Equal(
2728        p_curr_rec.sales_document_name,
2729        p_prior_rec.sales_document_name) THEN
2730  null;
2731 ELSE
2732    ind := ind+1;
2733    prior_exists := 'Y';
2734    x_header_changed_attr_tbl(ind).attribute_name  := 'sales_document_name';
2735    x_header_changed_attr_tbl(ind).current_value      := p_curr_rec.sales_document_name;
2736    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.sales_document_name;
2737 END IF;
2738 END IF; /*  PRIOR */
2739 /****************************/
2740 IF p_next_version IS NOT NULL THEN
2741 IF OE_Globals.Equal(
2742        p_curr_rec.sales_document_name,
2743        p_next_rec.sales_document_name) THEN
2744     IF prior_exists = 'Y' THEN
2745      x_header_changed_attr_tbl(ind).next_value      := p_curr_rec.sales_document_name;
2746     END IF;
2747 ELSE
2748     IF prior_exists = 'N' THEN
2749         ind := ind+1;
2750     END IF;
2751    x_header_changed_attr_tbl(ind).attribute_name := 'sales_document_name';
2752    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.sales_document_name;
2753    x_header_changed_attr_tbl(ind).current_value     := p_curr_rec.sales_document_name;
2754    x_header_changed_attr_tbl(ind).next_value      := p_next_rec.sales_document_name;
2755 END IF; /*  NEXT */
2756 END IF;
2757 
2758 /* END sales_document_name*/
2759 /****************************/
2760 /****************************/
2761 /* START transaction_phase_code*/
2762 
2763 prior_exists := 'N';
2764 IF p_prior_version IS NOT NULL THEN
2765 IF OE_Globals.Equal(
2766        p_curr_rec.transaction_phase_code,
2767        p_prior_rec.transaction_phase_code) THEN
2768  null;
2769 ELSE
2770    ind := ind+1;
2771    prior_exists := 'Y';
2772    x_header_changed_attr_tbl(ind).attribute_name  := 'transaction_phase';
2773    x_header_changed_attr_tbl(ind).current_id      := p_curr_rec.transaction_phase_code;
2774    x_header_changed_attr_tbl(ind).current_value   := OE_ID_TO_VALUE.Transaction_Phase(p_curr_rec.transaction_phase_code);
2775    x_header_changed_attr_tbl(ind).prior_id        := p_prior_rec.transaction_phase_code;
2776    x_header_changed_attr_tbl(ind).prior_value     := OE_ID_TO_VALUE.Transaction_Phase(p_prior_rec.transaction_phase_code);
2777 END IF;
2778 END IF; /*  PRIOR */
2779 /****************************/
2780 IF p_next_version IS NOT NULL THEN
2781 IF OE_Globals.Equal(
2782        p_curr_rec.transaction_phase_code,
2783        p_next_rec.transaction_phase_code) THEN
2784     IF prior_exists = 'Y' THEN
2785     x_header_changed_attr_tbl(ind).next_value   := OE_ID_TO_VALUE.Transaction_Phase(p_curr_rec.transaction_phase_code);
2786     END IF;
2787 ELSE
2788     IF prior_exists = 'N' THEN
2789         ind := ind+1;
2790     END IF;
2791    x_header_changed_attr_tbl(ind).attribute_name := 'transaction_phase';
2792    x_header_changed_attr_tbl(ind).prior_id        := p_prior_rec.transaction_phase_code;
2793    x_header_changed_attr_tbl(ind).prior_value     := OE_ID_TO_VALUE.Transaction_Phase(p_prior_rec.transaction_phase_code);
2794    x_header_changed_attr_tbl(ind).current_id     := p_curr_rec.transaction_phase_code;
2795    x_header_changed_attr_tbl(ind).current_value  := OE_ID_TO_VALUE.Transaction_Phase(p_curr_rec.transaction_phase_code);
2796    x_header_changed_attr_tbl(ind).next_id      := p_next_rec.transaction_phase_code;
2797    x_header_changed_attr_tbl(ind).next_value   := OE_ID_TO_VALUE.Transaction_Phase(p_next_rec.transaction_phase_code);
2798 END IF; /*  NEXT */
2799 END IF;
2800 
2801 /* END transaction_phase_code*/
2802 /****************************/
2803 /****************************/
2804 /* START user_status_code*/
2805 
2806 prior_exists := 'N';
2807 IF p_prior_version IS NOT NULL THEN
2808 IF OE_Globals.Equal(
2809        p_curr_rec.user_status_code,
2810        p_prior_rec.user_status_code) THEN
2811  null;
2812 ELSE
2813    ind := ind+1;
2814    prior_exists := 'Y';
2815    x_header_changed_attr_tbl(ind).attribute_name  := 'user_status';
2816    x_header_changed_attr_tbl(ind).current_id      := p_curr_rec.user_status_code;
2817    x_header_changed_attr_tbl(ind).current_value   := OE_ID_TO_VALUE.User_Status(p_curr_rec.user_status_code);
2818    x_header_changed_attr_tbl(ind).prior_id        := p_prior_rec.user_status_code;
2819    x_header_changed_attr_tbl(ind).prior_value     := OE_ID_TO_VALUE.User_Status(p_prior_rec.user_status_code);
2820 END IF;
2821 END IF; /*  PRIOR */
2822 /****************************/
2823 IF p_next_version IS NOT NULL THEN
2824 IF OE_Globals.Equal(
2825        p_curr_rec.user_status_code,
2826        p_next_rec.user_status_code) THEN
2827     IF prior_exists = 'Y' THEN
2828    x_header_changed_attr_tbl(ind).next_value   := OE_ID_TO_VALUE.User_Status(p_curr_rec.user_status_code);
2829     END IF;
2830 ELSE
2831     IF prior_exists = 'N' THEN
2832         ind := ind+1;
2833     END IF;
2834    x_header_changed_attr_tbl(ind).attribute_name := 'user_status';
2835    x_header_changed_attr_tbl(ind).prior_id        := p_prior_rec.user_status_code;
2836    x_header_changed_attr_tbl(ind).prior_value     := OE_ID_TO_VALUE.User_Status(p_prior_rec.user_status_code);
2837    x_header_changed_attr_tbl(ind).current_id     := p_curr_rec.user_status_code;
2838    x_header_changed_attr_tbl(ind).current_value  := OE_ID_TO_VALUE.User_Status(p_curr_rec.user_status_code);
2839    x_header_changed_attr_tbl(ind).next_id      := p_next_rec.user_status_code;
2840    x_header_changed_attr_tbl(ind).next_value   := OE_ID_TO_VALUE.User_Status(p_next_rec.user_status_code);
2841 END IF; /*  NEXT */
2842 END IF;
2843 
2844 /* END user_status_code*/
2845 /****************************/
2846 
2847 
2848 
2849 /****************************/
2850 /* START sold_to_site_use_id*/
2851 
2852 prior_exists := 'N';
2853 IF p_prior_version IS NOT NULL THEN
2854 IF OE_Globals.Equal(
2855        p_curr_rec.sold_to_site_use_id,
2856        p_prior_rec.sold_to_site_use_id) THEN
2857  null;
2858 ELSE
2859    ind := ind+1;
2860    prior_exists := 'Y';
2861    x_header_changed_attr_tbl(ind).attribute_name  := 'Customer_Location';
2862    if p_curr_rec.sold_to_site_use_id is not null then
2863      OE_ID_TO_VALUE.Customer_Location
2864          (   p_sold_to_site_use_id        => p_curr_rec.sold_to_site_use_id
2865         , x_sold_to_location_address1    => x_sold_to_location_address1
2866         , x_sold_to_location_address2    => x_sold_to_location_address2
2867 	, x_sold_to_location_address3    => x_sold_to_location_address3
2868 	, x_sold_to_location_address4    => x_sold_to_location_address4
2869 	, x_sold_to_location             => x_sold_to_location
2870 	, x_sold_to_location_city        => x_sold_to_location_city
2871 	, x_sold_to_location_state       => x_sold_to_location_state
2872 	, x_sold_to_location_postal      => x_sold_to_location_postal_code
2873 	, x_sold_to_location_country     => x_sold_to_location_country
2874           );
2875 
2876   select
2877     DECODE(x_sold_to_location, NULL, NULL,x_sold_to_location|| ', ') ||
2878     DECODE(x_sold_to_location_address1, NULL, NULL,x_sold_to_location_address1 || ', ') ||
2879     DECODE(x_sold_to_location_address2, NULL, NULL,x_sold_to_location_address3 || ', ') ||
2880     DECODE(x_sold_to_location_address3, NULL, NULL,x_sold_to_location_address3 || ', ') ||
2881     DECODE(x_sold_to_location_address4, NULL, NULL,x_sold_to_location_address4 || ', ') ||
2882     DECODE(x_sold_to_location_city, NULL, NULL,x_sold_to_location_city || ', ') ||
2883     DECODE(x_sold_to_location_state, NULL, NULL,x_sold_to_location_state || ', ') ||
2884     DECODE(x_sold_to_location_postal_code, NULL, NULL,x_sold_to_location_postal_code || ', ') ||
2885     DECODE(x_sold_to_location_country, NULL,NULL,x_sold_to_location_country)
2886         into x_current_sold_to_location from dual;
2887    x_header_changed_attr_tbl(ind).current_id      := p_curr_rec.sold_to_site_use_id;
2888 
2889    x_header_changed_attr_tbl(ind).current_value     := x_current_sold_to_location;
2890 
2891        end if;
2892    if p_prior_rec.sold_to_site_use_id is not null then
2893      OE_ID_TO_VALUE.Customer_Location
2894          (   p_sold_to_site_use_id        => p_prior_rec.sold_to_site_use_id
2895         , x_sold_to_location_address1    => x_sold_to_location_address1
2896         , x_sold_to_location_address2    => x_sold_to_location_address2
2897 	, x_sold_to_location_address3    => x_sold_to_location_address3
2898 	, x_sold_to_location_address4    => x_sold_to_location_address4
2899 	, x_sold_to_location             => x_sold_to_location
2900 	, x_sold_to_location_city        => x_sold_to_location_city
2901 	, x_sold_to_location_state       => x_sold_to_location_state
2902 	, x_sold_to_location_postal      => x_sold_to_location_postal_code
2903 	, x_sold_to_location_country     => x_sold_to_location_country
2904           );
2905 
2906   select
2907     DECODE(x_sold_to_location, NULL, NULL,x_sold_to_location|| ', ') ||
2908     DECODE(x_sold_to_location_address1, NULL, NULL,x_sold_to_location_address1 || ', ') ||
2909     DECODE(x_sold_to_location_address2, NULL, NULL,x_sold_to_location_address3 || ', ') ||
2910     DECODE(x_sold_to_location_address3, NULL, NULL,x_sold_to_location_address3 || ', ') ||
2911     DECODE(x_sold_to_location_address4, NULL, NULL,x_sold_to_location_address4 || ', ') ||
2912     DECODE(x_sold_to_location_city, NULL, NULL,x_sold_to_location_city || ', ') ||
2913     DECODE(x_sold_to_location_state, NULL, NULL,x_sold_to_location_state || ', ') ||
2914     DECODE(x_sold_to_location_postal_code, NULL, NULL,x_sold_to_location_postal_code || ', ') ||
2915     DECODE(x_sold_to_location_country, NULL,NULL,x_sold_to_location_country)
2916         into x_prior_sold_to_location from dual;
2917    x_header_changed_attr_tbl(ind).prior_id        := p_prior_rec.sold_to_site_use_id;
2918    x_header_changed_attr_tbl(ind).prior_value     := x_prior_sold_to_location;
2919        end if;
2920 END IF;
2921 END IF; /*  PRIOR */
2922 /****************************/
2923 
2924 IF p_next_version IS NOT NULL THEN
2925 IF OE_Globals.Equal(
2926        p_curr_rec.sold_to_site_use_id,
2927        p_next_rec.sold_to_site_use_id) THEN
2928     IF prior_exists = 'Y' THEN
2929      x_header_changed_attr_tbl(ind).next_value     := x_current_sold_to_location;
2930     END IF;
2931 ELSE
2932     IF prior_exists = 'N' THEN
2933         ind := ind+1;
2934     END IF;
2935    x_header_changed_attr_tbl(ind).attribute_name := 'customer_location';
2936 
2937    if p_prior_rec.sold_to_site_use_id is not null then
2938      OE_ID_TO_VALUE.customer_location
2939          (   p_sold_to_site_use_id        => p_prior_rec.sold_to_site_use_id
2940         , x_sold_to_location_address1    => x_sold_to_location_address1
2941         , x_sold_to_location_address2    => x_sold_to_location_address2
2942 	, x_sold_to_location_address3    => x_sold_to_location_address3
2943 	, x_sold_to_location_address4    => x_sold_to_location_address4
2944 	, x_sold_to_location             => x_sold_to_location
2945 	, x_sold_to_location_city        => x_sold_to_location_city
2946 	, x_sold_to_location_state       => x_sold_to_location_state
2947 	, x_sold_to_location_postal      => x_sold_to_location_postal_code
2948 	, x_sold_to_location_country     => x_sold_to_location_country
2949           );
2950 
2951   select
2952     DECODE(x_sold_to_location, NULL, NULL,x_sold_to_location|| ', ') ||
2953     DECODE(x_sold_to_location_address1, NULL, NULL,x_sold_to_location_address1 || ', ') ||
2954     DECODE(x_sold_to_location_address2, NULL, NULL,x_sold_to_location_address3 || ', ') ||
2955     DECODE(x_sold_to_location_address3, NULL, NULL,x_sold_to_location_address3 || ', ') ||
2956     DECODE(x_sold_to_location_address4, NULL, NULL,x_sold_to_location_address4 || ', ') ||
2957     DECODE(x_sold_to_location_city, NULL, NULL,x_sold_to_location_city || ', ') ||
2958     DECODE(x_sold_to_location_state, NULL, NULL,x_sold_to_location_state || ', ') ||
2959     DECODE(x_sold_to_location_postal_code, NULL, NULL,x_sold_to_location_postal_code || ', ') ||
2960     DECODE(x_sold_to_location_country, NULL,NULL,x_sold_to_location_country)
2961         into x_prior_sold_to_location from dual;
2962    x_header_changed_attr_tbl(ind).prior_id        := p_prior_rec.sold_to_site_use_id;
2963    x_header_changed_attr_tbl(ind).prior_value     := x_prior_sold_to_location;
2964        end if;
2965 
2966    if p_curr_rec.sold_to_site_use_id is not null then
2967      OE_ID_TO_VALUE.customer_location
2968          (   p_sold_to_site_use_id        => p_curr_rec.sold_to_site_use_id
2969         , x_sold_to_location_address1    => x_sold_to_location_address1
2970         , x_sold_to_location_address2    => x_sold_to_location_address2
2971 	, x_sold_to_location_address3    => x_sold_to_location_address3
2972 	, x_sold_to_location_address4    => x_sold_to_location_address4
2973 	, x_sold_to_location             => x_sold_to_location
2974 	, x_sold_to_location_city        => x_sold_to_location_city
2975 	, x_sold_to_location_state       => x_sold_to_location_state
2976 	, x_sold_to_location_postal      => x_sold_to_location_postal_code
2977 	, x_sold_to_location_country     => x_sold_to_location_country
2978           );
2979 
2980   select
2981     DECODE(x_sold_to_location, NULL, NULL,x_sold_to_location|| ', ') ||
2982     DECODE(x_sold_to_location_address1, NULL, NULL,x_sold_to_location_address1 || ', ') ||
2983     DECODE(x_sold_to_location_address2, NULL, NULL,x_sold_to_location_address3 || ', ') ||
2984     DECODE(x_sold_to_location_address3, NULL, NULL,x_sold_to_location_address3 || ', ') ||
2985     DECODE(x_sold_to_location_address4, NULL, NULL,x_sold_to_location_address4 || ', ') ||
2986     DECODE(x_sold_to_location_city, NULL, NULL,x_sold_to_location_city || ', ') ||
2987     DECODE(x_sold_to_location_state, NULL, NULL,x_sold_to_location_state || ', ') ||
2988     DECODE(x_sold_to_location_postal_code, NULL, NULL,x_sold_to_location_postal_code || ', ') ||
2989     DECODE(x_sold_to_location_country, NULL,NULL,x_sold_to_location_country)
2990         into x_current_sold_to_location from dual;
2991    x_header_changed_attr_tbl(ind).current_id     := p_curr_rec.sold_to_site_use_id;
2992    x_header_changed_attr_tbl(ind).current_value     := x_current_sold_to_location;
2993        end if;
2994 
2995    if p_next_rec.sold_to_site_use_id is not null then
2996      OE_ID_TO_VALUE.customer_location
2997          (   p_sold_to_site_use_id        => p_next_rec.sold_to_site_use_id
2998         , x_sold_to_location_address1    => x_sold_to_location_address1
2999         , x_sold_to_location_address2    => x_sold_to_location_address2
3000 	, x_sold_to_location_address3    => x_sold_to_location_address3
3001 	, x_sold_to_location_address4    => x_sold_to_location_address4
3002 	, x_sold_to_location             => x_sold_to_location
3003 	, x_sold_to_location_city        => x_sold_to_location_city
3004 	, x_sold_to_location_state       => x_sold_to_location_state
3005 	, x_sold_to_location_postal      => x_sold_to_location_postal_code
3006 	, x_sold_to_location_country     => x_sold_to_location_country
3007           );
3008 
3009   select
3010     DECODE(x_sold_to_location, NULL, NULL,x_sold_to_location|| ', ') ||
3011     DECODE(x_sold_to_location_address1, NULL, NULL,x_sold_to_location_address1 || ', ') ||
3012     DECODE(x_sold_to_location_address2, NULL, NULL,x_sold_to_location_address3 || ', ') ||
3013     DECODE(x_sold_to_location_address3, NULL, NULL,x_sold_to_location_address3 || ', ') ||
3014     DECODE(x_sold_to_location_address4, NULL, NULL,x_sold_to_location_address4 || ', ') ||
3015     DECODE(x_sold_to_location_city, NULL, NULL,x_sold_to_location_city || ', ') ||
3016     DECODE(x_sold_to_location_state, NULL, NULL,x_sold_to_location_state || ', ') ||
3017     DECODE(x_sold_to_location_postal_code, NULL, NULL,x_sold_to_location_postal_code || ', ') ||
3018     DECODE(x_sold_to_location_country, NULL,NULL,x_sold_to_location_country)
3019         into x_next_sold_to_location from dual;
3020    x_header_changed_attr_tbl(ind).next_id      := p_next_rec.sold_to_site_use_id;
3021    x_header_changed_attr_tbl(ind).next_value     := x_next_sold_to_location;
3022        end if;
3023 END IF; /*  NEXT */
3024 END IF;
3025 
3026 /* END sold_to_site_use_id*/
3027 /****************************/
3028 
3029 /****************************/
3030 /* START SUPPLIER_SIGNATURE*/
3031 
3032 prior_exists := 'N';
3033 IF p_prior_version IS NOT NULL THEN
3034 IF OE_Globals.Equal(
3035        p_curr_rec.SUPPLIER_SIGNATURE,
3036        p_prior_rec.SUPPLIER_SIGNATURE) THEN
3037  null;
3038 ELSE
3039    ind := ind+1;
3040    prior_exists := 'Y';
3041    x_header_changed_attr_tbl(ind).attribute_name  := 'SUPPLIER_SIGNATURE';
3042    x_header_changed_attr_tbl(ind).current_value      := to_char(p_curr_rec.SUPPLIER_SIGNATURE,'DD-MON-YYYY HH24:MI:SS');
3043    x_header_changed_attr_tbl(ind).prior_value        := to_char(p_prior_rec.SUPPLIER_SIGNATURE,'DD-MON-YYYY HH24:MI:SS');
3044 END IF;
3045 END IF; /*  PRIOR */
3046 /****************************/
3047 IF p_next_version IS NOT NULL THEN
3048 IF OE_Globals.Equal(
3049        p_curr_rec.SUPPLIER_SIGNATURE,
3050        p_next_rec.SUPPLIER_SIGNATURE) THEN
3051     IF prior_exists = 'Y' THEN
3052    x_header_changed_attr_tbl(ind).next_value      := to_char(p_curr_rec.SUPPLIER_SIGNATURE,'DD-MON-YYYY HH24:MI:SS');
3053     END IF;
3054 ELSE
3055     IF prior_exists = 'N' THEN
3056         ind := ind+1;
3057     END IF;
3058    x_header_changed_attr_tbl(ind).attribute_name := 'SUPPLIER_SIGNATURE';
3059    x_header_changed_attr_tbl(ind).prior_value        := to_char(p_prior_rec.SUPPLIER_SIGNATURE,'DD-MON-YYYY HH24:MI:SS');
3060    x_header_changed_attr_tbl(ind).current_value     := to_char(p_curr_rec.SUPPLIER_SIGNATURE,'DD-MON-YYYY HH24:MI:SS');
3061    x_header_changed_attr_tbl(ind).next_value      := to_char(p_next_rec.SUPPLIER_SIGNATURE,'DD-MON-YYYY HH24:MI:SS');
3062 END IF; /*  NEXT */
3063 END IF;
3064 
3065 /* END SUPPLIER_SIGNATURE*/
3066 /****************************/
3067 /****************************/
3068 /* START SUPPLIER_SIGNATURE_DATE*/
3069 
3070 prior_exists := 'N';
3071 IF p_prior_version IS NOT NULL THEN
3072 IF OE_Globals.Equal(
3073        p_curr_rec.SUPPLIER_SIGNATURE_DATE,
3074        p_prior_rec.SUPPLIER_SIGNATURE_DATE) THEN
3075  null;
3076 ELSE
3077    ind := ind+1;
3078    prior_exists := 'Y';
3079    x_header_changed_attr_tbl(ind).attribute_name  := 'SUPPLIER_SIGNATURE_DATE';
3080    x_header_changed_attr_tbl(ind).current_value      := p_curr_rec.SUPPLIER_SIGNATURE_DATE;
3081    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.SUPPLIER_SIGNATURE_DATE;
3082 END IF;
3083 END IF; /*  PRIOR */
3084 /****************************/
3085 IF p_next_version IS NOT NULL THEN
3086 IF OE_Globals.Equal(
3087        p_curr_rec.SUPPLIER_SIGNATURE_DATE,
3088        p_next_rec.SUPPLIER_SIGNATURE_DATE) THEN
3089     IF prior_exists = 'Y' THEN
3090    x_header_changed_attr_tbl(ind).next_value      := p_curr_rec.SUPPLIER_SIGNATURE_DATE;
3091     END IF;
3092 ELSE
3093     IF prior_exists = 'N' THEN
3094         ind := ind+1;
3095     END IF;
3096    x_header_changed_attr_tbl(ind).attribute_name := 'SUPPLIER_SIGNATURE_DATE';
3097    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.SUPPLIER_SIGNATURE_DATE;
3098    x_header_changed_attr_tbl(ind).current_value     := p_curr_rec.SUPPLIER_SIGNATURE_DATE;
3099    x_header_changed_attr_tbl(ind).next_value      := p_next_rec.SUPPLIER_SIGNATURE_DATE;
3100 END IF; /*  NEXT */
3101 END IF;
3102 
3103 /* END SUPPLIER_SIGNATURE_DATE*/
3104 /****************************/
3105 /****************************/
3106 /* START CUSTOMER_SIGNATURE*/
3107 
3108 prior_exists := 'N';
3109 IF p_prior_version IS NOT NULL THEN
3110 IF OE_Globals.Equal(
3111        p_curr_rec.CUSTOMER_SIGNATURE,
3112        p_prior_rec.CUSTOMER_SIGNATURE) THEN
3113  null;
3114 ELSE
3115    ind := ind+1;
3116    prior_exists := 'Y';
3117    x_header_changed_attr_tbl(ind).attribute_name  := 'CUSTOMER_SIGNATURE';
3118    x_header_changed_attr_tbl(ind).current_value      := p_curr_rec.CUSTOMER_SIGNATURE;
3119    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.CUSTOMER_SIGNATURE;
3120 END IF;
3121 END IF; /*  PRIOR */
3122 /****************************/
3123 IF p_next_version IS NOT NULL THEN
3124 IF OE_Globals.Equal(
3125        p_curr_rec.CUSTOMER_SIGNATURE,
3126        p_next_rec.CUSTOMER_SIGNATURE) THEN
3127     IF prior_exists = 'Y' THEN
3128    x_header_changed_attr_tbl(ind).next_value      := p_curr_rec.CUSTOMER_SIGNATURE;
3129     END IF;
3130 ELSE
3131     IF prior_exists = 'N' THEN
3132         ind := ind+1;
3133     END IF;
3134    x_header_changed_attr_tbl(ind).attribute_name := 'CUSTOMER_SIGNATURE';
3135    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.CUSTOMER_SIGNATURE;
3136    x_header_changed_attr_tbl(ind).current_value     := p_curr_rec.CUSTOMER_SIGNATURE;
3137    x_header_changed_attr_tbl(ind).next_value      := p_next_rec.CUSTOMER_SIGNATURE;
3138 END IF; /*  NEXT */
3139 END IF;
3140 
3141 /* END CUSTOMER_SIGNATURE*/
3142 /****************************/
3143 /****************************/
3144 /* START CUSTOMER_SIGNATURE_DATE*/
3145 
3146 prior_exists := 'N';
3147 IF p_prior_version IS NOT NULL THEN
3148 IF OE_Globals.Equal(
3149        p_curr_rec.CUSTOMER_SIGNATURE_DATE,
3150        p_prior_rec.CUSTOMER_SIGNATURE_DATE) THEN
3151  null;
3152 ELSE
3153    ind := ind+1;
3154    prior_exists := 'Y';
3155    x_header_changed_attr_tbl(ind).attribute_name  := 'CUSTOMER_SIGNATURE_DATE';
3156    x_header_changed_attr_tbl(ind).current_value      := to_char(p_curr_rec.CUSTOMER_SIGNATURE_DATE,'DD-MON-YYYY HH24:MI:SS');
3157    x_header_changed_attr_tbl(ind).prior_value        := to_char(p_prior_rec.CUSTOMER_SIGNATURE_DATE,'DD-MON-YYYY HH24:MI:SS');
3158 END IF;
3159 END IF; /*  PRIOR */
3160 /****************************/
3161 IF p_next_version IS NOT NULL THEN
3162 IF OE_Globals.Equal(
3163        p_curr_rec.CUSTOMER_SIGNATURE_DATE,
3164        p_next_rec.CUSTOMER_SIGNATURE_DATE) THEN
3165     IF prior_exists = 'Y' THEN
3166    x_header_changed_attr_tbl(ind).next_value      := to_char(p_curr_rec.CUSTOMER_SIGNATURE_DATE,'DD-MON-YYYY HH24:MI:SS');
3167     END IF;
3168 ELSE
3169     IF prior_exists = 'N' THEN
3170         ind := ind+1;
3171     END IF;
3172    x_header_changed_attr_tbl(ind).attribute_name := 'CUSTOMER_SIGNATURE_DATE';
3173    x_header_changed_attr_tbl(ind).prior_value        :=to_char( p_prior_rec.CUSTOMER_SIGNATURE_DATE,'DD-MON-YYYY HH24:MI:SS');
3174    x_header_changed_attr_tbl(ind).current_value     := to_char(p_curr_rec.CUSTOMER_SIGNATURE_DATE,'DD-MON-YYYY HH24:MI:SS');
3175    x_header_changed_attr_tbl(ind).next_value      := to_char(p_next_rec.CUSTOMER_SIGNATURE_DATE,'DD-MON-YYYY HH24:MI:SS');
3176 END IF; /*  NEXT */
3177 END IF;
3178 
3179 /* END CUSTOMER_SIGNATURE_DATE*/
3180 /****************************/
3181 
3182 /****************************/
3183 /* START START_DATE_ACTIVE*/
3184 
3185 prior_exists := 'N';
3186 IF p_prior_version IS NOT NULL THEN
3187 IF OE_Globals.Equal(
3188        p_curr_rec.START_DATE_ACTIVE,
3189        p_prior_rec.START_DATE_ACTIVE) THEN
3190  null;
3191 ELSE
3192    ind := ind+1;
3193    prior_exists := 'Y';
3194    x_header_changed_attr_tbl(ind).attribute_name  := 'START_DATE_ACTIVE';
3195    x_header_changed_attr_tbl(ind).current_value      := to_char(p_curr_rec.START_DATE_ACTIVE,'DD-MON-YYYY HH24:MI:SS');
3196    x_header_changed_attr_tbl(ind).prior_value        := to_char(p_prior_rec.START_DATE_ACTIVE,'DD-MON-YYYY HH24:MI:SS');
3197 END IF;
3198 END IF; /*  PRIOR */
3199 /****************************/
3200 IF p_next_version IS NOT NULL THEN
3201 IF OE_Globals.Equal(
3202        p_curr_rec.START_DATE_ACTIVE,
3203        p_next_rec.START_DATE_ACTIVE) THEN
3204     IF prior_exists = 'Y' THEN
3205    x_header_changed_attr_tbl(ind).next_value      := to_char(p_curr_rec.START_DATE_ACTIVE,'DD-MON-YYYY HH24:MI:SS');
3206     END IF;
3207 ELSE
3208     IF prior_exists = 'N' THEN
3209         ind := ind+1;
3210     END IF;
3211    x_header_changed_attr_tbl(ind).attribute_name := 'START_DATE_ACTIVE';
3212    x_header_changed_attr_tbl(ind).prior_value        := to_char(p_prior_rec.START_DATE_ACTIVE,'DD-MON-YYYY HH24:MI:SS');
3213    x_header_changed_attr_tbl(ind).current_value     := to_char(p_curr_rec.START_DATE_ACTIVE,'DD-MON-YYYY HH24:MI:SS');
3214    x_header_changed_attr_tbl(ind).next_value      := to_char(p_next_rec.START_DATE_ACTIVE,'DD-MON-YYYY HH24:MI:SS');
3215 END IF; /*  NEXT */
3216 END IF;
3217 
3218 /* END START_DATE_ACTIVE*/
3219 /****************************/
3220 
3221 /****************************/
3222 /* START END_DATE_ACTIVE*/
3223 
3224 prior_exists := 'N';
3225 IF p_prior_version IS NOT NULL THEN
3226 IF OE_Globals.Equal(
3227        p_curr_rec.END_DATE_ACTIVE,
3228        p_prior_rec.END_DATE_ACTIVE) THEN
3229  null;
3230 ELSE
3231    ind := ind+1;
3232    prior_exists := 'Y';
3233    x_header_changed_attr_tbl(ind).attribute_name  := 'END_DATE_ACTIVE';
3234    x_header_changed_attr_tbl(ind).current_value      := to_char(p_curr_rec.END_DATE_ACTIVE,'DD-MON-YYYY HH24:MI:SS');
3235    x_header_changed_attr_tbl(ind).prior_value        := to_char(p_prior_rec.END_DATE_ACTIVE,'DD-MON-YYYY HH24:MI:SS');
3236 END IF;
3237 END IF; /*  PRIOR */
3238 /****************************/
3239 IF p_next_version IS NOT NULL THEN
3240 IF OE_Globals.Equal(
3241        p_curr_rec.END_DATE_ACTIVE,
3242        p_next_rec.END_DATE_ACTIVE) THEN
3243     IF prior_exists = 'Y' THEN
3244      x_header_changed_attr_tbl(ind).next_value      := to_char(p_curr_rec.END_DATE_ACTIVE,'DD-MON-YYYY HH24:MI:SS');
3245     END IF;
3246 ELSE
3247     IF prior_exists = 'N' THEN
3248         ind := ind+1;
3249     END IF;
3250    x_header_changed_attr_tbl(ind).attribute_name := 'END_DATE_ACTIVE';
3251    x_header_changed_attr_tbl(ind).prior_value        := to_char(p_prior_rec.END_DATE_ACTIVE,'DD-MON-YYYY HH24:MI:SS');
3252    x_header_changed_attr_tbl(ind).current_value     := to_char(p_curr_rec.END_DATE_ACTIVE,'DD-MON-YYYY HH24:MI:SS');
3253    x_header_changed_attr_tbl(ind).next_value      := to_char(p_next_rec.END_DATE_ACTIVE,'DD-MON-YYYY HH24:MI:SS');
3254 END IF; /*  NEXT */
3255 END IF;
3256 
3257 /* END END_DATE_ACTIVE*/
3258 /****************************/
3259 
3260 /****************************/
3261 /* START on_hold_flag*/
3262 
3263 prior_exists := 'N';
3264 IF p_prior_version IS NOT NULL THEN
3265 IF OE_Globals.Equal(
3266        p_curr_rec.on_hold_flag,
3267        p_prior_rec.on_hold_flag) THEN
3268  null;
3269 ELSE
3270    ind := ind+1;
3271    prior_exists := 'Y';
3272    x_header_changed_attr_tbl(ind).attribute_name  := 'on_hold_flag';
3273    x_header_changed_attr_tbl(ind).current_value      := p_curr_rec.on_hold_flag;
3274    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.on_hold_flag;
3275 END IF;
3276 END IF; /*  PRIOR */
3277 /****************************/
3278 IF p_next_version IS NOT NULL THEN
3279 IF OE_Globals.Equal(
3280        p_curr_rec.on_hold_flag,
3281        p_next_rec.on_hold_flag) THEN
3282     IF prior_exists = 'Y' THEN
3283     x_header_changed_attr_tbl(ind).next_value      := p_curr_rec.on_hold_flag;
3284     END IF;
3285 ELSE
3286     IF prior_exists = 'N' THEN
3287         ind := ind+1;
3288     END IF;
3289    x_header_changed_attr_tbl(ind).attribute_name := 'on_hold_flag';
3290    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.on_hold_flag;
3291    x_header_changed_attr_tbl(ind).current_value     := p_curr_rec.on_hold_flag;
3292    x_header_changed_attr_tbl(ind).next_value      := p_next_rec.on_hold_flag;
3293 END IF; /*  NEXT */
3294 END IF;
3295 
3296 /* END on_hold_flag*/
3297 /****************************/
3298 
3299 /****************************/
3300 /* START ENFORCE_PRICE_LIST_FLAG*/
3301 
3302 prior_exists := 'N';
3303 IF p_prior_version IS NOT NULL THEN
3304 IF OE_Globals.Equal(
3305        p_curr_rec.ENFORCE_PRICE_LIST_FLAG,
3306        p_prior_rec.ENFORCE_PRICE_LIST_FLAG) THEN
3307  null;
3308 ELSE
3309    ind := ind+1;
3310    prior_exists := 'Y';
3311    x_header_changed_attr_tbl(ind).attribute_name  := 'ENFORCE_PRICE_LIST_FLAG';
3312    x_header_changed_attr_tbl(ind).current_value      := p_curr_rec.ENFORCE_PRICE_LIST_FLAG;
3313    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.ENFORCE_PRICE_LIST_FLAG;
3314 END IF;
3315 END IF; /*  PRIOR */
3316 /****************************/
3317 IF p_next_version IS NOT NULL THEN
3318 IF OE_Globals.Equal(
3319        p_curr_rec.ENFORCE_PRICE_LIST_FLAG,
3320        p_next_rec.ENFORCE_PRICE_LIST_FLAG) THEN
3321     IF prior_exists = 'Y' THEN
3322      x_header_changed_attr_tbl(ind).next_value      := p_curr_rec.ENFORCE_PRICE_LIST_FLAG;
3323     END IF;
3324 ELSE
3325     IF prior_exists = 'N' THEN
3326         ind := ind+1;
3327     END IF;
3328    x_header_changed_attr_tbl(ind).attribute_name := 'ENFORCE_PRICE_LIST_FLAG';
3329    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.ENFORCE_PRICE_LIST_FLAG;
3330    x_header_changed_attr_tbl(ind).current_value     := p_curr_rec.ENFORCE_PRICE_LIST_FLAG;
3331    x_header_changed_attr_tbl(ind).next_value      := p_next_rec.ENFORCE_PRICE_LIST_FLAG;
3332 END IF; /*  NEXT */
3333 END IF;
3334 
3335 /* END ENFORCE_PRICE_LIST_FLAG*/
3336 /****************************/
3337 
3338 /****************************/
3339 /* START enforce_ship_to_flag*/
3340 
3341 prior_exists := 'N';
3342 IF p_prior_version IS NOT NULL THEN
3343 IF OE_Globals.Equal(
3344        p_curr_rec.enforce_ship_to_flag,
3345        p_prior_rec.enforce_ship_to_flag) THEN
3346  null;
3347 ELSE
3348    ind := ind+1;
3349    prior_exists := 'Y';
3350    x_header_changed_attr_tbl(ind).attribute_name  := 'enforce_ship_to_flag';
3351    x_header_changed_attr_tbl(ind).current_value      := p_curr_rec.enforce_ship_to_flag;
3352    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.enforce_ship_to_flag;
3353 END IF;
3354 END IF; /*  PRIOR */
3355 /****************************/
3356 IF p_next_version IS NOT NULL THEN
3357 IF OE_Globals.Equal(
3358        p_curr_rec.enforce_ship_to_flag,
3359        p_next_rec.enforce_ship_to_flag) THEN
3360     IF prior_exists = 'Y' THEN
3361     x_header_changed_attr_tbl(ind).next_value      := p_curr_rec.enforce_ship_to_flag;
3362     END IF;
3363 ELSE
3364     IF prior_exists = 'N' THEN
3365         ind := ind+1;
3366     END IF;
3367    x_header_changed_attr_tbl(ind).attribute_name := 'enforce_ship_to_flag';
3368    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.enforce_ship_to_flag;
3369    x_header_changed_attr_tbl(ind).current_value     := p_curr_rec.enforce_ship_to_flag;
3370    x_header_changed_attr_tbl(ind).next_value      := p_next_rec.enforce_ship_to_flag;
3371 END IF; /*  NEXT */
3372 END IF;
3373 
3374 /* END enforce_ship_to_flag*/
3375 /****************************/
3376 
3377 /****************************/
3378 /* START enforce_invoice_to_flag*/
3379 
3380 prior_exists := 'N';
3381 IF p_prior_version IS NOT NULL THEN
3382 IF OE_Globals.Equal(
3383        p_curr_rec.enforce_invoice_to_flag,
3384        p_prior_rec.enforce_invoice_to_flag) THEN
3385  null;
3386 ELSE
3387    ind := ind+1;
3388    prior_exists := 'Y';
3389    x_header_changed_attr_tbl(ind).attribute_name  := 'enforce_invoice_to_flag';
3390    x_header_changed_attr_tbl(ind).current_value      := p_curr_rec.enforce_invoice_to_flag;
3391    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.enforce_invoice_to_flag;
3392 END IF;
3393 END IF; /*  PRIOR */
3394 /****************************/
3395 IF p_next_version IS NOT NULL THEN
3396 IF OE_Globals.Equal(
3397        p_curr_rec.enforce_invoice_to_flag,
3398        p_next_rec.enforce_invoice_to_flag) THEN
3399     IF prior_exists = 'Y' THEN
3400    x_header_changed_attr_tbl(ind).next_value      := p_curr_rec.enforce_invoice_to_flag;
3401     END IF;
3402 ELSE
3403     IF prior_exists = 'N' THEN
3404         ind := ind+1;
3405     END IF;
3406    x_header_changed_attr_tbl(ind).attribute_name := 'enforce_invoice_to_flag';
3407    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.enforce_invoice_to_flag;
3408    x_header_changed_attr_tbl(ind).current_value     := p_curr_rec.enforce_invoice_to_flag;
3409    x_header_changed_attr_tbl(ind).next_value      := p_next_rec.enforce_invoice_to_flag;
3410 END IF; /*  NEXT */
3411 END IF;
3412 
3413 /* END enforce_invoice_to_flag*/
3414 /****************************/
3415 
3416 /****************************/
3417 /* START enforce_freight_term_flag*/
3418 
3419 prior_exists := 'N';
3420 IF p_prior_version IS NOT NULL THEN
3421 IF OE_Globals.Equal(
3422        p_curr_rec.enforce_freight_term_flag,
3423        p_prior_rec.enforce_freight_term_flag) THEN
3424  null;
3425 ELSE
3426    ind := ind+1;
3427    prior_exists := 'Y';
3428    x_header_changed_attr_tbl(ind).attribute_name  := 'enforce_freight_term_flag';
3429    x_header_changed_attr_tbl(ind).current_value      := p_curr_rec.enforce_freight_term_flag;
3430    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.enforce_freight_term_flag;
3431 END IF;
3432 END IF; /*  PRIOR */
3433 /****************************/
3434 IF p_next_version IS NOT NULL THEN
3435 IF OE_Globals.Equal(
3436        p_curr_rec.enforce_freight_term_flag,
3437        p_next_rec.enforce_freight_term_flag) THEN
3438     IF prior_exists = 'Y' THEN
3439    x_header_changed_attr_tbl(ind).next_value      := p_curr_rec.enforce_freight_term_flag;
3440     END IF;
3441 ELSE
3442     IF prior_exists = 'N' THEN
3443         ind := ind+1;
3444     END IF;
3445    x_header_changed_attr_tbl(ind).attribute_name := 'enforce_freight_term_flag';
3446    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.enforce_freight_term_flag;
3447    x_header_changed_attr_tbl(ind).current_value     := p_curr_rec.enforce_freight_term_flag;
3448    x_header_changed_attr_tbl(ind).next_value      := p_next_rec.enforce_freight_term_flag;
3449 END IF; /*  NEXT */
3450 END IF;
3451 
3452 /* END enforce_freight_term_flag*/
3453 /****************************/
3454 
3455 /****************************/
3456 /* START enforce_shipping_method_flag*/
3457 
3458 prior_exists := 'N';
3459 IF p_prior_version IS NOT NULL THEN
3460 IF OE_Globals.Equal(
3461        p_curr_rec.enforce_shipping_method_flag,
3462        p_prior_rec.enforce_shipping_method_flag) THEN
3463  null;
3464 ELSE
3465    ind := ind+1;
3466    prior_exists := 'Y';
3467    x_header_changed_attr_tbl(ind).attribute_name  := 'enforce_shipping_method_flag';
3468    x_header_changed_attr_tbl(ind).current_value      := p_curr_rec.enforce_shipping_method_flag;
3469    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.enforce_shipping_method_flag;
3470 END IF;
3471 END IF; /*  PRIOR */
3472 /****************************/
3473 IF p_next_version IS NOT NULL THEN
3474 IF OE_Globals.Equal(
3475        p_curr_rec.enforce_shipping_method_flag,
3476        p_next_rec.enforce_shipping_method_flag) THEN
3477     IF prior_exists = 'Y' THEN
3478    x_header_changed_attr_tbl(ind).next_value      := p_curr_rec.enforce_shipping_method_flag;
3479     END IF;
3480 ELSE
3481     IF prior_exists = 'N' THEN
3482         ind := ind+1;
3483     END IF;
3484    x_header_changed_attr_tbl(ind).attribute_name := 'enforce_shipping_method_flag';
3485    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.enforce_shipping_method_flag;
3486    x_header_changed_attr_tbl(ind).current_value     := p_curr_rec.enforce_shipping_method_flag;
3487    x_header_changed_attr_tbl(ind).next_value      := p_next_rec.enforce_shipping_method_flag;
3488 END IF; /*  NEXT */
3489 END IF;
3490 
3491 /* END enforce_shipping_method_flag*/
3492 /****************************/
3493 
3494 /****************************/
3495 /* START enforce_payment_term_flag*/
3496 
3497 prior_exists := 'N';
3498 IF p_prior_version IS NOT NULL THEN
3499 IF OE_Globals.Equal(
3500        p_curr_rec.enforce_payment_term_flag,
3501        p_prior_rec.enforce_payment_term_flag) THEN
3502  null;
3503 ELSE
3504    ind := ind+1;
3505    prior_exists := 'Y';
3506    x_header_changed_attr_tbl(ind).attribute_name  := 'enforce_payment_term_flag';
3507    x_header_changed_attr_tbl(ind).current_value      := p_curr_rec.enforce_payment_term_flag;
3508    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.enforce_payment_term_flag;
3509 END IF;
3510 END IF; /*  PRIOR */
3511 /****************************/
3512 IF p_next_version IS NOT NULL THEN
3513 IF OE_Globals.Equal(
3514        p_curr_rec.enforce_payment_term_flag,
3515        p_next_rec.enforce_payment_term_flag) THEN
3516     IF prior_exists = 'Y' THEN
3517    x_header_changed_attr_tbl(ind).next_value      := p_curr_rec.enforce_payment_term_flag;
3518     END IF;
3519 ELSE
3520     IF prior_exists = 'N' THEN
3521         ind := ind+1;
3522     END IF;
3523    x_header_changed_attr_tbl(ind).attribute_name := 'enforce_payment_term_flag';
3524    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.enforce_payment_term_flag;
3525    x_header_changed_attr_tbl(ind).current_value     := p_curr_rec.enforce_payment_term_flag;
3526    x_header_changed_attr_tbl(ind).next_value      := p_next_rec.enforce_payment_term_flag;
3527 END IF; /*  NEXT */
3528 END IF;
3529 
3530 /* END enforce_payment_term_flag*/
3531 /****************************/
3532 
3533 /****************************/
3534 /* START enforce_accounting_rule_flag*/
3535 
3536 prior_exists := 'N';
3537 IF p_prior_version IS NOT NULL THEN
3538 IF OE_Globals.Equal(
3539        p_curr_rec.enforce_accounting_rule_flag,
3540        p_prior_rec.enforce_accounting_rule_flag) THEN
3541  null;
3542 ELSE
3543    ind := ind+1;
3544    prior_exists := 'Y';
3545    x_header_changed_attr_tbl(ind).attribute_name  := 'enforce_accounting_rule_flag';
3546    x_header_changed_attr_tbl(ind).current_value      := p_curr_rec.enforce_accounting_rule_flag;
3547    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.enforce_accounting_rule_flag;
3548 END IF;
3549 END IF; /*  PRIOR */
3550 /****************************/
3551 IF p_next_version IS NOT NULL THEN
3552 IF OE_Globals.Equal(
3553        p_curr_rec.enforce_accounting_rule_flag,
3554        p_next_rec.enforce_accounting_rule_flag) THEN
3555     IF prior_exists = 'Y' THEN
3556    x_header_changed_attr_tbl(ind).next_value      := p_curr_rec.enforce_accounting_rule_flag;
3557     END IF;
3558 ELSE
3559     IF prior_exists = 'N' THEN
3560         ind := ind+1;
3561     END IF;
3562    x_header_changed_attr_tbl(ind).attribute_name := 'enforce_accounting_rule_flag';
3563    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.enforce_accounting_rule_flag;
3564    x_header_changed_attr_tbl(ind).current_value     := p_curr_rec.enforce_accounting_rule_flag;
3565    x_header_changed_attr_tbl(ind).next_value      := p_next_rec.enforce_accounting_rule_flag;
3566 END IF; /*  NEXT */
3567 END IF;
3568 
3569 /* END enforce_accounting_rule_flag*/
3570 /****************************/
3571 
3572 /****************************/
3573 /* START enforce_invoicing_rule_flag*/
3574 
3575 prior_exists := 'N';
3576 IF p_prior_version IS NOT NULL THEN
3577 IF OE_Globals.Equal(
3578        p_curr_rec.enforce_invoicing_rule_flag,
3579        p_prior_rec.enforce_invoicing_rule_flag) THEN
3580  null;
3581 ELSE
3582    ind := ind+1;
3583    prior_exists := 'Y';
3584    x_header_changed_attr_tbl(ind).attribute_name  := 'enforce_invoicing_rule_flag';
3585    x_header_changed_attr_tbl(ind).current_value      := p_curr_rec.enforce_invoicing_rule_flag;
3586    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.enforce_invoicing_rule_flag;
3587 END IF;
3588 END IF; /*  PRIOR */
3589 /****************************/
3590 IF p_next_version IS NOT NULL THEN
3591 IF OE_Globals.Equal(
3592        p_curr_rec.enforce_invoicing_rule_flag,
3593        p_next_rec.enforce_invoicing_rule_flag) THEN
3594     IF prior_exists = 'Y' THEN
3595    x_header_changed_attr_tbl(ind).next_value      := p_curr_rec.enforce_invoicing_rule_flag;
3596     END IF;
3597 ELSE
3598     IF prior_exists = 'N' THEN
3599         ind := ind+1;
3600     END IF;
3601    x_header_changed_attr_tbl(ind).attribute_name := 'enforce_invoicing_rule_flag';
3602    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.enforce_invoicing_rule_flag;
3603    x_header_changed_attr_tbl(ind).current_value     := p_curr_rec.enforce_invoicing_rule_flag;
3604    x_header_changed_attr_tbl(ind).next_value      := p_next_rec.enforce_invoicing_rule_flag;
3605 END IF; /*  NEXT */
3606 END IF;
3607 
3608 /* END enforce_invoicing_rule_flag*/
3609 /****************************/
3610 
3611 /****************************/
3612 /* START OVERRIDE_AMOUNT_FLAG*/
3613 
3614 prior_exists := 'N';
3615 IF p_prior_version IS NOT NULL THEN
3616 IF OE_Globals.Equal(
3617        p_curr_rec.OVERRIDE_AMOUNT_FLAG,
3618        p_prior_rec.OVERRIDE_AMOUNT_FLAG) THEN
3619  null;
3620 ELSE
3621    ind := ind+1;
3622    prior_exists := 'Y';
3623    x_header_changed_attr_tbl(ind).attribute_name  := 'OVERRIDE_AMOUNT_FLAG';
3624    x_header_changed_attr_tbl(ind).current_value      := p_curr_rec.OVERRIDE_AMOUNT_FLAG;
3625    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.OVERRIDE_AMOUNT_FLAG;
3626 END IF;
3627 END IF; /*  PRIOR */
3628 /****************************/
3629 IF p_next_version IS NOT NULL THEN
3630 IF OE_Globals.Equal(
3631        p_curr_rec.OVERRIDE_AMOUNT_FLAG,
3632        p_next_rec.OVERRIDE_AMOUNT_FLAG) THEN
3633     IF prior_exists = 'Y' THEN
3634    x_header_changed_attr_tbl(ind).next_value      := p_curr_rec.OVERRIDE_AMOUNT_FLAG;
3635     END IF;
3636 ELSE
3637     IF prior_exists = 'N' THEN
3638         ind := ind+1;
3639     END IF;
3640    x_header_changed_attr_tbl(ind).attribute_name := 'OVERRIDE_AMOUNT_FLAG';
3641    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.OVERRIDE_AMOUNT_FLAG;
3642    x_header_changed_attr_tbl(ind).current_value     := p_curr_rec.OVERRIDE_AMOUNT_FLAG;
3643    x_header_changed_attr_tbl(ind).next_value      := p_next_rec.OVERRIDE_AMOUNT_FLAG;
3644 END IF; /*  NEXT */
3645 END IF;
3646 
3647 /* END OVERRIDE_AMOUNT_FLAG*/
3648 /****************************/
3649 
3650 /****************************/
3651 /* START BLANKET_MAX_AMOUNT*/
3652 
3653 prior_exists := 'N';
3654 IF p_prior_version IS NOT NULL THEN
3655 IF OE_Globals.Equal(
3656        p_curr_rec.BLANKET_MAX_AMOUNT,
3657        p_prior_rec.BLANKET_MAX_AMOUNT) THEN
3658  null;
3659 ELSE
3660    ind := ind+1;
3661    prior_exists := 'Y';
3662    x_header_changed_attr_tbl(ind).attribute_name  := 'BLANKET_MAX_AMOUNT';
3663    x_header_changed_attr_tbl(ind).current_value      := p_curr_rec.BLANKET_MAX_AMOUNT;
3664    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.BLANKET_MAX_AMOUNT;
3665 END IF;
3666 END IF; /*  PRIOR */
3667 /****************************/
3668 IF p_next_version IS NOT NULL THEN
3669 IF OE_Globals.Equal(
3670        p_curr_rec.BLANKET_MAX_AMOUNT,
3671        p_next_rec.BLANKET_MAX_AMOUNT) THEN
3672     IF prior_exists = 'Y' THEN
3673    x_header_changed_attr_tbl(ind).next_value      := p_curr_rec.BLANKET_MAX_AMOUNT;
3674     END IF;
3675 ELSE
3676     IF prior_exists = 'N' THEN
3677         ind := ind+1;
3678     END IF;
3679    x_header_changed_attr_tbl(ind).attribute_name := 'BLANKET_MAX_AMOUNT';
3680    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.BLANKET_MAX_AMOUNT;
3681    x_header_changed_attr_tbl(ind).current_value     := p_curr_rec.BLANKET_MAX_AMOUNT;
3682    x_header_changed_attr_tbl(ind).next_value      := p_next_rec.BLANKET_MAX_AMOUNT;
3683 END IF; /*  NEXT */
3684 END IF;
3685 
3686 /* END BLANKET_MAX_AMOUNT*/
3687 /****************************/
3688 
3689 /****************************/
3690 /* START BLANKET_MIN_AMOUNT*/
3691 
3692 prior_exists := 'N';
3693 IF p_prior_version IS NOT NULL THEN
3694 IF OE_Globals.Equal(
3695        p_curr_rec.BLANKET_MIN_AMOUNT,
3696        p_prior_rec.BLANKET_MIN_AMOUNT) THEN
3697  null;
3698 ELSE
3699    ind := ind+1;
3700    prior_exists := 'Y';
3701    x_header_changed_attr_tbl(ind).attribute_name  := 'BLANKET_MIN_AMOUNT';
3702    x_header_changed_attr_tbl(ind).current_value      := p_curr_rec.BLANKET_MIN_AMOUNT;
3703    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.BLANKET_MIN_AMOUNT;
3704 END IF;
3705 END IF; /*  PRIOR */
3706 /****************************/
3707 IF p_next_version IS NOT NULL THEN
3708 IF OE_Globals.Equal(
3709        p_curr_rec.BLANKET_MIN_AMOUNT,
3710        p_next_rec.BLANKET_MIN_AMOUNT) THEN
3711     IF prior_exists = 'Y' THEN
3712    x_header_changed_attr_tbl(ind).next_value      := p_curr_rec.BLANKET_MIN_AMOUNT;
3713     END IF;
3714 ELSE
3715     IF prior_exists = 'N' THEN
3716         ind := ind+1;
3717     END IF;
3718    x_header_changed_attr_tbl(ind).attribute_name := 'BLANKET_MIN_AMOUNT';
3719    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.BLANKET_MIN_AMOUNT;
3720    x_header_changed_attr_tbl(ind).current_value     := p_curr_rec.BLANKET_MIN_AMOUNT;
3721    x_header_changed_attr_tbl(ind).next_value      := p_next_rec.BLANKET_MIN_AMOUNT;
3722 END IF; /*  NEXT */
3723 END IF;
3724 
3725 /* END BLANKET_MIN_AMOUNT*/
3726 /****************************/
3727 
3728 /****************************/
3729 /* START RELEASED_AMOUNT*/
3730 
3731 prior_exists := 'N';
3732 IF p_prior_version IS NOT NULL THEN
3733 IF OE_Globals.Equal(
3734        p_curr_rec.RELEASED_AMOUNT,
3735        p_prior_rec.RELEASED_AMOUNT) THEN
3736  null;
3737 ELSE
3738    ind := ind+1;
3739    prior_exists := 'Y';
3740    x_header_changed_attr_tbl(ind).attribute_name  := 'RELEASED_AMOUNT';
3741    x_header_changed_attr_tbl(ind).current_value      := p_curr_rec.RELEASED_AMOUNT;
3742    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.RELEASED_AMOUNT;
3743 END IF;
3744 END IF; /*  PRIOR */
3745 /****************************/
3746 IF p_next_version IS NOT NULL THEN
3747 IF OE_Globals.Equal(
3748        p_curr_rec.RELEASED_AMOUNT,
3749        p_next_rec.RELEASED_AMOUNT) THEN
3750     IF prior_exists = 'Y' THEN
3751    x_header_changed_attr_tbl(ind).next_value      := p_curr_rec.RELEASED_AMOUNT;
3752     END IF;
3753 ELSE
3754     IF prior_exists = 'N' THEN
3755         ind := ind+1;
3756     END IF;
3757    x_header_changed_attr_tbl(ind).attribute_name := 'RELEASED_AMOUNT';
3758    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.RELEASED_AMOUNT;
3759    x_header_changed_attr_tbl(ind).current_value     := p_curr_rec.RELEASED_AMOUNT;
3760    x_header_changed_attr_tbl(ind).next_value      := p_next_rec.RELEASED_AMOUNT;
3761 END IF; /*  NEXT */
3762 END IF;
3763 
3764 /* END RELEASED_AMOUNT*/
3765 /****************************/
3766 
3767 /****************************/
3768 /* START FULFILLED_AMOUNT*/
3769 
3770 prior_exists := 'N';
3771 IF p_prior_version IS NOT NULL THEN
3772 IF OE_Globals.Equal(
3773        p_curr_rec.FULFILLED_AMOUNT,
3774        p_prior_rec.FULFILLED_AMOUNT) THEN
3775  null;
3776 ELSE
3777    ind := ind+1;
3778    prior_exists := 'Y';
3779    x_header_changed_attr_tbl(ind).attribute_name  := 'FULFILLED_AMOUNT';
3780    x_header_changed_attr_tbl(ind).current_value      := p_curr_rec.FULFILLED_AMOUNT;
3781    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.FULFILLED_AMOUNT;
3782 END IF;
3783 END IF; /*  PRIOR */
3784 /****************************/
3785 IF p_next_version IS NOT NULL THEN
3786 IF OE_Globals.Equal(
3787        p_curr_rec.FULFILLED_AMOUNT,
3788        p_next_rec.FULFILLED_AMOUNT) THEN
3789     IF prior_exists = 'Y' THEN
3790    x_header_changed_attr_tbl(ind).next_value      := p_curr_rec.FULFILLED_AMOUNT;
3791     END IF;
3792 ELSE
3793     IF prior_exists = 'N' THEN
3794         ind := ind+1;
3795     END IF;
3796    x_header_changed_attr_tbl(ind).attribute_name := 'FULFILLED_AMOUNT';
3797    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.FULFILLED_AMOUNT;
3798    x_header_changed_attr_tbl(ind).current_value     := p_curr_rec.FULFILLED_AMOUNT;
3799    x_header_changed_attr_tbl(ind).next_value      := p_next_rec.FULFILLED_AMOUNT;
3800 END IF; /*  NEXT */
3801 END IF;
3802 
3803 /* END FULFILLED_AMOUNT*/
3804 /****************************/
3805 
3806 /****************************/
3807 /* START RETURNED_AMOUNT*/
3808 
3809 prior_exists := 'N';
3810 IF p_prior_version IS NOT NULL THEN
3811 IF OE_Globals.Equal(
3812        p_curr_rec.RETURNED_AMOUNT,
3813        p_prior_rec.RETURNED_AMOUNT) THEN
3814  null;
3815 ELSE
3816    ind := ind+1;
3817    prior_exists := 'Y';
3818    x_header_changed_attr_tbl(ind).attribute_name  := 'RETURNED_AMOUNT';
3819    x_header_changed_attr_tbl(ind).current_value      := p_curr_rec.RETURNED_AMOUNT;
3820    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.RETURNED_AMOUNT;
3821 END IF;
3822 END IF; /*  PRIOR */
3823 /****************************/
3824 IF p_next_version IS NOT NULL THEN
3825 IF OE_Globals.Equal(
3826        p_curr_rec.RETURNED_AMOUNT,
3827        p_next_rec.RETURNED_AMOUNT) THEN
3828     IF prior_exists = 'Y' THEN
3829    x_header_changed_attr_tbl(ind).next_value      := p_curr_rec.RETURNED_AMOUNT;
3830     END IF;
3831  null;
3832 ELSE
3833     IF prior_exists = 'N' THEN
3834         ind := ind+1;
3835     END IF;
3836    x_header_changed_attr_tbl(ind).attribute_name := 'RETURNED_AMOUNT';
3837    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.RETURNED_AMOUNT;
3838    x_header_changed_attr_tbl(ind).current_value     := p_curr_rec.RETURNED_AMOUNT;
3839    x_header_changed_attr_tbl(ind).next_value      := p_next_rec.RETURNED_AMOUNT;
3840 END IF; /*  NEXT */
3841 END IF;
3842 
3843 /* END RETURNED_AMOUNT*/
3844 /****************************/
3845 /****************************/
3846 /* START NEW_PRICE_LIST_ID*/
3847 
3848 prior_exists := 'N';
3849 IF p_prior_version IS NOT NULL THEN
3850 IF OE_Globals.Equal(
3851        p_curr_rec.NEW_PRICE_LIST_ID,
3852        p_prior_rec.NEW_PRICE_LIST_ID) THEN
3853  null;
3854 ELSE
3855    ind := ind+1;
3856    prior_exists := 'Y';
3857    x_header_changed_attr_tbl(ind).attribute_name  := 'NEW_PRICE_LIST_NAME';
3858    x_header_changed_attr_tbl(ind).current_id      := p_curr_rec.NEW_PRICE_LIST_ID;
3859    x_header_changed_attr_tbl(ind).current_value   := OE_ID_TO_VALUE.PRICE_LIST(p_curr_rec.NEW_PRICE_LIST_ID);
3860    x_header_changed_attr_tbl(ind).prior_id        := p_prior_rec.NEW_PRICE_LIST_ID;
3861    x_header_changed_attr_tbl(ind).prior_value     := OE_ID_TO_VALUE.PRICE_LIST(p_prior_rec.NEW_PRICE_LIST_ID);
3862 END IF;
3863 END IF; /*  PRIOR */
3864 /****************************/
3865 IF p_next_version IS NOT NULL THEN
3866 IF OE_Globals.Equal(
3867        p_curr_rec.NEW_PRICE_LIST_ID,
3868        p_next_rec.NEW_PRICE_LIST_ID) THEN
3869     IF prior_exists = 'Y' THEN
3870    x_header_changed_attr_tbl(ind).next_value   := OE_ID_TO_VALUE.PRICE_LIST(p_curr_rec.NEW_PRICE_LIST_ID);
3871     END IF;
3872 ELSE
3873     IF prior_exists = 'N' THEN
3874         ind := ind+1;
3875     END IF;
3876    x_header_changed_attr_tbl(ind).attribute_name := 'NEW_PRICE_LIST_NAME';
3877    x_header_changed_attr_tbl(ind).prior_id        := p_prior_rec.NEW_PRICE_LIST_ID;
3878    x_header_changed_attr_tbl(ind).prior_value     := OE_ID_TO_VALUE.PRICE_LIST(p_prior_rec.NEW_PRICE_LIST_ID);
3879    x_header_changed_attr_tbl(ind).current_id     := p_curr_rec.NEW_PRICE_LIST_ID;
3880    x_header_changed_attr_tbl(ind).current_value  := OE_ID_TO_VALUE.PRICE_LIST(p_curr_rec.NEW_PRICE_LIST_ID);
3881    x_header_changed_attr_tbl(ind).next_id      := p_next_rec.NEW_PRICE_LIST_ID;
3882    x_header_changed_attr_tbl(ind).next_value   := OE_ID_TO_VALUE.PRICE_LIST(p_next_rec.NEW_PRICE_LIST_ID);
3883 END IF; /*  NEXT */
3884 END IF;
3885 
3886 /* END NEW_PRICE_LIST_ID*/
3887 /****************************/
3888 
3889 /****************************/
3890 /* START NEW_MODIFIER_LIST_ID*/
3891 
3892 prior_exists := 'N';
3893 IF p_prior_version IS NOT NULL THEN
3894 IF OE_Globals.Equal(
3895        p_curr_rec.NEW_MODIFIER_LIST_ID,
3896        p_prior_rec.NEW_MODIFIER_LIST_ID) THEN
3897  null;
3898 ELSE
3899    ind := ind+1;
3900    prior_exists := 'Y';
3901    x_header_changed_attr_tbl(ind).attribute_name  := 'NEW_MODIFIER_LIST_NAME';
3902    x_header_changed_attr_tbl(ind).current_id      := p_curr_rec.NEW_MODIFIER_LIST_ID;
3903    x_header_changed_attr_tbl(ind).current_value   := OE_ID_TO_VALUE.NEW_MODIFIER_LIST(p_curr_rec.NEW_MODIFIER_LIST_ID);
3904    x_header_changed_attr_tbl(ind).prior_id        := p_prior_rec.NEW_MODIFIER_LIST_ID;
3905    x_header_changed_attr_tbl(ind).prior_value     := OE_ID_TO_VALUE.NEW_MODIFIER_LIST(p_prior_rec.NEW_MODIFIER_LIST_ID);
3906 END IF;
3907 END IF; /*  PRIOR */
3908 /****************************/
3909 IF p_next_version IS NOT NULL THEN
3910 IF OE_Globals.Equal(
3911        p_curr_rec.NEW_MODIFIER_LIST_ID,
3912        p_next_rec.NEW_MODIFIER_LIST_ID) THEN
3913     IF prior_exists = 'Y' THEN
3914    x_header_changed_attr_tbl(ind).next_value   := OE_ID_TO_VALUE.NEW_MODIFIER_LIST(p_curr_rec.NEW_MODIFIER_LIST_ID);
3915     END IF;
3916 ELSE
3917     IF prior_exists = 'N' THEN
3918         ind := ind+1;
3919     END IF;
3920    x_header_changed_attr_tbl(ind).attribute_name := 'NEW_MODIFIER_LIST_NAME';
3921    x_header_changed_attr_tbl(ind).prior_id        := p_prior_rec.NEW_MODIFIER_LIST_ID;
3922    x_header_changed_attr_tbl(ind).prior_value     := OE_ID_TO_VALUE.NEW_MODIFIER_LIST(p_prior_rec.NEW_MODIFIER_LIST_ID);
3923    x_header_changed_attr_tbl(ind).current_id     := p_curr_rec.NEW_MODIFIER_LIST_ID;
3924    x_header_changed_attr_tbl(ind).current_value  := OE_ID_TO_VALUE.NEW_MODIFIER_LIST(p_curr_rec.NEW_MODIFIER_LIST_ID);
3925    x_header_changed_attr_tbl(ind).next_id      := p_next_rec.NEW_MODIFIER_LIST_ID;
3926    x_header_changed_attr_tbl(ind).next_value   := OE_ID_TO_VALUE.NEW_MODIFIER_LIST(p_next_rec.NEW_MODIFIER_LIST_ID);
3927 END IF; /*  NEXT */
3928 END IF;
3929 
3930 /* END NEW_MODIFIER_LIST_ID*/
3931 /****************************/
3932 
3933 /****************************/
3934 /* START default_discount_percent*/
3935 
3936 prior_exists := 'N';
3937 IF p_prior_version IS NOT NULL THEN
3938 IF OE_Globals.Equal(
3939        p_curr_rec.default_discount_percent,
3940        p_prior_rec.default_discount_percent) THEN
3941  null;
3942 ELSE
3943    ind := ind+1;
3944    prior_exists := 'Y';
3945    x_header_changed_attr_tbl(ind).attribute_name  := 'default_discount_percent';
3946    x_header_changed_attr_tbl(ind).current_value      := p_curr_rec.default_discount_percent;
3947    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.default_discount_percent;
3948 END IF;
3949 END IF; /*  PRIOR */
3950 /****************************/
3951 IF p_next_version IS NOT NULL THEN
3952 IF OE_Globals.Equal(
3953        p_curr_rec.default_discount_percent,
3954        p_next_rec.default_discount_percent) THEN
3955     IF prior_exists = 'Y' THEN
3956    x_header_changed_attr_tbl(ind).next_value      := p_curr_rec.default_discount_percent;
3957     END IF;
3958 ELSE
3959     IF prior_exists = 'N' THEN
3960         ind := ind+1;
3961     END IF;
3962    x_header_changed_attr_tbl(ind).attribute_name := 'default_discount_percent';
3963    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.default_discount_percent;
3964    x_header_changed_attr_tbl(ind).current_value     := p_curr_rec.default_discount_percent;
3965    x_header_changed_attr_tbl(ind).next_value      := p_next_rec.default_discount_percent;
3966 END IF; /*  NEXT */
3967 END IF;
3968 
3969 /* END default_discount_percent*/
3970 /****************************/
3971 
3972 /****************************/
3973 /* START default_discount_amount*/
3974 
3975 prior_exists := 'N';
3976 IF p_prior_version IS NOT NULL THEN
3977 IF OE_Globals.Equal(
3978        p_curr_rec.default_discount_amount,
3979        p_prior_rec.default_discount_amount) THEN
3980  null;
3981 ELSE
3982    ind := ind+1;
3983    prior_exists := 'Y';
3984    x_header_changed_attr_tbl(ind).attribute_name  := 'default_discount_amount';
3985    x_header_changed_attr_tbl(ind).current_value      := p_curr_rec.default_discount_amount;
3986    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.default_discount_amount;
3987 END IF;
3988 END IF; /*  PRIOR */
3989 /****************************/
3990 IF p_next_version IS NOT NULL THEN
3991 IF OE_Globals.Equal(
3992        p_curr_rec.default_discount_amount,
3993        p_next_rec.default_discount_amount) THEN
3994     IF prior_exists = 'Y' THEN
3995    x_header_changed_attr_tbl(ind).next_value      := p_curr_rec.default_discount_amount;
3996     END IF;
3997 ELSE
3998     IF prior_exists = 'N' THEN
3999         ind := ind+1;
4000     END IF;
4001    x_header_changed_attr_tbl(ind).attribute_name := 'default_discount_amount';
4002    x_header_changed_attr_tbl(ind).prior_value        := p_prior_rec.default_discount_amount;
4003    x_header_changed_attr_tbl(ind).current_value     := p_curr_rec.default_discount_amount;
4004    x_header_changed_attr_tbl(ind).next_value      := p_next_rec.default_discount_amount;
4005 END IF; /*  NEXT */
4006 END IF;
4007 
4008 /* END default_discount_amount*/
4009 /****************************/
4010 ELSE
4011 NULL;
4012 END IF;
4013 /*
4014 j := 0;
4015 dbms_output.put_line('No of records'||x_header_changed_attr_tbl.count);
4016 WHILE j < x_header_changed_attr_tbl.count
4017 LOOP
4018 j:=j+1;
4019 dbms_output.put_line('attribute value '||x_header_changed_attr_tbl(j).attribute_name ||
4020 ||' Prior '||x_header_changed_attr_tbl(j).prior_value||
4021 ||' Current '||x_header_changed_attr_tbl(j).current_value ||
4022 || ' Next '||x_header_changed_attr_tbl(j).next_value);
4023 END LOOP;
4024 */
4025 IF l_debug_level > 0 THEN
4026   oe_debug_pub.add('******AFTER COMPARING HEADER ATTRIBUTES*************');
4027   oe_debug_pub.add('current ind '|| ind);
4028 END IF;
4029 END COMPARE_HEADER_VERSIONS;
4030 
4031 PROCEDURE QUERY_LINE_ROW
4032 (p_header_id	                  NUMBER,
4033  p_line_id	                  NUMBER,
4034  p_version	                  NUMBER,
4035  p_phase_change_flag              VARCHAR2,
4036  x_line_rec	                  IN OUT NOCOPY OE_Blanket_PUB.line_rec_type)
4037 IS
4038 l_org_id                NUMBER;
4039 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
4040 BEGIN
4041 IF l_debug_level > 0 THEN
4042   oe_debug_pub.add('Entering OE_VERSION_BLANKET_COMP.QUERY_LINE_ROW');
4043   oe_debug_pub.add('header' ||p_header_id);
4044   oe_debug_pub.add('version' ||p_version);
4045   oe_debug_pub.add('phase_change_lfag' ||p_phase_change_flag);
4046 END IF;
4047 
4048     l_org_id := OE_GLOBALS.G_ORG_ID;
4049 
4050     IF l_org_id IS NULL THEN
4051       OE_GLOBALS.Set_Context;
4052       l_org_id := OE_GLOBALS.G_ORG_ID;
4053     END IF;
4054 
4055     SELECT  ACCOUNTING_RULE_ID
4056     ,       AGREEMENT_ID
4057     ,       ATTRIBUTE1
4058     ,       ATTRIBUTE10
4059     ,       ATTRIBUTE11
4060     ,       ATTRIBUTE12
4061     ,       ATTRIBUTE13
4062     ,       ATTRIBUTE14
4063     ,       ATTRIBUTE15
4064     ,       ATTRIBUTE2
4065     ,       ATTRIBUTE3
4066     ,       ATTRIBUTE4
4067     ,       ATTRIBUTE5
4068     ,       ATTRIBUTE6
4069     ,       ATTRIBUTE7
4070     ,       ATTRIBUTE8
4071     ,       ATTRIBUTE9
4072     ,       CONTEXT
4073     ,       CREATED_BY
4074     ,       CREATION_DATE
4075     ,       CUST_PO_NUMBER
4076     ,       DELIVER_TO_ORG_ID
4077     ,       FREIGHT_TERMS_CODE
4078     ,       header_id
4079     ,       min_release_quantity
4080     ,       max_release_quantity
4081     ,       inventory_item_id
4082     ,       INVOICE_TO_ORG_ID
4083     ,       INVOICING_RULE_ID
4084     ,       ORDERED_ITEM_ID
4085     ,       item_identifier_type
4086     ,       ORDERED_ITEM
4087     ,       ITEM_TYPE_CODE
4088     ,       LAST_UPDATED_BY
4089     ,       LAST_UPDATE_DATE
4090     ,       LAST_UPDATE_LOGIN
4091     ,       line_id
4092     ,       line_number
4093     ,       PAYMENT_TERM_ID
4094     ,       PREFERRED_GRADE
4095     ,       PRICE_LIST_ID
4096     ,       PROGRAM_APPLICATION_ID
4097     ,       PROGRAM_ID
4098     ,       PROGRAM_UPDATE_DATE
4099     ,       REQUEST_ID
4100     ,       SALESREP_ID
4101     ,       SHIPPING_METHOD_CODE
4102     ,       ship_from_org_id
4103     ,       SHIP_TO_ORG_ID
4104     ,       SHIPPING_INSTRUCTIONS
4105     ,       PACKING_INSTRUCTIONS
4106     ,       START_DATE_ACTIVE
4107     ,       END_DATE_ACTIVE
4108     ,       MAX_RELEASE_AMOUNT
4109     ,       MIN_RELEASE_AMOUNT
4110     ,       BLANKET_LINE_MAX_AMOUNT
4111     ,       BLANKET_LINE_MIN_AMOUNT
4112     ,       BLANKET_MAX_QUANTITY
4113     ,       BLANKET_MIN_QUANTITY
4114     ,       OVERRIDE_BLANKET_CONTROLS_FLAG
4115     ,       OVERRIDE_RELEASE_CONTROLS_FLAG
4116     ,       ENFORCE_PRICE_LIST_FLAG
4117     ,       enforce_ship_to_flag
4118     ,       enforce_invoice_to_flag
4119     ,       enforce_freight_term_flag
4120     ,       enforce_shipping_method_flag
4121     ,       enforce_payment_term_flag
4122     ,       enforce_accounting_rule_flag
4123     ,       enforce_invoicing_rule_flag
4124     ,       ORDER_QUANTITY_UOM
4125     ,       RELEASED_QUANTITY
4126     ,       FULFILLED_QUANTITY
4127     ,       RETURNED_QUANTITY
4128     ,       ORDER_NUMBER
4129     ,       RELEASED_AMOUNT
4130     ,       FULFILLED_AMOUNT
4131     ,       RETURNED_AMOUNT
4132     ,       TRANSACTION_PHASE_CODE
4133     ,       source_document_version_number
4134     ,       modifier_list_line_id
4135    INTO
4136     x_line_rec.ACCOUNTING_RULE_ID
4137     ,x_line_rec.AGREEMENT_ID
4138     ,x_line_rec.ATTRIBUTE1
4139     ,x_line_rec.ATTRIBUTE10
4140     ,x_line_rec.ATTRIBUTE11
4141     ,x_line_rec.ATTRIBUTE12
4142     ,x_line_rec.ATTRIBUTE13
4143     ,x_line_rec.ATTRIBUTE14
4144     ,x_line_rec.ATTRIBUTE15
4145     ,x_line_rec.ATTRIBUTE2
4146     ,x_line_rec.ATTRIBUTE3
4147     ,x_line_rec.ATTRIBUTE4
4148     ,x_line_rec.ATTRIBUTE5
4149     ,x_line_rec.ATTRIBUTE6
4150     ,x_line_rec.ATTRIBUTE7
4151     ,x_line_rec.ATTRIBUTE8
4152     ,x_line_rec.ATTRIBUTE9
4153     ,x_line_rec.CONTEXT
4154     ,x_line_rec.CREATED_BY
4155     ,x_line_rec.CREATION_DATE
4156     ,x_line_rec.CUST_PO_NUMBER
4157     ,x_line_rec.DELIVER_TO_ORG_ID
4158     ,x_line_rec.FREIGHT_TERMS_CODE
4159     ,x_line_rec.header_id
4160     ,x_line_rec.min_release_quantity
4161     ,x_line_rec.max_release_quantity
4162     ,x_line_rec.inventory_item_id
4163     ,x_line_rec.INVOICE_TO_ORG_ID
4164     ,x_line_rec.INVOICING_RULE_ID
4165     ,x_line_rec.ORDERED_ITEM_ID
4166     ,x_line_rec.item_identifier_type
4167     ,x_line_rec.ORDERED_ITEM
4168     ,x_line_rec.ITEM_TYPE_CODE
4169     ,x_line_rec.LAST_UPDATED_BY
4170     ,x_line_rec.LAST_UPDATE_DATE
4171     ,x_line_rec.LAST_UPDATE_LOGIN
4172     ,x_line_rec.line_id
4173     ,x_line_rec.line_number
4174     ,x_line_rec.PAYMENT_TERM_ID
4175     ,x_line_rec.PREFERRED_GRADE
4176     ,x_line_rec.PRICE_LIST_ID
4177     ,x_line_rec.PROGRAM_APPLICATION_ID
4178     ,x_line_rec.PROGRAM_ID
4179     ,x_line_rec.PROGRAM_UPDATE_DATE
4180     ,x_line_rec.REQUEST_ID
4181     ,x_line_rec.SALESREP_ID
4182     ,x_line_rec.SHIPPING_METHOD_CODE
4183     ,x_line_rec.ship_from_org_id
4184     ,x_line_rec.SHIP_TO_ORG_ID
4185     ,x_line_rec.SHIPPING_INSTRUCTIONS
4186     ,x_line_rec.PACKING_INSTRUCTIONS
4187     ,x_line_rec.START_DATE_ACTIVE
4188     ,x_line_rec.END_DATE_ACTIVE
4189     ,x_line_rec.MAX_RELEASE_AMOUNT
4190     ,x_line_rec.MIN_RELEASE_AMOUNT
4191     ,x_line_rec.BLANKET_MAX_AMOUNT
4192     ,x_line_rec.BLANKET_MIN_AMOUNT
4193     ,x_line_rec.BLANKET_MAX_QUANTITY
4194     ,x_line_rec.BLANKET_MIN_QUANTITY
4195     ,x_line_rec.OVERRIDE_BLANKET_CONTROLS_FLAG
4196     ,x_line_rec.OVERRIDE_RELEASE_CONTROLS_FLAG
4197     ,x_line_rec.ENFORCE_PRICE_LIST_FLAG
4198     ,x_line_rec.enforce_ship_to_flag
4199     ,x_line_rec.enforce_invoice_to_flag
4200     ,x_line_rec.enforce_freight_term_flag
4201     ,x_line_rec.enforce_shipping_method_flag
4202     ,x_line_rec.enforce_payment_term_flag
4203     ,x_line_rec.enforce_accounting_rule_flag
4204     ,x_line_rec.enforce_invoicing_rule_flag
4205     ,x_line_rec.ORDER_QUANTITY_UOM
4206     ,x_line_rec.RELEASED_QUANTITY
4207     ,x_line_rec.FULFILLED_QUANTITY
4208     ,x_line_rec.RETURNED_QUANTITY
4209     ,x_line_rec.ORDER_NUMBER
4210     ,x_line_rec.RELEASED_AMOUNT
4211     ,x_line_rec.FULFILLED_AMOUNT
4212     ,x_line_rec.RETURNED_AMOUNT
4213     ,x_line_rec.TRANSACTION_PHASE_CODE
4214     ,x_line_rec.source_document_version_number
4215    ,x_line_rec.modifier_list_line_id
4216     FROM    OE_BLANKET_LINES_HIST
4217     WHERE
4218             line_id = p_line_id
4219       AND   header_id = p_header_id
4220       AND   version_number = p_version
4221       AND   sales_document_type_code = 'B'
4222      AND    (PHASE_CHANGE_FLAG = p_phase_change_flag
4223      OR     (nvl(p_phase_change_flag, 'NULL') <> 'Y'
4224      AND     VERSION_FLAG = 'Y'));
4225 EXCEPTION
4226     WHEN NO_DATA_FOUND THEN
4227 	NULL;
4228     WHEN OTHERS THEN
4229 
4230         IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
4231         THEN
4232             OE_MSG_PUB.Add_Exc_Msg
4233             (   G_PKG_NAME,
4234                'Query_Line_Row'
4235             );
4236         END IF;
4237 
4238         RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
4239 
4240 END QUERY_LINE_ROW;
4241 
4242 PROCEDURE QUERY_LINE_TRANS_ROW
4243 (p_header_id	                  NUMBER,
4244  p_line_id	                  NUMBER,
4245  p_version	                  NUMBER,
4246  x_line_rec	                  IN OUT NOCOPY OE_Blanket_PUB.line_rec_type)
4247 IS
4248 l_org_id                NUMBER;
4249 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
4250 BEGIN
4251 IF l_debug_level > 0 THEN
4252   oe_debug_pub.add('Entering OE_VERSION_BLANKET_COMP.QUERY_LINE_TRANS_ROW', 1);
4253   oe_debug_pub.add('header' ||p_header_id);
4254   oe_debug_pub.add('version' ||p_version);
4255 END IF;
4256 
4257     l_org_id := OE_GLOBALS.G_ORG_ID;
4258 
4259     IF l_org_id IS NULL THEN
4260       OE_GLOBALS.Set_Context;
4261       l_org_id := OE_GLOBALS.G_ORG_ID;
4262     END IF;
4263 
4264     SELECT  ACCOUNTING_RULE_ID
4265     ,       AGREEMENT_ID
4266     ,       ATTRIBUTE1
4267     ,       ATTRIBUTE10
4268     ,       ATTRIBUTE11
4269     ,       ATTRIBUTE12
4270     ,       ATTRIBUTE13
4271     ,       ATTRIBUTE14
4272     ,       ATTRIBUTE15
4273     ,       ATTRIBUTE2
4274     ,       ATTRIBUTE3
4275     ,       ATTRIBUTE4
4276     ,       ATTRIBUTE5
4277     ,       ATTRIBUTE6
4278     ,       ATTRIBUTE7
4279     ,       ATTRIBUTE8
4280     ,       ATTRIBUTE9
4281     ,       CONTEXT
4282     ,       CREATED_BY
4283     ,       CREATION_DATE
4284     ,       CUST_PO_NUMBER
4285     ,       DELIVER_TO_ORG_ID
4286     ,       FREIGHT_TERMS_CODE
4287     ,       header_id
4288     ,       min_release_quantity
4289     ,       max_release_quantity
4290     ,       inventory_item_id
4291     ,       INVOICE_TO_ORG_ID
4292     ,       INVOICING_RULE_ID
4293     ,       ORDERED_ITEM_ID
4294     ,       item_identifier_type
4295     ,       ORDERED_ITEM
4296     ,       ITEM_TYPE_CODE
4297     ,       LAST_UPDATED_BY
4298     ,       LAST_UPDATE_DATE
4299     ,       LAST_UPDATE_LOGIN
4300     ,       bl.line_id
4301     ,       bl.line_number
4302     ,       PAYMENT_TERM_ID
4303     ,       PREFERRED_GRADE
4304     ,       PRICE_LIST_ID
4305     ,       PROGRAM_APPLICATION_ID
4306     ,       PROGRAM_ID
4307     ,       PROGRAM_UPDATE_DATE
4308     ,       REQUEST_ID
4309     ,       SALESREP_ID
4310     ,       SHIPPING_METHOD_CODE
4311     ,       ship_from_org_id
4312     ,       SHIP_TO_ORG_ID
4313     ,       SHIPPING_INSTRUCTIONS
4314     ,       PACKING_INSTRUCTIONS
4315     ,       START_DATE_ACTIVE
4316     ,       END_DATE_ACTIVE
4317     ,       MAX_RELEASE_AMOUNT
4318     ,       MIN_RELEASE_AMOUNT
4319     ,       BLANKET_LINE_MAX_AMOUNT
4320     ,       BLANKET_LINE_MIN_AMOUNT
4321     ,       BLANKET_MAX_QUANTITY
4322     ,       BLANKET_MIN_QUANTITY
4323     ,       OVERRIDE_BLANKET_CONTROLS_FLAG
4324     ,       OVERRIDE_RELEASE_CONTROLS_FLAG
4325     ,       ENFORCE_PRICE_LIST_FLAG
4326     ,       enforce_ship_to_flag
4327     ,       enforce_invoice_to_flag
4328     ,       enforce_freight_term_flag
4329     ,       enforce_shipping_method_flag
4330     ,       enforce_payment_term_flag
4331     ,       enforce_accounting_rule_flag
4332     ,       enforce_invoicing_rule_flag
4333     ,       ORDER_QUANTITY_UOM
4334     ,       RELEASED_QUANTITY
4335     ,       blx.FULFILLED_QUANTITY
4336     ,       RETURNED_QUANTITY
4337     ,       ORDER_NUMBER
4338     ,       RELEASED_AMOUNT
4339     ,       FULFILLED_AMOUNT
4340     ,       RETURNED_AMOUNT
4341     ,       TRANSACTION_PHASE_CODE
4342     ,       source_document_version_number
4343     ,       modifier_list_line_id
4344    INTO
4345     x_line_rec.ACCOUNTING_RULE_ID
4346     ,x_line_rec.AGREEMENT_ID
4347     ,x_line_rec.ATTRIBUTE1
4348     ,x_line_rec.ATTRIBUTE10
4349     ,x_line_rec.ATTRIBUTE11
4350     ,x_line_rec.ATTRIBUTE12
4351     ,x_line_rec.ATTRIBUTE13
4352     ,x_line_rec.ATTRIBUTE14
4353     ,x_line_rec.ATTRIBUTE15
4354     ,x_line_rec.ATTRIBUTE2
4355     ,x_line_rec.ATTRIBUTE3
4356     ,x_line_rec.ATTRIBUTE4
4357     ,x_line_rec.ATTRIBUTE5
4358     ,x_line_rec.ATTRIBUTE6
4359     ,x_line_rec.ATTRIBUTE7
4360     ,x_line_rec.ATTRIBUTE8
4361     ,x_line_rec.ATTRIBUTE9
4362     ,x_line_rec.CONTEXT
4363     ,x_line_rec.CREATED_BY
4364     ,x_line_rec.CREATION_DATE
4365     ,x_line_rec.CUST_PO_NUMBER
4366     ,x_line_rec.DELIVER_TO_ORG_ID
4367     ,x_line_rec.FREIGHT_TERMS_CODE
4368     ,x_line_rec.header_id
4369     ,x_line_rec.min_release_quantity
4370     ,x_line_rec.max_release_quantity
4371     ,x_line_rec.inventory_item_id
4372     ,x_line_rec.INVOICE_TO_ORG_ID
4373     ,x_line_rec.INVOICING_RULE_ID
4374     ,x_line_rec.ORDERED_ITEM_ID
4375     ,x_line_rec.item_identifier_type
4376     ,x_line_rec.ORDERED_ITEM
4377     ,x_line_rec.ITEM_TYPE_CODE
4378     ,x_line_rec.LAST_UPDATED_BY
4379     ,x_line_rec.LAST_UPDATE_DATE
4380     ,x_line_rec.LAST_UPDATE_LOGIN
4381     ,x_line_rec.line_id
4382     ,x_line_rec.line_number
4383     ,x_line_rec.PAYMENT_TERM_ID
4384     ,x_line_rec.PREFERRED_GRADE
4385     ,x_line_rec.PRICE_LIST_ID
4386     ,x_line_rec.PROGRAM_APPLICATION_ID
4387     ,x_line_rec.PROGRAM_ID
4388     ,x_line_rec.PROGRAM_UPDATE_DATE
4389     ,x_line_rec.REQUEST_ID
4390     ,x_line_rec.SALESREP_ID
4391     ,x_line_rec.SHIPPING_METHOD_CODE
4392     ,x_line_rec.ship_from_org_id
4393     ,x_line_rec.SHIP_TO_ORG_ID
4394     ,x_line_rec.SHIPPING_INSTRUCTIONS
4395     ,x_line_rec.PACKING_INSTRUCTIONS
4396     ,x_line_rec.START_DATE_ACTIVE
4397     ,x_line_rec.END_DATE_ACTIVE
4398     ,x_line_rec.MAX_RELEASE_AMOUNT
4399     ,x_line_rec.MIN_RELEASE_AMOUNT
4400     ,x_line_rec.BLANKET_MAX_AMOUNT
4401     ,x_line_rec.BLANKET_MIN_AMOUNT
4402     ,x_line_rec.BLANKET_MAX_QUANTITY
4403     ,x_line_rec.BLANKET_MIN_QUANTITY
4404     ,x_line_rec.OVERRIDE_BLANKET_CONTROLS_FLAG
4405     ,x_line_rec.OVERRIDE_RELEASE_CONTROLS_FLAG
4406     ,x_line_rec.ENFORCE_PRICE_LIST_FLAG
4407     ,x_line_rec.enforce_ship_to_flag
4408     ,x_line_rec.enforce_invoice_to_flag
4409     ,x_line_rec.enforce_freight_term_flag
4410     ,x_line_rec.enforce_shipping_method_flag
4411     ,x_line_rec.enforce_payment_term_flag
4412     ,x_line_rec.enforce_accounting_rule_flag
4413     ,x_line_rec.enforce_invoicing_rule_flag
4414     ,x_line_rec.ORDER_QUANTITY_UOM
4415     ,x_line_rec.RELEASED_QUANTITY
4416     ,x_line_rec.FULFILLED_QUANTITY
4417     ,x_line_rec.RETURNED_QUANTITY
4418     ,x_line_rec.ORDER_NUMBER
4419     ,x_line_rec.RELEASED_AMOUNT
4420     ,x_line_rec.FULFILLED_AMOUNT
4421     ,x_line_rec.RETURNED_AMOUNT
4422     ,x_line_rec.TRANSACTION_PHASE_CODE
4423     ,x_line_rec.source_document_version_number
4424     ,x_line_rec.modifier_list_line_id
4425     FROM    OE_BLANKET_LINES bl , OE_BLANKET_LINES_EXT blx
4426     WHERE
4427             bl.line_id = p_line_id
4428       AND   header_id = p_header_id
4429       AND   bl.line_id = blx.line_id
4430       AND   bl.sales_document_type_code = 'B';
4431 EXCEPTION
4432     WHEN NO_DATA_FOUND THEN
4433 	NULL;
4434     WHEN OTHERS THEN
4435 
4436         IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
4437         THEN
4438             OE_MSG_PUB.Add_Exc_Msg
4439             (   G_PKG_NAME,
4440                'Query_Line_TRANS_Row'
4441             );
4442         END IF;
4443 
4444         RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
4445 
4446 END QUERY_LINE_TRANS_ROW;
4447 
4448 PROCEDURE COMPARE_ATTRIBUTES
4449 (p_header_id	                  NUMBER,
4450  p_line_id	                  NUMBER,
4451  p_prior_version                  NUMBER,
4452  p_current_version                NUMBER,
4453  p_next_version                   NUMBER,
4454  g_max_version                    NUMBER,
4455  g_trans_version                  NUMBER,
4456  g_prior_phase_change_flag        VARCHAR2,
4457  g_curr_phase_change_flag         VARCHAR2,
4458  g_next_phase_change_flag         VARCHAR2,
4459  x_line_changed_attr_tbl        IN OUT NOCOPY OE_VERSION_BLANKET_COMP.line_tbl_type,
4460  p_total_lines                    NUMBER,
4461  x_line_number                    NUMBER)
4462 IS
4463 p_curr_rec                      OE_Blanket_PUB.line_rec_type;
4464 p_next_rec                      OE_Blanket_PUB.line_rec_type;
4465 p_prior_rec                     OE_Blanket_PUB.line_rec_type;
4466 
4467 
4468 prior_exists VARCHAR2(1) := 'N';
4469 j NUMBER;
4470 l_line_id NUMBER;
4471 x_deliver_to_address1          VARCHAR2(240);
4472 x_deliver_to_address2          VARCHAR2(240);
4473 x_deliver_to_address3          VARCHAR2(240);
4474 x_deliver_to_address4          VARCHAR2(240);
4475 x_deliver_to_location          VARCHAR2(240);
4476 x_deliver_to_org               VARCHAR2(240);
4477 x_deliver_to_city              VARCHAR2(240);
4478 x_deliver_to_state             VARCHAR2(240);
4479 x_deliver_to_postal_code       VARCHAR2(240);
4480 x_deliver_to_country           VARCHAR2(240);
4481 x_prior_deliver_to_address           VARCHAR2(2000);
4482 x_current_deliver_to_address           VARCHAR2(2000);
4483 x_next_deliver_to_address           VARCHAR2(2000);
4484 x_invoice_to_address1          VARCHAR2(240);
4485 x_invoice_to_address2          VARCHAR2(240);
4486 x_invoice_to_address3          VARCHAR2(240);
4487 x_invoice_to_address4          VARCHAR2(240);
4488 x_invoice_to_location          VARCHAR2(240);
4489 x_invoice_to_org               VARCHAR2(240);
4490 x_invoice_to_city              VARCHAR2(240);
4491 x_invoice_to_state             VARCHAR2(240);
4492 x_invoice_to_postal_code       VARCHAR2(240);
4493 x_invoice_to_country           VARCHAR2(240);
4494 x_prior_invoice_to_address           VARCHAR2(2000);
4495 x_current_invoice_to_address           VARCHAR2(2000);
4496 x_next_invoice_to_address           VARCHAR2(2000);
4497 x_ship_to_address1          VARCHAR2(240);
4498 x_ship_to_address2          VARCHAR2(240);
4499 x_ship_to_address3          VARCHAR2(240);
4500 x_ship_to_address4          VARCHAR2(240);
4501 x_ship_to_location          VARCHAR2(240);
4502 x_ship_to_org               VARCHAR2(240);
4503 x_ship_to_city              VARCHAR2(240);
4504 x_ship_to_state             VARCHAR2(240);
4505 x_ship_to_postal_code       VARCHAR2(240);
4506 x_ship_to_country           VARCHAR2(240);
4507 x_prior_ship_to_address           VARCHAR2(2000);
4508 x_current_ship_to_address           VARCHAR2(2000);
4509 x_next_ship_to_address           VARCHAR2(2000);
4510 x_ship_from_address1          VARCHAR2(240);
4511 x_ship_from_address2          VARCHAR2(240);
4512 x_ship_from_address3          VARCHAR2(240);
4513 x_ship_from_address4          VARCHAR2(240);
4514 x_ship_from_location          VARCHAR2(240);
4515 x_prior_ship_from_org               VARCHAR2(240);
4516 x_current_ship_from_org               VARCHAR2(240);
4517 x_next_ship_from_org               VARCHAR2(240);
4518 x_ship_from_address           VARCHAR2(2000);
4519 x_customer_name               VARCHAR2(360);
4520 x_customer_number             VARCHAR2(100);
4521 x_intermed_ship_to_address1          VARCHAR2(240);
4522 x_intermed_ship_to_address2          VARCHAR2(240);
4523 x_intermed_ship_to_address3          VARCHAR2(240);
4524 x_intermed_ship_to_address4          VARCHAR2(240);
4525 x_intermed_ship_to_location          VARCHAR2(240);
4526 x_intermed_ship_to_org               VARCHAR2(240);
4527 x_intermed_ship_to_city              VARCHAR2(240);
4528 x_intermed_ship_to_state             VARCHAR2(240);
4529 x_intermed_ship_to_postal_code       VARCHAR2(240);
4530 x_intermed_ship_to_country           VARCHAR2(240);
4531 x_item_relationship_type             VARCHAR2(240);
4532 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
4533 p_prior_rec_exists VARCHAR2(1) := 'N';
4534 p_curr_rec_exists VARCHAR2(1)  := 'N';
4535 p_next_rec_exists VARCHAR2(1)  := 'N';
4536 p_trans_rec_exists VARCHAR2(1)  := 'N';
4537 ind NUMBER;
4538 BEGIN
4539 
4540 IF l_debug_level > 0 THEN
4541   oe_debug_pub.add('Entering  COMPARE_ATTRIBUTES');
4542   oe_debug_pub.add('header' ||p_header_id);
4543   oe_debug_pub.add('line' ||p_line_id);
4544   oe_debug_pub.add('line number' ||x_line_number);
4545   oe_debug_pub.add('prior version' ||p_prior_version);
4546   oe_debug_pub.add('current version' ||p_current_version);
4547   oe_debug_pub.add('next version' ||p_next_version);
4548   oe_debug_pub.add('max version' ||g_max_version);
4549   oe_debug_pub.add('trans version' ||g_trans_version);
4550 END IF;
4551 
4552 if p_total_lines > 0 THEN
4553 IF l_debug_level > 0 THEN
4554   oe_debug_pub.add(' p_total_lines '||p_total_lines);
4555 end if;
4556 ind := p_total_lines;
4557 ELSE
4558 ind := 0;
4559 end if;
4560 
4561 IF p_line_id IS NOT NULL THEN
4562 
4563 p_prior_rec := NULL;
4564 p_curr_rec := NULL;
4565 p_next_rec := NULL;
4566 
4567 IF l_debug_level > 0 THEN
4568   oe_debug_pub.add(' Quering prior line version details');
4569   oe_debug_pub.add('prior version' ||p_prior_version);
4570 END IF;
4571 
4572 IF p_prior_version IS NOT NULL THEN
4573 OE_VERSION_BLANKET_COMP.QUERY_LINE_ROW(p_header_id       => p_header_id,
4574                           p_line_id         => p_line_id,
4575 			  p_version         => p_prior_version,
4576                           p_phase_change_flag         => g_prior_phase_change_flag,
4577 			  x_line_rec        => p_prior_rec);
4578      IF p_prior_rec.line_id is NULL THEN
4579           p_prior_rec_exists := 'N';
4580      ELSE
4581           p_prior_rec_exists := 'Y';
4582      END IF;
4583 END IF;
4584 IF l_debug_level > 0 THEN
4585   oe_debug_pub.add(' Quering current line version details');
4586   oe_debug_pub.add('current version' ||p_current_version);
4587 END IF;
4588 
4589 IF p_current_version IS NOT NULL THEN
4590 OE_VERSION_BLANKET_COMP.QUERY_LINE_ROW(p_header_id       => p_header_id,
4591                           p_line_id         => p_line_id,
4592                           p_version         => p_current_version,
4593                           p_phase_change_flag         => g_curr_phase_change_flag,
4594 			  x_line_rec        => p_curr_rec);
4595      IF p_curr_rec.line_id is NULL THEN
4596           p_curr_rec_exists := 'N';
4597      ELSE
4598           p_curr_rec_exists := 'Y';
4599      END IF;
4600 
4601 END IF;
4602 
4603 IF l_debug_level > 0 THEN
4604   oe_debug_pub.add(' Quering next/trans line version details');
4605   oe_debug_pub.add('next version' ||p_next_version);
4606   oe_debug_pub.add('trans version' ||g_trans_version);
4607 END IF;
4608 
4609 IF p_next_version = g_trans_version then
4610        IF g_trans_version is not null then
4611         --p_next_version := g_trans_version;
4612        OE_VERSION_BLANKET_COMP.QUERY_LINE_TRANS_ROW(p_header_id       => p_header_id,
4613                           p_line_id         => p_line_id,
4614                           p_version                => g_trans_version,
4615                           x_line_rec               => p_next_rec);
4616         END IF;
4617      IF p_next_rec.line_id is NULL THEN
4618           p_trans_rec_exists := 'N';
4619      ELSE
4620           p_trans_rec_exists := 'Y';
4621           p_next_rec_exists := 'Y';
4622      END IF;
4623 ELSE
4624      IF p_next_version IS NOT NULL THEN
4625        OE_VERSION_BLANKET_COMP.QUERY_LINE_ROW(p_header_id       => p_header_id,
4626                           p_line_id         => p_line_id,
4627                           p_version         => p_next_version,
4628                           p_phase_change_flag         => g_next_phase_change_flag,
4629 			  x_line_rec        => p_next_rec);
4630      IF p_next_rec.line_id is NULL THEN
4631           p_next_rec_exists := 'N';
4632      ELSE
4633           p_next_rec_exists := 'Y';
4634      END IF;
4635     END IF;
4636 END IF;
4637 IF l_debug_level > 0 THEN
4638     oe_debug_pub.add(' before finding new lines  ');
4639     oe_debug_pub.add(' p_prior_rec_exists'||p_prior_rec_exists);
4640     oe_debug_pub.add(' p_curr_rec_exists'||p_curr_rec_exists);
4641     oe_debug_pub.add(' p_next_rec_exists'||p_next_rec_exists);
4642     oe_debug_pub.add(' p_trans_rec_exists'||p_trans_rec_exists);
4643 END IF;
4644 IF (p_prior_rec_exists = 'N' and p_curr_rec_exists = 'Y') OR
4645     (p_curr_rec_exists = 'N' and p_next_rec_exists ='Y') THEN
4646    IF p_prior_version IS NOT NULL and p_curr_rec_exists = 'Y' THEN
4647          IF l_debug_level > 0 THEN
4648                oe_debug_pub.add(' Prior is not there - current is there');
4649          END IF;
4650        ind := ind+1;
4651        x_line_changed_attr_tbl(ind).line_number        := x_line_number;
4652        x_line_changed_attr_tbl(ind).prior_value        :=  null;
4653        x_line_changed_attr_tbl(ind).current_value      :=  'ADD';
4654        x_line_changed_attr_tbl(ind).next_value         :=  null;
4655    ELSIF (p_curr_rec_exists = 'N' and p_next_rec_exists = 'Y') THEN
4656          IF l_debug_level > 0 THEN
4657                oe_debug_pub.add(' Current is not there - next is there');
4658          END IF;
4659        ind := ind+1;
4660        x_line_changed_attr_tbl(ind).line_number        := x_line_number;
4661        x_line_changed_attr_tbl(ind).prior_value        :=  null;
4662        x_line_changed_attr_tbl(ind).current_value      :=  null;
4663        x_line_changed_attr_tbl(ind).next_value         :=  'ADD';
4664   end if;
4665 END IF;
4666 
4667 IF l_debug_level > 0 THEN
4668     oe_debug_pub.add(' before finding deleted lines');
4669     oe_debug_pub.add(' p_prior_rec_exists'||p_prior_rec_exists);
4670     oe_debug_pub.add(' p_curr_rec_exists'||p_curr_rec_exists);
4671     oe_debug_pub.add(' p_next_rec_exists'||p_next_rec_exists);
4672     oe_debug_pub.add(' p_trans_rec_exists'||p_trans_rec_exists);
4673     oe_debug_pub.add(' x_line_numer '||x_line_number);
4674 END IF;
4675 IF (p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'N') OR
4676     (p_curr_rec_exists = 'Y' and p_next_rec_exists ='N') THEN
4677    IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'N' THEN
4678          IF l_debug_level > 0 THEN
4679                oe_debug_pub.add(' Prior is there - current is not there');
4680          END IF;
4681        ind := ind+1;
4682        x_line_changed_attr_tbl(ind).line_number        := x_line_number;
4683        x_line_changed_attr_tbl(ind).prior_value        :=  null;
4684        x_line_changed_attr_tbl(ind).current_value      :=  'DELETE';
4685        x_line_changed_attr_tbl(ind).next_value         :=  null;
4686    ELSIF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'N' THEN
4687          IF l_debug_level > 0 THEN
4688                oe_debug_pub.add(' p_next_version'||p_next_version);
4689                oe_debug_pub.add(' g_trans_version'||g_trans_version);
4690          END IF;
4691       --if p_next_version != g_trans_version THEN
4692          IF l_debug_level > 0 THEN
4693                oe_debug_pub.add(' Current is there - next is not there');
4694          END IF;
4695        ind := ind+1;
4696        x_line_changed_attr_tbl(ind).line_number        := x_line_number;
4697        x_line_changed_attr_tbl(ind).prior_value        :=  null;
4698        x_line_changed_attr_tbl(ind).current_value      :=  null;
4699        x_line_changed_attr_tbl(ind).next_value         :=  'DELETE';
4700      --end if;
4701   end if;
4702 END IF;
4703 --dbms_output.put_line(' No line number'||x_line_number);
4704 IF l_debug_level > 0 THEN
4705   oe_debug_pub.add('******BEFORE COMPARING ATTRIBUTES*************');
4706   oe_debug_pub.add('current ind '|| ind);
4707 END IF;
4708 
4709 IF (p_prior_version IS NOT NULL and p_prior_rec_exists ='Y') OR
4710    (p_current_version IS NOT NULL and p_curr_rec_exists ='Y') OR
4711    (p_next_version IS NOT NULL and p_next_rec_exists ='Y') OR
4712    (g_trans_version IS NOT NULL and p_trans_rec_exists ='Y') THEN
4713 /****************************/
4714 
4715 /****************************/
4716 /* START ACCOUNTING_RULE_ID*/
4717 prior_exists := 'N';
4718 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
4719 IF OE_Globals.Equal(
4720        p_curr_rec.accounting_rule_id,
4721        p_prior_rec.accounting_rule_id) THEN
4722  null;
4723 ELSE
4724    ind := ind+1;
4725    prior_exists := 'Y';
4726    x_line_changed_attr_tbl(ind).attribute_name  := 'accounting_rule';
4727    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
4728    x_line_changed_attr_tbl(ind).current_id      := p_curr_rec.accounting_rule_id;
4729    x_line_changed_attr_tbl(ind).current_value   := OE_ID_TO_VALUE.Accounting_Rule(p_curr_rec.accounting_rule_id);
4730    x_line_changed_attr_tbl(ind).prior_id        := p_prior_rec.accounting_rule_id;
4731    x_line_changed_attr_tbl(ind).prior_value     := OE_ID_TO_VALUE.Accounting_rule(p_prior_rec.accounting_rule_id);
4732 END IF;
4733 END IF; /*  PRIOR */
4734 /****************************/
4735 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
4736 IF OE_Globals.Equal(
4737        p_curr_rec.accounting_rule_id,
4738        p_next_rec.accounting_rule_id) THEN
4739     IF prior_exists = 'Y' THEN
4740    x_line_changed_attr_tbl(ind).next_value   := OE_ID_TO_VALUE.Accounting_Rule(p_curr_rec.accounting_rule_id);
4741     END IF;
4742 ELSE
4743     IF prior_exists = 'N' THEN
4744         ind := ind+1;
4745     END IF;
4746    x_line_changed_attr_tbl(ind).attribute_name := 'accounting_rule';
4747    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
4748    x_line_changed_attr_tbl(ind).prior_id        := p_prior_rec.accounting_rule_id;
4749    x_line_changed_attr_tbl(ind).prior_value     := OE_ID_TO_VALUE.Accounting_rule(p_prior_rec.accounting_rule_id);
4750    x_line_changed_attr_tbl(ind).current_id     := p_curr_rec.accounting_rule_id;
4751    x_line_changed_attr_tbl(ind).current_value  := OE_ID_TO_VALUE.Accounting_Rule(p_curr_rec.accounting_rule_id);
4752    x_line_changed_attr_tbl(ind).next_id      := p_next_rec.accounting_rule_id;
4753    x_line_changed_attr_tbl(ind).next_value   := OE_ID_TO_VALUE.Accounting_Rule(p_next_rec.accounting_rule_id);
4754 END IF;
4755 END IF; /*  NEXT */
4756 
4757 /* END ACCOUNTING_RULE_ID*/
4758 /****************************/
4759 
4760 /****************************/
4761 /* START agreement_id*/
4762 
4763 prior_exists := 'N';
4764 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
4765 IF OE_Globals.Equal(
4766        p_curr_rec.agreement_id,
4767        p_prior_rec.agreement_id) THEN
4768  null;
4769 ELSE
4770    ind := ind+1;
4771    prior_exists := 'Y';
4772    x_line_changed_attr_tbl(ind).attribute_name  := 'agreement';
4773    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
4774    x_line_changed_attr_tbl(ind).current_id      := p_curr_rec.agreement_id;
4775    x_line_changed_attr_tbl(ind).current_value   := OE_ID_TO_VALUE.Agreement(p_curr_rec.agreement_id);
4776    x_line_changed_attr_tbl(ind).prior_id        := p_prior_rec.agreement_id;
4777    x_line_changed_attr_tbl(ind).prior_value     := OE_ID_TO_VALUE.Agreement(p_prior_rec.agreement_id);
4778 END IF;
4779 END IF; /*  PRIOR */
4780 /****************************/
4781 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
4782 IF OE_Globals.Equal(
4783        p_curr_rec.agreement_id,
4784        p_next_rec.agreement_id) THEN
4785     IF prior_exists = 'Y' THEN
4786    x_line_changed_attr_tbl(ind).next_value   := OE_ID_TO_VALUE.Agreement(p_curr_rec.agreement_id);
4787     END IF;
4788 ELSE
4789     IF prior_exists = 'N' THEN
4790         ind := ind+1;
4791     END IF;
4792    x_line_changed_attr_tbl(ind).attribute_name := 'agreement';
4793    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
4794    x_line_changed_attr_tbl(ind).prior_id        := p_prior_rec.agreement_id;
4795    x_line_changed_attr_tbl(ind).prior_value     := OE_ID_TO_VALUE.Agreement(p_prior_rec.agreement_id);
4796    x_line_changed_attr_tbl(ind).current_id     := p_curr_rec.agreement_id;
4797    x_line_changed_attr_tbl(ind).current_value  := OE_ID_TO_VALUE.Agreement(p_curr_rec.agreement_id);
4798    x_line_changed_attr_tbl(ind).next_id      := p_next_rec.agreement_id;
4799    x_line_changed_attr_tbl(ind).next_value   := OE_ID_TO_VALUE.Agreement(p_next_rec.agreement_id);
4800 END IF;
4801 END IF; /*  NEXT */
4802 
4803 /* END agreement_id*/
4804 /****************************/
4805 
4806 /****************************/
4807 /* START attribute1*/
4808 
4809 prior_exists := 'N';
4810 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
4811 IF OE_Globals.Equal(
4812        p_curr_rec.attribute1,
4813        p_prior_rec.attribute1) THEN
4814  null;
4815 ELSE
4816    ind := ind+1;
4817    prior_exists := 'Y';
4818    x_line_changed_attr_tbl(ind).attribute_name  := 'attribute1';
4819    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
4820    x_line_changed_attr_tbl(ind).current_value      := p_curr_rec.attribute1;
4821    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute1;
4822 END IF;
4823 END IF; /*  PRIOR */
4824 /****************************/
4825 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
4826 IF OE_Globals.Equal(
4827        p_curr_rec.attribute1,
4828        p_next_rec.attribute1) THEN
4829     IF prior_exists = 'Y' THEN
4830    x_line_changed_attr_tbl(ind).next_value      := p_curr_rec.attribute1;
4831     END IF;
4832 ELSE
4833     IF prior_exists = 'N' THEN
4834         ind := ind+1;
4835     END IF;
4836    x_line_changed_attr_tbl(ind).attribute_name := 'attribute1';
4837    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
4838    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute1;
4839    x_line_changed_attr_tbl(ind).current_value     := p_curr_rec.attribute1;
4840    x_line_changed_attr_tbl(ind).next_value      := p_next_rec.attribute1;
4841 END IF;
4842 END IF; /*  NEXT */
4843 
4844 /* END attribute1*/
4845 /****************************/
4846 
4847 /****************************/
4848 /* START attribute2*/
4849 
4850 prior_exists := 'N';
4851 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
4852 IF OE_Globals.Equal(
4853        p_curr_rec.attribute2,
4854        p_prior_rec.attribute2) THEN
4855  null;
4856 ELSE
4857    ind := ind+1;
4858    prior_exists := 'Y';
4859    x_line_changed_attr_tbl(ind).attribute_name  := 'attribute2';
4860    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
4861    x_line_changed_attr_tbl(ind).current_value      := p_curr_rec.attribute2;
4862    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute2;
4863 END IF;
4864 END IF; /*  PRIOR */
4865 /****************************/
4866 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
4867 IF OE_Globals.Equal(
4868        p_curr_rec.attribute2,
4869        p_next_rec.attribute2) THEN
4870     IF prior_exists = 'Y' THEN
4871    x_line_changed_attr_tbl(ind).next_value      := p_curr_rec.attribute2;
4872     END IF;
4873 ELSE
4874     IF prior_exists = 'N' THEN
4875         ind := ind+1;
4876     END IF;
4877    x_line_changed_attr_tbl(ind).attribute_name := 'attribute2';
4878    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
4879    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute2;
4880    x_line_changed_attr_tbl(ind).current_value     := p_curr_rec.attribute2;
4881    x_line_changed_attr_tbl(ind).next_value      := p_next_rec.attribute2;
4882 END IF;
4883 END IF; /*  NEXT */
4884 
4885 /* END attribute2*/
4886 /****************************/
4887 /****************************/
4888 /* START attribute3*/
4889 
4890 prior_exists := 'N';
4891 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
4892 IF OE_Globals.Equal(
4893        p_curr_rec.attribute3,
4894        p_prior_rec.attribute3) THEN
4895  null;
4896 ELSE
4897    ind := ind+1;
4898    prior_exists := 'Y';
4899    x_line_changed_attr_tbl(ind).attribute_name  := 'attribute3';
4900    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
4901    x_line_changed_attr_tbl(ind).current_value      := p_curr_rec.attribute3;
4902    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute3;
4903 END IF;
4904 END IF; /*  PRIOR */
4905 /****************************/
4906 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
4907 IF OE_Globals.Equal(
4908        p_curr_rec.attribute3,
4909        p_next_rec.attribute3) THEN
4910     IF prior_exists = 'Y' THEN
4911    x_line_changed_attr_tbl(ind).next_value      := p_curr_rec.attribute3;
4912     END IF;
4913 ELSE
4914     IF prior_exists = 'N' THEN
4915         ind := ind+1;
4916     END IF;
4917    x_line_changed_attr_tbl(ind).attribute_name := 'attribute3';
4918    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
4919    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute3;
4920    x_line_changed_attr_tbl(ind).current_value     := p_curr_rec.attribute3;
4921    x_line_changed_attr_tbl(ind).next_value      := p_next_rec.attribute3;
4922 END IF;
4923 END IF; /*  NEXT */
4924 
4925 /* END attribute3*/
4926 /****************************/
4927 
4928 /****************************/
4929 /* START attribute4*/
4930 
4931 prior_exists := 'N';
4932 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
4933 IF OE_Globals.Equal(
4934        p_curr_rec.attribute4,
4935        p_prior_rec.attribute4) THEN
4936  null;
4937 ELSE
4938    ind := ind+1;
4939    prior_exists := 'Y';
4940    x_line_changed_attr_tbl(ind).attribute_name  := 'attribute4';
4941    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
4942    x_line_changed_attr_tbl(ind).current_value      := p_curr_rec.attribute4;
4943    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute4;
4944 END IF;
4945 END IF; /*  PRIOR */
4946 /****************************/
4947 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
4948 IF OE_Globals.Equal(
4949        p_curr_rec.attribute4,
4950        p_next_rec.attribute4) THEN
4951     IF prior_exists = 'Y' THEN
4952    x_line_changed_attr_tbl(ind).next_value      := p_curr_rec.attribute4;
4953     END IF;
4954 ELSE
4955     IF prior_exists = 'N' THEN
4956         ind := ind+1;
4957     END IF;
4958    x_line_changed_attr_tbl(ind).attribute_name := 'attribute4';
4959    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
4960    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute4;
4961    x_line_changed_attr_tbl(ind).current_value     := p_curr_rec.attribute4;
4962    x_line_changed_attr_tbl(ind).next_value      := p_next_rec.attribute4;
4963 END IF;
4964 END IF; /*  NEXT */
4965 
4966 /* END attribute4*/
4967 /****************************/
4968 /****************************/
4969 /* START attribute5*/
4970 
4971 prior_exists := 'N';
4972 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
4973 IF OE_Globals.Equal(
4974        p_curr_rec.attribute5,
4975        p_prior_rec.attribute5) THEN
4976  null;
4977 ELSE
4978    ind := ind+1;
4979    prior_exists := 'Y';
4980    x_line_changed_attr_tbl(ind).attribute_name  := 'attribute5';
4981    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
4982    x_line_changed_attr_tbl(ind).current_value      := p_curr_rec.attribute5;
4983    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute5;
4984 END IF;
4985 END IF; /*  PRIOR */
4986 /****************************/
4987 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
4988 IF OE_Globals.Equal(
4989        p_curr_rec.attribute5,
4990        p_next_rec.attribute5) THEN
4991     IF prior_exists = 'Y' THEN
4992    x_line_changed_attr_tbl(ind).next_value      := p_curr_rec.attribute5;
4993     END IF;
4994 ELSE
4995     IF prior_exists = 'N' THEN
4996         ind := ind+1;
4997     END IF;
4998    x_line_changed_attr_tbl(ind).attribute_name := 'attribute5';
4999    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
5000    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute5;
5001    x_line_changed_attr_tbl(ind).current_value     := p_curr_rec.attribute5;
5002    x_line_changed_attr_tbl(ind).next_value      := p_next_rec.attribute5;
5003 END IF;
5004 END IF; /*  NEXT */
5005 
5006 /* END attribute5*/
5007 /****************************/
5008 
5009 /****************************/
5010 /* START attribute6*/
5011 
5012 prior_exists := 'N';
5013 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
5014 IF OE_Globals.Equal(
5015        p_curr_rec.attribute6,
5016        p_prior_rec.attribute6) THEN
5017  null;
5018 ELSE
5019    ind := ind+1;
5020    prior_exists := 'Y';
5021    x_line_changed_attr_tbl(ind).attribute_name  := 'attribute6';
5022    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
5023    x_line_changed_attr_tbl(ind).current_value      := p_curr_rec.attribute6;
5024    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute6;
5025 END IF;
5026 END IF; /*  PRIOR */
5027 /****************************/
5028 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
5029 IF OE_Globals.Equal(
5030        p_curr_rec.attribute6,
5031        p_next_rec.attribute6) THEN
5032     IF prior_exists = 'Y' THEN
5033    x_line_changed_attr_tbl(ind).next_value      := p_curr_rec.attribute6;
5034     END IF;
5035 ELSE
5036     IF prior_exists = 'N' THEN
5037         ind := ind+1;
5038     END IF;
5039    x_line_changed_attr_tbl(ind).attribute_name := 'attribute6';
5040    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
5041    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute6;
5042    x_line_changed_attr_tbl(ind).current_value     := p_curr_rec.attribute6;
5043    x_line_changed_attr_tbl(ind).next_value      := p_next_rec.attribute6;
5044 END IF;
5045 END IF; /*  NEXT */
5046 
5047 /* END attribute6*/
5048 /****************************/
5049 /****************************/
5050 /* START attribute7*/
5051 
5052 prior_exists := 'N';
5053 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
5054 IF OE_Globals.Equal(
5055        p_curr_rec.attribute7,
5056        p_prior_rec.attribute7) THEN
5057  null;
5058 ELSE
5059    ind := ind+1;
5060    prior_exists := 'Y';
5061    x_line_changed_attr_tbl(ind).attribute_name  := 'attribute7';
5062    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
5063    x_line_changed_attr_tbl(ind).current_value      := p_curr_rec.attribute7;
5064    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute7;
5065 END IF;
5066 END IF; /*  PRIOR */
5067 /****************************/
5068 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
5069 IF OE_Globals.Equal(
5070        p_curr_rec.attribute7,
5071        p_next_rec.attribute7) THEN
5072     IF prior_exists = 'Y' THEN
5073    x_line_changed_attr_tbl(ind).next_value      := p_curr_rec.attribute7;
5074     END IF;
5075 ELSE
5076     IF prior_exists = 'N' THEN
5077         ind := ind+1;
5078     END IF;
5079    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute7;
5080    x_line_changed_attr_tbl(ind).attribute_name := 'attribute7';
5081    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
5082    x_line_changed_attr_tbl(ind).current_value     := p_curr_rec.attribute7;
5083    x_line_changed_attr_tbl(ind).next_value      := p_next_rec.attribute7;
5084 END IF;
5085 END IF; /*  NEXT */
5086 
5087 /* END attribute7*/
5088 /****************************/
5089 
5090 /****************************/
5091 /* START attribute8*/
5092 
5093 prior_exists := 'N';
5094 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
5095 IF OE_Globals.Equal(
5096        p_curr_rec.attribute8,
5097        p_prior_rec.attribute8) THEN
5098  null;
5099 ELSE
5100    ind := ind+1;
5101    prior_exists := 'Y';
5102    x_line_changed_attr_tbl(ind).attribute_name  := 'attribute8';
5103    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
5104    x_line_changed_attr_tbl(ind).current_value      := p_curr_rec.attribute8;
5105    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute8;
5106 END IF;
5107 END IF; /*  PRIOR */
5108 /****************************/
5109 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
5110 IF OE_Globals.Equal(
5111        p_curr_rec.attribute8,
5112        p_next_rec.attribute8) THEN
5113     IF prior_exists = 'Y' THEN
5114    x_line_changed_attr_tbl(ind).next_value      := p_curr_rec.attribute8;
5115     END IF;
5116  null;
5117 ELSE
5118     IF prior_exists = 'N' THEN
5119         ind := ind+1;
5120     END IF;
5121    x_line_changed_attr_tbl(ind).attribute_name := 'attribute8';
5122    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
5123    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute8;
5124    x_line_changed_attr_tbl(ind).current_value     := p_curr_rec.attribute8;
5125    x_line_changed_attr_tbl(ind).next_value      := p_next_rec.attribute8;
5126 END IF;
5127 END IF; /*  NEXT */
5128 
5129 /* END attribute8*/
5130 /****************************/
5131 /****************************/
5132 /* START attribute9*/
5133 
5134 prior_exists := 'N';
5135 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
5136 IF OE_Globals.Equal(
5137        p_curr_rec.attribute9,
5138        p_prior_rec.attribute9) THEN
5139  null;
5140 ELSE
5141    ind := ind+1;
5142    prior_exists := 'Y';
5143    x_line_changed_attr_tbl(ind).attribute_name  := 'attribute9';
5144    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
5145    x_line_changed_attr_tbl(ind).current_value      := p_curr_rec.attribute9;
5146    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute9;
5147 END IF;
5148 END IF; /*  PRIOR */
5149 /****************************/
5150 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
5151 IF OE_Globals.Equal(
5152        p_curr_rec.attribute9,
5153        p_next_rec.attribute9) THEN
5154     IF prior_exists = 'Y' THEN
5155    x_line_changed_attr_tbl(ind).next_value      := p_curr_rec.attribute9;
5156     END IF;
5157 ELSE
5158     IF prior_exists = 'N' THEN
5159         ind := ind+1;
5160     END IF;
5161    x_line_changed_attr_tbl(ind).attribute_name := 'attribute9';
5162    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
5163    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute9;
5164    x_line_changed_attr_tbl(ind).current_value     := p_curr_rec.attribute9;
5165    x_line_changed_attr_tbl(ind).next_value      := p_next_rec.attribute9;
5166 END IF;
5167 END IF; /*  NEXT */
5168 
5169 /* END attribute9*/
5170 /****************************/
5171 
5172 /****************************/
5173 /* START attribute10*/
5174 
5175 prior_exists := 'N';
5176 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
5177 IF OE_Globals.Equal(
5178        p_curr_rec.attribute10,
5179        p_prior_rec.attribute10) THEN
5180  null;
5181 ELSE
5182    ind := ind+1;
5183    prior_exists := 'Y';
5184    x_line_changed_attr_tbl(ind).attribute_name  := 'attribute10';
5185    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
5186    x_line_changed_attr_tbl(ind).current_value      := p_curr_rec.attribute10;
5187    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute10;
5188 END IF;
5189 END IF; /*  PRIOR */
5190 /****************************/
5191 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
5192 IF OE_Globals.Equal(
5193        p_curr_rec.attribute10,
5194        p_next_rec.attribute10) THEN
5195     IF prior_exists = 'Y' THEN
5196    x_line_changed_attr_tbl(ind).next_value      := p_curr_rec.attribute10;
5197     END IF;
5198 ELSE
5199     IF prior_exists = 'N' THEN
5200         ind := ind+1;
5201     END IF;
5202    x_line_changed_attr_tbl(ind).attribute_name := 'attribute10';
5203    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
5204    x_line_changed_attr_tbl(ind).current_value     := p_curr_rec.attribute10;
5205    x_line_changed_attr_tbl(ind).next_value      := p_next_rec.attribute10;
5206 END IF;
5207 END IF; /*  NEXT */
5208 
5209 /* END attribute10*/
5210 /****************************/
5211 
5212 /****************************/
5213 /* START attribute11*/
5214 
5215 prior_exists := 'N';
5216 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
5217 IF OE_Globals.Equal(
5218        p_curr_rec.attribute11,
5219        p_prior_rec.attribute11) THEN
5220  null;
5221 ELSE
5222    ind := ind+1;
5223    prior_exists := 'Y';
5224    x_line_changed_attr_tbl(ind).attribute_name  := 'attribute11';
5225    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
5226    x_line_changed_attr_tbl(ind).current_value      := p_curr_rec.attribute11;
5227    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute11;
5228 END IF;
5229 END IF; /*  PRIOR */
5230 /****************************/
5231 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
5232 IF OE_Globals.Equal(
5233        p_curr_rec.attribute11,
5234        p_next_rec.attribute11) THEN
5235     IF prior_exists = 'Y' THEN
5236    x_line_changed_attr_tbl(ind).next_value      := p_curr_rec.attribute11;
5237     END IF;
5238 ELSE
5239     IF prior_exists = 'N' THEN
5240         ind := ind+1;
5241     END IF;
5242    x_line_changed_attr_tbl(ind).attribute_name := 'attribute11';
5243    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
5244    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute10;
5245    x_line_changed_attr_tbl(ind).current_value     := p_curr_rec.attribute11;
5246    x_line_changed_attr_tbl(ind).next_value      := p_next_rec.attribute11;
5247 END IF;
5248 END IF; /*  NEXT */
5249 
5250 /* END attribute11*/
5251 /****************************/
5252 
5253 /****************************/
5254 /* START attribute12*/
5255 
5256 prior_exists := 'N';
5257 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
5258 IF OE_Globals.Equal(
5259        p_curr_rec.attribute12,
5260        p_prior_rec.attribute12) THEN
5261  null;
5262 ELSE
5263    ind := ind+1;
5264    prior_exists := 'Y';
5265    x_line_changed_attr_tbl(ind).attribute_name  := 'attribute12';
5266    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
5267    x_line_changed_attr_tbl(ind).current_value      := p_curr_rec.attribute12;
5268    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute12;
5269 END IF;
5270 END IF; /*  PRIOR */
5271 /****************************/
5272 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
5273 IF OE_Globals.Equal(
5274        p_curr_rec.attribute12,
5275        p_next_rec.attribute12) THEN
5276     IF prior_exists = 'Y' THEN
5277    x_line_changed_attr_tbl(ind).next_value      := p_curr_rec.attribute12;
5278     END IF;
5279 ELSE
5280     IF prior_exists = 'N' THEN
5281         ind := ind+1;
5282     END IF;
5283    x_line_changed_attr_tbl(ind).attribute_name := 'attribute12';
5284    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
5285    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute12;
5286    x_line_changed_attr_tbl(ind).current_value     := p_curr_rec.attribute12;
5287    x_line_changed_attr_tbl(ind).next_value      := p_next_rec.attribute12;
5288 END IF;
5289 END IF; /*  NEXT */
5290 
5291 /* END attribute12*/
5292 /****************************/
5293 
5294 /****************************/
5295 /* START attribute13*/
5296 
5297 prior_exists := 'N';
5298 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
5299 IF OE_Globals.Equal(
5300        p_curr_rec.attribute13,
5301        p_prior_rec.attribute13) THEN
5302  null;
5303 ELSE
5304    ind := ind+1;
5305    prior_exists := 'Y';
5306    x_line_changed_attr_tbl(ind).attribute_name  := 'attribute13';
5307    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
5308    x_line_changed_attr_tbl(ind).current_value      := p_curr_rec.attribute13;
5309    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute13;
5310 END IF;
5311 END IF; /*  PRIOR */
5312 /****************************/
5313 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
5314 IF OE_Globals.Equal(
5315        p_curr_rec.attribute13,
5316        p_next_rec.attribute13) THEN
5317     IF prior_exists = 'Y' THEN
5318    x_line_changed_attr_tbl(ind).next_value      := p_curr_rec.attribute13;
5319     END IF;
5320 ELSE
5321     IF prior_exists = 'N' THEN
5322         ind := ind+1;
5323     END IF;
5324    x_line_changed_attr_tbl(ind).attribute_name := 'attribute13';
5325    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
5326    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute13;
5327    x_line_changed_attr_tbl(ind).current_value     := p_curr_rec.attribute13;
5328    x_line_changed_attr_tbl(ind).next_value      := p_next_rec.attribute13;
5329 END IF;
5330 END IF; /*  NEXT */
5331 
5332 /* END attribute13*/
5333 /****************************/
5334 
5335 /****************************/
5336 /* START attribute14*/
5337 
5338 prior_exists := 'N';
5339 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
5340 IF OE_Globals.Equal(
5341        p_curr_rec.attribute14,
5342        p_prior_rec.attribute14) THEN
5343  null;
5344 ELSE
5345    ind := ind+1;
5346    prior_exists := 'Y';
5347    x_line_changed_attr_tbl(ind).attribute_name  := 'attribute14';
5348    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
5349    x_line_changed_attr_tbl(ind).current_value      := p_curr_rec.attribute14;
5350    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute14;
5351 END IF;
5352 END IF; /*  PRIOR */
5353 /****************************/
5354 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
5355 IF OE_Globals.Equal(
5356        p_curr_rec.attribute14,
5357        p_next_rec.attribute14) THEN
5358     IF prior_exists = 'Y' THEN
5359    x_line_changed_attr_tbl(ind).next_value      := p_curr_rec.attribute14;
5360     END IF;
5361 ELSE
5362     IF prior_exists = 'N' THEN
5363         ind := ind+1;
5364     END IF;
5365    x_line_changed_attr_tbl(ind).attribute_name := 'attribute14';
5366    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
5367    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute14;
5368    x_line_changed_attr_tbl(ind).current_value     := p_curr_rec.attribute14;
5369    x_line_changed_attr_tbl(ind).next_value      := p_next_rec.attribute14;
5370 END IF;
5371 END IF; /*  NEXT */
5372 
5373 /* END attribute14*/
5374 /****************************/
5375 
5376 /****************************/
5377 /* START attribute15*/
5378 
5379 prior_exists := 'N';
5380 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
5381 IF OE_Globals.Equal(
5382        p_curr_rec.attribute15,
5383        p_prior_rec.attribute15) THEN
5384  null;
5385 ELSE
5386    ind := ind+1;
5387    prior_exists := 'Y';
5388    x_line_changed_attr_tbl(ind).attribute_name  := 'attribute15';
5389    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
5390    x_line_changed_attr_tbl(ind).current_value      := p_curr_rec.attribute15;
5391    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute15;
5392 END IF;
5393 END IF; /*  PRIOR */
5394 /****************************/
5395 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
5396 IF OE_Globals.Equal(
5397        p_curr_rec.attribute15,
5398        p_next_rec.attribute15) THEN
5399     IF prior_exists = 'Y' THEN
5400    x_line_changed_attr_tbl(ind).next_value      := p_curr_rec.attribute15;
5401     END IF;
5402 ELSE
5403     IF prior_exists = 'N' THEN
5404         ind := ind+1;
5405     END IF;
5406    x_line_changed_attr_tbl(ind).attribute_name := 'attribute15';
5407    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
5408    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.attribute15;
5409    x_line_changed_attr_tbl(ind).current_value     := p_curr_rec.attribute15;
5410    x_line_changed_attr_tbl(ind).next_value      := p_next_rec.attribute15;
5411 END IF;
5412 END IF; /*  NEXT */
5413 
5414 /* END attribute15*/
5415 /****************************/
5416 /****************************/
5417 /* START context*/
5418 
5419 prior_exists := 'N';
5420 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
5421 IF OE_Globals.Equal(
5422        p_curr_rec.context,
5423        p_prior_rec.context) THEN
5424  null;
5425 ELSE
5426    ind := ind+1;
5427    prior_exists := 'Y';
5428    x_line_changed_attr_tbl(ind).attribute_name  := 'context';
5429    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
5430    x_line_changed_attr_tbl(ind).current_value      := p_curr_rec.context;
5431    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.context;
5432 END IF;
5433 END IF; /*  PRIOR */
5434 /****************************/
5435 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
5436 IF OE_Globals.Equal(
5437        p_curr_rec.context,
5438        p_next_rec.context) THEN
5439     IF prior_exists = 'Y' THEN
5440    x_line_changed_attr_tbl(ind).next_value      := p_curr_rec.context;
5441     END IF;
5442 ELSE
5443     IF prior_exists = 'N' THEN
5444         ind := ind+1;
5445     END IF;
5446    x_line_changed_attr_tbl(ind).attribute_name := 'context';
5447    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
5448    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.context;
5449    x_line_changed_attr_tbl(ind).current_value     := p_curr_rec.context;
5450    x_line_changed_attr_tbl(ind).next_value      := p_next_rec.context;
5451 END IF;
5452 END IF; /*  NEXT */
5453 
5454 /* END context*/
5455 /****************************/
5456 /****************************/
5457 /* START cust_po_number*/
5458 
5459 prior_exists := 'N';
5460 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
5461 IF OE_Globals.Equal(
5462        p_curr_rec.cust_po_number,
5463        p_prior_rec.cust_po_number) THEN
5464  null;
5465 ELSE
5466    ind := ind+1;
5467    prior_exists := 'Y';
5468    x_line_changed_attr_tbl(ind).attribute_name  := 'cust_po_number';
5469    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
5470    x_line_changed_attr_tbl(ind).current_value      := p_curr_rec.cust_po_number;
5471    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.cust_po_number;
5472 END IF;
5473 END IF; /*  PRIOR */
5474 /****************************/
5475 
5476 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
5477 IF OE_Globals.Equal(
5478        p_curr_rec.cust_po_number,
5479        p_next_rec.cust_po_number) THEN
5480     IF prior_exists = 'Y' THEN
5481    x_line_changed_attr_tbl(ind).next_value      := p_curr_rec.cust_po_number;
5482     END IF;
5483 ELSE
5484     IF prior_exists = 'N' THEN
5485         ind := ind+1;
5486     END IF;
5487    x_line_changed_attr_tbl(ind).attribute_name  := 'cust_po_number';
5488    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
5489    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.cust_po_number;
5490    x_line_changed_attr_tbl(ind).current_value     := p_curr_rec.cust_po_number;
5491    x_line_changed_attr_tbl(ind).next_value      := p_next_rec.cust_po_number;
5492 END IF;
5493 END IF; /*  NEXT */
5494 
5495 /* END cust_po_number*/
5496 /****************************/
5497 
5498 /****************************/
5499 /* START deliver_to_org_id*/
5500 
5501 prior_exists := 'N';
5502 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
5503 IF OE_Globals.Equal(
5504        p_curr_rec.deliver_to_org_id,
5505        p_prior_rec.deliver_to_org_id) THEN
5506  null;
5507 ELSE
5508    ind := ind+1;
5509    prior_exists := 'Y';
5510    x_line_changed_attr_tbl(ind).attribute_name  := 'deliver_to';
5511    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
5512    if p_curr_rec.deliver_to_org_id is not null then
5513      OE_ID_TO_VALUE.deliver_To_Org
5514          (   p_deliver_to_org_id        => p_curr_rec.deliver_To_org_id
5515         , x_deliver_to_address1    => x_deliver_to_address1
5516         , x_deliver_to_address2    => x_deliver_to_address2
5517 	, x_deliver_to_address3    => x_deliver_to_address3
5518 	, x_deliver_to_address4    => x_deliver_to_address4
5519 	, x_deliver_to_location    => x_deliver_to_location
5520 	, x_deliver_to_org         => x_deliver_to_org
5521 	, x_deliver_to_city        => x_deliver_to_city
5522 	, x_deliver_to_state       => x_deliver_to_state
5523 	, x_deliver_to_postal_code => x_deliver_to_postal_code
5524 	, x_deliver_to_country     => x_deliver_to_country
5525           );
5526 
5527   select
5528     DECODE(x_deliver_to_location, NULL, NULL,x_deliver_to_location|| ', ') ||
5529     DECODE(x_deliver_to_address1, NULL, NULL,x_deliver_to_address1 || ', ') ||
5530     DECODE(x_deliver_to_address2, NULL, NULL,x_deliver_to_address3 || ', ') ||
5531     DECODE(x_deliver_to_address3, NULL, NULL,x_deliver_to_address3 || ', ') ||
5532     DECODE(x_deliver_to_address4, NULL, NULL,x_deliver_to_address4 || ', ') ||
5533     DECODE(x_deliver_to_city, NULL, NULL,x_deliver_to_city || ', ') ||
5534     DECODE(x_deliver_to_state, NULL, NULL,x_deliver_to_state || ', ') ||
5535     DECODE(x_deliver_to_postal_code, NULL, NULL,x_deliver_to_postal_code || ', ') ||
5536     DECODE(x_deliver_to_country, NULL,NULL,x_deliver_to_country)
5537         into x_current_deliver_to_address from dual;
5538 
5539    x_line_changed_attr_tbl(ind).current_id      := p_curr_rec.deliver_to_org_id;
5540    x_line_changed_attr_tbl(ind).current_value     := x_current_deliver_to_address;
5541 
5542        end if;
5543    if p_prior_rec.deliver_to_org_id is not null then
5544      OE_ID_TO_VALUE.deliver_To_Org
5545          (   p_deliver_to_org_id        => p_prior_rec.deliver_To_org_id
5546         , x_deliver_to_address1    => x_deliver_to_address1
5547         , x_deliver_to_address2    => x_deliver_to_address2
5548 	, x_deliver_to_address3    => x_deliver_to_address3
5549 	, x_deliver_to_address4    => x_deliver_to_address4
5550 	, x_deliver_to_location    => x_deliver_to_location
5551 	, x_deliver_to_org         => x_deliver_to_org
5552 	, x_deliver_to_city        => x_deliver_to_city
5553 	, x_deliver_to_state       => x_deliver_to_state
5554 	, x_deliver_to_postal_code => x_deliver_to_postal_code
5555 	, x_deliver_to_country     => x_deliver_to_country
5556           );
5557 
5558   select
5559     DECODE(x_deliver_to_location, NULL, NULL,x_deliver_to_location|| ', ') ||
5560     DECODE(x_deliver_to_address1, NULL, NULL,x_deliver_to_address1 || ', ') ||
5561     DECODE(x_deliver_to_address2, NULL, NULL,x_deliver_to_address3 || ', ') ||
5562     DECODE(x_deliver_to_address3, NULL, NULL,x_deliver_to_address3 || ', ') ||
5563     DECODE(x_deliver_to_address4, NULL, NULL,x_deliver_to_address4 || ', ') ||
5564     DECODE(x_deliver_to_city, NULL, NULL,x_deliver_to_city || ', ') ||
5565     DECODE(x_deliver_to_state, NULL, NULL,x_deliver_to_state || ', ') ||
5566     DECODE(x_deliver_to_postal_code, NULL, NULL,x_deliver_to_postal_code || ', ') ||
5567     DECODE(x_deliver_to_country, NULL,NULL,x_deliver_to_country)
5568         into x_prior_deliver_to_address from dual;
5569    x_line_changed_attr_tbl(ind).prior_id        := p_prior_rec.deliver_to_org_id;
5570    x_line_changed_attr_tbl(ind).prior_value     := x_prior_deliver_to_address;
5571        end if;
5572 END IF;
5573 END IF; /*  PRIOR */
5574 /****************************/
5575 
5576 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
5577 IF OE_Globals.Equal(
5578        p_curr_rec.deliver_to_org_id,
5579        p_next_rec.deliver_to_org_id) THEN
5580     IF prior_exists = 'Y' THEN
5581    x_line_changed_attr_tbl(ind).next_value     := x_current_deliver_to_address;
5582     END IF;
5583 ELSE
5584     IF prior_exists = 'N' THEN
5585         ind := ind+1;
5586     END IF;
5587    x_line_changed_attr_tbl(ind).attribute_name := 'deliver_to';
5588    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
5589 
5590    if p_prior_rec.deliver_to_org_id is not null then
5591      OE_ID_TO_VALUE.deliver_To_Org
5592          (   p_deliver_to_org_id        => p_prior_rec.deliver_To_org_id
5593         , x_deliver_to_address1    => x_deliver_to_address1
5594         , x_deliver_to_address2    => x_deliver_to_address2
5595 	, x_deliver_to_address3    => x_deliver_to_address3
5596 	, x_deliver_to_address4    => x_deliver_to_address4
5597 	, x_deliver_to_location    => x_deliver_to_location
5598 	, x_deliver_to_org         => x_deliver_to_org
5599 	, x_deliver_to_city        => x_deliver_to_city
5600 	, x_deliver_to_state       => x_deliver_to_state
5601 	, x_deliver_to_postal_code => x_deliver_to_postal_code
5602 	, x_deliver_to_country     => x_deliver_to_country
5603           );
5604 
5605   select
5606     DECODE(x_deliver_to_location, NULL, NULL,x_deliver_to_location|| ', ') ||
5607     DECODE(x_deliver_to_address1, NULL, NULL,x_deliver_to_address1 || ', ') ||
5608     DECODE(x_deliver_to_address2, NULL, NULL,x_deliver_to_address3 || ', ') ||
5609     DECODE(x_deliver_to_address3, NULL, NULL,x_deliver_to_address3 || ', ') ||
5610     DECODE(x_deliver_to_address4, NULL, NULL,x_deliver_to_address4 || ', ') ||
5611     DECODE(x_deliver_to_city, NULL, NULL,x_deliver_to_city || ', ') ||
5612     DECODE(x_deliver_to_state, NULL, NULL,x_deliver_to_state || ', ') ||
5613     DECODE(x_deliver_to_postal_code, NULL, NULL,x_deliver_to_postal_code || ', ') ||
5614     DECODE(x_deliver_to_country, NULL,NULL,x_deliver_to_country)
5615         into x_prior_deliver_to_address from dual;
5616    x_line_changed_attr_tbl(ind).prior_id        := p_prior_rec.deliver_to_org_id;
5617    x_line_changed_attr_tbl(ind).prior_value     := x_prior_deliver_to_address;
5618 
5619        end if;
5620    if p_curr_rec.deliver_to_org_id is not null then
5621      OE_ID_TO_VALUE.deliver_To_Org
5622          (   p_deliver_to_org_id        => p_curr_rec.deliver_To_org_id
5623         , x_deliver_to_address1    => x_deliver_to_address1
5624         , x_deliver_to_address2    => x_deliver_to_address2
5625 	, x_deliver_to_address3    => x_deliver_to_address3
5626 	, x_deliver_to_address4    => x_deliver_to_address4
5627 	, x_deliver_to_location    => x_deliver_to_location
5628 	, x_deliver_to_org         => x_deliver_to_org
5629 	, x_deliver_to_city        => x_deliver_to_city
5630 	, x_deliver_to_state       => x_deliver_to_state
5631 	, x_deliver_to_postal_code => x_deliver_to_postal_code
5632 	, x_deliver_to_country     => x_deliver_to_country
5633           );
5634 
5635   select
5636     DECODE(x_deliver_to_location, NULL, NULL,x_deliver_to_location|| ', ') ||
5637     DECODE(x_deliver_to_address1, NULL, NULL,x_deliver_to_address1 || ', ') ||
5638     DECODE(x_deliver_to_address2, NULL, NULL,x_deliver_to_address3 || ', ') ||
5639     DECODE(x_deliver_to_address3, NULL, NULL,x_deliver_to_address3 || ', ') ||
5640     DECODE(x_deliver_to_address4, NULL, NULL,x_deliver_to_address4 || ', ') ||
5641     DECODE(x_deliver_to_city, NULL, NULL,x_deliver_to_city || ', ') ||
5642     DECODE(x_deliver_to_state, NULL, NULL,x_deliver_to_state || ', ') ||
5643     DECODE(x_deliver_to_postal_code, NULL, NULL,x_deliver_to_postal_code || ', ') ||
5644     DECODE(x_deliver_to_country, NULL,NULL,x_deliver_to_country)
5645         into x_current_deliver_to_address from dual;
5646    x_line_changed_attr_tbl(ind).current_id     := p_curr_rec.deliver_to_org_id;
5647    x_line_changed_attr_tbl(ind).current_value     := x_current_deliver_to_address;
5648        end if;
5649 
5650    if p_next_rec.deliver_to_org_id is not null then
5651      OE_ID_TO_VALUE.deliver_To_Org
5652          (   p_deliver_to_org_id        => p_next_rec.deliver_To_org_id
5653         , x_deliver_to_address1    => x_deliver_to_address1
5654         , x_deliver_to_address2    => x_deliver_to_address2
5655 	, x_deliver_to_address3    => x_deliver_to_address3
5656 	, x_deliver_to_address4    => x_deliver_to_address4
5657 	, x_deliver_to_location    => x_deliver_to_location
5658 	, x_deliver_to_org         => x_deliver_to_org
5659 	, x_deliver_to_city        => x_deliver_to_city
5660 	, x_deliver_to_state       => x_deliver_to_state
5661 	, x_deliver_to_postal_code => x_deliver_to_postal_code
5662 	, x_deliver_to_country     => x_deliver_to_country
5663           );
5664 
5665   select
5666     DECODE(x_deliver_to_location, NULL, NULL,x_deliver_to_location|| ', ') ||
5667     DECODE(x_deliver_to_address1, NULL, NULL,x_deliver_to_address1 || ', ') ||
5668     DECODE(x_deliver_to_address2, NULL, NULL,x_deliver_to_address3 || ', ') ||
5669     DECODE(x_deliver_to_address3, NULL, NULL,x_deliver_to_address3 || ', ') ||
5670     DECODE(x_deliver_to_address4, NULL, NULL,x_deliver_to_address4 || ', ') ||
5671     DECODE(x_deliver_to_city, NULL, NULL,x_deliver_to_city || ', ') ||
5672     DECODE(x_deliver_to_state, NULL, NULL,x_deliver_to_state || ', ') ||
5673     DECODE(x_deliver_to_postal_code, NULL, NULL,x_deliver_to_postal_code || ', ') ||
5674     DECODE(x_deliver_to_country, NULL,NULL,x_deliver_to_country)
5675         into x_next_deliver_to_address from dual;
5676    x_line_changed_attr_tbl(ind).next_id      := p_next_rec.deliver_to_org_id;
5677    x_line_changed_attr_tbl(ind).next_value     := x_next_deliver_to_address;
5678        end if;
5679 END IF;
5680 END IF; /*  NEXT */
5681 
5682 /* END deliver_to_org_id*/
5683 /****************************/
5684 
5685 
5686 /****************************/
5687 /* START freight_terms_code*/
5688 
5689 prior_exists := 'N';
5690 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
5691 IF OE_Globals.Equal(
5692        p_curr_rec.freight_terms_code,
5693        p_prior_rec.freight_terms_code) THEN
5694  null;
5695 ELSE
5696    ind := ind+1;
5697    prior_exists := 'Y';
5698    x_line_changed_attr_tbl(ind).attribute_name  := 'freight_terms';
5699    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
5700    x_line_changed_attr_tbl(ind).current_id      := p_curr_rec.freight_terms_code;
5701    x_line_changed_attr_tbl(ind).current_value   := OE_ID_TO_VALUE.Freight_terms(p_curr_rec.freight_terms_code);
5702    x_line_changed_attr_tbl(ind).prior_id        := p_prior_rec.freight_terms_code;
5703    x_line_changed_attr_tbl(ind).prior_value     := OE_ID_TO_VALUE.Freight_terms(p_prior_rec.freight_terms_code);
5704 END IF;
5705 END IF; /*  PRIOR */
5706 /****************************/
5707 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
5708 IF OE_Globals.Equal(
5709        p_curr_rec.freight_terms_code,
5710        p_next_rec.freight_terms_code) THEN
5711     IF prior_exists = 'Y' THEN
5712    x_line_changed_attr_tbl(ind).next_value   := OE_ID_TO_VALUE.Freight_terms(p_curr_rec.freight_terms_code);
5713     END IF;
5714 ELSE
5715     IF prior_exists = 'N' THEN
5716         ind := ind+1;
5717     END IF;
5718    x_line_changed_attr_tbl(ind).attribute_name := 'freight_terms';
5719    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
5720    x_line_changed_attr_tbl(ind).prior_id        := p_prior_rec.freight_terms_code;
5721    x_line_changed_attr_tbl(ind).prior_value     := OE_ID_TO_VALUE.Freight_terms(p_prior_rec.freight_terms_code);
5722    x_line_changed_attr_tbl(ind).current_id     := p_curr_rec.freight_terms_code;
5723    x_line_changed_attr_tbl(ind).current_value  := OE_ID_TO_VALUE.Freight_terms(p_curr_rec.freight_terms_code);
5724    x_line_changed_attr_tbl(ind).next_id      := p_next_rec.freight_terms_code;
5725    x_line_changed_attr_tbl(ind).next_value   := OE_ID_TO_VALUE.Freight_terms(p_next_rec.freight_terms_code);
5726 END IF;
5727 END IF; /*  NEXT */
5728 
5729 /* END freight_terms_code*/
5730 /****************************/
5731 
5732 /****************************/
5733 /* START min_release_quantity*/
5734 
5735 prior_exists := 'N';
5736 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
5737 IF OE_Globals.Equal(
5738        p_curr_rec.min_release_quantity,
5739        p_prior_rec.min_release_quantity) THEN
5740  null;
5741 ELSE
5742    ind := ind+1;
5743    prior_exists := 'Y';
5744    x_line_changed_attr_tbl(ind).attribute_name  := 'min_release_quantity';
5745    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
5746    x_line_changed_attr_tbl(ind).current_value      := p_curr_rec.min_release_quantity;
5747    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.min_release_quantity;
5748 END IF;
5749 END IF; /*  PRIOR */
5750 /****************************/
5751 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
5752 IF OE_Globals.Equal(
5753        p_curr_rec.min_release_quantity,
5754        p_next_rec.min_release_quantity) THEN
5755     IF prior_exists = 'Y' THEN
5756    x_line_changed_attr_tbl(ind).next_value      := p_curr_rec.min_release_quantity;
5757     END IF;
5758 ELSE
5759     IF prior_exists = 'N' THEN
5760         ind := ind+1;
5761     END IF;
5762    x_line_changed_attr_tbl(ind).attribute_name := 'min_release_quantity';
5763    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
5764    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.min_release_quantity;
5765    x_line_changed_attr_tbl(ind).current_value     := p_curr_rec.min_release_quantity;
5766    x_line_changed_attr_tbl(ind).next_value      := p_next_rec.min_release_quantity;
5767 END IF;
5768 END IF; /*  NEXT */
5769 
5770 /* END min_release_quantity*/
5771 /****************************/
5772 
5773 /****************************/
5774 /* START max_release_quantity*/
5775 
5776 prior_exists := 'N';
5777 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
5778 IF OE_Globals.Equal(
5779        p_curr_rec.max_release_quantity,
5780        p_prior_rec.max_release_quantity) THEN
5781  null;
5782 ELSE
5783    ind := ind+1;
5784    prior_exists := 'Y';
5785    x_line_changed_attr_tbl(ind).attribute_name  := 'max_release_quantity';
5786    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
5787    x_line_changed_attr_tbl(ind).current_value      := p_curr_rec.max_release_quantity;
5788    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.max_release_quantity;
5789 END IF;
5790 END IF; /*  PRIOR */
5791 /****************************/
5792 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
5793 IF OE_Globals.Equal(
5794        p_curr_rec.max_release_quantity,
5795        p_next_rec.max_release_quantity) THEN
5796     IF prior_exists = 'Y' THEN
5797    x_line_changed_attr_tbl(ind).next_value      := p_curr_rec.max_release_quantity;
5798     END IF;
5799 ELSE
5800     IF prior_exists = 'N' THEN
5801         ind := ind+1;
5802     END IF;
5803    x_line_changed_attr_tbl(ind).attribute_name := 'max_release_quantity';
5804    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
5805    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.max_release_quantity;
5806    x_line_changed_attr_tbl(ind).current_value     := p_curr_rec.max_release_quantity;
5807    x_line_changed_attr_tbl(ind).next_value      := p_next_rec.max_release_quantity;
5808 END IF;
5809 END IF; /*  NEXT */
5810 
5811 /* END max_release_quantity*/
5812 /****************************/
5813 
5814 /****************************/
5815 /* START invoice_to_org_id*/
5816 
5817 prior_exists := 'N';
5818 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
5819 IF OE_Globals.Equal(
5820        p_curr_rec.invoice_to_org_id,
5821        p_prior_rec.invoice_to_org_id) THEN
5822  null;
5823 ELSE
5824    ind := ind+1;
5825    prior_exists := 'Y';
5826    x_line_changed_attr_tbl(ind).attribute_name  := 'invoice_to';
5827    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
5828    if p_curr_rec.invoice_to_org_id is not null then
5829 
5830      OE_ID_TO_VALUE.invoice_to_Org
5831          (   p_invoice_to_org_id        => p_curr_rec.invoice_to_org_id
5832         , x_invoice_to_address1    => x_invoice_to_address1
5833         , x_invoice_to_address2    => x_invoice_to_address2
5834 	, x_invoice_to_address3    => x_invoice_to_address3
5835 	, x_invoice_to_address4    => x_invoice_to_address4
5836 	, x_invoice_to_location    => x_invoice_to_location
5837 	, x_invoice_to_org         => x_invoice_to_org
5838 	, x_invoice_to_city        => x_invoice_to_city
5839 	, x_invoice_to_state       => x_invoice_to_state
5840 	, x_invoice_to_postal_code => x_invoice_to_postal_code
5841 	, x_invoice_to_country     => x_invoice_to_country
5842           );
5843 
5844   select
5845     DECODE(x_invoice_to_location, NULL, NULL,x_invoice_to_location|| ', ') ||
5846     DECODE(x_invoice_to_address1, NULL, NULL,x_invoice_to_address1 || ', ') ||
5847     DECODE(x_invoice_to_address2, NULL, NULL,x_invoice_to_address3 || ', ') ||
5848     DECODE(x_invoice_to_address3, NULL, NULL,x_invoice_to_address3 || ', ') ||
5849     DECODE(x_invoice_to_address4, NULL, NULL,x_invoice_to_address4 || ', ') ||
5850     DECODE(x_invoice_to_city, NULL, NULL,x_invoice_to_city || ', ') ||
5851     DECODE(x_invoice_to_state, NULL, NULL,x_invoice_to_state || ', ') ||
5852     DECODE(x_invoice_to_postal_code, NULL, NULL,x_invoice_to_postal_code || ', ') ||
5853     DECODE(x_invoice_to_country, NULL,NULL,x_invoice_to_country)
5854         into x_current_invoice_to_address from dual;
5855    x_line_changed_attr_tbl(ind).current_id      := p_curr_rec.invoice_to_org_id;
5856 
5857    x_line_changed_attr_tbl(ind).current_value     := x_current_invoice_to_address;
5858        end if;
5859 
5860    if p_prior_rec.invoice_to_org_id is not null then
5861      OE_ID_TO_VALUE.invoice_to_Org
5862          (   p_invoice_to_org_id        => p_prior_rec.invoice_to_org_id
5863         , x_invoice_to_address1    => x_invoice_to_address1
5864         , x_invoice_to_address2    => x_invoice_to_address2
5865 	, x_invoice_to_address3    => x_invoice_to_address3
5866 	, x_invoice_to_address4    => x_invoice_to_address4
5867 	, x_invoice_to_location    => x_invoice_to_location
5868 	, x_invoice_to_org         => x_invoice_to_org
5869 	, x_invoice_to_city        => x_invoice_to_city
5870 	, x_invoice_to_state       => x_invoice_to_state
5871 	, x_invoice_to_postal_code => x_invoice_to_postal_code
5872 	, x_invoice_to_country     => x_invoice_to_country
5873           );
5874 
5875   select
5876     DECODE(x_invoice_to_location, NULL, NULL,x_invoice_to_location|| ', ') ||
5877     DECODE(x_invoice_to_address1, NULL, NULL,x_invoice_to_address1 || ', ') ||
5878     DECODE(x_invoice_to_address2, NULL, NULL,x_invoice_to_address3 || ', ') ||
5879     DECODE(x_invoice_to_address3, NULL, NULL,x_invoice_to_address3 || ', ') ||
5880     DECODE(x_invoice_to_address4, NULL, NULL,x_invoice_to_address4 || ', ') ||
5881     DECODE(x_invoice_to_city, NULL, NULL,x_invoice_to_city || ', ') ||
5882     DECODE(x_invoice_to_state, NULL, NULL,x_invoice_to_state || ', ') ||
5883     DECODE(x_invoice_to_postal_code, NULL, NULL,x_invoice_to_postal_code || ', ') ||
5884     DECODE(x_invoice_to_country, NULL,NULL,x_invoice_to_country)
5885         into x_prior_invoice_to_address from dual;
5886    x_line_changed_attr_tbl(ind).prior_value     := x_prior_invoice_to_address;
5887    x_line_changed_attr_tbl(ind).prior_id        := p_prior_rec.invoice_to_org_id;
5888        end if;
5889 END IF;
5890 END IF; /*  PRIOR */
5891 /****************************/
5892 
5893 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
5894 IF OE_Globals.Equal(
5895        p_curr_rec.invoice_to_org_id,
5896        p_next_rec.invoice_to_org_id) THEN
5897     IF prior_exists = 'Y' THEN
5898    x_line_changed_attr_tbl(ind).next_value     := x_current_invoice_to_address;
5899     END IF;
5900 ELSE
5901     IF prior_exists = 'N' THEN
5902         ind := ind+1;
5903     END IF;
5904    x_line_changed_attr_tbl(ind).attribute_name := 'invoice_to';
5905    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
5906 
5907    if p_prior_rec.invoice_to_org_id is not null then
5908      OE_ID_TO_VALUE.invoice_to_Org
5909          (   p_invoice_to_org_id        => p_prior_rec.invoice_to_org_id
5910         , x_invoice_to_address1    => x_invoice_to_address1
5911         , x_invoice_to_address2    => x_invoice_to_address2
5912 	, x_invoice_to_address3    => x_invoice_to_address3
5913 	, x_invoice_to_address4    => x_invoice_to_address4
5914 	, x_invoice_to_location    => x_invoice_to_location
5915 	, x_invoice_to_org         => x_invoice_to_org
5916 	, x_invoice_to_city        => x_invoice_to_city
5917 	, x_invoice_to_state       => x_invoice_to_state
5918 	, x_invoice_to_postal_code => x_invoice_to_postal_code
5919 	, x_invoice_to_country     => x_invoice_to_country
5920           );
5921 
5922   select
5923     DECODE(x_invoice_to_location, NULL, NULL,x_invoice_to_location|| ', ') ||
5924     DECODE(x_invoice_to_address1, NULL, NULL,x_invoice_to_address1 || ', ') ||
5925     DECODE(x_invoice_to_address2, NULL, NULL,x_invoice_to_address3 || ', ') ||
5926     DECODE(x_invoice_to_address3, NULL, NULL,x_invoice_to_address3 || ', ') ||
5927     DECODE(x_invoice_to_address4, NULL, NULL,x_invoice_to_address4 || ', ') ||
5928     DECODE(x_invoice_to_city, NULL, NULL,x_invoice_to_city || ', ') ||
5929     DECODE(x_invoice_to_state, NULL, NULL,x_invoice_to_state || ', ') ||
5930     DECODE(x_invoice_to_postal_code, NULL, NULL,x_invoice_to_postal_code || ', ') ||
5931     DECODE(x_invoice_to_country, NULL,NULL,x_invoice_to_country)
5932         into x_prior_invoice_to_address from dual;
5933    x_line_changed_attr_tbl(ind).prior_id        := p_prior_rec.invoice_to_org_id;
5934    x_line_changed_attr_tbl(ind).prior_value     := x_prior_invoice_to_address;
5935        end if;
5936 
5937    if p_curr_rec.invoice_to_org_id is not null then
5938      OE_ID_TO_VALUE.invoice_to_Org
5939          (   p_invoice_to_org_id        => p_curr_rec.invoice_to_org_id
5940         , x_invoice_to_address1    => x_invoice_to_address1
5941         , x_invoice_to_address2    => x_invoice_to_address2
5942 	, x_invoice_to_address3    => x_invoice_to_address3
5943 	, x_invoice_to_address4    => x_invoice_to_address4
5944 	, x_invoice_to_location    => x_invoice_to_location
5945 	, x_invoice_to_org         => x_invoice_to_org
5946 	, x_invoice_to_city        => x_invoice_to_city
5947 	, x_invoice_to_state       => x_invoice_to_state
5948 	, x_invoice_to_postal_code => x_invoice_to_postal_code
5949 	, x_invoice_to_country     => x_invoice_to_country
5950           );
5951 
5952   select
5953     DECODE(x_invoice_to_location, NULL, NULL,x_invoice_to_location|| ', ') ||
5954     DECODE(x_invoice_to_address1, NULL, NULL,x_invoice_to_address1 || ', ') ||
5955     DECODE(x_invoice_to_address2, NULL, NULL,x_invoice_to_address3 || ', ') ||
5956     DECODE(x_invoice_to_address3, NULL, NULL,x_invoice_to_address3 || ', ') ||
5957     DECODE(x_invoice_to_address4, NULL, NULL,x_invoice_to_address4 || ', ') ||
5958     DECODE(x_invoice_to_city, NULL, NULL,x_invoice_to_city || ', ') ||
5959     DECODE(x_invoice_to_state, NULL, NULL,x_invoice_to_state || ', ') ||
5960     DECODE(x_invoice_to_postal_code, NULL, NULL,x_invoice_to_postal_code || ', ') ||
5961     DECODE(x_invoice_to_country, NULL,NULL,x_invoice_to_country)
5962         into x_current_invoice_to_address from dual;
5963    x_line_changed_attr_tbl(ind).current_id     := p_curr_rec.invoice_to_org_id;
5964    x_line_changed_attr_tbl(ind).current_value     := x_current_invoice_to_address;
5965        end if;
5966 
5967    if p_next_rec.invoice_to_org_id is not null then
5968      OE_ID_TO_VALUE.invoice_to_Org
5969          (   p_invoice_to_org_id        => p_next_rec.invoice_to_org_id
5970         , x_invoice_to_address1    => x_invoice_to_address1
5971         , x_invoice_to_address2    => x_invoice_to_address2
5972 	, x_invoice_to_address3    => x_invoice_to_address3
5973 	, x_invoice_to_address4    => x_invoice_to_address4
5974 	, x_invoice_to_location    => x_invoice_to_location
5975 	, x_invoice_to_org         => x_invoice_to_org
5976 	, x_invoice_to_city        => x_invoice_to_city
5977 	, x_invoice_to_state       => x_invoice_to_state
5978 	, x_invoice_to_postal_code => x_invoice_to_postal_code
5979 	, x_invoice_to_country     => x_invoice_to_country
5980           );
5981 
5982   select
5983     DECODE(x_invoice_to_location, NULL, NULL,x_invoice_to_location|| ', ') ||
5984     DECODE(x_invoice_to_address1, NULL, NULL,x_invoice_to_address1 || ', ') ||
5985     DECODE(x_invoice_to_address2, NULL, NULL,x_invoice_to_address3 || ', ') ||
5986     DECODE(x_invoice_to_address3, NULL, NULL,x_invoice_to_address3 || ', ') ||
5987     DECODE(x_invoice_to_address4, NULL, NULL,x_invoice_to_address4 || ', ') ||
5988     DECODE(x_invoice_to_city, NULL, NULL,x_invoice_to_city || ', ') ||
5989     DECODE(x_invoice_to_state, NULL, NULL,x_invoice_to_state || ', ') ||
5990     DECODE(x_invoice_to_postal_code, NULL, NULL,x_invoice_to_postal_code || ', ') ||
5991     DECODE(x_invoice_to_country, NULL,NULL,x_invoice_to_country)
5992         into x_next_invoice_to_address from dual;
5993    x_line_changed_attr_tbl(ind).next_id      := p_next_rec.invoice_to_org_id;
5994    x_line_changed_attr_tbl(ind).next_value     := x_next_invoice_to_address;
5995        end if;
5996 END IF;
5997 END IF; /*  NEXT */
5998 
5999 /* END invoice_to_org_id*/
6000 /****************************/
6001 
6002 /****************************/
6003 /* START invoicing_rule_id*/
6004 
6005 prior_exists := 'N';
6006 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
6007 IF OE_Globals.Equal(
6008        p_curr_rec.invoicing_rule_id,
6009        p_prior_rec.invoicing_rule_id) THEN
6010  null;
6011 ELSE
6012    ind := ind+1;
6013    prior_exists := 'Y';
6014    x_line_changed_attr_tbl(ind).attribute_name  := 'invoicing_rule';
6015    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
6016    x_line_changed_attr_tbl(ind).current_id      := p_curr_rec.invoicing_rule_id;
6017    x_line_changed_attr_tbl(ind).current_value   := OE_ID_TO_VALUE.Invoicing_Rule(p_curr_rec.invoicing_rule_id);
6018    x_line_changed_attr_tbl(ind).prior_id        := p_prior_rec.invoicing_rule_id;
6019    x_line_changed_attr_tbl(ind).prior_value     := OE_ID_TO_VALUE.Invoicing_Rule(p_prior_rec.invoicing_rule_id);
6020 END IF;
6021 END IF; /*  PRIOR */
6022 /****************************/
6023 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
6024 IF OE_Globals.Equal(
6025        p_curr_rec.invoicing_rule_id,
6026        p_next_rec.invoicing_rule_id) THEN
6027     IF prior_exists = 'Y' THEN
6028    x_line_changed_attr_tbl(ind).next_value   := OE_ID_TO_VALUE.Invoicing_Rule(p_curr_rec.invoicing_rule_id);
6029     END IF;
6030 ELSE
6031     IF prior_exists = 'N' THEN
6032         ind := ind+1;
6033     END IF;
6034    x_line_changed_attr_tbl(ind).attribute_name := 'invoicing_rule';
6035    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
6036    x_line_changed_attr_tbl(ind).prior_id        := p_prior_rec.invoicing_rule_id;
6037    x_line_changed_attr_tbl(ind).prior_value     := OE_ID_TO_VALUE.Invoicing_Rule(p_prior_rec.invoicing_rule_id);
6038    x_line_changed_attr_tbl(ind).current_id     := p_curr_rec.invoicing_rule_id;
6039    x_line_changed_attr_tbl(ind).current_value  := OE_ID_TO_VALUE.Invoicing_Rule(p_curr_rec.invoicing_rule_id);
6040    x_line_changed_attr_tbl(ind).next_id      := p_next_rec.invoicing_rule_id;
6041    x_line_changed_attr_tbl(ind).next_value   := OE_ID_TO_VALUE.Invoicing_Rule(p_next_rec.invoicing_rule_id);
6042 END IF;
6043 END IF; /*  NEXT */
6044 
6045 /* END invoicing_rule_id*/
6046 /****************************/
6047 
6048 
6049 /****************************/
6050 /* START ORDERED_ITEM*/
6051 prior_exists := 'N';
6052 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
6053 IF OE_Globals.Equal(
6054        p_curr_rec.ORDERED_ITEM,
6055        p_prior_rec.ORDERED_ITEM) THEN
6056  null;
6057 ELSE
6058    ind := ind+1;
6059    prior_exists := 'Y';
6060    x_line_changed_attr_tbl(ind).attribute_name  := 'ORDERED_ITEM';
6061    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
6062    x_line_changed_attr_tbl(ind).current_value      := p_curr_rec.ORDERED_ITEM;
6063    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.ORDERED_ITEM;
6064 END IF;
6065 END IF; /*  PRIOR */
6066 /****************************/
6067 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
6068 IF OE_Globals.Equal(
6069        p_curr_rec.ORDERED_ITEM,
6070        p_next_rec.ORDERED_ITEM) THEN
6071     IF prior_exists = 'Y' THEN
6072    x_line_changed_attr_tbl(ind).next_value      := p_curr_rec.ORDERED_ITEM;
6073     END IF;
6074 ELSE
6075     IF prior_exists = 'N' THEN
6076         ind := ind+1;
6077     END IF;
6078    x_line_changed_attr_tbl(ind).attribute_name := 'ORDERED_ITEM';
6079    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
6080    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.ORDERED_ITEM;
6081    x_line_changed_attr_tbl(ind).current_value     := p_curr_rec.ORDERED_ITEM;
6082    x_line_changed_attr_tbl(ind).next_value      := p_next_rec.ORDERED_ITEM;
6083 END IF;
6084 END IF; /*  NEXT */
6085 
6086 /* END ORDERED_ITEM*/
6087 /****************************/
6088 
6089 /****************************/
6090 /* START ORDER_QUANTITY_UOM*/
6091 
6092 prior_exists := 'N';
6093 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
6094 IF OE_Globals.Equal(
6095        p_curr_rec.ORDER_QUANTITY_UOM,
6096        p_prior_rec.ORDER_QUANTITY_UOM) THEN
6097  null;
6098 ELSE
6099    ind := ind+1;
6100    prior_exists := 'Y';
6101    x_line_changed_attr_tbl(ind).attribute_name  := 'ORDER_QUANTITY_UOM';
6102    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
6103    x_line_changed_attr_tbl(ind).current_value      := p_curr_rec.ORDER_QUANTITY_UOM;
6104    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.ORDER_QUANTITY_UOM;
6105 END IF;
6106 END IF; /*  PRIOR */
6107 /****************************/
6108 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
6109 IF OE_Globals.Equal(
6110        p_curr_rec.ORDER_QUANTITY_UOM,
6111        p_next_rec.ORDER_QUANTITY_UOM) THEN
6112     IF prior_exists = 'Y' THEN
6113    x_line_changed_attr_tbl(ind).next_value      := p_curr_rec.ORDER_QUANTITY_UOM;
6114     END IF;
6115 ELSE
6116     IF prior_exists = 'N' THEN
6117         ind := ind+1;
6118     END IF;
6119    x_line_changed_attr_tbl(ind).attribute_name := 'ORDER_QUANTITY_UOM';
6120    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
6121    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.ORDER_QUANTITY_UOM;
6122    x_line_changed_attr_tbl(ind).current_value     := p_curr_rec.ORDER_QUANTITY_UOM;
6123    x_line_changed_attr_tbl(ind).next_value      := p_next_rec.ORDER_QUANTITY_UOM;
6124 END IF;
6125 END IF; /*  NEXT */
6126 
6127 /* END ORDER_QUANTITY_UOM*/
6128 /****************************/
6129 /****************************/
6130 /* START PRICE_LIST_ID*/
6131 
6132 prior_exists := 'N';
6133 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
6134 IF OE_Globals.Equal(
6135        p_curr_rec.PRICE_LIST_ID,
6136        p_prior_rec.PRICE_LIST_ID) THEN
6137  null;
6138 ELSE
6139    ind := ind+1;
6140    prior_exists := 'Y';
6141    x_line_changed_attr_tbl(ind).attribute_name  := 'PRICE_LIST_NAME_DUP';
6142    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
6143    x_line_changed_attr_tbl(ind).current_id      := p_curr_rec.PRICE_LIST_ID;
6144    x_line_changed_attr_tbl(ind).current_value   := OE_ID_TO_VALUE.PRICE_LIST(p_curr_rec.PRICE_LIST_ID);
6145    x_line_changed_attr_tbl(ind).prior_id        := p_prior_rec.PRICE_LIST_ID;
6146    x_line_changed_attr_tbl(ind).prior_value     := OE_ID_TO_VALUE.PRICE_LIST(p_prior_rec.PRICE_LIST_ID);
6147 END IF;
6148 END IF; /*  PRIOR */
6149 /****************************/
6150 
6151 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
6152 IF OE_Globals.Equal(
6153        p_curr_rec.PRICE_LIST_ID,
6154        p_next_rec.PRICE_LIST_ID) THEN
6155     IF prior_exists = 'Y' THEN
6156    x_line_changed_attr_tbl(ind).next_value   := OE_ID_TO_VALUE.PRICE_LIST(p_curr_rec.PRICE_LIST_ID);
6157     END IF;
6158 ELSE
6159     IF prior_exists = 'N' THEN
6160         ind := ind+1;
6161     END IF;
6162    x_line_changed_attr_tbl(ind).attribute_name := 'PRICE_LIST_NAME_DUP';
6163    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
6164    x_line_changed_attr_tbl(ind).prior_id        := p_prior_rec.PRICE_LIST_ID;
6165    x_line_changed_attr_tbl(ind).prior_value     := OE_ID_TO_VALUE.PRICE_LIST(p_prior_rec.PRICE_LIST_ID);
6166    x_line_changed_attr_tbl(ind).current_id     := p_curr_rec.PRICE_LIST_ID;
6167    x_line_changed_attr_tbl(ind).current_value  := OE_ID_TO_VALUE.PRICE_LIST(p_curr_rec.PRICE_LIST_ID);
6168    x_line_changed_attr_tbl(ind).next_id      := p_next_rec.PRICE_LIST_ID;
6169    x_line_changed_attr_tbl(ind).next_value   := OE_ID_TO_VALUE.PRICE_LIST(p_next_rec.PRICE_LIST_ID);
6170 END IF;
6171 END IF; /*  NEXT */
6172 
6173 /* END PRICE_LIST_ID*/
6174 /****************************/
6175 
6176 /****************************/
6177 /* START SALESREP_ID*/
6178 
6179 prior_exists := 'N';
6180 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
6181 IF OE_Globals.Equal(
6182        p_curr_rec.SALESREP_ID,
6183        p_prior_rec.SALESREP_ID) THEN
6184  null;
6185 ELSE
6186    ind := ind+1;
6187    prior_exists := 'Y';
6188    x_line_changed_attr_tbl(ind).attribute_name  := 'SALESREP';
6189    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
6190    x_line_changed_attr_tbl(ind).current_id      := p_curr_rec.SALESREP_ID;
6191    x_line_changed_attr_tbl(ind).current_value   := OE_ID_TO_VALUE.SALESREP(p_curr_rec.SALESREP_ID);
6192    x_line_changed_attr_tbl(ind).prior_id        := p_prior_rec.SALESREP_ID;
6193    x_line_changed_attr_tbl(ind).prior_value     := OE_ID_TO_VALUE.SALESREP(p_prior_rec.SALESREP_ID);
6194 END IF;
6195 END IF; /*  PRIOR */
6196 /****************************/
6197 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
6198 IF OE_Globals.Equal(
6199        p_curr_rec.SALESREP_ID,
6200        p_next_rec.SALESREP_ID) THEN
6201     IF prior_exists = 'Y' THEN
6202    x_line_changed_attr_tbl(ind).next_value   := OE_ID_TO_VALUE.SALESREP(p_curr_rec.SALESREP_ID);
6203     END IF;
6204 ELSE
6205     IF prior_exists = 'N' THEN
6206         ind := ind+1;
6207     END IF;
6208    x_line_changed_attr_tbl(ind).attribute_name := 'SALESREP';
6209    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
6210    x_line_changed_attr_tbl(ind).prior_id        := p_prior_rec.SALESREP_ID;
6211    x_line_changed_attr_tbl(ind).prior_value     := OE_ID_TO_VALUE.SALESREP(p_prior_rec.SALESREP_ID);
6212    x_line_changed_attr_tbl(ind).current_id     := p_curr_rec.SALESREP_ID;
6213    x_line_changed_attr_tbl(ind).current_value  := OE_ID_TO_VALUE.SALESREP(p_curr_rec.SALESREP_ID);
6214    x_line_changed_attr_tbl(ind).next_id      := p_next_rec.SALESREP_ID;
6215    x_line_changed_attr_tbl(ind).next_value   := OE_ID_TO_VALUE.SALESREP(p_next_rec.SALESREP_ID);
6216 END IF; /*  NEXT */
6217 END IF;
6218 
6219 /* END SALESREP_ID*/
6220 /****************************/
6221 /****************************/
6222 /* START SHIPPING_METHOD_CODE*/
6223 
6224 prior_exists := 'N';
6225 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
6226 IF OE_Globals.Equal(
6227        p_curr_rec.SHIPPING_METHOD_CODE,
6228        p_prior_rec.SHIPPING_METHOD_CODE) THEN
6229  null;
6230 ELSE
6231    ind := ind+1;
6232    prior_exists := 'Y';
6233    x_line_changed_attr_tbl(ind).attribute_name  := 'SHIPPING_METHOD';
6234    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
6235    x_line_changed_attr_tbl(ind).current_id      := p_curr_rec.SHIPPING_METHOD_CODE;
6236    x_line_changed_attr_tbl(ind).current_value   := OE_ID_TO_VALUE.ship_method(p_curr_rec.SHIPPING_METHOD_CODE);
6237    x_line_changed_attr_tbl(ind).prior_id        := p_prior_rec.SHIPPING_METHOD_CODE;
6238    x_line_changed_attr_tbl(ind).prior_value     := OE_ID_TO_VALUE.ship_method(p_prior_rec.SHIPPING_METHOD_CODE);
6239 END IF;
6240 END IF; /*  PRIOR */
6241 /****************************/
6242 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
6243 IF OE_Globals.Equal(
6244        p_curr_rec.SHIPPING_METHOD_CODE,
6245        p_next_rec.SHIPPING_METHOD_CODE) THEN
6246     IF prior_exists = 'Y' THEN
6247    x_line_changed_attr_tbl(ind).next_value   := OE_ID_TO_VALUE.ship_method(p_curr_rec.SHIPPING_METHOD_CODE);
6248     END IF;
6249 ELSE
6250     IF prior_exists = 'N' THEN
6251         ind := ind+1;
6252     END IF;
6253    x_line_changed_attr_tbl(ind).attribute_name := 'SHIPPING_METHOD';
6254    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
6255    x_line_changed_attr_tbl(ind).prior_id        := p_prior_rec.SHIPPING_METHOD_CODE;
6256    x_line_changed_attr_tbl(ind).prior_value     := OE_ID_TO_VALUE.ship_method(p_prior_rec.SHIPPING_METHOD_CODE);
6257    x_line_changed_attr_tbl(ind).current_id     := p_curr_rec.SHIPPING_METHOD_CODE;
6258    x_line_changed_attr_tbl(ind).current_value  := OE_ID_TO_VALUE.ship_method(p_curr_rec.SHIPPING_METHOD_CODE);
6259    x_line_changed_attr_tbl(ind).next_id      := p_next_rec.SHIPPING_METHOD_CODE;
6260    x_line_changed_attr_tbl(ind).next_value   := OE_ID_TO_VALUE.ship_method(p_next_rec.SHIPPING_METHOD_CODE);
6261 END IF;
6262 END IF; /*  NEXT */
6263 
6264 /* END SHIPPING_METHOD_CODE*/
6265 /****************************/
6266 
6267 /****************************/
6268 /* START ship_from_org_id*/
6269 
6270 prior_exists := 'N';
6271 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
6272 IF OE_Globals.Equal(
6273        p_curr_rec.ship_from_org_id,
6274        p_prior_rec.ship_from_org_id) THEN
6275  null;
6276 ELSE
6277    ind := ind+1;
6278    prior_exists := 'Y';
6279    x_line_changed_attr_tbl(ind).attribute_name  := 'Warehouse';
6280    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
6281    if p_curr_rec.ship_from_org_id is not null then
6282      OE_ID_TO_VALUE.ship_from_Org
6283          (   p_ship_from_org_id        => p_curr_rec.ship_from_org_id
6284         , x_ship_from_address1    => x_ship_from_address1
6285         , x_ship_from_address2    => x_ship_from_address2
6286 	, x_ship_from_address3    => x_ship_from_address3
6287 	, x_ship_from_address4    => x_ship_from_address4
6288 	, x_ship_from_location    => x_ship_from_location
6289 	, x_ship_from_org         => x_current_ship_from_org
6290           );
6291 /*
6292   select
6293     DECODE(x_ship_from_location, NULL, NULL,x_ship_from_location|| ', ') ||
6294     DECODE(x_ship_from_address1, NULL, NULL,x_ship_from_address1 || ', ') ||
6295     DECODE(x_ship_from_address2, NULL, NULL,x_ship_from_address3 || ', ') ||
6296     DECODE(x_ship_from_address3, NULL, NULL,x_ship_from_address3 || ', ') ||
6297     DECODE(x_ship_from_address4, NULL, NULL,x_ship_from_address4 || ', ')
6298         into x_ship_from_address from dual;
6299 */
6300    x_line_changed_attr_tbl(ind).current_id      := p_curr_rec.ship_from_org_id;
6301    x_line_changed_attr_tbl(ind).current_value     := x_current_ship_from_org;
6302 
6303        end if;
6304    if p_prior_rec.ship_from_org_id is not null then
6305      OE_ID_TO_VALUE.ship_from_Org
6306          (   p_ship_from_org_id        => p_prior_rec.ship_from_org_id
6307         , x_ship_from_address1    => x_ship_from_address1
6308         , x_ship_from_address2    => x_ship_from_address2
6309 	, x_ship_from_address3    => x_ship_from_address3
6310 	, x_ship_from_address4    => x_ship_from_address4
6311 	, x_ship_from_location    => x_ship_from_location
6312 	, x_ship_from_org         => x_prior_ship_from_org
6313           );
6314 /*
6315   select
6316     DECODE(x_ship_from_location, NULL, NULL,x_ship_from_location|| ', ') ||
6317     DECODE(x_ship_from_address1, NULL, NULL,x_ship_from_address1 || ', ') ||
6318     DECODE(x_ship_from_address2, NULL, NULL,x_ship_from_address3 || ', ') ||
6319     DECODE(x_ship_from_address3, NULL, NULL,x_ship_from_address3 || ', ') ||
6320     DECODE(x_ship_from_address4, NULL, NULL,x_ship_from_address4 || ', ')
6321         into x_ship_from_address from dual;
6322 */
6323    x_line_changed_attr_tbl(ind).prior_id        := p_prior_rec.ship_from_org_id;
6324    x_line_changed_attr_tbl(ind).prior_value     := x_prior_ship_from_org;
6325        end if;
6326 END IF;
6327 END IF; /*  PRIOR */
6328 /****************************/
6329 
6330 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
6331 IF OE_Globals.Equal(
6332        p_curr_rec.ship_from_org_id,
6333        p_next_rec.ship_from_org_id) THEN
6334     IF prior_exists = 'Y' THEN
6335    x_line_changed_attr_tbl(ind).next_value     := x_current_ship_from_org;
6336     END IF;
6337 ELSE
6338     IF prior_exists = 'N' THEN
6339         ind := ind+1;
6340     END IF;
6341    x_line_changed_attr_tbl(ind).attribute_name := 'Warehouse';
6342    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
6343 
6344    if p_prior_rec.ship_from_org_id is not null then
6345      OE_ID_TO_VALUE.ship_from_Org
6346          (   p_ship_from_org_id        => p_prior_rec.ship_from_org_id
6347         , x_ship_from_address1    => x_ship_from_address1
6348         , x_ship_from_address2    => x_ship_from_address2
6349 	, x_ship_from_address3    => x_ship_from_address3
6350 	, x_ship_from_address4    => x_ship_from_address4
6351 	, x_ship_from_location    => x_ship_from_location
6352 	, x_ship_from_org         => x_prior_ship_from_org
6353           );
6354 /*
6355   select
6356     DECODE(x_ship_from_location, NULL, NULL,x_ship_from_location|| ', ') ||
6357     DECODE(x_ship_from_address1, NULL, NULL,x_ship_from_address1 || ', ') ||
6358     DECODE(x_ship_from_address2, NULL, NULL,x_ship_from_address3 || ', ') ||
6359     DECODE(x_ship_from_address3, NULL, NULL,x_ship_from_address3 || ', ') ||
6360     DECODE(x_ship_from_address4, NULL, NULL,x_ship_from_address4 || ', ')
6361         into x_ship_from_address from dual;
6362 */
6363    x_line_changed_attr_tbl(ind).prior_id        := p_prior_rec.ship_from_org_id;
6364    x_line_changed_attr_tbl(ind).prior_value     := x_prior_ship_from_org;
6365 
6366        end if;
6367    if p_curr_rec.ship_from_org_id is not null then
6368      OE_ID_TO_VALUE.ship_from_Org
6369          (   p_ship_from_org_id        => p_curr_rec.ship_from_org_id
6370         , x_ship_from_address1    => x_ship_from_address1
6371         , x_ship_from_address2    => x_ship_from_address2
6372 	, x_ship_from_address3    => x_ship_from_address3
6373 	, x_ship_from_address4    => x_ship_from_address4
6374 	, x_ship_from_location    => x_ship_from_location
6375 	, x_ship_from_org         => x_current_ship_from_org
6376           );
6377 /*
6378   select
6379     DECODE(x_ship_from_location, NULL, NULL,x_ship_from_location|| ', ') ||
6380     DECODE(x_ship_from_address1, NULL, NULL,x_ship_from_address1 || ', ') ||
6381     DECODE(x_ship_from_address2, NULL, NULL,x_ship_from_address3 || ', ') ||
6382     DECODE(x_ship_from_address3, NULL, NULL,x_ship_from_address3 || ', ') ||
6383     DECODE(x_ship_from_address4, NULL, NULL,x_ship_from_address4 || ', ')
6384         into x_ship_from_address from dual;
6385 */
6386    x_line_changed_attr_tbl(ind).current_id     := p_curr_rec.ship_from_org_id;
6387    x_line_changed_attr_tbl(ind).current_value     := x_current_ship_from_org;
6388        end if;
6389 
6390    if p_next_rec.ship_from_org_id is not null then
6391      OE_ID_TO_VALUE.ship_from_Org
6392          (   p_ship_from_org_id        => p_next_rec.ship_from_org_id
6393         , x_ship_from_address1    => x_ship_from_address1
6394         , x_ship_from_address2    => x_ship_from_address2
6395 	, x_ship_from_address3    => x_ship_from_address3
6396 	, x_ship_from_address4    => x_ship_from_address4
6397 	, x_ship_from_location    => x_ship_from_location
6398 	, x_ship_from_org         => x_next_ship_from_org
6399           );
6400 /*
6401   select
6402     DECODE(x_ship_from_location, NULL, NULL,x_ship_from_location|| ', ') ||
6403     DECODE(x_ship_from_address1, NULL, NULL,x_ship_from_address1 || ', ') ||
6404     DECODE(x_ship_from_address2, NULL, NULL,x_ship_from_address3 || ', ') ||
6405     DECODE(x_ship_from_address3, NULL, NULL,x_ship_from_address3 || ', ') ||
6406     DECODE(x_ship_from_address4, NULL, NULL,x_ship_from_address4 || ', ')
6407         into x_ship_from_address from dual;
6408 */
6409    x_line_changed_attr_tbl(ind).next_id      := p_next_rec.ship_from_org_id;
6410    x_line_changed_attr_tbl(ind).next_value     := x_next_ship_from_org;
6411        end if;
6412 END IF;
6413 END IF; /*  NEXT */
6414 
6415 /* END ship_from_org_id*/
6416 /****************************/
6417 
6418 /****************************/
6419 /* START ship_to_org_id*/
6420 
6421 prior_exists := 'N';
6422 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
6423 IF OE_Globals.Equal(
6424        p_curr_rec.ship_to_org_id,
6425        p_prior_rec.ship_to_org_id) THEN
6426  null;
6427 ELSE
6428    ind := ind+1;
6429    prior_exists := 'Y';
6430    x_line_changed_attr_tbl(ind).attribute_name  := 'ship_to';
6431    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
6432    if p_curr_rec.ship_to_org_id is not null then
6433      OE_ID_TO_VALUE.ship_to_Org
6434          (   p_ship_to_org_id        => p_curr_rec.ship_to_org_id
6435         , x_ship_to_address1    => x_ship_to_address1
6436         , x_ship_to_address2    => x_ship_to_address2
6437 	, x_ship_to_address3    => x_ship_to_address3
6438 	, x_ship_to_address4    => x_ship_to_address4
6439 	, x_ship_to_location    => x_ship_to_location
6440 	, x_ship_to_org         => x_ship_to_org
6441 	, x_ship_to_city        => x_ship_to_city
6442 	, x_ship_to_state       => x_ship_to_state
6443 	, x_ship_to_postal_code => x_ship_to_postal_code
6444 	, x_ship_to_country     => x_ship_to_country
6445           );
6446 
6447   select
6448     DECODE(x_ship_to_location, NULL, NULL,x_ship_to_location|| ', ') ||
6449     DECODE(x_ship_to_address1, NULL, NULL,x_ship_to_address1 || ', ') ||
6450     DECODE(x_ship_to_address2, NULL, NULL,x_ship_to_address3 || ', ') ||
6451     DECODE(x_ship_to_address3, NULL, NULL,x_ship_to_address3 || ', ') ||
6452     DECODE(x_ship_to_address4, NULL, NULL,x_ship_to_address4 || ', ') ||
6453     DECODE(x_ship_to_city, NULL, NULL,x_ship_to_city || ', ') ||
6454     DECODE(x_ship_to_state, NULL, NULL,x_ship_to_state || ', ') ||
6455     DECODE(x_ship_to_postal_code, NULL, NULL,x_ship_to_postal_code || ', ') ||
6456     DECODE(x_ship_to_country, NULL,NULL,x_ship_to_country)
6457         into x_current_ship_to_address from dual;
6458 
6459    x_line_changed_attr_tbl(ind).current_id      := p_curr_rec.ship_to_org_id;
6460    x_line_changed_attr_tbl(ind).current_value     := x_current_ship_to_address;
6461        end if;
6462 
6463    if p_prior_rec.ship_to_org_id is not null then
6464      OE_ID_TO_VALUE.ship_to_Org
6465          (   p_ship_to_org_id        => p_prior_rec.ship_to_org_id
6466         , x_ship_to_address1    => x_ship_to_address1
6467         , x_ship_to_address2    => x_ship_to_address2
6468 	, x_ship_to_address3    => x_ship_to_address3
6469 	, x_ship_to_address4    => x_ship_to_address4
6470 	, x_ship_to_location    => x_ship_to_location
6471 	, x_ship_to_org         => x_ship_to_org
6472 	, x_ship_to_city        => x_ship_to_city
6473 	, x_ship_to_state       => x_ship_to_state
6474 	, x_ship_to_postal_code => x_ship_to_postal_code
6475 	, x_ship_to_country     => x_ship_to_country
6476           );
6477 
6478   select
6479     DECODE(x_ship_to_location, NULL, NULL,x_ship_to_location|| ', ') ||
6480     DECODE(x_ship_to_address1, NULL, NULL,x_ship_to_address1 || ', ') ||
6481     DECODE(x_ship_to_address2, NULL, NULL,x_ship_to_address3 || ', ') ||
6482     DECODE(x_ship_to_address3, NULL, NULL,x_ship_to_address3 || ', ') ||
6483     DECODE(x_ship_to_address4, NULL, NULL,x_ship_to_address4 || ', ') ||
6484     DECODE(x_ship_to_city, NULL, NULL,x_ship_to_city || ', ') ||
6485     DECODE(x_ship_to_state, NULL, NULL,x_ship_to_state || ', ') ||
6486     DECODE(x_ship_to_postal_code, NULL, NULL,x_ship_to_postal_code || ', ') ||
6487     DECODE(x_ship_to_country, NULL,NULL,x_ship_to_country)
6488         into x_prior_ship_to_address from dual;
6489    x_line_changed_attr_tbl(ind).prior_id        := p_prior_rec.ship_to_org_id;
6490    x_line_changed_attr_tbl(ind).prior_value     := x_prior_ship_to_address;
6491        end if;
6492 END IF;
6493 END IF; /*  PRIOR */
6494 /****************************/
6495 
6496 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
6497 IF OE_Globals.Equal(
6498        p_curr_rec.ship_to_org_id,
6499        p_next_rec.ship_to_org_id) THEN
6500     IF prior_exists = 'Y' THEN
6501    x_line_changed_attr_tbl(ind).next_value     := x_current_ship_to_address;
6502     END IF;
6503 ELSE
6504     IF prior_exists = 'N' THEN
6505         ind := ind+1;
6506     END IF;
6507    x_line_changed_attr_tbl(ind).attribute_name := 'ship_to';
6508    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
6509 
6510    if p_prior_rec.ship_to_org_id is not null then
6511      OE_ID_TO_VALUE.ship_to_Org
6512          (   p_ship_to_org_id        => p_prior_rec.ship_to_org_id
6513         , x_ship_to_address1    => x_ship_to_address1
6514         , x_ship_to_address2    => x_ship_to_address2
6515 	, x_ship_to_address3    => x_ship_to_address3
6516 	, x_ship_to_address4    => x_ship_to_address4
6517 	, x_ship_to_location    => x_ship_to_location
6518 	, x_ship_to_org         => x_ship_to_org
6519 	, x_ship_to_city        => x_ship_to_city
6520 	, x_ship_to_state       => x_ship_to_state
6521 	, x_ship_to_postal_code => x_ship_to_postal_code
6522 	, x_ship_to_country     => x_ship_to_country
6523           );
6524 
6525   select
6526     DECODE(x_ship_to_location, NULL, NULL,x_ship_to_location|| ', ') ||
6527     DECODE(x_ship_to_address1, NULL, NULL,x_ship_to_address1 || ', ') ||
6528     DECODE(x_ship_to_address2, NULL, NULL,x_ship_to_address3 || ', ') ||
6529     DECODE(x_ship_to_address3, NULL, NULL,x_ship_to_address3 || ', ') ||
6530     DECODE(x_ship_to_address4, NULL, NULL,x_ship_to_address4 || ', ') ||
6531     DECODE(x_ship_to_city, NULL, NULL,x_ship_to_city || ', ') ||
6532     DECODE(x_ship_to_state, NULL, NULL,x_ship_to_state || ', ') ||
6533     DECODE(x_ship_to_postal_code, NULL, NULL,x_ship_to_postal_code || ', ') ||
6534     DECODE(x_ship_to_country, NULL,NULL,x_ship_to_country)
6535         into x_prior_ship_to_address from dual;
6536    x_line_changed_attr_tbl(ind).prior_id        := p_prior_rec.ship_to_org_id;
6537    x_line_changed_attr_tbl(ind).prior_value     := x_prior_ship_to_address;
6538        end if;
6539 
6540    if p_curr_rec.ship_to_org_id is not null then
6541      OE_ID_TO_VALUE.ship_to_Org
6542          (   p_ship_to_org_id        => p_curr_rec.ship_to_org_id
6543         , x_ship_to_address1    => x_ship_to_address1
6544         , x_ship_to_address2    => x_ship_to_address2
6545 	, x_ship_to_address3    => x_ship_to_address3
6546 	, x_ship_to_address4    => x_ship_to_address4
6547 	, x_ship_to_location    => x_ship_to_location
6548 	, x_ship_to_org         => x_ship_to_org
6549 	, x_ship_to_city        => x_ship_to_city
6550 	, x_ship_to_state       => x_ship_to_state
6551 	, x_ship_to_postal_code => x_ship_to_postal_code
6552 	, x_ship_to_country     => x_ship_to_country
6553           );
6554 
6555   select
6556     DECODE(x_ship_to_location, NULL, NULL,x_ship_to_location|| ', ') ||
6557     DECODE(x_ship_to_address1, NULL, NULL,x_ship_to_address1 || ', ') ||
6558     DECODE(x_ship_to_address2, NULL, NULL,x_ship_to_address3 || ', ') ||
6559     DECODE(x_ship_to_address3, NULL, NULL,x_ship_to_address3 || ', ') ||
6560     DECODE(x_ship_to_address4, NULL, NULL,x_ship_to_address4 || ', ') ||
6561     DECODE(x_ship_to_city, NULL, NULL,x_ship_to_city || ', ') ||
6562     DECODE(x_ship_to_state, NULL, NULL,x_ship_to_state || ', ') ||
6563     DECODE(x_ship_to_postal_code, NULL, NULL,x_ship_to_postal_code || ', ') ||
6564     DECODE(x_ship_to_country, NULL,NULL,x_ship_to_country)
6565         into x_current_ship_to_address from dual;
6566    x_line_changed_attr_tbl(ind).current_id     := p_curr_rec.ship_to_org_id;
6567    x_line_changed_attr_tbl(ind).current_value     := x_current_ship_to_address;
6568        end if;
6569 
6570    if p_next_rec.ship_to_org_id is not null then
6571      OE_ID_TO_VALUE.ship_to_Org
6572          (   p_ship_to_org_id        => p_next_rec.ship_to_org_id
6573         , x_ship_to_address1    => x_ship_to_address1
6574         , x_ship_to_address2    => x_ship_to_address2
6575 	, x_ship_to_address3    => x_ship_to_address3
6576 	, x_ship_to_address4    => x_ship_to_address4
6577 	, x_ship_to_location    => x_ship_to_location
6578 	, x_ship_to_org         => x_ship_to_org
6579 	, x_ship_to_city        => x_ship_to_city
6580 	, x_ship_to_state       => x_ship_to_state
6581 	, x_ship_to_postal_code => x_ship_to_postal_code
6582 	, x_ship_to_country     => x_ship_to_country
6583           );
6584 
6585   select
6586     DECODE(x_ship_to_location, NULL, NULL,x_ship_to_location|| ', ') ||
6587     DECODE(x_ship_to_address1, NULL, NULL,x_ship_to_address1 || ', ') ||
6588     DECODE(x_ship_to_address2, NULL, NULL,x_ship_to_address3 || ', ') ||
6589     DECODE(x_ship_to_address3, NULL, NULL,x_ship_to_address3 || ', ') ||
6590     DECODE(x_ship_to_address4, NULL, NULL,x_ship_to_address4 || ', ') ||
6591     DECODE(x_ship_to_city, NULL, NULL,x_ship_to_city || ', ') ||
6592     DECODE(x_ship_to_state, NULL, NULL,x_ship_to_state || ', ') ||
6593     DECODE(x_ship_to_postal_code, NULL, NULL,x_ship_to_postal_code || ', ') ||
6594     DECODE(x_ship_to_country, NULL,NULL,x_ship_to_country)
6595         into x_next_ship_to_address from dual;
6596    x_line_changed_attr_tbl(ind).next_id      := p_next_rec.ship_to_org_id;
6597    x_line_changed_attr_tbl(ind).next_value     := x_next_ship_to_address;
6598        end if;
6599 END IF;
6600 END IF; /*  NEXT */
6601 
6602 /* END ship_to_org_id*/
6603 /****************************/
6604 
6605 /****************************/
6606 /* START shipping_instructions*/
6607 
6608 prior_exists := 'N';
6609 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
6610 IF OE_Globals.Equal(
6611        p_curr_rec.shipping_instructions,
6612        p_prior_rec.shipping_instructions) THEN
6613  null;
6614 ELSE
6615    ind := ind+1;
6616    prior_exists := 'Y';
6617    x_line_changed_attr_tbl(ind).attribute_name  := 'shipping_instructions';
6618    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
6619    x_line_changed_attr_tbl(ind).current_value      := p_curr_rec.shipping_instructions;
6620    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.shipping_instructions;
6621 END IF;
6622 END IF; /*  PRIOR */
6623 /****************************/
6624 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
6625 IF OE_Globals.Equal(
6626        p_curr_rec.shipping_instructions,
6627        p_next_rec.shipping_instructions) THEN
6628     IF prior_exists = 'Y' THEN
6629    x_line_changed_attr_tbl(ind).next_value      := p_curr_rec.shipping_instructions;
6630     END IF;
6631 ELSE
6632     IF prior_exists = 'N' THEN
6633         ind := ind+1;
6634     END IF;
6635    x_line_changed_attr_tbl(ind).attribute_name := 'shipping_instructions';
6636    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
6637    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.shipping_instructions;
6638    x_line_changed_attr_tbl(ind).current_value     := p_curr_rec.shipping_instructions;
6639    x_line_changed_attr_tbl(ind).next_value      := p_next_rec.shipping_instructions;
6640 END IF;
6641 END IF; /*  NEXT */
6642 
6643 /* END shipping_instructions*/
6644 /****************************/
6645 
6646 /****************************/
6647 /* START packing_instructions*/
6648 
6649 prior_exists := 'N';
6650 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
6651 IF OE_Globals.Equal(
6652        p_curr_rec.packing_instructions,
6653        p_prior_rec.packing_instructions) THEN
6654  null;
6655 ELSE
6656    ind := ind+1;
6657    prior_exists := 'Y';
6658    x_line_changed_attr_tbl(ind).attribute_name  := 'packing_instructions';
6659    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
6660    x_line_changed_attr_tbl(ind).current_value      := p_curr_rec.packing_instructions;
6661    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.packing_instructions;
6662 END IF;
6663 END IF; /*  PRIOR */
6664 /****************************/
6665 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
6666 IF OE_Globals.Equal(
6667        p_curr_rec.packing_instructions,
6668        p_next_rec.packing_instructions) THEN
6669     IF prior_exists = 'Y' THEN
6670    x_line_changed_attr_tbl(ind).next_value      := p_curr_rec.packing_instructions;
6671     END IF;
6672 ELSE
6673     IF prior_exists = 'N' THEN
6674         ind := ind+1;
6675     END IF;
6676    x_line_changed_attr_tbl(ind).attribute_name := 'packing_instructions';
6677    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
6678    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.packing_instructions;
6679    x_line_changed_attr_tbl(ind).current_value     := p_curr_rec.packing_instructions;
6680    x_line_changed_attr_tbl(ind).next_value      := p_next_rec.packing_instructions;
6681 END IF;
6682 END IF; /*  NEXT */
6683 
6684 /* END packing_instructions*/
6685 /****************************/
6686 
6687 /****************************/
6688 /* START MAX_RELEASE_AMOUNT*/
6689 
6690 prior_exists := 'N';
6691 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
6692 IF OE_Globals.Equal(
6693        p_curr_rec.MAX_RELEASE_AMOUNT,
6694        p_prior_rec.MAX_RELEASE_AMOUNT) THEN
6695  null;
6696 ELSE
6697    ind := ind+1;
6698    prior_exists := 'Y';
6699    x_line_changed_attr_tbl(ind).attribute_name  := 'MAX_RELEASE_AMOUNT';
6700    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
6701    x_line_changed_attr_tbl(ind).current_value      := p_curr_rec.MAX_RELEASE_AMOUNT;
6702    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.MAX_RELEASE_AMOUNT;
6703 END IF;
6704 END IF; /*  PRIOR */
6705 /****************************/
6706 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
6707 IF OE_Globals.Equal(
6708        p_curr_rec.MAX_RELEASE_AMOUNT,
6709        p_next_rec.MAX_RELEASE_AMOUNT) THEN
6710     IF prior_exists = 'Y' THEN
6711    x_line_changed_attr_tbl(ind).next_value      := p_curr_rec.MAX_RELEASE_AMOUNT;
6712     END IF;
6713 ELSE
6714     IF prior_exists = 'N' THEN
6715         ind := ind+1;
6716     END IF;
6717    x_line_changed_attr_tbl(ind).attribute_name := 'MAX_RELEASE_AMOUNT';
6718    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
6719    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.MAX_RELEASE_AMOUNT;
6720    x_line_changed_attr_tbl(ind).current_value     := p_curr_rec.MAX_RELEASE_AMOUNT;
6721    x_line_changed_attr_tbl(ind).next_value      := p_next_rec.MAX_RELEASE_AMOUNT;
6722 END IF;
6723 END IF; /*  NEXT */
6724 
6725 /* END MAX_RELEASE_AMOUNT*/
6726 /****************************/
6727 
6728 /****************************/
6729 /* START MIN_RELEASE_AMOUNT*/
6730 
6731 prior_exists := 'N';
6732 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
6733 IF OE_Globals.Equal(
6734        p_curr_rec.MIN_RELEASE_AMOUNT,
6735        p_prior_rec.MIN_RELEASE_AMOUNT) THEN
6736  null;
6737 ELSE
6738    ind := ind+1;
6739    prior_exists := 'Y';
6740    x_line_changed_attr_tbl(ind).attribute_name  := 'MIN_RELEASE_AMOUNT';
6741    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
6742    x_line_changed_attr_tbl(ind).current_value      := p_curr_rec.MIN_RELEASE_AMOUNT;
6743    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.MIN_RELEASE_AMOUNT;
6744 END IF;
6745 END IF; /*  PRIOR */
6746 /****************************/
6747 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
6748 IF OE_Globals.Equal(
6749        p_curr_rec.MIN_RELEASE_AMOUNT,
6750        p_next_rec.MIN_RELEASE_AMOUNT) THEN
6751     IF prior_exists = 'Y' THEN
6752    x_line_changed_attr_tbl(ind).next_value      := p_curr_rec.MIN_RELEASE_AMOUNT;
6753     END IF;
6754 ELSE
6755     IF prior_exists = 'N' THEN
6756         ind := ind+1;
6757     END IF;
6758    x_line_changed_attr_tbl(ind).attribute_name := 'MIN_RELEASE_AMOUNT';
6759    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
6760    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.MIN_RELEASE_AMOUNT;
6761    x_line_changed_attr_tbl(ind).current_value     := p_curr_rec.MIN_RELEASE_AMOUNT;
6762    x_line_changed_attr_tbl(ind).next_value      := p_next_rec.MIN_RELEASE_AMOUNT;
6763 END IF;
6764 END IF; /*  NEXT */
6765 
6766 /* END MIN_RELEASE_AMOUNT*/
6767 /****************************/
6768 /****************************/
6769 /* START START_DATE_ACTIVE*/
6770 
6771 prior_exists := 'N';
6772 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
6773 IF OE_Globals.Equal(
6774        p_curr_rec.START_DATE_ACTIVE,
6775        p_prior_rec.START_DATE_ACTIVE) THEN
6776  null;
6777 ELSE
6778    ind := ind+1;
6779    prior_exists := 'Y';
6780    x_line_changed_attr_tbl(ind).attribute_name  := 'START_DATE_ACTIVE';
6781    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
6782    x_line_changed_attr_tbl(ind).current_value      := to_char(p_curr_rec.START_DATE_ACTIVE,'DD-MON-YYYY HH24:MI:SS');
6783    x_line_changed_attr_tbl(ind).prior_value        := to_char(p_prior_rec.START_DATE_ACTIVE,'DD-MON-YYYY HH24:MI:SS');
6784 END IF;
6785 END IF; /*  PRIOR */
6786 /****************************/
6787 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
6788 IF OE_Globals.Equal(
6789        p_curr_rec.START_DATE_ACTIVE,
6790        p_next_rec.START_DATE_ACTIVE) THEN
6791     IF prior_exists = 'Y' THEN
6792    x_line_changed_attr_tbl(ind).next_value      := to_char(p_curr_rec.START_DATE_ACTIVE,'DD-MON-YYYY HH24:MI:SS');
6793     END IF;
6794 ELSE
6795     IF prior_exists = 'N' THEN
6796         ind := ind+1;
6797     END IF;
6798    x_line_changed_attr_tbl(ind).attribute_name := 'START_DATE_ACTIVE';
6799    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
6800    x_line_changed_attr_tbl(ind).prior_value        := to_char(p_prior_rec.START_DATE_ACTIVE,'DD-MON-YYYY HH24:MI:SS');
6801    x_line_changed_attr_tbl(ind).current_value     := to_char(p_curr_rec.START_DATE_ACTIVE,'DD-MON-YYYY HH24:MI:SS');
6802    x_line_changed_attr_tbl(ind).next_value      := to_char(p_next_rec.START_DATE_ACTIVE,'DD-MON-YYYY HH24:MI:SS');
6803 END IF;
6804 END IF; /*  NEXT */
6805 
6806 /* END START_DATE_ACTIVE*/
6807 /****************************/
6808 
6809 /****************************/
6810 /* START END_DATE_ACTIVE*/
6811 
6812 prior_exists := 'N';
6813 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
6814 IF OE_Globals.Equal(
6815        p_curr_rec.END_DATE_ACTIVE,
6816        p_prior_rec.END_DATE_ACTIVE) THEN
6817  null;
6818 ELSE
6819    ind := ind+1;
6820    prior_exists := 'Y';
6821    x_line_changed_attr_tbl(ind).attribute_name  := 'END_DATE_ACTIVE';
6822    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
6823    x_line_changed_attr_tbl(ind).current_value      := to_char(p_curr_rec.END_DATE_ACTIVE,'DD-MON-YYYY HH24:MI:SS');
6824    x_line_changed_attr_tbl(ind).prior_value        := to_char(p_prior_rec.END_DATE_ACTIVE,'DD-MON-YYYY HH24:MI:SS');
6825 END IF;
6826 END IF; /*  PRIOR */
6827 /****************************/
6828 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
6829 IF OE_Globals.Equal(
6830        p_curr_rec.END_DATE_ACTIVE,
6831        p_next_rec.END_DATE_ACTIVE) THEN
6832     IF prior_exists = 'Y' THEN
6833    x_line_changed_attr_tbl(ind).next_value      := to_char(p_curr_rec.END_DATE_ACTIVE,'DD-MON-YYYY HH24:MI:SS');
6834     END IF;
6835 ELSE
6836     IF prior_exists = 'N' THEN
6837         ind := ind+1;
6838     END IF;
6839    x_line_changed_attr_tbl(ind).attribute_name := 'END_DATE_ACTIVE';
6840    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
6841    x_line_changed_attr_tbl(ind).prior_value        := to_char(p_prior_rec.END_DATE_ACTIVE,'DD-MON-YYYY HH24:MI:SS');
6842    x_line_changed_attr_tbl(ind).current_value     := to_char(p_curr_rec.END_DATE_ACTIVE,'DD-MON-YYYY HH24:MI:SS');
6843    x_line_changed_attr_tbl(ind).next_value      := to_char(p_next_rec.END_DATE_ACTIVE,'DD-MON-YYYY HH24:MI:SS');
6844 END IF;
6845 END IF; /*  NEXT */
6846 
6847 /* END END_DATE_ACTIVE*/
6848 /****************************/
6849 
6850 /****************************/
6851 /* START BLANKET_MAX_QUANTITY*/
6852 
6853 prior_exists := 'N';
6854 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
6855 IF OE_Globals.Equal(
6856        p_curr_rec.BLANKET_MAX_QUANTITY,
6857        p_prior_rec.BLANKET_MAX_QUANTITY) THEN
6858  null;
6859 ELSE
6860    ind := ind+1;
6861    prior_exists := 'Y';
6862    x_line_changed_attr_tbl(ind).attribute_name  := 'BLANKET_MAX_QUANTITY';
6863    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
6864    x_line_changed_attr_tbl(ind).current_value      := p_curr_rec.BLANKET_MAX_QUANTITY;
6865    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.BLANKET_MAX_QUANTITY;
6866 END IF;
6867 END IF; /*  PRIOR */
6868 /****************************/
6869 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
6870 IF OE_Globals.Equal(
6871        p_curr_rec.BLANKET_MAX_QUANTITY,
6872        p_next_rec.BLANKET_MAX_QUANTITY) THEN
6873     IF prior_exists = 'Y' THEN
6874    x_line_changed_attr_tbl(ind).next_value      := p_curr_rec.BLANKET_MAX_QUANTITY;
6875     END IF;
6876 ELSE
6877     IF prior_exists = 'N' THEN
6878         ind := ind+1;
6879     END IF;
6880    x_line_changed_attr_tbl(ind).attribute_name := 'BLANKET_MAX_QUANTITY';
6881    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
6882    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.BLANKET_MAX_QUANTITY;
6883    x_line_changed_attr_tbl(ind).current_value     := p_curr_rec.BLANKET_MAX_QUANTITY;
6884    x_line_changed_attr_tbl(ind).next_value      := p_next_rec.BLANKET_MAX_QUANTITY;
6885 END IF;
6886 END IF; /*  NEXT */
6887 
6888 /* END BLANKET_MAX_QUANTITY*/
6889 /****************************/
6890 /****************************/
6891 /* START BLANKET_MIN_QUANTITY*/
6892 
6893 prior_exists := 'N';
6894 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
6895 IF OE_Globals.Equal(
6896        p_curr_rec.BLANKET_MIN_QUANTITY,
6897        p_prior_rec.BLANKET_MIN_QUANTITY) THEN
6898  null;
6899 ELSE
6900    ind := ind+1;
6901    prior_exists := 'Y';
6902    x_line_changed_attr_tbl(ind).attribute_name  := 'BLANKET_MIN_QUANTITY';
6903    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
6904    x_line_changed_attr_tbl(ind).current_value      := p_curr_rec.BLANKET_MIN_QUANTITY;
6905    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.BLANKET_MIN_QUANTITY;
6906 END IF;
6907 END IF; /*  PRIOR */
6908 /****************************/
6909 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
6910 IF OE_Globals.Equal(
6911        p_curr_rec.BLANKET_MIN_QUANTITY,
6912        p_next_rec.BLANKET_MIN_QUANTITY) THEN
6913     IF prior_exists = 'Y' THEN
6914    x_line_changed_attr_tbl(ind).next_value      := p_curr_rec.BLANKET_MIN_QUANTITY;
6915     END IF;
6916 ELSE
6917     IF prior_exists = 'N' THEN
6918         ind := ind+1;
6919     END IF;
6920    x_line_changed_attr_tbl(ind).attribute_name := 'BLANKET_MIN_QUANTITY';
6921    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
6922    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.BLANKET_MIN_QUANTITY;
6923    x_line_changed_attr_tbl(ind).current_value     := p_curr_rec.BLANKET_MIN_QUANTITY;
6924    x_line_changed_attr_tbl(ind).next_value      := p_next_rec.BLANKET_MIN_QUANTITY;
6925 END IF;
6926 END IF; /*  NEXT */
6927 
6928 /* END BLANKET_MIN_QUANTITY*/
6929 /****************************/
6930 
6931 /****************************/
6932 /* START OVERRIDE_BLANKET_CONTROLS_FLAG*/
6933 
6934 prior_exists := 'N';
6935 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
6936 IF OE_Globals.Equal(
6937        p_curr_rec.OVERRIDE_BLANKET_CONTROLS_FLAG,
6938        p_prior_rec.OVERRIDE_BLANKET_CONTROLS_FLAG) THEN
6939  null;
6940 ELSE
6941    ind := ind+1;
6942    prior_exists := 'Y';
6943    x_line_changed_attr_tbl(ind).attribute_name  := 'OVERRIDE_BLANKET_CONTROLS_FLAG';
6944    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
6945    x_line_changed_attr_tbl(ind).current_value      := p_curr_rec.OVERRIDE_BLANKET_CONTROLS_FLAG;
6946    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.OVERRIDE_BLANKET_CONTROLS_FLAG;
6947 END IF;
6948 END IF; /*  PRIOR */
6949 /****************************/
6950 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
6951 IF OE_Globals.Equal(
6952        p_curr_rec.OVERRIDE_BLANKET_CONTROLS_FLAG,
6953        p_next_rec.OVERRIDE_BLANKET_CONTROLS_FLAG) THEN
6954     IF prior_exists = 'Y' THEN
6955    x_line_changed_attr_tbl(ind).next_value      := p_curr_rec.OVERRIDE_BLANKET_CONTROLS_FLAG;
6956     END IF;
6957 ELSE
6958     IF prior_exists = 'N' THEN
6959         ind := ind+1;
6960     END IF;
6961    x_line_changed_attr_tbl(ind).attribute_name := 'OVERRIDE_BLANKET_CONTROLS_FLAG';
6962    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
6963    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.OVERRIDE_BLANKET_CONTROLS_FLAG;
6964    x_line_changed_attr_tbl(ind).current_value     := p_curr_rec.OVERRIDE_BLANKET_CONTROLS_FLAG;
6965    x_line_changed_attr_tbl(ind).next_value      := p_next_rec.OVERRIDE_BLANKET_CONTROLS_FLAG;
6966 END IF;
6967 END IF; /*  NEXT */
6968 
6969 /* END OVERRIDE_BLANKET_CONTROLS_FLAG*/
6970 /****************************/
6971 
6972 /****************************/
6973 /* START OVERRIDE_RELEASE_CONTROLS_FLAG*/
6974 
6975 prior_exists := 'N';
6976 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
6977 IF OE_Globals.Equal(
6978        p_curr_rec.OVERRIDE_RELEASE_CONTROLS_FLAG,
6979        p_prior_rec.OVERRIDE_RELEASE_CONTROLS_FLAG) THEN
6980  null;
6981 ELSE
6982    ind := ind+1;
6983    prior_exists := 'Y';
6984    x_line_changed_attr_tbl(ind).attribute_name  := 'OVERRIDE_RELEASE_CONTROLS_FLAG';
6985    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
6986    x_line_changed_attr_tbl(ind).current_value      := p_curr_rec.OVERRIDE_RELEASE_CONTROLS_FLAG;
6987    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.OVERRIDE_RELEASE_CONTROLS_FLAG;
6988 END IF;
6989 END IF; /*  PRIOR */
6990 /****************************/
6991 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
6992 IF OE_Globals.Equal(
6993        p_curr_rec.OVERRIDE_RELEASE_CONTROLS_FLAG,
6994        p_next_rec.OVERRIDE_RELEASE_CONTROLS_FLAG) THEN
6995     IF prior_exists = 'Y' THEN
6996    x_line_changed_attr_tbl(ind).next_value      := p_curr_rec.OVERRIDE_RELEASE_CONTROLS_FLAG;
6997     END IF;
6998 ELSE
6999     IF prior_exists = 'N' THEN
7000         ind := ind+1;
7001     END IF;
7002    x_line_changed_attr_tbl(ind).attribute_name := 'OVERRIDE_RELEASE_CONTROLS_FLAG';
7003    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
7004    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.OVERRIDE_RELEASE_CONTROLS_FLAG;
7005    x_line_changed_attr_tbl(ind).current_value     := p_curr_rec.OVERRIDE_RELEASE_CONTROLS_FLAG;
7006    x_line_changed_attr_tbl(ind).next_value      := p_next_rec.OVERRIDE_RELEASE_CONTROLS_FLAG;
7007 END IF;
7008 END IF; /*  NEXT */
7009 
7010 /* END OVERRIDE_RELEASE_CONTROLS_FLAG*/
7011 /****************************/
7012 /****************************/
7013 /* START ENFORCE_PRICE_LIST_FLAG*/
7014 
7015 prior_exists := 'N';
7016 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
7017 IF OE_Globals.Equal(
7018        p_curr_rec.ENFORCE_PRICE_LIST_FLAG,
7019        p_prior_rec.ENFORCE_PRICE_LIST_FLAG) THEN
7020  null;
7021 ELSE
7022    ind := ind+1;
7023    prior_exists := 'Y';
7024    x_line_changed_attr_tbl(ind).attribute_name  := 'ENFORCE_PRICE_LIST_FLAG_DUP';
7025    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
7026    x_line_changed_attr_tbl(ind).current_value      := p_curr_rec.ENFORCE_PRICE_LIST_FLAG;
7027    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.ENFORCE_PRICE_LIST_FLAG;
7028 END IF;
7029 END IF; /*  PRIOR */
7030 /****************************/
7031 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
7032 IF OE_Globals.Equal(
7033        p_curr_rec.ENFORCE_PRICE_LIST_FLAG,
7034        p_next_rec.ENFORCE_PRICE_LIST_FLAG) THEN
7035     IF prior_exists = 'Y' THEN
7036    x_line_changed_attr_tbl(ind).next_value      := p_curr_rec.ENFORCE_PRICE_LIST_FLAG;
7037     END IF;
7038 ELSE
7039     IF prior_exists = 'N' THEN
7040         ind := ind+1;
7041     END IF;
7042    x_line_changed_attr_tbl(ind).attribute_name := 'ENFORCE_PRICE_LIST_FLAG_DUP';
7043    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
7044    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.ENFORCE_PRICE_LIST_FLAG;
7045    x_line_changed_attr_tbl(ind).current_value     := p_curr_rec.ENFORCE_PRICE_LIST_FLAG;
7046    x_line_changed_attr_tbl(ind).next_value      := p_next_rec.ENFORCE_PRICE_LIST_FLAG;
7047 END IF;
7048 END IF; /*  NEXT */
7049 
7050 /* END ENFORCE_PRICE_LIST_FLAG*/
7051 /****************************/
7052 
7053 /****************************/
7054 /* START enforce_ship_to_flag*/
7055 
7056 prior_exists := 'N';
7057 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
7058 IF OE_Globals.Equal(
7059        p_curr_rec.enforce_ship_to_flag,
7060        p_prior_rec.enforce_ship_to_flag) THEN
7061  null;
7062 ELSE
7063    ind := ind+1;
7064    prior_exists := 'Y';
7065    x_line_changed_attr_tbl(ind).attribute_name  := 'enforce_ship_to_flag';
7066    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
7067    x_line_changed_attr_tbl(ind).current_value      := p_curr_rec.enforce_ship_to_flag;
7068    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.enforce_ship_to_flag;
7069 END IF;
7070 END IF; /*  PRIOR */
7071 /****************************/
7072 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
7073 IF OE_Globals.Equal(
7074        p_curr_rec.enforce_ship_to_flag,
7075        p_next_rec.enforce_ship_to_flag) THEN
7076     IF prior_exists = 'Y' THEN
7077    x_line_changed_attr_tbl(ind).next_value      := p_curr_rec.enforce_ship_to_flag;
7078     END IF;
7079 ELSE
7080     IF prior_exists = 'N' THEN
7081         ind := ind+1;
7082     END IF;
7083    x_line_changed_attr_tbl(ind).attribute_name := 'enforce_ship_to_flag';
7084    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
7085    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.enforce_ship_to_flag;
7086    x_line_changed_attr_tbl(ind).current_value     := p_curr_rec.enforce_ship_to_flag;
7087    x_line_changed_attr_tbl(ind).next_value      := p_next_rec.enforce_ship_to_flag;
7088 END IF;
7089 END IF; /*  NEXT */
7090 
7091 /* END enforce_ship_to_flag*/
7092 /****************************/
7093 
7094 /****************************/
7095 /* START enforce_invoice_to_flag*/
7096 
7097 prior_exists := 'N';
7098 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
7099 IF OE_Globals.Equal(
7100        p_curr_rec.enforce_invoice_to_flag,
7101        p_prior_rec.enforce_invoice_to_flag) THEN
7102  null;
7103 ELSE
7104    ind := ind+1;
7105    prior_exists := 'Y';
7106    x_line_changed_attr_tbl(ind).attribute_name  := 'enforce_invoice_to_flag';
7107    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
7108    x_line_changed_attr_tbl(ind).current_value      := p_curr_rec.enforce_invoice_to_flag;
7109    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.enforce_invoice_to_flag;
7110 END IF;
7111 END IF; /*  PRIOR */
7112 /****************************/
7113 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
7114 IF OE_Globals.Equal(
7115        p_curr_rec.enforce_invoice_to_flag,
7116        p_next_rec.enforce_invoice_to_flag) THEN
7117     IF prior_exists = 'Y' THEN
7118    x_line_changed_attr_tbl(ind).next_value      := p_curr_rec.enforce_invoice_to_flag;
7119     END IF;
7120 ELSE
7121     IF prior_exists = 'N' THEN
7122         ind := ind+1;
7123     END IF;
7124    x_line_changed_attr_tbl(ind).attribute_name := 'enforce_invoice_to_flag';
7125    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
7126    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.enforce_invoice_to_flag;
7127    x_line_changed_attr_tbl(ind).current_value     := p_curr_rec.enforce_invoice_to_flag;
7128    x_line_changed_attr_tbl(ind).next_value      := p_next_rec.enforce_invoice_to_flag;
7129 END IF;
7130 END IF; /*  NEXT */
7131 
7132 /* END enforce_invoice_to_flag*/
7133 /****************************/
7134 
7135 /****************************/
7136 /* START enforce_freight_term_flag*/
7137 
7138 prior_exists := 'N';
7139 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
7140 IF OE_Globals.Equal(
7141        p_curr_rec.enforce_freight_term_flag,
7142        p_prior_rec.enforce_freight_term_flag) THEN
7143  null;
7144 ELSE
7145    ind := ind+1;
7146    prior_exists := 'Y';
7147    x_line_changed_attr_tbl(ind).attribute_name  := 'enforce_freight_term_flag';
7148    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
7149    x_line_changed_attr_tbl(ind).current_value      := p_curr_rec.enforce_freight_term_flag;
7150    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.enforce_freight_term_flag;
7151 END IF;
7152 END IF; /*  PRIOR */
7153 /****************************/
7154 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
7155 IF OE_Globals.Equal(
7156        p_curr_rec.enforce_freight_term_flag,
7157        p_next_rec.enforce_freight_term_flag) THEN
7158     IF prior_exists = 'Y' THEN
7159    x_line_changed_attr_tbl(ind).next_value      := p_curr_rec.enforce_freight_term_flag;
7160     END IF;
7161 ELSE
7162     IF prior_exists = 'N' THEN
7163         ind := ind+1;
7164     END IF;
7165    x_line_changed_attr_tbl(ind).attribute_name := 'enforce_freight_term_flag';
7166    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
7167    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.enforce_freight_term_flag;
7168    x_line_changed_attr_tbl(ind).current_value     := p_curr_rec.enforce_freight_term_flag;
7169    x_line_changed_attr_tbl(ind).next_value      := p_next_rec.enforce_freight_term_flag;
7170 END IF;
7171 END IF; /*  NEXT */
7172 
7173 /* END enforce_freight_term_flag*/
7174 /****************************/
7175 
7176 /****************************/
7177 /* START enforce_shipping_method_flag*/
7178 
7179 prior_exists := 'N';
7180 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
7181 IF OE_Globals.Equal(
7182        p_curr_rec.enforce_shipping_method_flag,
7183        p_prior_rec.enforce_shipping_method_flag) THEN
7184  null;
7185 ELSE
7186    ind := ind+1;
7187    prior_exists := 'Y';
7188    x_line_changed_attr_tbl(ind).attribute_name  := 'enforce_shipping_method_flag';
7189    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
7190    x_line_changed_attr_tbl(ind).current_value      := p_curr_rec.enforce_shipping_method_flag;
7191    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.enforce_shipping_method_flag;
7192 END IF;
7193 END IF; /*  PRIOR */
7194 /****************************/
7195 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
7196 IF OE_Globals.Equal(
7197        p_curr_rec.enforce_shipping_method_flag,
7198        p_next_rec.enforce_shipping_method_flag) THEN
7199     IF prior_exists = 'Y' THEN
7200    x_line_changed_attr_tbl(ind).next_value      := p_curr_rec.enforce_shipping_method_flag;
7201     END IF;
7202 ELSE
7203     IF prior_exists = 'N' THEN
7204         ind := ind+1;
7205     END IF;
7206    x_line_changed_attr_tbl(ind).attribute_name := 'enforce_shipping_method_flag';
7207    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
7208    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.enforce_shipping_method_flag;
7209    x_line_changed_attr_tbl(ind).current_value     := p_curr_rec.enforce_shipping_method_flag;
7210    x_line_changed_attr_tbl(ind).next_value      := p_next_rec.enforce_shipping_method_flag;
7211 END IF;
7212 END IF; /*  NEXT */
7213 
7214 /* END enforce_shipping_method_flag*/
7215 /****************************/
7216 
7217 /****************************/
7218 /* START enforce_payment_term_flag*/
7219 
7220 prior_exists := 'N';
7221 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
7222 IF OE_Globals.Equal(
7223        p_curr_rec.enforce_payment_term_flag,
7224        p_prior_rec.enforce_payment_term_flag) THEN
7225  null;
7226 ELSE
7227    ind := ind+1;
7228    prior_exists := 'Y';
7229    x_line_changed_attr_tbl(ind).attribute_name  := 'enforce_payment_term_flag';
7230    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
7231    x_line_changed_attr_tbl(ind).current_value      := p_curr_rec.enforce_payment_term_flag;
7232    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.enforce_payment_term_flag;
7233 END IF;
7234 END IF; /*  PRIOR */
7235 /****************************/
7236 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
7237 IF OE_Globals.Equal(
7238        p_curr_rec.enforce_payment_term_flag,
7239        p_next_rec.enforce_payment_term_flag) THEN
7240     IF prior_exists = 'Y' THEN
7241    x_line_changed_attr_tbl(ind).next_value      := p_curr_rec.enforce_payment_term_flag;
7242     END IF;
7243 ELSE
7244     IF prior_exists = 'N' THEN
7245         ind := ind+1;
7246     END IF;
7247    x_line_changed_attr_tbl(ind).attribute_name := 'enforce_payment_term_flag';
7248    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
7249    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.enforce_payment_term_flag;
7250    x_line_changed_attr_tbl(ind).current_value     := p_curr_rec.enforce_payment_term_flag;
7251    x_line_changed_attr_tbl(ind).next_value      := p_next_rec.enforce_payment_term_flag;
7252 END IF;
7253 END IF; /*  NEXT */
7254 
7255 /* END enforce_payment_term_flag*/
7256 /****************************/
7257 
7258 /****************************/
7259 /* START enforce_accounting_rule_flag*/
7260 
7261 prior_exists := 'N';
7262 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
7263 IF OE_Globals.Equal(
7264        p_curr_rec.enforce_accounting_rule_flag,
7265        p_prior_rec.enforce_accounting_rule_flag) THEN
7266  null;
7267 ELSE
7268    ind := ind+1;
7269    prior_exists := 'Y';
7270    x_line_changed_attr_tbl(ind).attribute_name  := 'enforce_accounting_rule_flag';
7271    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
7272    x_line_changed_attr_tbl(ind).current_value      := p_curr_rec.enforce_accounting_rule_flag;
7273    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.enforce_accounting_rule_flag;
7274 END IF;
7275 END IF; /*  PRIOR */
7276 /****************************/
7277 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
7278 IF OE_Globals.Equal(
7279        p_curr_rec.enforce_accounting_rule_flag,
7280        p_next_rec.enforce_accounting_rule_flag) THEN
7281     IF prior_exists = 'Y' THEN
7282    x_line_changed_attr_tbl(ind).next_value      := p_curr_rec.enforce_accounting_rule_flag;
7283     END IF;
7284 ELSE
7285     IF prior_exists = 'N' THEN
7286         ind := ind+1;
7287     END IF;
7288    x_line_changed_attr_tbl(ind).attribute_name := 'enforce_accounting_rule_flag';
7289    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
7290    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.enforce_accounting_rule_flag;
7291    x_line_changed_attr_tbl(ind).current_value     := p_curr_rec.enforce_accounting_rule_flag;
7292    x_line_changed_attr_tbl(ind).next_value      := p_next_rec.enforce_accounting_rule_flag;
7293 END IF;
7294 END IF; /*  NEXT */
7295 
7296 /* END enforce_accounting_rule_flag*/
7297 /****************************/
7298 
7299 /****************************/
7300 /* START BLANKET_MAX_AMOUNT*/
7301 
7302 prior_exists := 'N';
7303 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
7304 IF OE_Globals.Equal(
7305        p_curr_rec.BLANKET_MAX_AMOUNT,
7306        p_prior_rec.BLANKET_MAX_AMOUNT) THEN
7307  null;
7308 ELSE
7309    ind := ind+1;
7310    prior_exists := 'Y';
7311    x_line_changed_attr_tbl(ind).attribute_name  := 'BLANKET_LINE_MAX_AMOUNT';
7312    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
7313    x_line_changed_attr_tbl(ind).current_value      := p_curr_rec.BLANKET_MAX_AMOUNT;
7314    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.BLANKET_MAX_AMOUNT;
7315 END IF;
7316 END IF; /*  PRIOR */
7317 /****************************/
7318 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
7319 IF OE_Globals.Equal(
7320        p_curr_rec.BLANKET_MAX_AMOUNT,
7321        p_next_rec.BLANKET_MAX_AMOUNT) THEN
7322     IF prior_exists = 'Y' THEN
7323    x_line_changed_attr_tbl(ind).next_value      := p_curr_rec.BLANKET_MAX_AMOUNT;
7324     END IF;
7325 ELSE
7326     IF prior_exists = 'N' THEN
7327         ind := ind+1;
7328     END IF;
7329    x_line_changed_attr_tbl(ind).attribute_name := 'BLANKET_LINE_MAX_AMOUNT';
7330    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
7331    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.BLANKET_MAX_AMOUNT;
7332    x_line_changed_attr_tbl(ind).current_value     := p_curr_rec.BLANKET_MAX_AMOUNT;
7333    x_line_changed_attr_tbl(ind).next_value      := p_next_rec.BLANKET_MAX_AMOUNT;
7334 END IF; /*  NEXT */
7335 END IF;
7336 
7337 /* END BLANKET_MAX_AMOUNT*/
7338 /****************************/
7339 
7340 /****************************/
7341 /* START BLANKET_MIN_AMOUNT*/
7342 
7343 prior_exists := 'N';
7344 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
7345 IF OE_Globals.Equal(
7346        p_curr_rec.BLANKET_MIN_AMOUNT,
7347        p_prior_rec.BLANKET_MIN_AMOUNT) THEN
7348  null;
7349 ELSE
7350    ind := ind+1;
7351    prior_exists := 'Y';
7352    x_line_changed_attr_tbl(ind).attribute_name  := 'BLANKET_LINE_MIN_AMOUNT';
7353    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
7354    x_line_changed_attr_tbl(ind).current_value      := p_curr_rec.BLANKET_MIN_AMOUNT;
7355    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.BLANKET_MIN_AMOUNT;
7356 END IF;
7357 END IF; /*  PRIOR */
7358 /****************************/
7359 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
7360 IF OE_Globals.Equal(
7361        p_curr_rec.BLANKET_MIN_AMOUNT,
7362        p_next_rec.BLANKET_MIN_AMOUNT) THEN
7363     IF prior_exists = 'Y' THEN
7364    x_line_changed_attr_tbl(ind).next_value      := p_curr_rec.BLANKET_MIN_AMOUNT;
7365     END IF;
7366 ELSE
7367     IF prior_exists = 'N' THEN
7368         ind := ind+1;
7369     END IF;
7370    x_line_changed_attr_tbl(ind).attribute_name := 'BLANKET_LINE_MIN_AMOUNT';
7371    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
7372    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.BLANKET_MIN_AMOUNT;
7373    x_line_changed_attr_tbl(ind).current_value     := p_curr_rec.BLANKET_MIN_AMOUNT;
7374    x_line_changed_attr_tbl(ind).next_value      := p_next_rec.BLANKET_MIN_AMOUNT;
7375 END IF;
7376 END IF; /*  NEXT */
7377 
7378 /* END BLANKET_MIN_AMOUNT*/
7379 /****************************/
7380 
7381 /****************************/
7382 /* START FULFILLED_QUANTITY*/
7383 
7384 prior_exists := 'N';
7385 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
7386 IF OE_Globals.Equal(
7387        p_curr_rec.FULFILLED_QUANTITY,
7388        p_prior_rec.FULFILLED_QUANTITY) THEN
7389  null;
7390 ELSE
7391    ind := ind+1;
7392    prior_exists := 'Y';
7393    x_line_changed_attr_tbl(ind).attribute_name  := 'FULFILLED_QUANTITY';
7394    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
7395    x_line_changed_attr_tbl(ind).current_value      := p_curr_rec.FULFILLED_QUANTITY;
7396    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.FULFILLED_QUANTITY;
7397 END IF;
7398 END IF; /*  PRIOR */
7399 /****************************/
7400 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
7401 IF OE_Globals.Equal(
7402        p_curr_rec.FULFILLED_QUANTITY,
7403        p_next_rec.FULFILLED_QUANTITY) THEN
7404     IF prior_exists = 'Y' THEN
7405    x_line_changed_attr_tbl(ind).next_value      := p_curr_rec.FULFILLED_QUANTITY;
7406     END IF;
7407 ELSE
7408     IF prior_exists = 'N' THEN
7409         ind := ind+1;
7410     END IF;
7411    x_line_changed_attr_tbl(ind).attribute_name := 'FULFILLED_QUANTITY';
7412    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
7413    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.FULFILLED_QUANTITY;
7414    x_line_changed_attr_tbl(ind).current_value     := p_curr_rec.FULFILLED_QUANTITY;
7415    x_line_changed_attr_tbl(ind).next_value      := p_next_rec.FULFILLED_QUANTITY;
7416 END IF;
7417 END IF; /*  NEXT */
7418 
7419 /* END FULFILLED_QUANTITY*/
7420 /****************************/
7421 
7422 /****************************/
7423 /* START RELEASED_QUANTITY*/
7424 
7425 prior_exists := 'N';
7426 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
7427 IF OE_Globals.Equal(
7428        p_curr_rec.RELEASED_QUANTITY,
7429        p_prior_rec.RELEASED_QUANTITY) THEN
7430  null;
7431 ELSE
7432    ind := ind+1;
7433    prior_exists := 'Y';
7434    x_line_changed_attr_tbl(ind).attribute_name  := 'RELEASED_QUANTITY';
7435    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
7436    x_line_changed_attr_tbl(ind).current_value      := p_curr_rec.RELEASED_QUANTITY;
7437    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.RELEASED_QUANTITY;
7438 END IF;
7439 END IF; /*  PRIOR */
7440 /****************************/
7441 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
7442 IF OE_Globals.Equal(
7443        p_curr_rec.RELEASED_QUANTITY,
7444        p_next_rec.RELEASED_QUANTITY) THEN
7445     IF prior_exists = 'Y' THEN
7446    x_line_changed_attr_tbl(ind).next_value      := p_curr_rec.RELEASED_QUANTITY;
7447     END IF;
7448 ELSE
7449     IF prior_exists = 'N' THEN
7450         ind := ind+1;
7451     END IF;
7452    x_line_changed_attr_tbl(ind).attribute_name := 'RELEASED_QUANTITY';
7453    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
7454    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.RELEASED_QUANTITY;
7455    x_line_changed_attr_tbl(ind).current_value     := p_curr_rec.RELEASED_QUANTITY;
7456    x_line_changed_attr_tbl(ind).next_value      := p_next_rec.RELEASED_QUANTITY;
7457 END IF;
7458 END IF; /*  NEXT */
7459 
7460 /* END RELEASED_QUANTITY*/
7461 /****************************/
7462 
7463 /****************************/
7464 /* START RETURNED_QUANTITY*/
7465 
7466 prior_exists := 'N';
7467 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
7468 IF OE_Globals.Equal(
7469        p_curr_rec.RETURNED_QUANTITY,
7470        p_prior_rec.RETURNED_QUANTITY) THEN
7471  null;
7472 ELSE
7473    ind := ind+1;
7474    prior_exists := 'Y';
7475    x_line_changed_attr_tbl(ind).attribute_name  := 'RETURNED_QUANTITY';
7476    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
7477    x_line_changed_attr_tbl(ind).current_value      := p_curr_rec.RETURNED_QUANTITY;
7478    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.RETURNED_QUANTITY;
7479 END IF;
7480 END IF; /*  PRIOR */
7481 /****************************/
7482 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
7483 IF OE_Globals.Equal(
7484        p_curr_rec.RETURNED_QUANTITY,
7485        p_next_rec.RETURNED_QUANTITY) THEN
7486     IF prior_exists = 'Y' THEN
7487    x_line_changed_attr_tbl(ind).next_value      := p_curr_rec.RETURNED_QUANTITY;
7488     END IF;
7489 ELSE
7490     IF prior_exists = 'N' THEN
7491         ind := ind+1;
7492     END IF;
7493    x_line_changed_attr_tbl(ind).attribute_name := 'RETURNED_QUANTITY';
7494    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
7495    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.RETURNED_QUANTITY;
7496    x_line_changed_attr_tbl(ind).current_value     := p_curr_rec.RETURNED_QUANTITY;
7497    x_line_changed_attr_tbl(ind).next_value      := p_next_rec.RETURNED_QUANTITY;
7498 END IF;
7499 END IF; /*  NEXT */
7500 
7501 /* END RETURNED_QUANTITY*/
7502 /****************************/
7503 
7504 /****************************/
7505 /* START ORDER_NUMBER*/
7506 
7507 prior_exists := 'N';
7508 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
7509 IF OE_Globals.Equal(
7510        p_curr_rec.ORDER_NUMBER,
7511        p_prior_rec.ORDER_NUMBER) THEN
7512  null;
7513 ELSE
7514    ind := ind+1;
7515    prior_exists := 'Y';
7516    x_line_changed_attr_tbl(ind).attribute_name  := 'ORDER_NUMBER';
7517    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
7518    x_line_changed_attr_tbl(ind).current_value      := p_curr_rec.ORDER_NUMBER;
7519    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.ORDER_NUMBER;
7520 END IF;
7521 END IF; /*  PRIOR */
7522 /****************************/
7523 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
7524 IF OE_Globals.Equal(
7525        p_curr_rec.ORDER_NUMBER,
7526        p_next_rec.ORDER_NUMBER) THEN
7527     IF prior_exists = 'Y' THEN
7528    x_line_changed_attr_tbl(ind).next_value      := p_curr_rec.ORDER_NUMBER;
7529     END IF;
7530 ELSE
7531     IF prior_exists = 'N' THEN
7532         ind := ind+1;
7533     END IF;
7534    x_line_changed_attr_tbl(ind).attribute_name := 'ORDER_NUMBER';
7535    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
7536    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.ORDER_NUMBER;
7537    x_line_changed_attr_tbl(ind).current_value     := p_curr_rec.ORDER_NUMBER;
7538    x_line_changed_attr_tbl(ind).next_value      := p_next_rec.ORDER_NUMBER;
7539 END IF;
7540 END IF; /*  NEXT */
7541 
7542 /* END ORDER_NUMBER*/
7543 /****************************/
7544 
7545 /****************************/
7546 /* START RELEASED_AMOUNT*/
7547 
7548 prior_exists := 'N';
7549 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
7550 IF OE_Globals.Equal(
7551        p_curr_rec.RELEASED_AMOUNT,
7552        p_prior_rec.RELEASED_AMOUNT) THEN
7553  null;
7554 ELSE
7555    ind := ind+1;
7556    prior_exists := 'Y';
7557    x_line_changed_attr_tbl(ind).attribute_name  := 'RELEASED_AMOUNT';
7558    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
7559    x_line_changed_attr_tbl(ind).current_value      := p_curr_rec.RELEASED_AMOUNT;
7560    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.RELEASED_AMOUNT;
7561 END IF;
7562 END IF; /*  PRIOR */
7563 /****************************/
7564 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
7565 IF OE_Globals.Equal(
7566        p_curr_rec.RELEASED_AMOUNT,
7567        p_next_rec.RELEASED_AMOUNT) THEN
7568     IF prior_exists = 'Y' THEN
7569    x_line_changed_attr_tbl(ind).next_value      := p_curr_rec.RELEASED_AMOUNT;
7570     END IF;
7571 ELSE
7572     IF prior_exists = 'N' THEN
7573         ind := ind+1;
7574     END IF;
7575    x_line_changed_attr_tbl(ind).attribute_name := 'RELEASED_AMOUNT';
7576    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
7577    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.RELEASED_AMOUNT;
7578    x_line_changed_attr_tbl(ind).current_value     := p_curr_rec.RELEASED_AMOUNT;
7579    x_line_changed_attr_tbl(ind).next_value      := p_next_rec.RELEASED_AMOUNT;
7580 END IF;
7581 END IF; /*  NEXT */
7582 
7583 /* END RELEASED_AMOUNT*/
7584 /****************************/
7585 
7586 /****************************/
7587 /* START FULFILLED_AMOUNT*/
7588 
7589 prior_exists := 'N';
7590 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
7591 IF OE_Globals.Equal(
7592        p_curr_rec.FULFILLED_AMOUNT,
7593        p_prior_rec.FULFILLED_AMOUNT) THEN
7594  null;
7595 ELSE
7596    ind := ind+1;
7597    prior_exists := 'Y';
7598    x_line_changed_attr_tbl(ind).attribute_name  := 'FULFILLED_AMOUNT';
7599    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
7600    x_line_changed_attr_tbl(ind).current_value      := p_curr_rec.FULFILLED_AMOUNT;
7601    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.FULFILLED_AMOUNT;
7602 END IF;
7603 END IF; /*  PRIOR */
7604 /****************************/
7605 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
7606 IF OE_Globals.Equal(
7607        p_curr_rec.FULFILLED_AMOUNT,
7608        p_next_rec.FULFILLED_AMOUNT) THEN
7609     IF prior_exists = 'Y' THEN
7610    x_line_changed_attr_tbl(ind).next_value      := p_curr_rec.FULFILLED_AMOUNT;
7611     END IF;
7612 ELSE
7613     IF prior_exists = 'N' THEN
7614         ind := ind+1;
7615     END IF;
7616    x_line_changed_attr_tbl(ind).attribute_name := 'FULFILLED_AMOUNT';
7617    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
7618    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.FULFILLED_AMOUNT;
7619    x_line_changed_attr_tbl(ind).current_value     := p_curr_rec.FULFILLED_AMOUNT;
7620    x_line_changed_attr_tbl(ind).next_value      := p_next_rec.FULFILLED_AMOUNT;
7621 END IF;
7622 END IF; /*  NEXT */
7623 
7624 /* END FULFILLED_AMOUNT*/
7625 /****************************/
7626 
7627 /****************************/
7628 /* START RETURNED_AMOUNT*/
7629 
7630 prior_exists := 'N';
7631 IF p_prior_rec_exists = 'Y' and p_curr_rec_exists = 'Y' THEN
7632 IF OE_Globals.Equal(
7633        p_curr_rec.RETURNED_AMOUNT,
7634        p_prior_rec.RETURNED_AMOUNT) THEN
7635  null;
7636 ELSE
7637    ind := ind+1;
7638    prior_exists := 'Y';
7639    x_line_changed_attr_tbl(ind).attribute_name  := 'RETURNED_AMOUNT';
7640    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
7641    x_line_changed_attr_tbl(ind).current_value      := p_curr_rec.RETURNED_AMOUNT;
7642    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.RETURNED_AMOUNT;
7643 END IF;
7644 END IF; /*  PRIOR */
7645 /****************************/
7646 IF p_curr_rec_exists = 'Y' and p_next_rec_exists = 'Y' THEN
7647 IF OE_Globals.Equal(
7648        p_curr_rec.RETURNED_AMOUNT,
7649        p_next_rec.RETURNED_AMOUNT) THEN
7650     IF prior_exists = 'Y' THEN
7651    x_line_changed_attr_tbl(ind).next_value      := p_curr_rec.RETURNED_AMOUNT;
7652     END IF;
7653 ELSE
7654     IF prior_exists = 'N' THEN
7655         ind := ind+1;
7656     END IF;
7657    x_line_changed_attr_tbl(ind).attribute_name := 'RETURNED_AMOUNT';
7658    x_line_changed_attr_tbl(ind).line_number     := x_line_number;
7659    x_line_changed_attr_tbl(ind).prior_value        := p_prior_rec.RETURNED_AMOUNT;
7660    x_line_changed_attr_tbl(ind).current_value     := p_curr_rec.RETURNED_AMOUNT;
7661    x_line_changed_attr_tbl(ind).next_value      := p_next_rec.RETURNED_AMOUNT;
7662 END IF;
7663 END IF; /*  NEXT */
7664 
7665 /* END RETURNED_AMOUNT*/
7666 /****************************/
7667 ELSE
7668 NULL;
7669 END IF; /* if prior or next exists*/
7670 /*
7671 END LOOP;
7672 CLOSE C_GET_LINES;
7673 */
7674 END IF; /* line_id not null */
7675 IF l_debug_level > 0 THEN
7676   oe_debug_pub.add('******AFTER COMPARING ATTRIBUTES*************');
7677   oe_debug_pub.add('current ind '|| ind);
7678 END IF;
7679 END COMPARE_ATTRIBUTES;
7680 
7681 /***************************************************/
7682 
7683 PROCEDURE COMPARE_LINE_VERSIONS
7684 (p_header_id	                  NUMBER,
7685  p_line_id	                  NUMBER,
7686  p_prior_version                  NUMBER,
7687  p_current_version                NUMBER,
7688  p_next_version                   NUMBER,
7689  g_max_version                    NUMBER,
7690  g_trans_version                  NUMBER,
7691  g_prior_phase_change_flag        VARCHAR2,
7692  g_curr_phase_change_flag         VARCHAR2,
7693  g_next_phase_change_flag         VARCHAR2,
7694  x_line_changed_attr_tbl        IN OUT NOCOPY OE_VERSION_BLANKET_COMP.line_tbl_type)
7695 IS
7696 
7697 l_line_id NUMBER;
7698 
7699 CURSOR C_get_lines(p_header_id IN NUMBER,p_prior_version IN NUMBER, p_current_version IN NUMBER, p_next_version IN NUMBER) IS
7700            SELECT distinct line_id,line_number
7701 	   from oe_blanket_lines_hist
7702 	   where header_id = p_header_id
7703            --and transaction_phase_code = p_transaction_phase_code
7704            and version_number in (p_prior_version,p_current_version,p_next_version)
7705 	   union
7706            SELECT line_id,line_number
7707            from oe_blanket_lines_all
7708            where header_id=p_header_id;
7709            --and transaction_phase_code = p_transaction_phase_code;
7710 
7711 CURSOR C_get_hist_lines(p_header_id IN NUMBER,p_prior_version IN NUMBER, p_current_version IN NUMBER, p_next_version IN NUMBER) IS
7712            SELECT distinct line_id,line_number
7713 	   from oe_blanket_lines_hist
7714 	   where header_id = p_header_id
7715           -- and transaction_phase_code = p_transaction_phase_code
7716            and version_number in (p_prior_version,p_current_version,p_next_version);
7717 
7718 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
7719 ind1 NUMBER;
7720 total_lines NUMBER;
7721 x_line_number NUMBER;
7722 BEGIN
7723 
7724 IF l_debug_level > 0 THEN
7725   oe_debug_pub.add('Entering  COMPARE_LINE_VERSIONS');
7726   oe_debug_pub.add('header' ||p_header_id);
7727   oe_debug_pub.add('prior version' ||p_prior_version);
7728   oe_debug_pub.add('current version' ||p_current_version);
7729   oe_debug_pub.add('next version' ||p_next_version);
7730   oe_debug_pub.add('max version' ||g_max_version);
7731   oe_debug_pub.add('trans version' ||g_trans_version);
7732 END IF;
7733 
7734 ind1:=0;
7735 total_lines:=0;
7736 IF p_header_id IS NOT NULL THEN
7737   IF p_next_version = g_trans_version THEN
7738     OPEN C_GET_LINES(p_header_id,p_prior_version,p_current_version,p_next_version);
7739     LOOP
7740     FETCH C_GET_LINES INTO l_line_id,x_line_number;
7741     EXIT WHEN C_GET_LINES%NOTFOUND;
7742     IF l_debug_level  > 0 THEN
7743          oe_debug_pub.add('*************lines found(trans)******************'||l_line_id);
7744     END IF;
7745 
7746      IF l_line_id IS NOT NULL THEN
7747          IF l_debug_level  > 0 THEN
7748             oe_debug_pub.add('*************before call total lines(trans) ******************'||ind1);
7749          END IF;
7750          COMPARE_ATTRIBUTES(p_header_id                 => p_header_id,
7751                           p_line_id                     => l_line_id,
7752                           p_prior_version               => p_prior_version,
7753                           p_current_version             => p_current_version,
7754                           p_next_version                => p_next_version,
7755                           g_max_version                 => g_max_version,
7756                           g_trans_version               => g_trans_version,
7757                           g_prior_phase_change_flag     => g_prior_phase_change_flag,
7758                           g_curr_phase_change_flag      => g_curr_phase_change_flag,
7759                           g_next_phase_change_flag      => g_next_phase_change_flag,
7760                           x_line_changed_attr_tbl       => x_line_changed_attr_tbl,
7761                           p_total_lines                 => ind1,
7762                           x_line_number                 => x_line_number);
7763          IF x_line_changed_attr_tbl.count > 0 THEN
7764 		ind1 := x_line_changed_attr_tbl.count;
7765 	--	ind1 := ind1 + total_lines;
7766          END IF;
7767          IF l_debug_level  > 0 THEN
7768             oe_debug_pub.add('*************after call total lines(trans) ******************'||ind1);
7769          END IF;
7770      END IF; /* line_id is not null */
7771     END LOOP;
7772     CLOSE C_GET_LINES;
7773   ELSE
7774     OPEN C_GET_HIST_LINES(p_header_id,p_prior_version,p_current_version,p_next_version);
7775     LOOP
7776     FETCH C_GET_HIST_LINES INTO l_line_id,x_line_number;
7777     EXIT WHEN C_GET_HIST_LINES%NOTFOUND;
7778     IF l_debug_level  > 0 THEN
7779          oe_debug_pub.add('*************lines found******************'||l_line_id);
7780     END IF;
7781 
7782      IF l_line_id IS NOT NULL THEN
7783          IF l_debug_level  > 0 THEN
7784             oe_debug_pub.add('*************before call total lines ******************'||ind1);
7785          END IF;
7786          COMPARE_ATTRIBUTES(p_header_id                 => p_header_id,
7787                           p_line_id                     => l_line_id,
7788                           p_prior_version               => p_prior_version,
7789                           p_current_version             => p_current_version,
7790                           p_next_version                => p_next_version,
7791                           g_max_version                 => g_max_version,
7792                           g_trans_version               => g_trans_version,
7793                           g_prior_phase_change_flag     => g_prior_phase_change_flag,
7794                           g_curr_phase_change_flag      => g_curr_phase_change_flag,
7795                           g_next_phase_change_flag      => g_next_phase_change_flag,
7796                           x_line_changed_attr_tbl       => x_line_changed_attr_tbl,
7797                           p_total_lines                 => ind1,
7798                           x_line_number                 => x_line_number);
7799          IF l_debug_level  > 0 THEN
7800             oe_debug_pub.add('*************after call total lines ******************'||ind1);
7801          END IF;
7802          IF x_line_changed_attr_tbl.count > 0 THEN
7803 		ind1 := x_line_changed_attr_tbl.count;
7804 	--	ind1 := ind1 + total_lines;
7805          END IF;
7806      END IF; /* line_id is not null */
7807     END LOOP;
7808     CLOSE C_GET_HIST_LINES;
7809   END IF;/* next equals trans */
7810 END IF;/*header_id is not null*/
7811 END COMPARE_LINE_VERSIONS;
7812 
7813 FUNCTION line_status
7814 (   p_line_status_code            IN  VARCHAR2
7815 ) RETURN VARCHAR2
7816 IS
7817 l_line_status               VARCHAR2(240) := NULL;
7818 --
7819 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
7820 --
7821 BEGIN
7822 
7823     IF p_line_status_code IS NOT NULL THEN
7824 
7825         SELECT  MEANING
7826         INTO    l_line_status
7827         FROM    OE_LOOKUPS
7828         WHERE   LOOKUP_CODE = p_line_status_code
7829         AND     LOOKUP_TYPE = 'VERSION_COMP_LINE_STATUS';
7830 
7831     END IF;
7832 
7833     RETURN l_line_status;
7834 
7835 EXCEPTION
7836 
7837     WHEN NO_DATA_FOUND THEN
7838          IF l_debug_level  > 0 THEN
7839             oe_debug_pub.add('could not find line_status meaning');
7840          END IF;
7841         RETURN NULL;
7842     WHEN OTHERS THEN
7843          IF l_debug_level  > 0 THEN
7844             oe_debug_pub.add('others exception - line_status meaning');
7845          END IF;
7846         RETURN NULL;
7847 END line_status;
7848 /***************************************************/
7849 --added for bug 4302049
7850 /* Function to get segment prompt */
7851 
7852  FUNCTION get_dff_seg_prompt(p_application_id               IN NUMBER,
7853 		     p_descriptive_flexfield_name   IN VARCHAR2,
7854 		     p_descriptive_flex_context_cod IN VARCHAR2,
7855 		     p_desc_flex_context_cod_prior IN VARCHAR2,
7856 		     p_desc_flex_context_cod_next IN VARCHAR2,
7857 		     p_application_column_name      IN VARCHAR2)
7858    RETURN VARCHAR2
7859  IS
7860    l_prompt varchar2(2000);
7861    x_prompt varchar2(2000);
7862    slash    varchar2(20);
7863    CURSOR c1 IS select form_left_prompt from fnd_descr_flex_col_usage_vl
7864 	   where application_id=660
7865 	   and descriptive_flexfield_name= p_descriptive_flexfield_name
7866 	   and application_column_name =p_application_column_name
7867 	   and DESCRIPTIVE_FLEX_CONTEXT_CODE in (p_descriptive_flex_context_cod, p_desc_flex_context_cod_prior, p_desc_flex_context_cod_next, 'Global Data Elements');
7868    BEGIN
7869 	 oe_debug_pub.add('Entering get_dff_seg_prompt');
7870 	fnd_message.set_name('ONT','ONT_SLASH_SEPARATOR');
7871 	slash:=FND_MESSAGE.GET;
7872 
7873 	IF p_application_column_name = 'CONTEXT' THEN		--Context Prompt
7874 		select FORM_CONTEXT_PROMPT into l_prompt from FND_DESCRIPTIVE_FLEXS_VL
7875 		where APPLICATION_ID = p_application_id
7876 		and DESCRIPTIVE_FLEXFIELD_NAME = p_descriptive_flexfield_name;
7877 
7878 		oe_debug_pub.add('Context Prompt='||l_prompt);
7879 	ELSE						--Attribute Prompt
7880 	IF p_descriptive_flex_context_cod IS NULL
7881 	 AND p_desc_flex_context_cod_prior IS NULL
7882 	  AND p_desc_flex_context_cod_next IS NULL THEN
7883 	  select form_left_prompt into l_prompt from fnd_descr_flex_col_usage_vl where application_id=660
7884 	   and descriptive_flexfield_name= p_descriptive_flexfield_name
7885 	   and application_column_name =p_application_column_name;
7886 
7887            oe_debug_pub.add('Prompt='||l_prompt);
7888 
7889 	ELSE						--Context has been passed
7890   	   OPEN c1;
7891 	   LOOP
7892 	       FETCH c1 into l_prompt;
7893 	       EXIT WHEN c1%NOTFOUND;
7894 	       if x_prompt IS NULL THEN
7895 			x_prompt:=l_prompt;
7896 		ELSIF x_prompt <> l_prompt   THEN
7897 			x_prompt:=x_prompt||slash||l_prompt;
7898 		END IF;
7899            END LOOP;
7900            CLOSE C1;
7901            oe_debug_pub.add('Prompt='||x_prompt);
7902 	   RETURN(x_prompt);
7903        END IF;				--Context been passed
7904        END IF;				--Context/Attribute Prompt
7905 
7906       RETURN(l_prompt);
7907 EXCEPTION
7908    WHEN no_data_found THEN
7909 	Return null;
7910    WHEN OTHERS THEN
7911 	oe_debug_pub.add('error is'||SQLCODE||'message'||SQLERRM);
7912 	Return Null;
7913 END get_dff_seg_prompt;
7914 --bug 4302049
7915 
7916 END OE_VERSION_BLANKET_COMP;