DBA Data[Home] [Help]

APPS.CN_COLLECTION_AR_GEN dependencies on CN_GLOBAL

Line 101: IF (x_event_id = cn_global.inv_event_id) THEN

97: cn_utils.appindcr(code, 'processed_date,');
98: cn_utils.appindcr(code, 'collection_run_id,');
99:
100:
101: IF (x_event_id = cn_global.inv_event_id) THEN
102: -- Populate the mapping-driven columns
103: FOR h IN header_direct_maps LOOP
104: cn_utils.appindcr(code, h.dest_column || ',');
105: END LOOP;

Line 113: ELSIF ((x_event_id = cn_global.pmt_event_id) OR

109: cn_utils.strip_prev(code, 1); --AE 08-24-95 remove trailing comma
110: cn_utils.appindcr(code, ')');
111: cn_utils.unindent(code, 1);
112:
113: ELSIF ((x_event_id = cn_global.pmt_event_id) OR
114: (x_event_id = cn_global.cbk_event_id) OR
115: (x_event_id = cn_global.wo_event_id)) THEN
116:
117: cn_utils.appindcr(code, 'gl_posted_date,');

Line 114: (x_event_id = cn_global.cbk_event_id) OR

110: cn_utils.appindcr(code, ')');
111: cn_utils.unindent(code, 1);
112:
113: ELSIF ((x_event_id = cn_global.pmt_event_id) OR
114: (x_event_id = cn_global.cbk_event_id) OR
115: (x_event_id = cn_global.wo_event_id)) THEN
116:
117: cn_utils.appindcr(code, 'gl_posted_date,');
118: cn_utils.appindcr(code, 'gl_date,');

Line 115: (x_event_id = cn_global.wo_event_id)) THEN

111: cn_utils.unindent(code, 1);
112:
113: ELSIF ((x_event_id = cn_global.pmt_event_id) OR
114: (x_event_id = cn_global.cbk_event_id) OR
115: (x_event_id = cn_global.wo_event_id)) THEN
116:
117: cn_utils.appindcr(code, 'gl_posted_date,');
118: cn_utils.appindcr(code, 'gl_date,');
119: cn_utils.appindcr(code, 'prorated_amount,');

Line 136: cn_utils.appindcr(code, 'FLOOR(cn_trx_s.CURRVAL/cn_global.xfer_batch_size),');

