38: -- who.set_program_name('notify_invoices');
39:
40:
41: cn_message_pkg.debug('notify_invoices>>');
42: fnd_file.put_line(fnd_file.Log, 'notify_invoices>>');
43:
44:
45: x_proc_audit_id := NULL; -- Will get a value in the call below
46: cn_process_audits_pkg.insert_row(x_rowid, x_proc_audit_id, NULL, 'NOT', 'Notification run', NULL, NULL, NULL, NULL, NULL, SYSDATE, NULL, x_org_id);
48: cn_periods_api.set_dates(x_start_period, x_end_period, x_org_id,
49: x_start_date, x_end_date);
50:
51: cn_message_pkg.debug('notify_invoices: Is collecting invoices for CN_NOT_TRX from period '||x_start_date ||' to period '||x_end_date ||'.');
52: fnd_file.put_line(fnd_file.Log, 'notify_invoices: Is collecting invoices for CN_NOT_TRX from period '||x_start_date ||' to period '||x_end_date ||'.');
53:
54:
55: -- Check if the profile option CN_COLLECT_ON_ACCT_CREDITS is turned on
56: -- or not
179:
180: IF ( x_trx_count = 0 ) THEN
181:
182: cn_message_pkg.debug('notify_invoices: No rows inserted into CN_NOT_TRX. Possible reason: Transactions have not been posted to GL or they have already been collected.');
183: fnd_file.put_line(fnd_file.Log, 'notify_invoices: No rows inserted into CN_NOT_TRX. Possible reason: Transactions have not been posted to GL or they have already been collected.');
184:
185: END IF;
186:
187: COMMIT;
186:
187: COMMIT;
188:
189: cn_message_pkg.debug('notify_invoices: Finished notification run: Notified ' || x_trx_count || ' invoices.');
190: fnd_file.put_line(fnd_file.Log, 'notify_invoices: Finished notification run: Notified ' || x_trx_count || ' invoices.');
191:
192: cn_debug.print_msg('<
194: fnd_file.put_line(fnd_file.Log, 'notify_invoices<<');
190: fnd_file.put_line(fnd_file.Log, 'notify_invoices: Finished notification run: Notified ' || x_trx_count || ' invoices.');
191:
192: cn_debug.print_msg('<
194: fnd_file.put_line(fnd_file.Log, 'notify_invoices<<');
195:
196: -- cn_message_pkg.end_batch (x_proc_audit_id);
197:
198:
199: EXCEPTION
200: WHEN OTHERS THEN ROLLBACK;
201:
202: cn_message_pkg.debug('notify_invoices: in exception handler');
203: fnd_file.put_line(fnd_file.Log, 'notify_invoices: in exception handler');
204:
205: cn_message_pkg.debug(SQLCODE||' '||SQLERRM);
206: fnd_file.put_line(fnd_file.Log, SQLCODE||' '||SQLERRM);
207:
202: cn_message_pkg.debug('notify_invoices: in exception handler');
203: fnd_file.put_line(fnd_file.Log, 'notify_invoices: in exception handler');
204:
205: cn_message_pkg.debug(SQLCODE||' '||SQLERRM);
206: fnd_file.put_line(fnd_file.Log, SQLCODE||' '||SQLERRM);
207:
208: cn_debug.print_msg('notify_invoices: in exception handler', 1);
209: cn_process_audits_pkg.update_row(X_proc_audit_id, NULL, SYSDATE, SQLCODE,
210: SQLERRM);