132: --Added for MOAC by Ashley
133: cn_utils.appindcr(code, 'cnt.org_id,');
134: cn_utils.appindcr(code, 'cnt.not_trx_id,');
135: cn_utils.appindcr(code, 'cnt.batch_id,');
136: cn_utils.appindcr(code, 'FLOOR(cn_trx_s.CURRVAL/cn_global.xfer_batch_size),');
137: cn_utils.appindcr(code, '''COL'',');
138: cn_utils.appindcr(code, '''' || x_module_type || ''','); --AE 11-16-95
139: cn_utils.appindcr(code, 'cnt.event_id,'); --AE 01-16-96
140: cn_utils.appindcr(code, 'cnt.notified_date,');

Line 145: IF (x_event_id = cn_global.inv_event_id) THEN

141: cn_utils.appindcr(code, 'cnt.processed_date,'); --AE 01-05-96
142: cn_utils.appindcr(code, 'x_proc_audit_id,');
143:
144:
145: IF (x_event_id = cn_global.inv_event_id) THEN
146: -- Select the mapping-driven columns.
147: FOR h IN header_direct_maps LOOP
148: cn_utils.appindcr(code, h.expression || ',');
149: END LOOP;

Line 158: ELSIF (x_event_id = cn_global.pmt_event_id) THEN

154: cn_utils.strip_prev(code, 1); --AE 08-24-95 remove trailing comma
155: cn_utils.appendcr(code);
156: cn_utils.unindent(code, 1);
157:
158: ELSIF (x_event_id = cn_global.pmt_event_id) THEN
159: cn_utils.appindcr(code, 'ara.gl_posted_date,');
160: cn_utils.appindcr(code, 'ara.gl_date,');
161: cn_utils.appindcr(code, 'ara.line_applied,');
162: cn_utils.appindcr(code, 'ara.line_applied,');

Line 170: ELSIF (x_event_id = cn_global.wo_event_id) THEN

166: cn_utils.appindcr(code, 'NULL ');
167: cn_utils.appendcr(code);
168: cn_utils.unindent(code, 1);
169:
170: ELSIF (x_event_id = cn_global.wo_event_id) THEN
171: cn_utils.appindcr(code, 'aa.gl_posted_date,');
172: cn_utils.appindcr(code, 'aa.gl_date,');
173: cn_utils.appindcr(code, 'NVL(aa.line_adjusted, 0),'); --AE 02-05-96
174: cn_utils.appindcr(code, 'NVL(aa.line_adjusted, 0),'); --AE 02-05-96

Line 182: ELSIF (x_event_id = cn_global.cbk_event_id) THEN

178: cn_utils.appindcr(code, 'NULL ');
179: cn_utils.appendcr(code);
180: cn_utils.unindent(code, 1);
181:
182: ELSIF (x_event_id = cn_global.cbk_event_id) THEN
183: cn_utils.appindcr(code, 'NULL,');
184: cn_utils.appindcr(code, 'NULL,');
185: cn_utils.appindcr(code, 'aps.amount_line_items_remaining,');
186: cn_utils.appindcr(code, 'NULL,');

Line 196: IF (x_event_id = cn_global.inv_event_id) THEN

192: cn_utils.unindent(code, 1);
193: END IF;
194:
195: -- generate the from statements
196: IF (x_event_id = cn_global.inv_event_id) THEN
197: cn_utils.appindcr(code, ' FROM cn_not_trx cnt, ra_customer_trx rct');
198: cn_utils.appindcr(code, 'WHERE cnt.source_trx_id = rct.customer_trx_id');
199: -- Added for MOAC by Ashley
200: cn_utils.appindcr(code, 'AND cnt.org_id = '||x_org_id);

Line 204: ELSIF (x_event_id = cn_global.pmt_event_id) THEN

200: cn_utils.appindcr(code, 'AND cnt.org_id = '||x_org_id);
201: cn_utils.appindcr(code, 'AND rct.org_id = cnt.org_id');
202:
203:
204: ELSIF (x_event_id = cn_global.pmt_event_id) THEN
205: cn_utils.appindcr(code, ' FROM cn_not_trx cnt, ar_receivable_applications ara');
206: cn_utils.appindcr(code, 'WHERE cnt.source_trx_id = ara.receivable_application_id');
207:
208: --Added For MOAC By Ashley

Line 220: ELSIF (x_event_id = cn_global.wo_event_id) THEN

216: --Added For MOAC By Ashley
217: cn_utils.appindcr(code, ' AND ct.org_id = '||x_org_id);
218: cn_utils.appindcr(code, ' AND ct.trx_type = ''CBK'')');
219:
220: ELSIF (x_event_id = cn_global.wo_event_id) THEN
221: cn_utils.appindcr(code, ' FROM cn_not_trx cnt, ar_adjustments aa');
222: cn_utils.appindcr(code, 'WHERE cnt.source_trx_id = aa.adjustment_id');
223: --Added For MOAC By Ashley
224: cn_utils.appindcr(code, 'AND cnt.org_id = '||x_org_id);

Line 227: ELSIF (x_event_id = cn_global.cbk_event_id) THEN

223: --Added For MOAC By Ashley
224: cn_utils.appindcr(code, 'AND cnt.org_id = '||x_org_id);
225: cn_utils.appindcr(code, 'AND aa.org_id = cnt.org_id');
226:
227: ELSIF (x_event_id = cn_global.cbk_event_id) THEN
228: cn_utils.appindcr(code, ' FROM cn_not_trx cnt, ar_payment_schedules aps');
229: cn_utils.appindcr(code, 'WHERE cnt.source_trx_id = aps.payment_schedule_id');
230: --Added For MOAC By Ashley
231: cn_utils.appindcr(code, 'AND cnt.org_id = '||x_org_id);

Line 256: IF (x_event_id = cn_global.pmt_event_id) THEN

252: cn_utils.appendcr(code);
253:
254: --++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
255: -- AE 03-01-96 If event_type = Payments do Givebacks at the same time.
256: IF (x_event_id = cn_global.pmt_event_id) THEN
257:
258: cn_utils.appindcr(code, 'INSERT INTO cn_trx(');
259: cn_utils.indent(code, 1);
260:

Line 294: cn_utils.appindcr(code, 'FLOOR(cn_trx_s.CURRVAL/cn_global.xfer_batch_size),');

290: --Added for MOAC by Ashley
291: cn_utils.appindcr(code, 'cnt.org_id,');
292: cn_utils.appindcr(code, 'cnt.not_trx_id,');
293: cn_utils.appindcr(code, 'cnt.batch_id,');
294: cn_utils.appindcr(code, 'FLOOR(cn_trx_s.CURRVAL/cn_global.xfer_batch_size),');
295: cn_utils.appindcr(code, '''COL'',');
296: cn_utils.appindcr(code, '''GBK'',');
297: cn_utils.appindcr(code, 'cn_global.gbk_event_id,');
298: cn_utils.appindcr(code, 'cnt.notified_date,');

Line 297: cn_utils.appindcr(code, 'cn_global.gbk_event_id,');

293: cn_utils.appindcr(code, 'cnt.batch_id,');
294: cn_utils.appindcr(code, 'FLOOR(cn_trx_s.CURRVAL/cn_global.xfer_batch_size),');
295: cn_utils.appindcr(code, '''COL'',');
296: cn_utils.appindcr(code, '''GBK'',');
297: cn_utils.appindcr(code, 'cn_global.gbk_event_id,');
298: cn_utils.appindcr(code, 'cnt.notified_date,');
299: cn_utils.appindcr(code, 'cnt.processed_date,');
300: cn_utils.appindcr(code, 'x_proc_audit_id,');
301:

Line 338: END IF; -- (x_event_id = cn_global.pmt_event_id)

334: -- Generate code to update the trx_count variable
335: cn_utils.appindcr(code, 'trx_count := trx_count + SQL%ROWCOUNT;');
336: cn_utils.appendcr(code);
337: cn_utils.appendcr(code);
338: END IF; -- (x_event_id = cn_global.pmt_event_id)
339: --++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
340:
341: cn_utils.unset_org_id();
342: cn_debug.print_msg('insert_trx: Generated INSERT statement.', 1);

Line 438: IF (x_event_id = cn_global.inv_event_id) THEN

434: cn_utils.appindcr(code, 'fnd_file.put_line(fnd_file.Log, ''' || procedure_name || ': Updating CN_TRX .'');');
435: cn_utils.appendcr(code);
436:
437:
438: IF (x_event_id = cn_global.inv_event_id) THEN
439:
440: -- update trx_type for Invoices and Credit Memos. --AE 01-26-96
441: -- Note: Sort out the Credit Memos from the Invoices.
442: -- Up to this point, the ct.trx_type = INV for both.

Line 481: END IF; -- for cn_global.inv_event_id compare

477: cn_utils.appindcr(code, ' AND ct.trx_type = ''CM'' ');
478: cn_utils.appindcr(code, ' AND ct.source_parent_trx_id IS NOT NULL; ');
479: cn_utils.appendcr(code);
480:
481: END IF; -- for cn_global.inv_event_id compare
482:
483:
484: -- Update the columns whose mappings have been defined for invoices
485: -- For all event types other than Invoices.

Line 486: IF (x_event_id <> cn_global.inv_event_id) THEN

482:
483:
484: -- Update the columns whose mappings have been defined for invoices
485: -- For all event types other than Invoices.
486: IF (x_event_id <> cn_global.inv_event_id) THEN
487:
488: cn_utils.appindcr(code, 'UPDATE cn_trx ct');
489: cn_utils.appindcr(code, ' SET');
490:

Line 529: END IF; -- for cn_global compare

525: cn_utils.appindcr(code, 'AND ct.org_id = '||x_org_id||';');
526:
527: cn_utils.appendcr(code);
528:
529: END IF; -- for cn_global compare
530:
531:
532: -- Generate code to update the trx_update_count variable
533: cn_utils.appendcr(code);

Line 715: IF x_event_id <> cn_global.inv_event_id THEN

711: cn_utils.appindcr(code, 'cn_message_pkg.debug(''' || procedure_name || ': Updating CN_TRX_LINES .'');');
712: cn_utils.appindcr(code, 'fnd_file.put_line(fnd_file.Log, ''' || procedure_name || ': Updating CN_TRX_LINES .'');');
713: cn_utils.appendcr(code);
714:
715: IF x_event_id <> cn_global.inv_event_id THEN
716:
717: cn_utils.appindcr(code, 'UPDATE cn_trx_lines ctl');
718: cn_utils.appindcr(code, ' SET');
719: cn_utils.indent(code, 1);

Line 830: IF (x_event_id = cn_global.ram_event_id) THEN

826: cn_utils.appindcr(code, 'trx_line_id,');
827: cn_utils.appindcr(code, 'trx_id,');
828: cn_utils.appindcr(code, 'event_id,');
829: cn_utils.appindcr(code, 'collection_run_id,');
830: IF (x_event_id = cn_global.ram_event_id) THEN
831: cn_utils.appindcr(code, 'adj_collection_run_id,');
832: cn_utils.appindcr(code, 'created_by,');
833: cn_utils.appindcr(code, 'creation_date,');
834: cn_utils.appindcr(code, 'last_updated_by,');

Line 856: cn_utils.appindcr(code, 'FLOOR(cn_trx_sales_lines_s.CURRVAL/cn_global.cls_batch_size),');

852: cn_utils.indent(code, 1);
853:
854: -- Select fixed columns
855: cn_utils.appindcr(code, 'cn_trx_sales_lines_s.NEXTVAL,');
856: cn_utils.appindcr(code, 'FLOOR(cn_trx_sales_lines_s.CURRVAL/cn_global.cls_batch_size),');
857: --Added for MOAC by Ashley
858: cn_utils.appindcr(code, 'ctl.org_id,');
859: cn_utils.appindcr(code, 'ctl.trx_line_id,');
860: cn_utils.appindcr(code, 'ctl.trx_id,');

Line 862: IF (x_event_id = cn_global.ram_event_id) THEN

858: cn_utils.appindcr(code, 'ctl.org_id,');
859: cn_utils.appindcr(code, 'ctl.trx_line_id,');
860: cn_utils.appindcr(code, 'ctl.trx_id,');
861: cn_utils.appindcr(code, 'ctl.event_id,');
862: IF (x_event_id = cn_global.ram_event_id) THEN
863: cn_utils.appindcr(code, 'null,');
864: cn_utils.appindcr(code, 'x_proc_audit_id,');
865: cn_utils.appindcr(code, 'x_created_by,');
866: cn_utils.appindcr(code, 'x_creation_date,');

Line 897: IF (x_event_id = cn_global.ram_event_id) THEN

893: cn_utils.appendcr(code);
894: cn_utils.unindent(code, 1);
895:
896: -- Generate FROM and WHERE clauses
897: IF (x_event_id = cn_global.ram_event_id) THEN
898: cn_utils.appindcr(code, ' FROM cn_trx_lines ctl, ra_cust_trx_line_salesreps rctls ');
899: cn_utils.appindcr(code, 'WHERE ctl.source_trx_id = rctls.customer_trx_id ');
900: --cn_utils.appindcr(code, ' AND rctls.revenue_adjustment_id is NOT NULL'); -- Added Bug : 3331479
901: -- Commented By Hithanki QA Bug 4234180

Line 907: cn_utils.appindcr(code, ' AND ctl.event_id = cn_global.inv_event_id ');

903: cn_utils.appindcr(code, ' AND ctl.adj_collection_run_id = x_proc_audit_id ');
904: cn_utils.appindcr(code, ' AND ctl.adjusted_flag = ''Y'' ');
905: cn_utils.appindcr(code, ' AND ctl.negated_flag = ''Y'' ');
906: cn_utils.appindcr(code, ' AND ctl.collected_flag = ''N'' ');
907: cn_utils.appindcr(code, ' AND ctl.event_id = cn_global.inv_event_id ');
908: cn_utils.appindcr(code, ' AND ctl.adj_batch_id = x_adj_batch_id ');
909: --Added for MOAC by Ashley
910: cn_utils.appindcr(code, ' AND ctl.org_id = '||x_org_id );
911: cn_utils.appindcr(code, ' AND rctls.org_id = ctl.org_id ');

Line 920: cn_utils.appindcr(code, ' AND ctsl.event_id = cn_global.inv_event_id'); -- Added Bug : 3331479

916: cn_utils.appindcr(code, ' (SELECT 1 ');
917: cn_utils.appindcr(code, ' FROM cn_trx_sales_lines ctsl ');
918: cn_utils.appindcr(code, ' WHERE ctsl.source_trx_sales_line_id = rctls.cust_trx_line_salesrep_id');
919: --cn_utils.appindcr(code, ' AND ctsl.adj_collection_run_id is NOT NULL'); -- Added Bug : 3331479
920: cn_utils.appindcr(code, ' AND ctsl.event_id = cn_global.inv_event_id'); -- Added Bug : 3331479
921: --Added for MOAC by Ashley
922: cn_utils.appindcr(code, ' AND ctsl.org_id = '||x_org_id||')');
923: cn_utils.appindcr(code, ' )');
924: cn_utils.appindcr(code, ' );');

Line 925: ELSIF (x_event_id = cn_global.inv_event_id) THEN

921: --Added for MOAC by Ashley
922: cn_utils.appindcr(code, ' AND ctsl.org_id = '||x_org_id||')');
923: cn_utils.appindcr(code, ' )');
924: cn_utils.appindcr(code, ' );');
925: ELSIF (x_event_id = cn_global.inv_event_id) THEN
926: cn_utils.appindcr(code, ' FROM cn_trx_lines ctl, ra_cust_trx_line_salesreps rctls');
927: cn_utils.appindcr(code, 'WHERE ctl.source_trx_id = rctls.customer_trx_id');
928: cn_utils.appindcr(code, ' AND ctl.source_trx_line_id = rctls.customer_trx_line_id');
929: cn_utils.appindcr(code, ' AND ctl.collection_run_id = x_proc_audit_id');

Line 934: ELSIF (x_event_id = cn_global.pmt_event_id) THEN

930: --Added for MOAC by Ashley
931: cn_utils.appindcr(code, ' AND ctl.org_id = '||x_org_id);
932: cn_utils.appindcr(code, ' AND rctls.org_id = ctl.org_id;');
933:
934: ELSIF (x_event_id = cn_global.pmt_event_id) THEN
935: cn_utils.appindcr(code, ' FROM cn_trx_lines ctl, ra_cust_trx_line_salesreps rctls');
936: cn_utils.appindcr(code, 'WHERE ctl.source_trx_id = rctls.customer_trx_id');
937: cn_utils.appindcr(code, ' AND ctl.source_trx_line_id = rctls.customer_trx_line_id');
938: cn_utils.appindcr(code, ' AND ctl.collection_run_id = x_proc_audit_id');

Line 940: cn_utils.appindcr(code, ' AND (ctl.event_id = cn_global.gbk_event_id');

936: cn_utils.appindcr(code, 'WHERE ctl.source_trx_id = rctls.customer_trx_id');
937: cn_utils.appindcr(code, ' AND ctl.source_trx_line_id = rctls.customer_trx_line_id');
938: cn_utils.appindcr(code, ' AND ctl.collection_run_id = x_proc_audit_id');
939: --cn_utils.appindcr(code, ' AND rctls.revenue_adjustment_id is null');
940: cn_utils.appindcr(code, ' AND (ctl.event_id = cn_global.gbk_event_id');
941: --Added for MOAC by Ashley
942: cn_utils.appindcr(code, ' AND ctl.org_id = '||x_org_id);
943: cn_utils.appindcr(code, ' AND rctls.org_id = ctl.org_id');
944:

Line 949: cn_utils.appindcr(code, ' and rctls_in.event_id = cn_global.cbk_event_id');

945: cn_utils.appindcr(code, ' AND EXISTS');
946: cn_utils.appindcr(code, ' (select 1');
947: cn_utils.appindcr(code, ' from cn_trx_sales_lines rctls_in');
948: cn_utils.appindcr(code, ' where rctls_in.source_trx_sales_line_id = rctls.cust_trx_line_salesrep_id');
949: cn_utils.appindcr(code, ' and rctls_in.event_id = cn_global.cbk_event_id');
950: --Added for MOAC by Ashley
951: cn_utils.appindcr(code, ' and rctls_in.org_id = '||x_org_id||')');
952:
953: cn_utils.appindcr(code, ' OR (ctl.event_id = cn_global.pmt_event_id and rctls.revenue_adjustment_id is null));');

Line 953: cn_utils.appindcr(code, ' OR (ctl.event_id = cn_global.pmt_event_id and rctls.revenue_adjustment_id is null));');

949: cn_utils.appindcr(code, ' and rctls_in.event_id = cn_global.cbk_event_id');
950: --Added for MOAC by Ashley
951: cn_utils.appindcr(code, ' and rctls_in.org_id = '||x_org_id||')');
952:
953: cn_utils.appindcr(code, ' OR (ctl.event_id = cn_global.pmt_event_id and rctls.revenue_adjustment_id is null));');
954: ELSE
955: cn_utils.appindcr(code, ' FROM cn_trx_lines ctl, ra_cust_trx_line_salesreps rctls');
956: cn_utils.appindcr(code, 'WHERE ctl.source_trx_id = rctls.customer_trx_id');
957: cn_utils.appindcr(code, ' AND ctl.source_trx_line_id = rctls.customer_trx_line_id');

Line 970: cn_utils.appindcr(code, ' AND (ctl.event_id <> cn_global.pmt_event_id ');

966: cn_utils.appindcr(code, 'WHERE ctl.source_trx_id = rctls.customer_trx_id');
967: cn_utils.appindcr(code, ' AND ctl.source_trx_line_id = rctls.customer_trx_line_id');
968: cn_utils.appindcr(code, ' AND ctl.collection_run_id = x_proc_audit_id');
969: --cn_utils.appindcr(code, ' AND rctls.revenue_adjustment_id is null;');
970: cn_utils.appindcr(code, ' AND (ctl.event_id <> cn_global.pmt_event_id ');
971: cn_utils.appindcr(code, ' AND EXISTS');
972: cn_utils.appindcr(code, ' (SELECT 1');
973: cn_utils.appindcr(code, ' FROM cn_trx_sales_lines rctls_in');
974: cn_utils.appindcr(code, ' WHERE rctls_in.source_trx_sales_line_id = rctls.cust_trx_line_salesrep_id');

Line 975: cn_utils.appindcr(code, ' AND rctls_in.event_id = cn_global.inv_event_id)');

971: cn_utils.appindcr(code, ' AND EXISTS');
972: cn_utils.appindcr(code, ' (SELECT 1');
973: cn_utils.appindcr(code, ' FROM cn_trx_sales_lines rctls_in');
974: cn_utils.appindcr(code, ' WHERE rctls_in.source_trx_sales_line_id = rctls.cust_trx_line_salesrep_id');
975: cn_utils.appindcr(code, ' AND rctls_in.event_id = cn_global.inv_event_id)');
976: cn_utils.appindcr(code, ' OR (ctl.event_id = cn_global.pmt_event_id AND');
977: cn_utils.appindcr(code, ' rctls.revenue_adjustment_id IS NULL))');
978: cn_utils.appindcr(code, ' AND rctls.salesrep_id <> 0;'); */
979: END IF; --IF (x_event_id = cn_global.ram_event_id)

Line 976: cn_utils.appindcr(code, ' OR (ctl.event_id = cn_global.pmt_event_id AND');

972: cn_utils.appindcr(code, ' (SELECT 1');
973: cn_utils.appindcr(code, ' FROM cn_trx_sales_lines rctls_in');
974: cn_utils.appindcr(code, ' WHERE rctls_in.source_trx_sales_line_id = rctls.cust_trx_line_salesrep_id');
975: cn_utils.appindcr(code, ' AND rctls_in.event_id = cn_global.inv_event_id)');
976: cn_utils.appindcr(code, ' OR (ctl.event_id = cn_global.pmt_event_id AND');
977: cn_utils.appindcr(code, ' rctls.revenue_adjustment_id IS NULL))');
978: cn_utils.appindcr(code, ' AND rctls.salesrep_id <> 0;'); */
979: END IF; --IF (x_event_id = cn_global.ram_event_id)
980:

Line 979: END IF; --IF (x_event_id = cn_global.ram_event_id)

975: cn_utils.appindcr(code, ' AND rctls_in.event_id = cn_global.inv_event_id)');
976: cn_utils.appindcr(code, ' OR (ctl.event_id = cn_global.pmt_event_id AND');
977: cn_utils.appindcr(code, ' rctls.revenue_adjustment_id IS NULL))');
978: cn_utils.appindcr(code, ' AND rctls.salesrep_id <> 0;'); */
979: END IF; --IF (x_event_id = cn_global.ram_event_id)
980:
981: -- Update trx_sales_line_count variable
982: cn_utils.appendcr(code);
983: cn_utils.appindcr(code, 'trx_sales_line_count := SQL%ROWCOUNT;');

Line 993: IF (x_event_id = cn_global.ram_event_id) THEN

989:
990: cn_debug.print_msg('insert_sales_lines<<', 1);
991: fnd_file.put_line(fnd_file.Log, 'insert_sales_lines<<');
992:
993: IF (x_event_id = cn_global.ram_event_id) THEN
994: cn_utils.appindcr(code, 'UPDATE cn_trx_lines');
995: cn_utils.appindcr(code, ' SET collected_flag = ''Y''');
996: cn_utils.appindcr(code, ' WHERE adjusted_flag = ''Y'' ');
997: --Added for MOAC by Ashley

Line 1001: cn_utils.appindcr(code, ' AND event_id = cn_global.inv_event_id ');

997: --Added for MOAC by Ashley
998: cn_utils.appindcr(code, ' AND org_id = '||x_org_id);
999: cn_utils.appindcr(code, ' AND negated_flag = ''Y'' ');
1000: cn_utils.appindcr(code, ' AND collected_flag = ''N'' ');
1001: cn_utils.appindcr(code, ' AND event_id = cn_global.inv_event_id ');
1002: cn_utils.appindcr(code, ' AND adj_batch_id = x_adj_batch_id;');
1003: cn_utils.appendcr(code);
1004: cn_utils.appindcr(code, 'cn_message_pkg.debug(''' || procedure_name || ': Updated collected_flag in cn_trx_lines.'');');
1005: cn_utils.appindcr(code, 'fnd_file.put_line(fnd_file.Log, ''' || procedure_name || ': Updated collected_flag in cn_trx_lines.'');');

Line 1006: END IF; --IF (x_event_id = cn_global.ram_event_id)

1002: cn_utils.appindcr(code, ' AND adj_batch_id = x_adj_batch_id;');
1003: cn_utils.appendcr(code);
1004: cn_utils.appindcr(code, 'cn_message_pkg.debug(''' || procedure_name || ': Updated collected_flag in cn_trx_lines.'');');
1005: cn_utils.appindcr(code, 'fnd_file.put_line(fnd_file.Log, ''' || procedure_name || ': Updated collected_flag in cn_trx_lines.'');');
1006: END IF; --IF (x_event_id = cn_global.ram_event_id)
1007:
1008: EXCEPTION
1009: WHEN NO_DATA_FOUND THEN
1010: cn_debug.print_msg('insert_sales_lines: in exception handler for NO_DATA_FOUND', 1);

Line 1058: IF ((x_event_id <> cn_global.inv_event_id) and

1054: cn_utils.indent(code, 1);
1055:
1056: -- Prorate Amount, Revenue_amount_split and Non_revenue_amount_split
1057: -- columns for all trx types except invoices.
1058: IF ((x_event_id <> cn_global.inv_event_id) and
1059: (x_event_id <> cn_global.ram_event_id)) THEN
1060: cn_utils.appindcr(code, '(amount, revenue_amount_split, non_revenue_amount_split) = (');
1061: cn_utils.appindcr(code, ' SELECT ');
1062: cn_utils.appindcr(code, ' DECODE(ct.invoice_total, 0, 0, (ct.prorated_amount/ct.invoice_total) * ctsl.amount),');

Line 1059: (x_event_id <> cn_global.ram_event_id)) THEN

1055:
1056: -- Prorate Amount, Revenue_amount_split and Non_revenue_amount_split
1057: -- columns for all trx types except invoices.
1058: IF ((x_event_id <> cn_global.inv_event_id) and
1059: (x_event_id <> cn_global.ram_event_id)) THEN
1060: cn_utils.appindcr(code, '(amount, revenue_amount_split, non_revenue_amount_split) = (');
1061: cn_utils.appindcr(code, ' SELECT ');
1062: cn_utils.appindcr(code, ' DECODE(ct.invoice_total, 0, 0, (ct.prorated_amount/ct.invoice_total) * ctsl.amount),');
1063: cn_utils.appindcr(code, ' DECODE(ct.invoice_total, 0, 0, (ct.prorated_amount/ct.invoice_total) * ctsl.revenue_amount_split),');

Line 1105: IF (x_event_id = cn_global.ram_event_id) THEN

1101:
1102: cn_utils.appendcr(code);
1103: cn_utils.unindent(code, 1);
1104:
1105: IF (x_event_id = cn_global.ram_event_id) THEN
1106: cn_utils.appindcr(code, 'WHERE ctsl.adj_collection_run_id = x_proc_audit_id');
1107: --Added for MOAC by Ashley
1108: cn_utils.appindcr(code, 'AND ctsl.org_id = '||x_org_id||';');
1109: ELSE

Line 1116: IF (x_event_id = cn_global.cbk_event_id) THEN

1112: cn_utils.appindcr(code, 'AND ctsl.org_id = '||x_org_id||';');
1113: END IF;
1114:
1115: -- For clawbacks only, negate the amounts
1116: IF (x_event_id = cn_global.cbk_event_id) THEN
1117: cn_utils.appindcr(code, 'UPDATE cn_trx_sales_lines ctsl');
1118: cn_utils.appindcr(code, ' SET');
1119: cn_utils.indent(code, 1);
1120: cn_utils.appindcr(code, 'amount = amount * -1,');

Line 1316: IF (x_event_id = cn_global.ram_event_id) THEN

1312:
1313:
1314: -- Generate the SELECT clause for the insert statement
1315:
1316: IF (x_event_id = cn_global.ram_event_id) THEN
1317: cn_utils.appindcr(code, 'SELECT /*+ ordered index(CTSL CN_TRX_SALES_LINES_N3) index(CTL CN_TRX_LINES_N4) */');
1318: ELSE
1319: cn_utils.appindcr(code, 'SELECT /*+ ordered index(CTSL CN_TRX_SALES_LINES_N2) index(CTL CN_TRX_LINES_N3) */');
1320: END IF;

Line 1374: IF (x_event_id = cn_global.ram_event_id) THEN

1370: cn_utils.appindcr(code, ' cn_trx_lines ctl,');
1371: cn_utils.appindcr(code, ' cn_trx ct');
1372:
1373: -- Generate WHERE clause
1374: IF (x_event_id = cn_global.ram_event_id) THEN
1375: cn_utils.appindcr(code, 'WHERE ct.trx_id = ctsl.trx_id' );
1376: cn_utils.appindcr(code, ' AND ctl.trx_line_id = ctsl.trx_line_id' );
1377: cn_utils.appindcr(code, ' AND ct.adj_collection_run_id = x_proc_audit_id' );
1378: cn_utils.appindcr(code, ' AND ctl.adj_collection_run_id = x_proc_audit_id' );