127: EXCEPTION
128: WHEN OTHERS THEN
129: g_err_code := SQLCODE;
130: g_err_buf := SQLERRM;
131: fv_utility.log_mesg(fnd_log.level_unexpected, l_module_name||'.final_exception',g_err_buf) ;
132: RAISE;
133: END insert_ia_recs;
134:
135: --****************************************************************************************--
143: --* Global Vars : g_module_name *--
144: --* : g_set_of_books_id *--
145: --* : g_err_buf *--
146: --* : g_err_code *--
147: --* : fnd_log.level_unexpected *--
148: --* : fnd_log.level_statement *--
149: --* : fnd_log.g_current_runtime_level *--
150: --* Called from : Concurrent program Update Interagency Transfers (FVIAUPDB) *--
151: --* Calls : insert_ia_recs *--
144: --* : g_set_of_books_id *--
145: --* : g_err_buf *--
146: --* : g_err_code *--
147: --* : fnd_log.level_unexpected *--
148: --* : fnd_log.level_statement *--
149: --* : fnd_log.g_current_runtime_level *--
150: --* Called from : Concurrent program Update Interagency Transfers (FVIAUPDB) *--
151: --* Calls : insert_ia_recs *--
152: --* : fv_utility.debug_mesg *--
145: --* : g_err_buf *--
146: --* : g_err_code *--
147: --* : fnd_log.level_unexpected *--
148: --* : fnd_log.level_statement *--
149: --* : fnd_log.g_current_runtime_level *--
150: --* Called from : Concurrent program Update Interagency Transfers (FVIAUPDB) *--
151: --* Calls : insert_ia_recs *--
152: --* : fv_utility.debug_mesg *--
153: --* : fv_utility.log_mesg *--
225: END LOOP ;
226:
227: IF l_count =0 THEN
228: errbuf := 'No Invoices found for Upload.';
229: IF ( FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
230: FV_UTILITY.DEBUG_MESG(FND_LOG.LEVEL_STATEMENT, l_module_name,errbuf);
231: END IF;
232: ELSE
233: errbuf := 'Total Number of records Uploaded : '||l_count||'.';
226:
227: IF l_count =0 THEN
228: errbuf := 'No Invoices found for Upload.';
229: IF ( FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
230: FV_UTILITY.DEBUG_MESG(FND_LOG.LEVEL_STATEMENT, l_module_name,errbuf);
231: END IF;
232: ELSE
233: errbuf := 'Total Number of records Uploaded : '||l_count||'.';
234: IF ( FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
230: FV_UTILITY.DEBUG_MESG(FND_LOG.LEVEL_STATEMENT, l_module_name,errbuf);
231: END IF;
232: ELSE
233: errbuf := 'Total Number of records Uploaded : '||l_count||'.';
234: IF ( FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
235: FV_UTILITY.DEBUG_MESG(FND_LOG.LEVEL_STATEMENT, l_module_name,errbuf);
236: END IF;
237: COMMIT;
238: END IF;
231: END IF;
232: ELSE
233: errbuf := 'Total Number of records Uploaded : '||l_count||'.';
234: IF ( FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
235: FV_UTILITY.DEBUG_MESG(FND_LOG.LEVEL_STATEMENT, l_module_name,errbuf);
236: END IF;
237: COMMIT;
238: END IF;
239:
240: EXCEPTION
241: WHEN OTHERS THEN
242: g_err_code := SQLCODE;
243: g_err_buf := SQLERRM;
244: FV_UTILITY.LOG_MESG(FND_LOG.LEVEL_UNEXPECTED, l_module_name||'.final_exception',g_err_buf) ;
245: END upd_ia_main;
246:
247: --****************************************************************************************--
248: --* Name : insert_error *--
256: --* : p_retcode OUT Return Code to calling process *--
257: --* Global Vars : g_module_name READ *--
258: --* : g_SUCCESS READ *--
259: --* : g_ERROR READ *--
260: --* : fnd_log.level_statement READ *--
261: --* : fnd_log.g_current_runtime_level READ *--
262: --* : fnd_log.level_unexpected READ *--
263: --* : fnd_log.level_procedure READ *--
264: --* : g_enter READ *--
257: --* Global Vars : g_module_name READ *--
258: --* : g_SUCCESS READ *--
259: --* : g_ERROR READ *--
260: --* : fnd_log.level_statement READ *--
261: --* : fnd_log.g_current_runtime_level READ *--
262: --* : fnd_log.level_unexpected READ *--
263: --* : fnd_log.level_procedure READ *--
264: --* : g_enter READ *--
265: --* : g_exit READ *--
258: --* : g_SUCCESS READ *--
259: --* : g_ERROR READ *--
260: --* : fnd_log.level_statement READ *--
261: --* : fnd_log.g_current_runtime_level READ *--
262: --* : fnd_log.level_unexpected READ *--
263: --* : fnd_log.level_procedure READ *--
264: --* : g_enter READ *--
265: --* : g_exit READ *--
266: --* Called from : check_for_ap_import_errors *--
259: --* : g_ERROR READ *--
260: --* : fnd_log.level_statement READ *--
261: --* : fnd_log.g_current_runtime_level READ *--
262: --* : fnd_log.level_unexpected READ *--
263: --* : fnd_log.level_procedure READ *--
264: --* : g_enter READ *--
265: --* : g_exit READ *--
266: --* Called from : check_for_ap_import_errors *--
267: --* : resolve_uom *--
286: l_location VARCHAR2(400);
287: BEGIN
288: l_module_name := g_module_name || 'insert_error';
289: p_error_code := g_SUCCESS;
290: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
291: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
292: END IF;
293: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
294: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_ipac_import_id = '||p_ipac_import_id);
287: BEGIN
288: l_module_name := g_module_name || 'insert_error';
289: p_error_code := g_SUCCESS;
290: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
291: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
292: END IF;
293: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
294: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_ipac_import_id = '||p_ipac_import_id);
295: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_validation_code = '||p_validation_code);
289: p_error_code := g_SUCCESS;
290: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
291: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
292: END IF;
293: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
294: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_ipac_import_id = '||p_ipac_import_id);
295: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_validation_code = '||p_validation_code);
296: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_validation_err = '||p_validation_err);
297: END IF;
290: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
291: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
292: END IF;
293: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
294: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_ipac_import_id = '||p_ipac_import_id);
295: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_validation_code = '||p_validation_code);
296: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_validation_err = '||p_validation_err);
297: END IF;
298:
291: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
292: END IF;
293: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
294: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_ipac_import_id = '||p_ipac_import_id);
295: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_validation_code = '||p_validation_code);
296: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_validation_err = '||p_validation_err);
297: END IF;
298:
299: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
292: END IF;
293: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
294: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_ipac_import_id = '||p_ipac_import_id);
295: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_validation_code = '||p_validation_code);
296: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_validation_err = '||p_validation_err);
297: END IF;
298:
299: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
300: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Inserting into fv_ipac_import_errors');
295: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_validation_code = '||p_validation_code);
296: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_validation_err = '||p_validation_err);
297: END IF;
298:
299: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
300: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Inserting into fv_ipac_import_errors');
301: END IF;
302: INSERT INTO fv_ipac_import_errors
303: (
296: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_validation_err = '||p_validation_err);
297: END IF;
298:
299: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
300: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Inserting into fv_ipac_import_errors');
301: END IF;
302: INSERT INTO fv_ipac_import_errors
303: (
304: ipac_import_id,
310: p_ipac_import_id,
311: p_validation_code,
312: p_validation_err
313: );
314: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
315: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
316: END IF;
317: EXCEPTION
318: WHEN OTHERS THEN
311: p_validation_code,
312: p_validation_err
313: );
314: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
315: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
316: END IF;
317: EXCEPTION
318: WHEN OTHERS THEN
319: p_error_code := g_FAILURE;
318: WHEN OTHERS THEN
319: p_error_code := g_FAILURE;
320: p_error_desc := SQLERRM;
321: l_location := l_module_name||'.final_exception';
322: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
323: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
324: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
325: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
326: END IF;
319: p_error_code := g_FAILURE;
320: p_error_desc := SQLERRM;
321: l_location := l_module_name||'.final_exception';
322: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
323: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
324: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
325: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
326: END IF;
327: END;
320: p_error_desc := SQLERRM;
321: l_location := l_module_name||'.final_exception';
322: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
323: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
324: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
325: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
326: END IF;
327: END;
328:
321: l_location := l_module_name||'.final_exception';
322: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
323: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
324: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
325: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
326: END IF;
327: END;
328:
329: --****************************************************************************************--
335: --* : p_retcode Return Code to concurrent process *--
336: --* Global Vars : g_module_name READ *--
337: --* : g_SUCCESS READ *--
338: --* : g_ERROR READ *--
339: --* : fnd_log.level_statement READ *--
340: --* : fnd_log.g_current_runtime_level READ *--
341: --* : fnd_log.level_unexpected READ *--
342: --* : fnd_log.level_procedure READ *--
343: --* : g_enter READ *--
336: --* Global Vars : g_module_name READ *--
337: --* : g_SUCCESS READ *--
338: --* : g_ERROR READ *--
339: --* : fnd_log.level_statement READ *--
340: --* : fnd_log.g_current_runtime_level READ *--
341: --* : fnd_log.level_unexpected READ *--
342: --* : fnd_log.level_procedure READ *--
343: --* : g_enter READ *--
344: --* : g_exit READ *--
337: --* : g_SUCCESS READ *--
338: --* : g_ERROR READ *--
339: --* : fnd_log.level_statement READ *--
340: --* : fnd_log.g_current_runtime_level READ *--
341: --* : fnd_log.level_unexpected READ *--
342: --* : fnd_log.level_procedure READ *--
343: --* : g_enter READ *--
344: --* : g_exit READ *--
345: --* Called from : save_or_erase_invoice *--
338: --* : g_ERROR READ *--
339: --* : fnd_log.level_statement READ *--
340: --* : fnd_log.g_current_runtime_level READ *--
341: --* : fnd_log.level_unexpected READ *--
342: --* : fnd_log.level_procedure READ *--
343: --* : g_enter READ *--
344: --* : g_exit READ *--
345: --* Called from : save_or_erase_invoice *--
346: --* Calls : fv_utility.debug_mesg *--
359: l_location VARCHAR2(400);
360: BEGIN
361: l_module_name := g_module_name || 'insert_invoice_hdr';
362: p_error_code := g_SUCCESS;
363: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
364: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
365: END IF;
366:
367: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
360: BEGIN
361: l_module_name := g_module_name || 'insert_invoice_hdr';
362: p_error_code := g_SUCCESS;
363: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
364: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
365: END IF;
366:
367: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
368: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Inserting into ap_invoices_interface');
363: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
364: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
365: END IF;
366:
367: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
368: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Inserting into ap_invoices_interface');
369: END IF;
370: INSERT INTO ap_invoices_interface
371: (
364: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
365: END IF;
366:
367: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
368: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Inserting into ap_invoices_interface');
369: END IF;
370: INSERT INTO ap_invoices_interface
371: (
372: invoice_id,
562: p_invoice_hdr_rec.ship_to_location,
563: p_invoice_hdr_rec.external_doc_ref,
564: p_invoice_hdr_rec.payment_method_code
565: );
566: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
567: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
568: END IF;
569: EXCEPTION
570: WHEN OTHERS THEN
563: p_invoice_hdr_rec.external_doc_ref,
564: p_invoice_hdr_rec.payment_method_code
565: );
566: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
567: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
568: END IF;
569: EXCEPTION
570: WHEN OTHERS THEN
571: p_error_code := g_FAILURE;
570: WHEN OTHERS THEN
571: p_error_code := g_FAILURE;
572: p_error_desc := SQLERRM;
573: l_location := l_module_name||'.final_exception';
574: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
575: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
576: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
577: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
578: END IF;
571: p_error_code := g_FAILURE;
572: p_error_desc := SQLERRM;
573: l_location := l_module_name||'.final_exception';
574: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
575: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
576: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
577: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
578: END IF;
579: END;
572: p_error_desc := SQLERRM;
573: l_location := l_module_name||'.final_exception';
574: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
575: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
576: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
577: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
578: END IF;
579: END;
580:
573: l_location := l_module_name||'.final_exception';
574: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
575: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
576: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
577: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
578: END IF;
579: END;
580:
581: --****************************************************************************************--
587: --* : p_retcode Return Code to concurrent process *--
588: --* Global Vars : g_module_name READ *--
589: --* : g_SUCCESS READ *--
590: --* : g_ERROR READ *--
591: --* : fnd_log.level_statement READ *--
592: --* : fnd_log.g_current_runtime_level READ *--
593: --* : fnd_log.level_unexpected READ *--
594: --* : fnd_log.level_procedure READ *--
595: --* : g_enter READ *--
588: --* Global Vars : g_module_name READ *--
589: --* : g_SUCCESS READ *--
590: --* : g_ERROR READ *--
591: --* : fnd_log.level_statement READ *--
592: --* : fnd_log.g_current_runtime_level READ *--
593: --* : fnd_log.level_unexpected READ *--
594: --* : fnd_log.level_procedure READ *--
595: --* : g_enter READ *--
596: --* : g_exit READ *--
589: --* : g_SUCCESS READ *--
590: --* : g_ERROR READ *--
591: --* : fnd_log.level_statement READ *--
592: --* : fnd_log.g_current_runtime_level READ *--
593: --* : fnd_log.level_unexpected READ *--
594: --* : fnd_log.level_procedure READ *--
595: --* : g_enter READ *--
596: --* : g_exit READ *--
597: --* Called from : process_data *--
590: --* : g_ERROR READ *--
591: --* : fnd_log.level_statement READ *--
592: --* : fnd_log.g_current_runtime_level READ *--
593: --* : fnd_log.level_unexpected READ *--
594: --* : fnd_log.level_procedure READ *--
595: --* : g_enter READ *--
596: --* : g_exit READ *--
597: --* Called from : process_data *--
598: --* Calls : fv_utility.debug_mesg *--
615: l_location VARCHAR2(400);
616: BEGIN
617: l_module_name := g_module_name || 'insert_invoice_line';
618: p_error_code := g_SUCCESS;
619: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
620: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
621: END IF;
622:
623: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
616: BEGIN
617: l_module_name := g_module_name || 'insert_invoice_line';
618: p_error_code := g_SUCCESS;
619: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
620: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
621: END IF;
622:
623: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
624: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Inserting into ap_invoice_lines_interface');
619: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
620: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
621: END IF;
622:
623: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
624: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Inserting into ap_invoice_lines_interface');
625: END IF;
626: INSERT INTO ap_invoice_lines_interface
627: (
620: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
621: END IF;
622:
623: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
624: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Inserting into ap_invoice_lines_interface');
625: END IF;
626: INSERT INTO ap_invoice_lines_interface
627: (
628: invoice_id,
858: p_invoice_lines_rec.taxable_flag,
859: p_invoice_lines_rec.price_correct_inv_num,
860: p_invoice_lines_rec.external_doc_line_ref
861: ) RETURNING invoice_line_id INTO p_invoice_lines_rec.invoice_line_id;
862: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
863: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
864: END IF;
865: EXCEPTION
866: WHEN OTHERS THEN
859: p_invoice_lines_rec.price_correct_inv_num,
860: p_invoice_lines_rec.external_doc_line_ref
861: ) RETURNING invoice_line_id INTO p_invoice_lines_rec.invoice_line_id;
862: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
863: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
864: END IF;
865: EXCEPTION
866: WHEN OTHERS THEN
867: p_error_code := g_FAILURE;
866: WHEN OTHERS THEN
867: p_error_code := g_FAILURE;
868: p_error_desc := SQLERRM;
869: l_location := l_module_name||'.final_exception';
870: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
871: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
872: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
873: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
874: END IF;
867: p_error_code := g_FAILURE;
868: p_error_desc := SQLERRM;
869: l_location := l_module_name||'.final_exception';
870: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
871: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
872: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
873: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
874: END IF;
875: END;
868: p_error_desc := SQLERRM;
869: l_location := l_module_name||'.final_exception';
870: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
871: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
872: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
873: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
874: END IF;
875: END;
876:
869: l_location := l_module_name||'.final_exception';
870: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
871: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
872: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
873: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
874: END IF;
875: END;
876:
877: --****************************************************************************************--
883: --* : p_retcode Return Code to concurrent process *--
884: --* Global Vars : g_module_name READ *--
885: --* : g_SUCCESS READ *--
886: --* : g_ERROR READ *--
887: --* : fnd_log.level_statement READ *--
888: --* : fnd_log.g_current_runtime_level READ *--
889: --* : fnd_log.level_unexpected READ *--
890: --* : fnd_log.level_procedure READ *--
891: --* : g_enter READ *--
884: --* Global Vars : g_module_name READ *--
885: --* : g_SUCCESS READ *--
886: --* : g_ERROR READ *--
887: --* : fnd_log.level_statement READ *--
888: --* : fnd_log.g_current_runtime_level READ *--
889: --* : fnd_log.level_unexpected READ *--
890: --* : fnd_log.level_procedure READ *--
891: --* : g_enter READ *--
892: --* : g_exit READ *--
885: --* : g_SUCCESS READ *--
886: --* : g_ERROR READ *--
887: --* : fnd_log.level_statement READ *--
888: --* : fnd_log.g_current_runtime_level READ *--
889: --* : fnd_log.level_unexpected READ *--
890: --* : fnd_log.level_procedure READ *--
891: --* : g_enter READ *--
892: --* : g_exit READ *--
893: --* Called from : main *--
886: --* : g_ERROR READ *--
887: --* : fnd_log.level_statement READ *--
888: --* : fnd_log.g_current_runtime_level READ *--
889: --* : fnd_log.level_unexpected READ *--
890: --* : fnd_log.level_procedure READ *--
891: --* : g_enter READ *--
892: --* : g_exit READ *--
893: --* Called from : main *--
894: --* Calls : insert_error *--
920: l_rowcount NUMBER;
921: BEGIN
922: l_module_name := g_module_name || 'check_for_ap_import_errors';
923: p_error_code := g_SUCCESS;
924: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
925: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
926: END IF;
927: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
928: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_group_id = '||p_group_id);
921: BEGIN
922: l_module_name := g_module_name || 'check_for_ap_import_errors';
923: p_error_code := g_SUCCESS;
924: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
925: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
926: END IF;
927: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
928: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_group_id = '||p_group_id);
929: END IF;
923: p_error_code := g_SUCCESS;
924: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
925: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
926: END IF;
927: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
928: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_group_id = '||p_group_id);
929: END IF;
930:
931: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
924: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
925: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
926: END IF;
927: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
928: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_group_id = '||p_group_id);
929: END IF;
930:
931: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
932: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'About to get into invoices_rec');
927: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
928: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_group_id = '||p_group_id);
929: END IF;
930:
931: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
932: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'About to get into invoices_rec');
933: END IF;
934: FOR invoices_rec IN (SELECT aii.invoice_id,
935: air.reject_lookup_code,
928: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_group_id = '||p_group_id);
929: END IF;
930:
931: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
932: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'About to get into invoices_rec');
933: END IF;
934: FOR invoices_rec IN (SELECT aii.invoice_id,
935: air.reject_lookup_code,
936: fii.ipac_import_id,
946: AND fii.group_id = p_group_id
947: AND fii.int_invoice_id = aii.invoice_id
948: AND alc.lookup_type = 'REJECT CODE'
949: AND alc.lookup_code = air.reject_lookup_code) LOOP
950: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
951: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'invoice_id='||invoices_rec.invoice_id);
952: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'reject_lookup_code='||invoices_rec.reject_lookup_code);
953: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'description='||invoices_rec.description);
954: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'ipac_import_id='||invoices_rec.ipac_import_id);
947: AND fii.int_invoice_id = aii.invoice_id
948: AND alc.lookup_type = 'REJECT CODE'
949: AND alc.lookup_code = air.reject_lookup_code) LOOP
950: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
951: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'invoice_id='||invoices_rec.invoice_id);
952: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'reject_lookup_code='||invoices_rec.reject_lookup_code);
953: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'description='||invoices_rec.description);
954: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'ipac_import_id='||invoices_rec.ipac_import_id);
955: END IF;
948: AND alc.lookup_type = 'REJECT CODE'
949: AND alc.lookup_code = air.reject_lookup_code) LOOP
950: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
951: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'invoice_id='||invoices_rec.invoice_id);
952: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'reject_lookup_code='||invoices_rec.reject_lookup_code);
953: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'description='||invoices_rec.description);
954: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'ipac_import_id='||invoices_rec.ipac_import_id);
955: END IF;
956:
949: AND alc.lookup_code = air.reject_lookup_code) LOOP
950: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
951: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'invoice_id='||invoices_rec.invoice_id);
952: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'reject_lookup_code='||invoices_rec.reject_lookup_code);
953: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'description='||invoices_rec.description);
954: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'ipac_import_id='||invoices_rec.ipac_import_id);
955: END IF;
956:
957: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
950: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
951: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'invoice_id='||invoices_rec.invoice_id);
952: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'reject_lookup_code='||invoices_rec.reject_lookup_code);
953: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'description='||invoices_rec.description);
954: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'ipac_import_id='||invoices_rec.ipac_import_id);
955: END IF;
956:
957: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
958: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling insert_error');
953: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'description='||invoices_rec.description);
954: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'ipac_import_id='||invoices_rec.ipac_import_id);
955: END IF;
956:
957: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
958: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling insert_error');
959: END IF;
960: insert_error
961: (
954: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'ipac_import_id='||invoices_rec.ipac_import_id);
955: END IF;
956:
957: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
958: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling insert_error');
959: END IF;
960: insert_error
961: (
962: p_ipac_import_id => invoices_rec.ipac_import_id,
964: p_validation_err => invoices_rec.description,
965: p_error_code => p_error_code,
966: p_error_desc => p_error_desc
967: );
968: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
969: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'insert_error returned with code'||p_error_code);
970: END IF;
971:
972: IF (p_error_code = g_SUCCESS) THEN
965: p_error_code => p_error_code,
966: p_error_desc => p_error_desc
967: );
968: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
969: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'insert_error returned with code'||p_error_code);
970: END IF;
971:
972: IF (p_error_code = g_SUCCESS) THEN
973: BEGIN
970: END IF;
971:
972: IF (p_error_code = g_SUCCESS) THEN
973: BEGIN
974: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
975: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'UPDATE fv_ipac_import1');
976: END IF;
977: UPDATE fv_ipac_import
978: SET record_status = g_status_error
971:
972: IF (p_error_code = g_SUCCESS) THEN
973: BEGIN
974: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
975: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'UPDATE fv_ipac_import1');
976: END IF;
977: UPDATE fv_ipac_import
978: SET record_status = g_status_error
979: WHERE ipac_import_id = invoices_rec.ipac_import_id;
977: UPDATE fv_ipac_import
978: SET record_status = g_status_error
979: WHERE ipac_import_id = invoices_rec.ipac_import_id;
980: l_rowcount := SQL%ROWCOUNT;
981: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
982: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'UPDATED '||l_rowcount||' rows.');
983: END IF;
984:
985: EXCEPTION
978: SET record_status = g_status_error
979: WHERE ipac_import_id = invoices_rec.ipac_import_id;
980: l_rowcount := SQL%ROWCOUNT;
981: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
982: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'UPDATED '||l_rowcount||' rows.');
983: END IF;
984:
985: EXCEPTION
986: WHEN OTHERS THEN
986: WHEN OTHERS THEN
987: p_error_code := g_FAILURE;
988: p_error_desc := SQLERRM;
989: l_location := l_module_name||'.update_fv_ipac_import1';
990: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
991: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
992: END;
993: END IF;
994: IF (p_error_code <> g_SUCCESS) THEN
987: p_error_code := g_FAILURE;
988: p_error_desc := SQLERRM;
989: l_location := l_module_name||'.update_fv_ipac_import1';
990: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
991: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
992: END;
993: END IF;
994: IF (p_error_code <> g_SUCCESS) THEN
995: EXIT;
994: IF (p_error_code <> g_SUCCESS) THEN
995: EXIT;
996: END IF;
997: END LOOP;
998: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
999: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'invoices_rec processing finished');
1000: END IF;
1001:
1002: IF (p_error_code = g_SUCCESS) THEN
995: EXIT;
996: END IF;
997: END LOOP;
998: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
999: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'invoices_rec processing finished');
1000: END IF;
1001:
1002: IF (p_error_code = g_SUCCESS) THEN
1003: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
999: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'invoices_rec processing finished');
1000: END IF;
1001:
1002: IF (p_error_code = g_SUCCESS) THEN
1003: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1004: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'About to get into invoice_lines_rec');
1005: END IF;
1006: FOR invoice_lines_rec IN (SELECT aii.invoice_id,
1007: air.reject_lookup_code,
1000: END IF;
1001:
1002: IF (p_error_code = g_SUCCESS) THEN
1003: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1004: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'About to get into invoice_lines_rec');
1005: END IF;
1006: FOR invoice_lines_rec IN (SELECT aii.invoice_id,
1007: air.reject_lookup_code,
1008: fii.ipac_import_id,
1021: AND fii.int_invoice_id = aii.invoice_id
1022: AND fii.int_invoice_line_id = aili.invoice_line_id
1023: AND alc.lookup_type = 'REJECT CODE'
1024: AND alc.lookup_code = air.reject_lookup_code) LOOP
1025: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1026: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'invoice_id='||invoice_lines_rec.invoice_id);
1027: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'reject_lookup_code='||invoice_lines_rec.reject_lookup_code);
1028: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'description='||invoice_lines_rec.description);
1029: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'ipac_import_id='||invoice_lines_rec.ipac_import_id);
1022: AND fii.int_invoice_line_id = aili.invoice_line_id
1023: AND alc.lookup_type = 'REJECT CODE'
1024: AND alc.lookup_code = air.reject_lookup_code) LOOP
1025: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1026: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'invoice_id='||invoice_lines_rec.invoice_id);
1027: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'reject_lookup_code='||invoice_lines_rec.reject_lookup_code);
1028: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'description='||invoice_lines_rec.description);
1029: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'ipac_import_id='||invoice_lines_rec.ipac_import_id);
1030: END IF;
1023: AND alc.lookup_type = 'REJECT CODE'
1024: AND alc.lookup_code = air.reject_lookup_code) LOOP
1025: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1026: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'invoice_id='||invoice_lines_rec.invoice_id);
1027: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'reject_lookup_code='||invoice_lines_rec.reject_lookup_code);
1028: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'description='||invoice_lines_rec.description);
1029: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'ipac_import_id='||invoice_lines_rec.ipac_import_id);
1030: END IF;
1031:
1024: AND alc.lookup_code = air.reject_lookup_code) LOOP
1025: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1026: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'invoice_id='||invoice_lines_rec.invoice_id);
1027: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'reject_lookup_code='||invoice_lines_rec.reject_lookup_code);
1028: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'description='||invoice_lines_rec.description);
1029: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'ipac_import_id='||invoice_lines_rec.ipac_import_id);
1030: END IF;
1031:
1032: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1025: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1026: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'invoice_id='||invoice_lines_rec.invoice_id);
1027: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'reject_lookup_code='||invoice_lines_rec.reject_lookup_code);
1028: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'description='||invoice_lines_rec.description);
1029: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'ipac_import_id='||invoice_lines_rec.ipac_import_id);
1030: END IF;
1031:
1032: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1033: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling insert_error');
1028: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'description='||invoice_lines_rec.description);
1029: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'ipac_import_id='||invoice_lines_rec.ipac_import_id);
1030: END IF;
1031:
1032: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1033: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling insert_error');
1034: END IF;
1035: insert_error
1036: (
1029: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'ipac_import_id='||invoice_lines_rec.ipac_import_id);
1030: END IF;
1031:
1032: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1033: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling insert_error');
1034: END IF;
1035: insert_error
1036: (
1037: p_ipac_import_id => invoice_lines_rec.ipac_import_id,
1042: );
1043:
1044: IF (p_error_code = g_SUCCESS) THEN
1045: BEGIN
1046: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1047: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'UPDATE fv_ipac_import2');
1048: END IF;
1049: UPDATE fv_ipac_import
1050: SET record_status = g_status_error
1043:
1044: IF (p_error_code = g_SUCCESS) THEN
1045: BEGIN
1046: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1047: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'UPDATE fv_ipac_import2');
1048: END IF;
1049: UPDATE fv_ipac_import
1050: SET record_status = g_status_error
1051: WHERE ipac_import_id = invoice_lines_rec.ipac_import_id;
1049: UPDATE fv_ipac_import
1050: SET record_status = g_status_error
1051: WHERE ipac_import_id = invoice_lines_rec.ipac_import_id;
1052: l_rowcount := SQL%ROWCOUNT;
1053: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1054: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'UPDATED '||l_rowcount||' rows.');
1055: END IF;
1056: EXCEPTION
1057: WHEN OTHERS THEN
1050: SET record_status = g_status_error
1051: WHERE ipac_import_id = invoice_lines_rec.ipac_import_id;
1052: l_rowcount := SQL%ROWCOUNT;
1053: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1054: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'UPDATED '||l_rowcount||' rows.');
1055: END IF;
1056: EXCEPTION
1057: WHEN OTHERS THEN
1058: p_error_code := g_FAILURE;
1057: WHEN OTHERS THEN
1058: p_error_code := g_FAILURE;
1059: p_error_desc := SQLERRM;
1060: l_location := l_module_name||'.update_fv_ipac_import2';
1061: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1062: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
1063: END;
1064: END IF;
1065: IF (p_error_code <> g_SUCCESS) THEN
1058: p_error_code := g_FAILURE;
1059: p_error_desc := SQLERRM;
1060: l_location := l_module_name||'.update_fv_ipac_import2';
1061: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1062: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
1063: END;
1064: END IF;
1065: IF (p_error_code <> g_SUCCESS) THEN
1066: EXIT;
1065: IF (p_error_code <> g_SUCCESS) THEN
1066: EXIT;
1067: END IF;
1068: END LOOP;
1069: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1070: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'invoice_lines_rec processing finished');
1071: END IF;
1072:
1073: END IF;
1066: EXIT;
1067: END IF;
1068: END LOOP;
1069: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1070: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'invoice_lines_rec processing finished');
1071: END IF;
1072:
1073: END IF;
1074: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1070: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'invoice_lines_rec processing finished');
1071: END IF;
1072:
1073: END IF;
1074: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1075: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
1076: END IF;
1077: EXCEPTION
1078: WHEN OTHERS THEN
1071: END IF;
1072:
1073: END IF;
1074: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1075: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
1076: END IF;
1077: EXCEPTION
1078: WHEN OTHERS THEN
1079: p_error_code := g_FAILURE;
1078: WHEN OTHERS THEN
1079: p_error_code := g_FAILURE;
1080: p_error_desc := SQLERRM;
1081: l_location := l_module_name||'.final_exception';
1082: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1083: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
1084: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1085: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
1086: END IF;
1079: p_error_code := g_FAILURE;
1080: p_error_desc := SQLERRM;
1081: l_location := l_module_name||'.final_exception';
1082: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1083: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
1084: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1085: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
1086: END IF;
1087: END;
1080: p_error_desc := SQLERRM;
1081: l_location := l_module_name||'.final_exception';
1082: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1083: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
1084: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1085: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
1086: END IF;
1087: END;
1088:
1081: l_location := l_module_name||'.final_exception';
1082: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1083: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
1084: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1085: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
1086: END IF;
1087: END;
1088:
1089: --****************************************************************************************--
1098: --* Global Vars : g_org_id READ *--
1099: --* : g_module_name READ *--
1100: --* : g_SUCCESS READ *--
1101: --* : g_ERROR READ *--
1102: --* : fnd_log.level_statement READ *--
1103: --* : fnd_log.g_current_runtime_level READ *--
1104: --* : fnd_log.level_unexpected READ *--
1105: --* : fnd_log.level_procedure READ *--
1106: --* : g_enter READ *--
1099: --* : g_module_name READ *--
1100: --* : g_SUCCESS READ *--
1101: --* : g_ERROR READ *--
1102: --* : fnd_log.level_statement READ *--
1103: --* : fnd_log.g_current_runtime_level READ *--
1104: --* : fnd_log.level_unexpected READ *--
1105: --* : fnd_log.level_procedure READ *--
1106: --* : g_enter READ *--
1107: --* : g_exit READ *--
1100: --* : g_SUCCESS READ *--
1101: --* : g_ERROR READ *--
1102: --* : fnd_log.level_statement READ *--
1103: --* : fnd_log.g_current_runtime_level READ *--
1104: --* : fnd_log.level_unexpected READ *--
1105: --* : fnd_log.level_procedure READ *--
1106: --* : g_enter READ *--
1107: --* : g_exit READ *--
1108: --* Called from : main *--
1101: --* : g_ERROR READ *--
1102: --* : fnd_log.level_statement READ *--
1103: --* : fnd_log.g_current_runtime_level READ *--
1104: --* : fnd_log.level_unexpected READ *--
1105: --* : fnd_log.level_procedure READ *--
1106: --* : g_enter READ *--
1107: --* : g_exit READ *--
1108: --* Called from : main *--
1109: --* Calls : fnd_request.set_org_id *--
1136: l_message VARCHAR2(100);
1137: BEGIN
1138: l_module_name := g_module_name || 'kick_off_ipac_auto_pmt_process';
1139: p_error_code := g_SUCCESS;
1140: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1141: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
1142: END IF;
1143: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1144: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_batch_name = '||p_batch_name);
1137: BEGIN
1138: l_module_name := g_module_name || 'kick_off_ipac_auto_pmt_process';
1139: p_error_code := g_SUCCESS;
1140: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1141: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
1142: END IF;
1143: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1144: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_batch_name = '||p_batch_name);
1145: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_payment_bank_acct_id = '||p_payment_bank_acct_id);
1139: p_error_code := g_SUCCESS;
1140: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1141: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
1142: END IF;
1143: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1144: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_batch_name = '||p_batch_name);
1145: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_payment_bank_acct_id = '||p_payment_bank_acct_id);
1146: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_payment_profile_id = '||p_payment_profile_id);
1147: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_payment_document_id = '||p_payment_document_id);
1140: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1141: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
1142: END IF;
1143: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1144: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_batch_name = '||p_batch_name);
1145: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_payment_bank_acct_id = '||p_payment_bank_acct_id);
1146: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_payment_profile_id = '||p_payment_profile_id);
1147: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_payment_document_id = '||p_payment_document_id);
1148: -- fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_pay_trans_code = '||p_pay_trans_code);
1141: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
1142: END IF;
1143: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1144: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_batch_name = '||p_batch_name);
1145: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_payment_bank_acct_id = '||p_payment_bank_acct_id);
1146: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_payment_profile_id = '||p_payment_profile_id);
1147: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_payment_document_id = '||p_payment_document_id);
1148: -- fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_pay_trans_code = '||p_pay_trans_code);
1149: END IF;
1142: END IF;
1143: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1144: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_batch_name = '||p_batch_name);
1145: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_payment_bank_acct_id = '||p_payment_bank_acct_id);
1146: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_payment_profile_id = '||p_payment_profile_id);
1147: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_payment_document_id = '||p_payment_document_id);
1148: -- fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_pay_trans_code = '||p_pay_trans_code);
1149: END IF;
1150:
1143: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1144: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_batch_name = '||p_batch_name);
1145: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_payment_bank_acct_id = '||p_payment_bank_acct_id);
1146: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_payment_profile_id = '||p_payment_profile_id);
1147: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_payment_document_id = '||p_payment_document_id);
1148: -- fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_pay_trans_code = '||p_pay_trans_code);
1149: END IF;
1150:
1151: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1144: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_batch_name = '||p_batch_name);
1145: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_payment_bank_acct_id = '||p_payment_bank_acct_id);
1146: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_payment_profile_id = '||p_payment_profile_id);
1147: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_payment_document_id = '||p_payment_document_id);
1148: -- fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_pay_trans_code = '||p_pay_trans_code);
1149: END IF;
1150:
1151: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1152: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling submit_request');
1147: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_payment_document_id = '||p_payment_document_id);
1148: -- fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_pay_trans_code = '||p_pay_trans_code);
1149: END IF;
1150:
1151: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1152: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling submit_request');
1153: END IF;
1154:
1155: fnd_request.set_org_id(g_org_id);
1148: -- fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_pay_trans_code = '||p_pay_trans_code);
1149: END IF;
1150:
1151: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1152: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling submit_request');
1153: END IF;
1154:
1155: fnd_request.set_org_id(g_org_id);
1156: l_request_id := fnd_request.submit_request
1167: argument5 => g_org_id,
1168: argument6 => g_set_of_books_id
1169: );
1170:
1171: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1172: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'submit_request retured');
1173: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_request_id = '||l_request_id);
1174: END IF;
1175:
1168: argument6 => g_set_of_books_id
1169: );
1170:
1171: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1172: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'submit_request retured');
1173: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_request_id = '||l_request_id);
1174: END IF;
1175:
1176: IF (l_request_id = 0) THEN
1169: );
1170:
1171: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1172: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'submit_request retured');
1173: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_request_id = '||l_request_id);
1174: END IF;
1175:
1176: IF (l_request_id = 0) THEN
1177: p_error_code := g_FAILURE;
1175:
1176: IF (l_request_id = 0) THEN
1177: p_error_code := g_FAILURE;
1178: p_error_desc := 'Failed to submit request for IPAC Automatic Payment Process';
1179: fv_utility.log_mesg(fnd_log.level_error, l_module_name,p_error_desc) ;
1180: ELSE
1181: COMMIT;
1182: END IF;
1183:
1181: COMMIT;
1182: END IF;
1183:
1184: IF (p_error_code = g_SUCCESS) THEN
1185: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1186: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling wait_for_request');
1187: END IF;
1188: l_request_wait_status := fnd_concurrent.wait_for_request
1189: (
1182: END IF;
1183:
1184: IF (p_error_code = g_SUCCESS) THEN
1185: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1186: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling wait_for_request');
1187: END IF;
1188: l_request_wait_status := fnd_concurrent.wait_for_request
1189: (
1190: request_id => l_request_id,
1195: dev_phase => l_dev_phase,
1196: dev_status => l_dev_status,
1197: message => l_message
1198: );
1199: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1200: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'wait_for_request retured');
1201: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_phase = '||l_phase);
1202: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_status = '||l_status);
1203: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_dev_phase = '||l_dev_phase);
1196: dev_status => l_dev_status,
1197: message => l_message
1198: );
1199: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1200: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'wait_for_request retured');
1201: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_phase = '||l_phase);
1202: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_status = '||l_status);
1203: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_dev_phase = '||l_dev_phase);
1204: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_dev_status = '||l_dev_status);
1197: message => l_message
1198: );
1199: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1200: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'wait_for_request retured');
1201: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_phase = '||l_phase);
1202: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_status = '||l_status);
1203: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_dev_phase = '||l_dev_phase);
1204: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_dev_status = '||l_dev_status);
1205: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_message = '||l_message);
1198: );
1199: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1200: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'wait_for_request retured');
1201: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_phase = '||l_phase);
1202: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_status = '||l_status);
1203: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_dev_phase = '||l_dev_phase);
1204: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_dev_status = '||l_dev_status);
1205: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_message = '||l_message);
1206: END IF;
1199: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1200: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'wait_for_request retured');
1201: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_phase = '||l_phase);
1202: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_status = '||l_status);
1203: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_dev_phase = '||l_dev_phase);
1204: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_dev_status = '||l_dev_status);
1205: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_message = '||l_message);
1206: END IF;
1207:
1200: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'wait_for_request retured');
1201: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_phase = '||l_phase);
1202: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_status = '||l_status);
1203: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_dev_phase = '||l_dev_phase);
1204: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_dev_status = '||l_dev_status);
1205: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_message = '||l_message);
1206: END IF;
1207:
1208: COMMIT;
1201: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_phase = '||l_phase);
1202: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_status = '||l_status);
1203: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_dev_phase = '||l_dev_phase);
1204: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_dev_status = '||l_dev_status);
1205: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_message = '||l_message);
1206: END IF;
1207:
1208: COMMIT;
1209:
1209:
1210: IF l_request_wait_status = FALSE THEN
1211: p_error_code := g_FAILURE;
1212: p_error_desc := 'Failed to wait for IPAC Automatic Payment Process';
1213: fv_utility.log_mesg(fnd_log.level_error, l_module_name,p_error_desc) ;
1214: END IF;
1215: END IF;
1216: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1217: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
1212: p_error_desc := 'Failed to wait for IPAC Automatic Payment Process';
1213: fv_utility.log_mesg(fnd_log.level_error, l_module_name,p_error_desc) ;
1214: END IF;
1215: END IF;
1216: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1217: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
1218: END IF;
1219:
1220: EXCEPTION
1213: fv_utility.log_mesg(fnd_log.level_error, l_module_name,p_error_desc) ;
1214: END IF;
1215: END IF;
1216: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1217: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
1218: END IF;
1219:
1220: EXCEPTION
1221: WHEN OTHERS THEN
1221: WHEN OTHERS THEN
1222: p_error_code := g_FAILURE;
1223: p_error_desc := SQLERRM;
1224: l_location := l_module_name||'.final_exception';
1225: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1226: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
1227: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1228: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
1229: END IF;
1222: p_error_code := g_FAILURE;
1223: p_error_desc := SQLERRM;
1224: l_location := l_module_name||'.final_exception';
1225: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1226: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
1227: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1228: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
1229: END IF;
1230: END;
1223: p_error_desc := SQLERRM;
1224: l_location := l_module_name||'.final_exception';
1225: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1226: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
1227: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1228: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
1229: END IF;
1230: END;
1231:
1224: l_location := l_module_name||'.final_exception';
1225: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1226: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
1227: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1228: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
1229: END IF;
1230: END;
1231:
1232: --****************************************************************************************--
1241: --* Global Vars : g_org_id READ *--
1242: --* : g_module_name READ *--
1243: --* : g_SUCCESS READ *--
1244: --* : g_ERROR READ *--
1245: --* : fnd_log.level_statement READ *--
1246: --* : fnd_log.g_current_runtime_level READ *--
1247: --* : fnd_log.level_unexpected READ *--
1248: --* : fnd_log.level_procedure READ *--
1249: --* : g_enter READ *--
1242: --* : g_module_name READ *--
1243: --* : g_SUCCESS READ *--
1244: --* : g_ERROR READ *--
1245: --* : fnd_log.level_statement READ *--
1246: --* : fnd_log.g_current_runtime_level READ *--
1247: --* : fnd_log.level_unexpected READ *--
1248: --* : fnd_log.level_procedure READ *--
1249: --* : g_enter READ *--
1250: --* : g_exit READ *--
1243: --* : g_SUCCESS READ *--
1244: --* : g_ERROR READ *--
1245: --* : fnd_log.level_statement READ *--
1246: --* : fnd_log.g_current_runtime_level READ *--
1247: --* : fnd_log.level_unexpected READ *--
1248: --* : fnd_log.level_procedure READ *--
1249: --* : g_enter READ *--
1250: --* : g_exit READ *--
1251: --* Called from : main *--
1244: --* : g_ERROR READ *--
1245: --* : fnd_log.level_statement READ *--
1246: --* : fnd_log.g_current_runtime_level READ *--
1247: --* : fnd_log.level_unexpected READ *--
1248: --* : fnd_log.level_procedure READ *--
1249: --* : g_enter READ *--
1250: --* : g_exit READ *--
1251: --* Called from : main *--
1252: --* Calls : fnd_request.set_org_id *--
1278: BEGIN
1279: l_module_name := g_module_name || 'kick_off_ap_invoices_import';
1280: p_error_code := g_SUCCESS;
1281:
1282: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1283: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
1284: END IF;
1285: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1286: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_batch_name = '||p_batch_name);
1279: l_module_name := g_module_name || 'kick_off_ap_invoices_import';
1280: p_error_code := g_SUCCESS;
1281:
1282: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1283: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
1284: END IF;
1285: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1286: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_batch_name = '||p_batch_name);
1287: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_group_id = '||p_group_id);
1281:
1282: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1283: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
1284: END IF;
1285: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1286: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_batch_name = '||p_batch_name);
1287: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_group_id = '||p_group_id);
1288: END IF;
1289:
1282: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1283: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
1284: END IF;
1285: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1286: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_batch_name = '||p_batch_name);
1287: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_group_id = '||p_group_id);
1288: END IF;
1289:
1290: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1283: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
1284: END IF;
1285: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1286: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_batch_name = '||p_batch_name);
1287: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_group_id = '||p_group_id);
1288: END IF;
1289:
1290: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1291: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling submit_request');
1286: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_batch_name = '||p_batch_name);
1287: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_group_id = '||p_group_id);
1288: END IF;
1289:
1290: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1291: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling submit_request');
1292: END IF;
1293:
1294:
1287: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_group_id = '||p_group_id);
1288: END IF;
1289:
1290: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1291: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling submit_request');
1292: END IF;
1293:
1294:
1295: fnd_request.set_org_id(g_org_id);
1316: argument14 => ''
1317: ) ;
1318:
1319:
1320: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1321: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'submit_request retured');
1322: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_request_id = '||l_request_id);
1323: END IF;
1324:
1317: ) ;
1318:
1319:
1320: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1321: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'submit_request retured');
1322: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_request_id = '||l_request_id);
1323: END IF;
1324:
1325: IF (l_request_id = 0) THEN
1318:
1319:
1320: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1321: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'submit_request retured');
1322: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_request_id = '||l_request_id);
1323: END IF;
1324:
1325: IF (l_request_id = 0) THEN
1326: p_error_code := g_FAILURE;
1324:
1325: IF (l_request_id = 0) THEN
1326: p_error_code := g_FAILURE;
1327: p_error_desc := 'Failed to submit request for "Payables Open Interface Import" Program';
1328: fv_utility.log_mesg(fnd_log.level_error, l_module_name,p_error_desc) ;
1329: ELSE
1330: COMMIT;
1331: END IF;
1332:
1330: COMMIT;
1331: END IF;
1332:
1333: IF (p_error_code = g_SUCCESS) THEN
1334: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1335: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling wait_for_request');
1336: END IF;
1337: l_request_wait_status := fnd_concurrent.wait_for_request
1338: (
1331: END IF;
1332:
1333: IF (p_error_code = g_SUCCESS) THEN
1334: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1335: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling wait_for_request');
1336: END IF;
1337: l_request_wait_status := fnd_concurrent.wait_for_request
1338: (
1339: request_id => l_request_id,
1344: dev_phase => l_dev_phase,
1345: dev_status => l_dev_status,
1346: message => l_message
1347: );
1348: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1349: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'wait_for_request retured');
1350: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_phase = '||l_phase);
1351: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_status = '||l_status);
1352: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_dev_phase = '||l_dev_phase);
1345: dev_status => l_dev_status,
1346: message => l_message
1347: );
1348: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1349: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'wait_for_request retured');
1350: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_phase = '||l_phase);
1351: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_status = '||l_status);
1352: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_dev_phase = '||l_dev_phase);
1353: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_dev_status = '||l_dev_status);
1346: message => l_message
1347: );
1348: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1349: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'wait_for_request retured');
1350: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_phase = '||l_phase);
1351: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_status = '||l_status);
1352: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_dev_phase = '||l_dev_phase);
1353: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_dev_status = '||l_dev_status);
1354: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_message = '||l_message);
1347: );
1348: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1349: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'wait_for_request retured');
1350: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_phase = '||l_phase);
1351: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_status = '||l_status);
1352: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_dev_phase = '||l_dev_phase);
1353: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_dev_status = '||l_dev_status);
1354: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_message = '||l_message);
1355: END IF;
1348: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1349: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'wait_for_request retured');
1350: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_phase = '||l_phase);
1351: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_status = '||l_status);
1352: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_dev_phase = '||l_dev_phase);
1353: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_dev_status = '||l_dev_status);
1354: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_message = '||l_message);
1355: END IF;
1356:
1349: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'wait_for_request retured');
1350: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_phase = '||l_phase);
1351: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_status = '||l_status);
1352: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_dev_phase = '||l_dev_phase);
1353: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_dev_status = '||l_dev_status);
1354: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_message = '||l_message);
1355: END IF;
1356:
1357: COMMIT;
1350: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_phase = '||l_phase);
1351: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_status = '||l_status);
1352: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_dev_phase = '||l_dev_phase);
1353: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_dev_status = '||l_dev_status);
1354: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_message = '||l_message);
1355: END IF;
1356:
1357: COMMIT;
1358:
1358:
1359: IF l_request_wait_status = FALSE THEN
1360: p_error_code := g_FAILURE;
1361: p_error_desc := 'Failed to wait for the payables open interface';
1362: fv_utility.log_mesg(fnd_log.level_error, l_module_name,p_error_desc) ;
1363: END IF;
1364: END IF;
1365: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1366: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
1361: p_error_desc := 'Failed to wait for the payables open interface';
1362: fv_utility.log_mesg(fnd_log.level_error, l_module_name,p_error_desc) ;
1363: END IF;
1364: END IF;
1365: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1366: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
1367: END IF;
1368:
1369: EXCEPTION
1362: fv_utility.log_mesg(fnd_log.level_error, l_module_name,p_error_desc) ;
1363: END IF;
1364: END IF;
1365: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1366: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
1367: END IF;
1368:
1369: EXCEPTION
1370: WHEN OTHERS THEN
1370: WHEN OTHERS THEN
1371: p_error_code := g_FAILURE;
1372: p_error_desc := SQLERRM;
1373: l_location := l_module_name||'.final_exception';
1374: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1375: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
1376: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1377: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
1378: END IF;
1371: p_error_code := g_FAILURE;
1372: p_error_desc := SQLERRM;
1373: l_location := l_module_name||'.final_exception';
1374: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1375: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
1376: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1377: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
1378: END IF;
1379: END;
1372: p_error_desc := SQLERRM;
1373: l_location := l_module_name||'.final_exception';
1374: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1375: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
1376: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1377: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
1378: END IF;
1379: END;
1380:
1373: l_location := l_module_name||'.final_exception';
1374: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1375: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
1376: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1377: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
1378: END IF;
1379: END;
1380:
1381: --****************************************************************************************--
1391: --* Global Vars : g_org_id READ *--
1392: --* : g_module_name READ *--
1393: --* : g_SUCCESS READ *--
1394: --* : g_ERROR READ *--
1395: --* : fnd_log.level_statement READ *--
1396: --* : fnd_log.g_current_runtime_level READ *--
1397: --* : fnd_log.level_procedure READ *--
1398: --* : fnd_log.level_unexpected READ *--
1399: --* : g_enter READ *--
1392: --* : g_module_name READ *--
1393: --* : g_SUCCESS READ *--
1394: --* : g_ERROR READ *--
1395: --* : fnd_log.level_statement READ *--
1396: --* : fnd_log.g_current_runtime_level READ *--
1397: --* : fnd_log.level_procedure READ *--
1398: --* : fnd_log.level_unexpected READ *--
1399: --* : g_enter READ *--
1400: --* : g_exit READ *--
1393: --* : g_SUCCESS READ *--
1394: --* : g_ERROR READ *--
1395: --* : fnd_log.level_statement READ *--
1396: --* : fnd_log.g_current_runtime_level READ *--
1397: --* : fnd_log.level_procedure READ *--
1398: --* : fnd_log.level_unexpected READ *--
1399: --* : g_enter READ *--
1400: --* : g_exit READ *--
1401: --* Called from : main *--
1394: --* : g_ERROR READ *--
1395: --* : fnd_log.level_statement READ *--
1396: --* : fnd_log.g_current_runtime_level READ *--
1397: --* : fnd_log.level_procedure READ *--
1398: --* : fnd_log.level_unexpected READ *--
1399: --* : g_enter READ *--
1400: --* : g_exit READ *--
1401: --* Called from : main *--
1402: --* Calls : fnd_request.set_org_id *--
1428: l_message VARCHAR2(100);
1429: BEGIN
1430: l_module_name := g_module_name || 'kick_off_exception_report';
1431: p_error_code := g_SUCCESS;
1432: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1433: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
1434: END IF;
1435: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1436: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_data_file_name = '||p_data_file_name);
1429: BEGIN
1430: l_module_name := g_module_name || 'kick_off_exception_report';
1431: p_error_code := g_SUCCESS;
1432: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1433: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
1434: END IF;
1435: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1436: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_data_file_name = '||p_data_file_name);
1437: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_agency_location_code = '||p_agency_location_code);
1431: p_error_code := g_SUCCESS;
1432: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1433: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
1434: END IF;
1435: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1436: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_data_file_name = '||p_data_file_name);
1437: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_agency_location_code = '||p_agency_location_code);
1438: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_group_id = '||p_group_id);
1439: END IF;
1432: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1433: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
1434: END IF;
1435: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1436: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_data_file_name = '||p_data_file_name);
1437: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_agency_location_code = '||p_agency_location_code);
1438: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_group_id = '||p_group_id);
1439: END IF;
1440:
1433: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
1434: END IF;
1435: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1436: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_data_file_name = '||p_data_file_name);
1437: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_agency_location_code = '||p_agency_location_code);
1438: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_group_id = '||p_group_id);
1439: END IF;
1440:
1441: -- The request below submits the IPAC Disbursement Exception Report. The report should
1434: END IF;
1435: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1436: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_data_file_name = '||p_data_file_name);
1437: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_agency_location_code = '||p_agency_location_code);
1438: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_group_id = '||p_group_id);
1439: END IF;
1440:
1441: -- The request below submits the IPAC Disbursement Exception Report. The report should
1442: -- be submitted even if there are no valid records for the Payables Open Interface
1440:
1441: -- The request below submits the IPAC Disbursement Exception Report. The report should
1442: -- be submitted even if there are no valid records for the Payables Open Interface
1443: -- Import process
1444: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1445: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling submit_request');
1446: END IF;
1447:
1448: fnd_request.set_org_id(g_org_id);
1441: -- The request below submits the IPAC Disbursement Exception Report. The report should
1442: -- be submitted even if there are no valid records for the Payables Open Interface
1443: -- Import process
1444: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1445: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling submit_request');
1446: END IF;
1447:
1448: fnd_request.set_org_id(g_org_id);
1449: l_request_id := fnd_request.submit_request
1459: argument4 => g_org_id,
1460: argument5 => g_set_of_books_id
1461: );
1462:
1463: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1464: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'submit_request retured');
1465: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_request_id = '||l_request_id);
1466: END IF;
1467:
1460: argument5 => g_set_of_books_id
1461: );
1462:
1463: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1464: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'submit_request retured');
1465: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_request_id = '||l_request_id);
1466: END IF;
1467:
1468: IF (l_request_id = 0) THEN
1461: );
1462:
1463: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1464: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'submit_request retured');
1465: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_request_id = '||l_request_id);
1466: END IF;
1467:
1468: IF (l_request_id = 0) THEN
1469: p_error_code := g_FAILURE;
1467:
1468: IF (l_request_id = 0) THEN
1469: p_error_code := g_FAILURE;
1470: p_error_desc := 'Failed to submit request for IPAC Disbursement Exception Report';
1471: fv_utility.log_mesg(fnd_log.level_error, l_module_name,p_error_desc) ;
1472: ELSE
1473: COMMIT;
1474: END IF;
1475:
1474: END IF;
1475:
1476:
1477: IF (p_error_code = g_SUCCESS) THEN
1478: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1479: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling wait_for_request');
1480: END IF;
1481: l_request_wait_status := fnd_concurrent.wait_for_request
1482: (
1475:
1476:
1477: IF (p_error_code = g_SUCCESS) THEN
1478: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1479: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling wait_for_request');
1480: END IF;
1481: l_request_wait_status := fnd_concurrent.wait_for_request
1482: (
1483: request_id => l_request_id,
1488: dev_phase => l_dev_phase,
1489: dev_status => l_dev_status,
1490: message => l_message
1491: );
1492: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1493: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'wait_for_request retured');
1494: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_phase = '||l_phase);
1495: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_status = '||l_status);
1496: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_dev_phase = '||l_dev_phase);
1489: dev_status => l_dev_status,
1490: message => l_message
1491: );
1492: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1493: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'wait_for_request retured');
1494: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_phase = '||l_phase);
1495: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_status = '||l_status);
1496: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_dev_phase = '||l_dev_phase);
1497: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_dev_status = '||l_dev_status);
1490: message => l_message
1491: );
1492: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1493: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'wait_for_request retured');
1494: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_phase = '||l_phase);
1495: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_status = '||l_status);
1496: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_dev_phase = '||l_dev_phase);
1497: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_dev_status = '||l_dev_status);
1498: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_message = '||l_message);
1491: );
1492: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1493: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'wait_for_request retured');
1494: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_phase = '||l_phase);
1495: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_status = '||l_status);
1496: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_dev_phase = '||l_dev_phase);
1497: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_dev_status = '||l_dev_status);
1498: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_message = '||l_message);
1499: END IF;
1492: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1493: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'wait_for_request retured');
1494: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_phase = '||l_phase);
1495: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_status = '||l_status);
1496: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_dev_phase = '||l_dev_phase);
1497: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_dev_status = '||l_dev_status);
1498: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_message = '||l_message);
1499: END IF;
1500:
1493: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'wait_for_request retured');
1494: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_phase = '||l_phase);
1495: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_status = '||l_status);
1496: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_dev_phase = '||l_dev_phase);
1497: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_dev_status = '||l_dev_status);
1498: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_message = '||l_message);
1499: END IF;
1500:
1501: COMMIT;
1494: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_phase = '||l_phase);
1495: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_status = '||l_status);
1496: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_dev_phase = '||l_dev_phase);
1497: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_dev_status = '||l_dev_status);
1498: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_message = '||l_message);
1499: END IF;
1500:
1501: COMMIT;
1502:
1502:
1503: IF l_request_wait_status = FALSE THEN
1504: p_error_code := g_FAILURE;
1505: p_error_desc := 'Failed to wait for the exception report';
1506: fv_utility.log_mesg(fnd_log.level_error, l_module_name,p_error_desc) ;
1507: END IF;
1508: END IF;
1509: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1510: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
1505: p_error_desc := 'Failed to wait for the exception report';
1506: fv_utility.log_mesg(fnd_log.level_error, l_module_name,p_error_desc) ;
1507: END IF;
1508: END IF;
1509: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1510: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
1511: END IF;
1512:
1513: EXCEPTION
1506: fv_utility.log_mesg(fnd_log.level_error, l_module_name,p_error_desc) ;
1507: END IF;
1508: END IF;
1509: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1510: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
1511: END IF;
1512:
1513: EXCEPTION
1514: WHEN OTHERS THEN
1514: WHEN OTHERS THEN
1515: p_error_code := g_FAILURE;
1516: p_error_desc := SQLERRM;
1517: l_location := l_module_name||'.final_exception';
1518: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1519: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
1520: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1521: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
1522: END IF;
1515: p_error_code := g_FAILURE;
1516: p_error_desc := SQLERRM;
1517: l_location := l_module_name||'.final_exception';
1518: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1519: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
1520: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1521: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
1522: END IF;
1523: END;
1516: p_error_desc := SQLERRM;
1517: l_location := l_module_name||'.final_exception';
1518: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1519: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
1520: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1521: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
1522: END IF;
1523: END;
1524:
1517: l_location := l_module_name||'.final_exception';
1518: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1519: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
1520: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1521: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
1522: END IF;
1523: END;
1524:
1525: --****************************************************************************************--
1535: --* : p_retcode OUT Return Code to concurrent process *--
1536: --* Global Vars : g_module_name READ *--
1537: --* : g_SUCCESS READ *--
1538: --* : g_ERROR READ *--
1539: --* : fnd_log.level_statement READ *--
1540: --* : fnd_log.g_current_runtime_level READ *--
1541: --* : fnd_log.level_unexpected READ *--
1542: --* : fnd_log.level_procedure READ *--
1543: --* : g_enter READ *--
1536: --* Global Vars : g_module_name READ *--
1537: --* : g_SUCCESS READ *--
1538: --* : g_ERROR READ *--
1539: --* : fnd_log.level_statement READ *--
1540: --* : fnd_log.g_current_runtime_level READ *--
1541: --* : fnd_log.level_unexpected READ *--
1542: --* : fnd_log.level_procedure READ *--
1543: --* : g_enter READ *--
1544: --* : g_exit READ *--
1537: --* : g_SUCCESS READ *--
1538: --* : g_ERROR READ *--
1539: --* : fnd_log.level_statement READ *--
1540: --* : fnd_log.g_current_runtime_level READ *--
1541: --* : fnd_log.level_unexpected READ *--
1542: --* : fnd_log.level_procedure READ *--
1543: --* : g_enter READ *--
1544: --* : g_exit READ *--
1545: --* Called from : process_data *--
1538: --* : g_ERROR READ *--
1539: --* : fnd_log.level_statement READ *--
1540: --* : fnd_log.g_current_runtime_level READ *--
1541: --* : fnd_log.level_unexpected READ *--
1542: --* : fnd_log.level_procedure READ *--
1543: --* : g_enter READ *--
1544: --* : g_exit READ *--
1545: --* Called from : process_data *--
1546: --* Calls : fv_utility.debug_mesg *--
1572: l_rowcount NUMBER;
1573: BEGIN
1574: l_module_name := g_module_name || 'pre_process_data';
1575: p_error_code := g_SUCCESS;
1576: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1577: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
1578: END IF;
1579:
1580: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1573: BEGIN
1574: l_module_name := g_module_name || 'pre_process_data';
1575: p_error_code := g_SUCCESS;
1576: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1577: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
1578: END IF;
1579:
1580: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1581: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_agency_location_code = '||p_agency_location_code);
1576: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1577: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
1578: END IF;
1579:
1580: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1581: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_agency_location_code = '||p_agency_location_code);
1582: END IF;
1583:
1584: IF (p_error_code = g_SUCCESS) THEN
1577: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
1578: END IF;
1579:
1580: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1581: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_agency_location_code = '||p_agency_location_code);
1582: END IF;
1583:
1584: IF (p_error_code = g_SUCCESS) THEN
1585: -- determine batch name for ipac payment interface submission.
1583:
1584: IF (p_error_code = g_SUCCESS) THEN
1585: -- determine batch name for ipac payment interface submission.
1586: BEGIN
1587: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1588: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Selecting ap_interface_groups_s');
1589: END IF;
1590: SELECT 'IPAC'||TO_CHAR(fv_ipac_batch_s.NEXTVAL),
1591: ap_interface_groups_s.NEXTVAL
1584: IF (p_error_code = g_SUCCESS) THEN
1585: -- determine batch name for ipac payment interface submission.
1586: BEGIN
1587: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1588: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Selecting ap_interface_groups_s');
1589: END IF;
1590: SELECT 'IPAC'||TO_CHAR(fv_ipac_batch_s.NEXTVAL),
1591: ap_interface_groups_s.NEXTVAL
1592: INTO p_batch_name,
1592: INTO p_batch_name,
1593: p_group_id
1594: FROM dual;
1595:
1596: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1597: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_batch_name = '||p_batch_name);
1598: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_group_id = '||p_group_id);
1599: END IF;
1600: EXCEPTION
1593: p_group_id
1594: FROM dual;
1595:
1596: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1597: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_batch_name = '||p_batch_name);
1598: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_group_id = '||p_group_id);
1599: END IF;
1600: EXCEPTION
1601: WHEN OTHERS THEN
1594: FROM dual;
1595:
1596: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1597: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_batch_name = '||p_batch_name);
1598: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_group_id = '||p_group_id);
1599: END IF;
1600: EXCEPTION
1601: WHEN OTHERS THEN
1602: p_error_code := g_FAILURE;
1601: WHEN OTHERS THEN
1602: p_error_code := g_FAILURE;
1603: p_error_desc := SQLERRM;
1604: l_location := l_module_name||'.select_fv_ipac_batch_s_nextval';
1605: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1606: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
1607: END;
1608: END IF;
1609:
1602: p_error_code := g_FAILURE;
1603: p_error_desc := SQLERRM;
1604: l_location := l_module_name||'.select_fv_ipac_batch_s_nextval';
1605: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1606: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
1607: END;
1608: END IF;
1609:
1610: IF (p_error_code = g_SUCCESS) THEN
1608: END IF;
1609:
1610: IF (p_error_code = g_SUCCESS) THEN
1611: BEGIN
1612: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1613: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Updating fv_ipac_import');
1614: END IF;
1615: UPDATE fv_ipac_import
1616: SET request_id = g_request_id,
1609:
1610: IF (p_error_code = g_SUCCESS) THEN
1611: BEGIN
1612: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1613: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Updating fv_ipac_import');
1614: END IF;
1615: UPDATE fv_ipac_import
1616: SET request_id = g_request_id,
1617: record_status = g_status_preprocessed,
1625: data_file = p_data_file_name
1626: WHERE request_id = -1
1627: AND record_status = g_status_imported;
1628: l_rowcount := SQL%ROWCOUNT;
1629: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1630: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Updated '||l_rowcount||' rows.');
1631: END IF;
1632: EXCEPTION
1633: WHEN OTHERS THEN
1626: WHERE request_id = -1
1627: AND record_status = g_status_imported;
1628: l_rowcount := SQL%ROWCOUNT;
1629: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1630: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Updated '||l_rowcount||' rows.');
1631: END IF;
1632: EXCEPTION
1633: WHEN OTHERS THEN
1634: p_error_code := g_FAILURE;
1633: WHEN OTHERS THEN
1634: p_error_code := g_FAILURE;
1635: p_error_desc := SQLERRM;
1636: l_location := l_module_name||'.update_fv_ipac_import';
1637: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1638: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
1639: END;
1640: END IF;
1641:
1634: p_error_code := g_FAILURE;
1635: p_error_desc := SQLERRM;
1636: l_location := l_module_name||'.update_fv_ipac_import';
1637: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1638: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
1639: END;
1640: END IF;
1641:
1642: /*
1642: /*
1643: IF (p_error_code = g_SUCCESS) THEN
1644: BEGIN
1645: -- Delete all 'A' and 'P' records and keep only valid disbursement records
1646: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1647: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Deleting fv_ipac_import');
1648: END IF;
1649: DELETE fv_ipac_import
1650: WHERE group_id = p_group_id
1643: IF (p_error_code = g_SUCCESS) THEN
1644: BEGIN
1645: -- Delete all 'A' and 'P' records and keep only valid disbursement records
1646: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1647: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Deleting fv_ipac_import');
1648: END IF;
1649: DELETE fv_ipac_import
1650: WHERE group_id = p_group_id
1651: AND record_status = g_status_preprocessed
1651: AND record_status = g_status_preprocessed
1652: AND (transaction_type IN ('A', 'P')
1653: OR customer_alc <> p_Agency_Location_Code);
1654: l_rowcount := SQL%ROWCOUNT;
1655: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1656: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Deleted '||l_rowcount||' rows.');
1657: END IF;
1658: EXCEPTION
1659: WHEN OTHERS THEN
1652: AND (transaction_type IN ('A', 'P')
1653: OR customer_alc <> p_Agency_Location_Code);
1654: l_rowcount := SQL%ROWCOUNT;
1655: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1656: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Deleted '||l_rowcount||' rows.');
1657: END IF;
1658: EXCEPTION
1659: WHEN OTHERS THEN
1660: p_error_code := g_FAILURE;
1658: EXCEPTION
1659: WHEN OTHERS THEN
1660: p_error_code := g_FAILURE;
1661: p_error_desc := SQLERRM;
1662: fv_utility.log_mesg(fnd_log.level_unexpected, l_module_name||'.update_fv_ipac_import',p_error_desc) ;
1663: END;
1664: END IF;
1665: */
1666:
1665: */
1666:
1667: IF (p_error_code = g_SUCCESS) THEN
1668: -- Reject all 'A' and 'P' records and keep only valid disbursement records
1669: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1670: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Rejecting fv_ipac_import for A and P records');
1671: END IF;
1672: FOR del_rec IN (SELECT ipac_import_id
1673: FROM fv_ipac_import
1666:
1667: IF (p_error_code = g_SUCCESS) THEN
1668: -- Reject all 'A' and 'P' records and keep only valid disbursement records
1669: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1670: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Rejecting fv_ipac_import for A and P records');
1671: END IF;
1672: FOR del_rec IN (SELECT ipac_import_id
1673: FROM fv_ipac_import
1674: WHERE group_id = p_group_id
1673: FROM fv_ipac_import
1674: WHERE group_id = p_group_id
1675: AND record_status = g_status_preprocessed
1676: AND transaction_type IN ('A', 'P')) LOOP
1677: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1678: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling insert_error');
1679: END IF;
1680: insert_error
1681: (
1674: WHERE group_id = p_group_id
1675: AND record_status = g_status_preprocessed
1676: AND transaction_type IN ('A', 'P')) LOOP
1677: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1678: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling insert_error');
1679: END IF;
1680: insert_error
1681: (
1682: p_ipac_import_id => del_rec.ipac_import_id,
1694: WHEN OTHERS THEN
1695: p_error_code := g_FAILURE;
1696: p_error_desc := SQLERRM;
1697: l_location := l_module_name||'.update_fv_ipac_import1';
1698: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1699: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
1700: END;
1701: END LOOP;
1702: END IF;
1695: p_error_code := g_FAILURE;
1696: p_error_desc := SQLERRM;
1697: l_location := l_module_name||'.update_fv_ipac_import1';
1698: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1699: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
1700: END;
1701: END LOOP;
1702: END IF;
1703:
1702: END IF;
1703:
1704: IF (p_error_code = g_SUCCESS) THEN
1705: -- Reject all non selected ALC records
1706: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1707: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Rejecting not selected ALC records');
1708: END IF;
1709: FOR del_rec IN (SELECT ipac_import_id
1710: FROM fv_ipac_import
1703:
1704: IF (p_error_code = g_SUCCESS) THEN
1705: -- Reject all non selected ALC records
1706: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1707: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Rejecting not selected ALC records');
1708: END IF;
1709: FOR del_rec IN (SELECT ipac_import_id
1710: FROM fv_ipac_import
1711: WHERE group_id = p_group_id
1710: FROM fv_ipac_import
1711: WHERE group_id = p_group_id
1712: AND record_status = g_status_preprocessed
1713: AND customer_alc <> p_Agency_Location_Code) LOOP
1714: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1715: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling insert_error');
1716: END IF;
1717: insert_error
1718: (
1711: WHERE group_id = p_group_id
1712: AND record_status = g_status_preprocessed
1713: AND customer_alc <> p_Agency_Location_Code) LOOP
1714: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1715: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling insert_error');
1716: END IF;
1717: insert_error
1718: (
1719: p_ipac_import_id => del_rec.ipac_import_id,
1731: WHEN OTHERS THEN
1732: p_error_code := g_FAILURE;
1733: p_error_desc := SQLERRM;
1734: l_location := l_module_name||'.update_fv_ipac_import1';
1735: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1736: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
1737: END;
1738: END LOOP;
1739: END IF;
1732: p_error_code := g_FAILURE;
1733: p_error_desc := SQLERRM;
1734: l_location := l_module_name||'.update_fv_ipac_import1';
1735: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1736: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
1737: END;
1738: END LOOP;
1739: END IF;
1740:
1737: END;
1738: END LOOP;
1739: END IF;
1740:
1741: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1742: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
1743: END IF;
1744:
1745: EXCEPTION
1738: END LOOP;
1739: END IF;
1740:
1741: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1742: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
1743: END IF;
1744:
1745: EXCEPTION
1746: WHEN OTHERS THEN
1746: WHEN OTHERS THEN
1747: p_error_code := g_FAILURE;
1748: p_error_desc := SQLERRM;
1749: l_location := l_module_name||'.final_exception';
1750: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1751: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
1752: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1753: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
1754: END IF;
1747: p_error_code := g_FAILURE;
1748: p_error_desc := SQLERRM;
1749: l_location := l_module_name||'.final_exception';
1750: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1751: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
1752: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1753: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
1754: END IF;
1755: END;
1748: p_error_desc := SQLERRM;
1749: l_location := l_module_name||'.final_exception';
1750: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1751: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
1752: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1753: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
1754: END IF;
1755: END;
1756:
1749: l_location := l_module_name||'.final_exception';
1750: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1751: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
1752: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1753: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
1754: END IF;
1755: END;
1756:
1757: --****************************************************************************************--
1771: --* Global Vars : g_module_name READ *--
1772: --* : g_SUCCESS READ *--
1773: --* : g_WARNING READ *--
1774: --* : g_ERROR READ *--
1775: --* : fnd_log.level_statement READ *--
1776: --* : fnd_log.g_current_runtime_level READ *--
1777: --* : fnd_log.level_unexpected READ *--
1778: --* : fnd_log.level_procedure READ *--
1779: --* : g_enter READ *--
1772: --* : g_SUCCESS READ *--
1773: --* : g_WARNING READ *--
1774: --* : g_ERROR READ *--
1775: --* : fnd_log.level_statement READ *--
1776: --* : fnd_log.g_current_runtime_level READ *--
1777: --* : fnd_log.level_unexpected READ *--
1778: --* : fnd_log.level_procedure READ *--
1779: --* : g_enter READ *--
1780: --* : g_exit READ *--
1773: --* : g_WARNING READ *--
1774: --* : g_ERROR READ *--
1775: --* : fnd_log.level_statement READ *--
1776: --* : fnd_log.g_current_runtime_level READ *--
1777: --* : fnd_log.level_unexpected READ *--
1778: --* : fnd_log.level_procedure READ *--
1779: --* : g_enter READ *--
1780: --* : g_exit READ *--
1781: --* : g_login_id READ *--
1774: --* : g_ERROR READ *--
1775: --* : fnd_log.level_statement READ *--
1776: --* : fnd_log.g_current_runtime_level READ *--
1777: --* : fnd_log.level_unexpected READ *--
1778: --* : fnd_log.level_procedure READ *--
1779: --* : g_enter READ *--
1780: --* : g_exit READ *--
1781: --* : g_login_id READ *--
1782: --* : g_user_id READ *--
1873: p_validation_code := NULL;
1874: p_error_desc := NULL;
1875: p_invoice_found := 'N';
1876: p_invoice_id := NULL;
1877: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1878: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
1879: END IF;
1880: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1881: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_po_num = '||p_po_num);
1874: p_error_desc := NULL;
1875: p_invoice_found := 'N';
1876: p_invoice_id := NULL;
1877: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1878: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
1879: END IF;
1880: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1881: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_po_num = '||p_po_num);
1882: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_po_line_num = '||p_po_line_num);
1876: p_invoice_id := NULL;
1877: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1878: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
1879: END IF;
1880: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1881: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_po_num = '||p_po_num);
1882: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_po_line_num = '||p_po_line_num);
1883: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_amount = '||p_amount);
1884: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_batch_name = '||p_batch_name);
1877: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1878: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
1879: END IF;
1880: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1881: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_po_num = '||p_po_num);
1882: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_po_line_num = '||p_po_line_num);
1883: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_amount = '||p_amount);
1884: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_batch_name = '||p_batch_name);
1885: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_accomplished_date = '||TO_CHAR(p_accomplished_date, 'MM/DD/YYYY'));
1878: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
1879: END IF;
1880: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1881: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_po_num = '||p_po_num);
1882: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_po_line_num = '||p_po_line_num);
1883: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_amount = '||p_amount);
1884: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_batch_name = '||p_batch_name);
1885: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_accomplished_date = '||TO_CHAR(p_accomplished_date, 'MM/DD/YYYY'));
1886: END IF;
1879: END IF;
1880: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1881: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_po_num = '||p_po_num);
1882: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_po_line_num = '||p_po_line_num);
1883: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_amount = '||p_amount);
1884: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_batch_name = '||p_batch_name);
1885: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_accomplished_date = '||TO_CHAR(p_accomplished_date, 'MM/DD/YYYY'));
1886: END IF;
1887:
1880: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1881: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_po_num = '||p_po_num);
1882: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_po_line_num = '||p_po_line_num);
1883: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_amount = '||p_amount);
1884: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_batch_name = '||p_batch_name);
1885: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_accomplished_date = '||TO_CHAR(p_accomplished_date, 'MM/DD/YYYY'));
1886: END IF;
1887:
1888: -- find an invoice for this recurring payment template.
1881: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_po_num = '||p_po_num);
1882: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_po_line_num = '||p_po_line_num);
1883: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_amount = '||p_amount);
1884: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_batch_name = '||p_batch_name);
1885: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_accomplished_date = '||TO_CHAR(p_accomplished_date, 'MM/DD/YYYY'));
1886: END IF;
1887:
1888: -- find an invoice for this recurring payment template.
1889: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1885: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_accomplished_date = '||TO_CHAR(p_accomplished_date, 'MM/DD/YYYY'));
1886: END IF;
1887:
1888: -- find an invoice for this recurring payment template.
1889: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1890: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Opening cursor invoice_cur');
1891: END IF;
1892: OPEN invoice_cur (p_po_num, p_po_line_num, p_amount);
1893: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1886: END IF;
1887:
1888: -- find an invoice for this recurring payment template.
1889: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1890: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Opening cursor invoice_cur');
1891: END IF;
1892: OPEN invoice_cur (p_po_num, p_po_line_num, p_amount);
1893: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1894: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Fetching cursor invoice_cur');
1889: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1890: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Opening cursor invoice_cur');
1891: END IF;
1892: OPEN invoice_cur (p_po_num, p_po_line_num, p_amount);
1893: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1894: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Fetching cursor invoice_cur');
1895: END IF;
1896: FETCH invoice_cur INTO l_invoice_id, l_approval_code;
1897:
1890: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Opening cursor invoice_cur');
1891: END IF;
1892: OPEN invoice_cur (p_po_num, p_po_line_num, p_amount);
1893: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1894: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Fetching cursor invoice_cur');
1895: END IF;
1896: FETCH invoice_cur INTO l_invoice_id, l_approval_code;
1897:
1898: IF invoice_cur%NOTFOUND THEN
1897:
1898: IF invoice_cur%NOTFOUND THEN
1899: NULL;
1900: -- -- this is an exception since no invoice was found
1901: -- fv_utility.log_mesg(fnd_log.level_exception, l_module_name,'No Invoice Found so exception.') ;
1902: -- p_validation_err := 'Cannot find a valid recurring invoice for this Purchase Order';
1903: -- p_validation_code := 'PO_NUM_FOUND_IN_RECURRING_INV';
1904: ELSE
1905: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1901: -- fv_utility.log_mesg(fnd_log.level_exception, l_module_name,'No Invoice Found so exception.') ;
1902: -- p_validation_err := 'Cannot find a valid recurring invoice for this Purchase Order';
1903: -- p_validation_code := 'PO_NUM_FOUND_IN_RECURRING_INV';
1904: ELSE
1905: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1906: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_invoice_id = '||l_invoice_id);
1907: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_approval_code = '||l_approval_code);
1908: END IF;
1909:
1902: -- p_validation_err := 'Cannot find a valid recurring invoice for this Purchase Order';
1903: -- p_validation_code := 'PO_NUM_FOUND_IN_RECURRING_INV';
1904: ELSE
1905: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1906: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_invoice_id = '||l_invoice_id);
1907: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_approval_code = '||l_approval_code);
1908: END IF;
1909:
1910: -- found an invoice. find approval status of invoice
1903: -- p_validation_code := 'PO_NUM_FOUND_IN_RECURRING_INV';
1904: ELSE
1905: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1906: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_invoice_id = '||l_invoice_id);
1907: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_approval_code = '||l_approval_code);
1908: END IF;
1909:
1910: -- found an invoice. find approval status of invoice
1911: IF l_approval_code = 'APPROVED' THEN
1915: ELSE
1916: l_code := NULL;
1917: -- this is an exception category since we can't find an invoice to use
1918:
1919: fv_utility.log_mesg(fnd_log.level_exception, l_module_name,'Cannot find an correct invoice');
1920: p_validation_err := 'Cannot find a valid recurring invoice for this Purchase Order';
1921: p_validation_code := 'PO_NUM_FOUND_IN_RECURRING_INV';
1922: END IF;
1923:
1920: p_validation_err := 'Cannot find a valid recurring invoice for this Purchase Order';
1921: p_validation_code := 'PO_NUM_FOUND_IN_RECURRING_INV';
1922: END IF;
1923:
1924: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1925: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_code = '||l_code);
1926: END IF;
1927:
1928: IF (l_code in ('V','P')) THEN
1921: p_validation_code := 'PO_NUM_FOUND_IN_RECURRING_INV';
1922: END IF;
1923:
1924: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1925: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_code = '||l_code);
1926: END IF;
1927:
1928: IF (l_code in ('V','P')) THEN
1929: -- insert this record if the invoice isn't already there
1928: IF (l_code in ('V','P')) THEN
1929: -- insert this record if the invoice isn't already there
1930: -- the automatic payment program will refer to this table to create
1931: -- a payment for this invoice.
1932: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1933: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Inserting into fv_ipac_recurring_inv');
1934: END IF;
1935: INSERT INTO fv_ipac_recurring_inv
1936: (
1929: -- insert this record if the invoice isn't already there
1930: -- the automatic payment program will refer to this table to create
1931: -- a payment for this invoice.
1932: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
1933: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Inserting into fv_ipac_recurring_inv');
1934: END IF;
1935: INSERT INTO fv_ipac_recurring_inv
1936: (
1937: batch_name,
1964: END IF;
1965: END IF;
1966:
1967: CLOSE invoice_cur;
1968: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1969: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
1970: END IF;
1971:
1972: EXCEPTION
1965: END IF;
1966:
1967: CLOSE invoice_cur;
1968: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1969: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
1970: END IF;
1971:
1972: EXCEPTION
1973: WHEN OTHERS THEN
1973: WHEN OTHERS THEN
1974: p_error_code := g_FAILURE;
1975: p_error_desc := SQLERRM;
1976: l_location := l_module_name||'.final_exception';
1977: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1978: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
1979: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1980: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
1981: END IF;
1974: p_error_code := g_FAILURE;
1975: p_error_desc := SQLERRM;
1976: l_location := l_module_name||'.final_exception';
1977: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1978: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
1979: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1980: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
1981: END IF;
1982: END process_recurr_invoice;
1975: p_error_desc := SQLERRM;
1976: l_location := l_module_name||'.final_exception';
1977: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1978: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
1979: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1980: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
1981: END IF;
1982: END process_recurr_invoice;
1983:
1976: l_location := l_module_name||'.final_exception';
1977: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1978: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
1979: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
1980: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
1981: END IF;
1982: END process_recurr_invoice;
1983:
1984: --****************************************************************************************--
1994: --* : p_retcode Return Code to concurrent process *--
1995: --* Global Vars : g_module_name READ *--
1996: --* : g_SUCCESS READ *--
1997: --* : g_ERROR READ *--
1998: --* : fnd_log.level_statement READ *--
1999: --* : fnd_log.g_current_runtime_level READ *--
2000: --* : fnd_log.level_unexpected READ *--
2001: --* : fnd_log.level_procedure READ *--
2002: --* : g_enter READ *--
1995: --* Global Vars : g_module_name READ *--
1996: --* : g_SUCCESS READ *--
1997: --* : g_ERROR READ *--
1998: --* : fnd_log.level_statement READ *--
1999: --* : fnd_log.g_current_runtime_level READ *--
2000: --* : fnd_log.level_unexpected READ *--
2001: --* : fnd_log.level_procedure READ *--
2002: --* : g_enter READ *--
2003: --* : g_exit READ *--
1996: --* : g_SUCCESS READ *--
1997: --* : g_ERROR READ *--
1998: --* : fnd_log.level_statement READ *--
1999: --* : fnd_log.g_current_runtime_level READ *--
2000: --* : fnd_log.level_unexpected READ *--
2001: --* : fnd_log.level_procedure READ *--
2002: --* : g_enter READ *--
2003: --* : g_exit READ *--
2004: --* Called from : process_data *--
1997: --* : g_ERROR READ *--
1998: --* : fnd_log.level_statement READ *--
1999: --* : fnd_log.g_current_runtime_level READ *--
2000: --* : fnd_log.level_unexpected READ *--
2001: --* : fnd_log.level_procedure READ *--
2002: --* : g_enter READ *--
2003: --* : g_exit READ *--
2004: --* Called from : process_data *--
2005: --* Calls : insert_error *--
2032: BEGIN
2033: l_module_name := g_module_name || 'resolve_uom';
2034: p_error_code := g_SUCCESS;
2035: l_unit_of_measure := NULL;
2036: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2037: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
2038: END IF;
2039: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2040: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_uom_code = '||p_uom_code);
2033: l_module_name := g_module_name || 'resolve_uom';
2034: p_error_code := g_SUCCESS;
2035: l_unit_of_measure := NULL;
2036: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2037: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
2038: END IF;
2039: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2040: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_uom_code = '||p_uom_code);
2041: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_unit_of_measure = '||p_unit_of_measure);
2035: l_unit_of_measure := NULL;
2036: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2037: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
2038: END IF;
2039: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2040: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_uom_code = '||p_uom_code);
2041: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_unit_of_measure = '||p_unit_of_measure);
2042: END IF;
2043:
2036: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2037: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
2038: END IF;
2039: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2040: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_uom_code = '||p_uom_code);
2041: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_unit_of_measure = '||p_unit_of_measure);
2042: END IF;
2043:
2044: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2037: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
2038: END IF;
2039: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2040: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_uom_code = '||p_uom_code);
2041: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_unit_of_measure = '||p_unit_of_measure);
2042: END IF;
2043:
2044: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2045: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Selecting from mtl_units_of_measure_vl1');
2040: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_uom_code = '||p_uom_code);
2041: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_unit_of_measure = '||p_unit_of_measure);
2042: END IF;
2043:
2044: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2045: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Selecting from mtl_units_of_measure_vl1');
2046: END IF;
2047:
2048: BEGIN
2041: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_unit_of_measure = '||p_unit_of_measure);
2042: END IF;
2043:
2044: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2045: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Selecting from mtl_units_of_measure_vl1');
2046: END IF;
2047:
2048: BEGIN
2049: SELECT unit_of_measure
2049: SELECT unit_of_measure
2050: INTO l_unit_of_measure
2051: FROM mtl_units_of_measure_vl
2052: WHERE uom_code = p_uom_code;
2053: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2054: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_unit_of_measure='||l_unit_of_measure);
2055: END IF;
2056: EXCEPTION
2057: WHEN NO_DATA_FOUND THEN
2050: INTO l_unit_of_measure
2051: FROM mtl_units_of_measure_vl
2052: WHERE uom_code = p_uom_code;
2053: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2054: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_unit_of_measure='||l_unit_of_measure);
2055: END IF;
2056: EXCEPTION
2057: WHEN NO_DATA_FOUND THEN
2058: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2054: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_unit_of_measure='||l_unit_of_measure);
2055: END IF;
2056: EXCEPTION
2057: WHEN NO_DATA_FOUND THEN
2058: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2059: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'no data found');
2060: END IF;
2061: l_unit_of_measure := NULL;
2062: WHEN OTHERS THEN
2055: END IF;
2056: EXCEPTION
2057: WHEN NO_DATA_FOUND THEN
2058: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2059: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'no data found');
2060: END IF;
2061: l_unit_of_measure := NULL;
2062: WHEN OTHERS THEN
2063: p_error_code := g_FAILURE;
2062: WHEN OTHERS THEN
2063: p_error_code := g_FAILURE;
2064: p_error_desc := SQLERRM;
2065: l_location := l_module_name||'.select_mtl_units_of_measure_vl1';
2066: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2067: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
2068: END;
2069:
2070: IF (p_error_code = g_SUCCESS) THEN
2063: p_error_code := g_FAILURE;
2064: p_error_desc := SQLERRM;
2065: l_location := l_module_name||'.select_mtl_units_of_measure_vl1';
2066: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2067: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
2068: END;
2069:
2070: IF (p_error_code = g_SUCCESS) THEN
2071: IF (l_unit_of_measure IS NOT NULL) THEN
2070: IF (p_error_code = g_SUCCESS) THEN
2071: IF (l_unit_of_measure IS NOT NULL) THEN
2072: p_unit_of_measure := l_unit_of_measure;
2073: ELSE
2074: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2075: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Selecting from mtl_units_of_measure_vl1');
2076: END IF;
2077: BEGIN
2078: SELECT unit_of_measure
2071: IF (l_unit_of_measure IS NOT NULL) THEN
2072: p_unit_of_measure := l_unit_of_measure;
2073: ELSE
2074: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2075: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Selecting from mtl_units_of_measure_vl1');
2076: END IF;
2077: BEGIN
2078: SELECT unit_of_measure
2079: INTO l_unit_of_measure
2080: FROM mtl_units_of_measure_vl
2081: WHERE unit_of_measure = p_unit_of_measure;
2082: EXCEPTION
2083: WHEN NO_DATA_FOUND THEN
2084: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2085: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'no data found');
2086: END IF;
2087: l_unit_of_measure := NULL;
2088: WHEN OTHERS THEN
2081: WHERE unit_of_measure = p_unit_of_measure;
2082: EXCEPTION
2083: WHEN NO_DATA_FOUND THEN
2084: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2085: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'no data found');
2086: END IF;
2087: l_unit_of_measure := NULL;
2088: WHEN OTHERS THEN
2089: p_error_code := g_FAILURE;
2088: WHEN OTHERS THEN
2089: p_error_code := g_FAILURE;
2090: p_error_desc := SQLERRM;
2091: l_location := l_module_name||'.select_mtl_units_of_measure_vl2';
2092: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2093: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
2094: END;
2095: END IF;
2096: END IF;
2089: p_error_code := g_FAILURE;
2090: p_error_desc := SQLERRM;
2091: l_location := l_module_name||'.select_mtl_units_of_measure_vl2';
2092: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2093: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
2094: END;
2095: END IF;
2096: END IF;
2097: IF (p_error_code = g_SUCCESS) THEN
2095: END IF;
2096: END IF;
2097: IF (p_error_code = g_SUCCESS) THEN
2098: IF (l_unit_of_measure IS NULL) THEN
2099: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2100: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling insert_error');
2101: END IF;
2102: insert_error
2103: (
2096: END IF;
2097: IF (p_error_code = g_SUCCESS) THEN
2098: IF (l_unit_of_measure IS NULL) THEN
2099: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2100: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling insert_error');
2101: END IF;
2102: insert_error
2103: (
2104: p_ipac_import_id => p_ipac_import_id,
2112: END IF;
2113: END IF;
2114: END IF;
2115:
2116: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2117: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_unit_of_measure='||p_unit_of_measure);
2118: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_record_status='||p_record_status);
2119: END IF;
2120: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2113: END IF;
2114: END IF;
2115:
2116: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2117: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_unit_of_measure='||p_unit_of_measure);
2118: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_record_status='||p_record_status);
2119: END IF;
2120: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2121: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
2114: END IF;
2115:
2116: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2117: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_unit_of_measure='||p_unit_of_measure);
2118: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_record_status='||p_record_status);
2119: END IF;
2120: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2121: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
2122: END IF;
2116: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2117: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_unit_of_measure='||p_unit_of_measure);
2118: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_record_status='||p_record_status);
2119: END IF;
2120: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2121: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
2122: END IF;
2123:
2124: EXCEPTION
2117: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_unit_of_measure='||p_unit_of_measure);
2118: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_record_status='||p_record_status);
2119: END IF;
2120: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2121: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
2122: END IF;
2123:
2124: EXCEPTION
2125: WHEN OTHERS THEN
2125: WHEN OTHERS THEN
2126: p_error_code := g_FAILURE;
2127: p_error_desc := SQLERRM;
2128: l_location := l_module_name||'.final_exception';
2129: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2130: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
2131: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2132: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
2133: END IF;
2126: p_error_code := g_FAILURE;
2127: p_error_desc := SQLERRM;
2128: l_location := l_module_name||'.final_exception';
2129: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2130: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
2131: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2132: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
2133: END IF;
2134: END;
2127: p_error_desc := SQLERRM;
2128: l_location := l_module_name||'.final_exception';
2129: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2130: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
2131: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2132: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
2133: END IF;
2134: END;
2135:
2128: l_location := l_module_name||'.final_exception';
2129: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2130: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
2131: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2132: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
2133: END IF;
2134: END;
2135:
2136:
2143: --* : p_retcode OUT Return Code to concurrent process *--
2144: --* Global Vars : g_module_name READ *--
2145: --* : g_SUCCESS READ *--
2146: --* : g_ERROR READ *--
2147: --* : fnd_log.level_statement READ *--
2148: --* : fnd_log.g_current_runtime_level READ *--
2149: --* : fnd_log.level_unexpected READ *--
2150: --* : fnd_log.level_procedure READ *--
2151: --* : g_enter READ *--
2144: --* Global Vars : g_module_name READ *--
2145: --* : g_SUCCESS READ *--
2146: --* : g_ERROR READ *--
2147: --* : fnd_log.level_statement READ *--
2148: --* : fnd_log.g_current_runtime_level READ *--
2149: --* : fnd_log.level_unexpected READ *--
2150: --* : fnd_log.level_procedure READ *--
2151: --* : g_enter READ *--
2152: --* : g_exit READ *--
2145: --* : g_SUCCESS READ *--
2146: --* : g_ERROR READ *--
2147: --* : fnd_log.level_statement READ *--
2148: --* : fnd_log.g_current_runtime_level READ *--
2149: --* : fnd_log.level_unexpected READ *--
2150: --* : fnd_log.level_procedure READ *--
2151: --* : g_enter READ *--
2152: --* : g_exit READ *--
2153: --* Called from : process_data *--
2146: --* : g_ERROR READ *--
2147: --* : fnd_log.level_statement READ *--
2148: --* : fnd_log.g_current_runtime_level READ *--
2149: --* : fnd_log.level_unexpected READ *--
2150: --* : fnd_log.level_procedure READ *--
2151: --* : g_enter READ *--
2152: --* : g_exit READ *--
2153: --* Called from : process_data *--
2154: --* Calls : insert_error *--
2185: p_error_code := g_SUCCESS;
2186: p_error_desc := NULL;
2187: l_validation_code := NULL;
2188:
2189: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2190: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
2191: END IF;
2192:
2193: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2186: p_error_desc := NULL;
2187: l_validation_code := NULL;
2188:
2189: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2190: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
2191: END IF;
2192:
2193: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2194: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_ipac_import_rec.vendor_id='||p_ipac_import_rec.vendor_id);
2189: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2190: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
2191: END IF;
2192:
2193: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2194: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_ipac_import_rec.vendor_id='||p_ipac_import_rec.vendor_id);
2195: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_ipac_import_rec.receiver_duns='||p_ipac_import_rec.receiver_duns);
2196: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_ipac_import_rec.receiver_duns_4='||p_ipac_import_rec.receiver_duns_4);
2197: END IF;
2190: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
2191: END IF;
2192:
2193: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2194: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_ipac_import_rec.vendor_id='||p_ipac_import_rec.vendor_id);
2195: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_ipac_import_rec.receiver_duns='||p_ipac_import_rec.receiver_duns);
2196: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_ipac_import_rec.receiver_duns_4='||p_ipac_import_rec.receiver_duns_4);
2197: END IF;
2198:
2191: END IF;
2192:
2193: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2194: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_ipac_import_rec.vendor_id='||p_ipac_import_rec.vendor_id);
2195: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_ipac_import_rec.receiver_duns='||p_ipac_import_rec.receiver_duns);
2196: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_ipac_import_rec.receiver_duns_4='||p_ipac_import_rec.receiver_duns_4);
2197: END IF;
2198:
2199: IF (p_error_code = g_SUCCESS) THEN
2192:
2193: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2194: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_ipac_import_rec.vendor_id='||p_ipac_import_rec.vendor_id);
2195: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_ipac_import_rec.receiver_duns='||p_ipac_import_rec.receiver_duns);
2196: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_ipac_import_rec.receiver_duns_4='||p_ipac_import_rec.receiver_duns_4);
2197: END IF;
2198:
2199: IF (p_error_code = g_SUCCESS) THEN
2200: BEGIN
2197: END IF;
2198:
2199: IF (p_error_code = g_SUCCESS) THEN
2200: BEGIN
2201: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2202: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Select fv_ccr_vendors');
2203: END IF;
2204: SELECT 'X'
2205: INTO l_dummy
2198:
2199: IF (p_error_code = g_SUCCESS) THEN
2200: BEGIN
2201: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2202: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Select fv_ccr_vendors');
2203: END IF;
2204: SELECT 'X'
2205: INTO l_dummy
2206: FROM fv_ccr_vendors fcv
2208: AND fcv.duns = p_ipac_import_rec.receiver_duns
2209: AND NVL(fcv.plus_four, '-1') = NVL(p_ipac_import_rec.receiver_duns_4, '-1');
2210: EXCEPTION
2211: WHEN NO_DATA_FOUND THEN
2212: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2213: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'no data found');
2214: END IF;
2215: l_validation_err := 'Invalid DUNS and DUNS PLUS FOUR combination';
2216: l_validation_code := 'DUNS_NOT_SETUP';
2209: AND NVL(fcv.plus_four, '-1') = NVL(p_ipac_import_rec.receiver_duns_4, '-1');
2210: EXCEPTION
2211: WHEN NO_DATA_FOUND THEN
2212: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2213: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'no data found');
2214: END IF;
2215: l_validation_err := 'Invalid DUNS and DUNS PLUS FOUR combination';
2216: l_validation_code := 'DUNS_NOT_SETUP';
2217: WHEN OTHERS THEN
2217: WHEN OTHERS THEN
2218: p_error_code := g_FAILURE;
2219: p_error_desc := SQLERRM;
2220: l_location := l_module_name||'.select_po_headers';
2221: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2222: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
2223: END;
2224: END IF;
2225:
2218: p_error_code := g_FAILURE;
2219: p_error_desc := SQLERRM;
2220: l_location := l_module_name||'.select_po_headers';
2221: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2222: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
2223: END;
2224: END IF;
2225:
2226: IF (p_error_code = g_SUCCESS AND l_validation_code IS NULL) THEN
2224: END IF;
2225:
2226: IF (p_error_code = g_SUCCESS AND l_validation_code IS NULL) THEN
2227: BEGIN
2228: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2229: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Select po_vendor_sites');
2230: END IF;
2231: SELECT vendor_site_id
2232: INTO l_vendor_site_id
2225:
2226: IF (p_error_code = g_SUCCESS AND l_validation_code IS NULL) THEN
2227: BEGIN
2228: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2229: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Select po_vendor_sites');
2230: END IF;
2231: SELECT vendor_site_id
2232: INTO l_vendor_site_id
2233: FROM po_vendor_sites pvs
2232: INTO l_vendor_site_id
2233: FROM po_vendor_sites pvs
2234: WHERE pvs.vendor_id = p_ipac_import_rec.vendor_id
2235: AND pvs.vendor_site_code = p_ipac_import_rec.receiver_duns||p_ipac_import_rec.receiver_duns_4;
2236: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2237: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_vendor_site_id='||l_vendor_site_id);
2238: END IF;
2239: EXCEPTION
2240: WHEN NO_DATA_FOUND THEN
2233: FROM po_vendor_sites pvs
2234: WHERE pvs.vendor_id = p_ipac_import_rec.vendor_id
2235: AND pvs.vendor_site_code = p_ipac_import_rec.receiver_duns||p_ipac_import_rec.receiver_duns_4;
2236: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2237: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_vendor_site_id='||l_vendor_site_id);
2238: END IF;
2239: EXCEPTION
2240: WHEN NO_DATA_FOUND THEN
2241: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2237: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_vendor_site_id='||l_vendor_site_id);
2238: END IF;
2239: EXCEPTION
2240: WHEN NO_DATA_FOUND THEN
2241: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2242: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'no data found');
2243: END IF;
2244: l_validation_err := 'Invalid Site Code for DUNS and DUNS PLUS FOUR combination';
2245: l_validation_code := 'INAVALID_SITE_CODE';
2238: END IF;
2239: EXCEPTION
2240: WHEN NO_DATA_FOUND THEN
2241: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2242: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'no data found');
2243: END IF;
2244: l_validation_err := 'Invalid Site Code for DUNS and DUNS PLUS FOUR combination';
2245: l_validation_code := 'INAVALID_SITE_CODE';
2246: WHEN OTHERS THEN
2246: WHEN OTHERS THEN
2247: p_error_code := g_FAILURE;
2248: p_error_desc := SQLERRM;
2249: l_location := l_module_name||'.select_po_headers';
2250: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2251: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
2252: END;
2253: END IF;
2254:
2247: p_error_code := g_FAILURE;
2248: p_error_desc := SQLERRM;
2249: l_location := l_module_name||'.select_po_headers';
2250: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2251: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
2252: END;
2253: END IF;
2254:
2255: IF (p_error_code = g_SUCCESS AND l_validation_code IS NULL) THEN
2253: END IF;
2254:
2255: IF (p_error_code = g_SUCCESS AND l_validation_code IS NULL) THEN
2256: IF (l_vendor_site_id <> p_ipac_import_rec.vendor_site_id) THEN
2257: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2258: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'no match');
2259: END IF;
2260: l_validation_err := 'Purchase Order SITE does not match the DUNS Site';
2261: l_validation_code := 'PO_SITE_MISMATCH';
2254:
2255: IF (p_error_code = g_SUCCESS AND l_validation_code IS NULL) THEN
2256: IF (l_vendor_site_id <> p_ipac_import_rec.vendor_site_id) THEN
2257: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2258: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'no match');
2259: END IF;
2260: l_validation_err := 'Purchase Order SITE does not match the DUNS Site';
2261: l_validation_code := 'PO_SITE_MISMATCH';
2262: END IF;
2262: END IF;
2263: END IF;
2264:
2265: IF (l_validation_code IS NOT NULL AND p_error_code = g_SUCCESS) THEN
2266: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2267: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling insert_error');
2268: END IF;
2269: insert_error
2270: (
2263: END IF;
2264:
2265: IF (l_validation_code IS NOT NULL AND p_error_code = g_SUCCESS) THEN
2266: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2267: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling insert_error');
2268: END IF;
2269: insert_error
2270: (
2271: p_ipac_import_id => p_ipac_import_rec.ipac_import_id,
2278: p_ipac_import_rec.record_status := g_status_error;
2279: END IF;
2280: END IF;
2281:
2282: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2283: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_ipac_import_rec.record_status='||p_ipac_import_rec.record_status);
2284: END IF;
2285:
2286: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2279: END IF;
2280: END IF;
2281:
2282: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2283: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_ipac_import_rec.record_status='||p_ipac_import_rec.record_status);
2284: END IF;
2285:
2286: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2287: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
2282: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2283: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_ipac_import_rec.record_status='||p_ipac_import_rec.record_status);
2284: END IF;
2285:
2286: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2287: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
2288: END IF;
2289: EXCEPTION
2290: WHEN OTHERS THEN
2283: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_ipac_import_rec.record_status='||p_ipac_import_rec.record_status);
2284: END IF;
2285:
2286: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2287: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
2288: END IF;
2289: EXCEPTION
2290: WHEN OTHERS THEN
2291: p_error_code := g_FAILURE;
2290: WHEN OTHERS THEN
2291: p_error_code := g_FAILURE;
2292: p_error_desc := SQLERRM;
2293: l_location := l_module_name||'.final_exception';
2294: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2295: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
2296: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2297: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
2298: END IF;
2291: p_error_code := g_FAILURE;
2292: p_error_desc := SQLERRM;
2293: l_location := l_module_name||'.final_exception';
2294: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2295: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
2296: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2297: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
2298: END IF;
2299: END;
2292: p_error_desc := SQLERRM;
2293: l_location := l_module_name||'.final_exception';
2294: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2295: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
2296: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2297: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
2298: END IF;
2299: END;
2300:
2293: l_location := l_module_name||'.final_exception';
2294: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2295: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
2296: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2297: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
2298: END IF;
2299: END;
2300:
2301: --****************************************************************************************--
2308: --* : p_retcode OUT Return Code to concurrent process *--
2309: --* Global Vars : g_module_name READ *--
2310: --* : g_SUCCESS READ *--
2311: --* : g_ERROR READ *--
2312: --* : fnd_log.level_statement READ *--
2313: --* : fnd_log.g_current_runtime_level READ *--
2314: --* : fnd_log.level_unexpected READ *--
2315: --* : fnd_log.level_procedure READ *--
2316: --* : g_enter READ *--
2309: --* Global Vars : g_module_name READ *--
2310: --* : g_SUCCESS READ *--
2311: --* : g_ERROR READ *--
2312: --* : fnd_log.level_statement READ *--
2313: --* : fnd_log.g_current_runtime_level READ *--
2314: --* : fnd_log.level_unexpected READ *--
2315: --* : fnd_log.level_procedure READ *--
2316: --* : g_enter READ *--
2317: --* : g_exit READ *--
2310: --* : g_SUCCESS READ *--
2311: --* : g_ERROR READ *--
2312: --* : fnd_log.level_statement READ *--
2313: --* : fnd_log.g_current_runtime_level READ *--
2314: --* : fnd_log.level_unexpected READ *--
2315: --* : fnd_log.level_procedure READ *--
2316: --* : g_enter READ *--
2317: --* : g_exit READ *--
2318: --* Called from : process_data *--
2311: --* : g_ERROR READ *--
2312: --* : fnd_log.level_statement READ *--
2313: --* : fnd_log.g_current_runtime_level READ *--
2314: --* : fnd_log.level_unexpected READ *--
2315: --* : fnd_log.level_procedure READ *--
2316: --* : g_enter READ *--
2317: --* : g_exit READ *--
2318: --* Called from : process_data *--
2319: --* Calls : process_recurr_invoice *--
2352: p_error_code := g_SUCCESS;
2353: p_error_desc := NULL;
2354: l_invoice_found := 'N';
2355:
2356: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2357: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
2358: END IF;
2359: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2360: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'po_number = '||p_ipac_import_rec.purchase_order_number);
2353: p_error_desc := NULL;
2354: l_invoice_found := 'N';
2355:
2356: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2357: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
2358: END IF;
2359: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2360: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'po_number = '||p_ipac_import_rec.purchase_order_number);
2361: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'batch_name = '||p_ipac_import_rec.batch_name);
2355:
2356: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2357: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
2358: END IF;
2359: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2360: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'po_number = '||p_ipac_import_rec.purchase_order_number);
2361: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'batch_name = '||p_ipac_import_rec.batch_name);
2362: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'accomplished_date = '||p_ipac_import_rec.accomplished_date);
2363: END IF;
2356: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2357: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
2358: END IF;
2359: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2360: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'po_number = '||p_ipac_import_rec.purchase_order_number);
2361: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'batch_name = '||p_ipac_import_rec.batch_name);
2362: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'accomplished_date = '||p_ipac_import_rec.accomplished_date);
2363: END IF;
2364:
2357: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
2358: END IF;
2359: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2360: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'po_number = '||p_ipac_import_rec.purchase_order_number);
2361: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'batch_name = '||p_ipac_import_rec.batch_name);
2362: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'accomplished_date = '||p_ipac_import_rec.accomplished_date);
2363: END IF;
2364:
2365: -- Isolate the po_number if the po_number value contains both po_number and line_number
2358: END IF;
2359: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2360: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'po_number = '||p_ipac_import_rec.purchase_order_number);
2361: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'batch_name = '||p_ipac_import_rec.batch_name);
2362: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'accomplished_date = '||p_ipac_import_rec.accomplished_date);
2363: END IF;
2364:
2365: -- Isolate the po_number if the po_number value contains both po_number and line_number
2366: IF INSTR(p_ipac_import_rec.purchase_order_number,'/',1,1) > 0 THEN
2368: ELSE
2369: p_ap_inv_lines_rec.po_number := p_ipac_import_rec.purchase_order_number;
2370: END IF;
2371:
2372: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2373: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'derived po_number = '||p_ap_inv_lines_rec.po_number);
2374: END IF;
2375:
2376: IF (p_error_code = g_SUCCESS) THEN
2369: p_ap_inv_lines_rec.po_number := p_ipac_import_rec.purchase_order_number;
2370: END IF;
2371:
2372: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2373: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'derived po_number = '||p_ap_inv_lines_rec.po_number);
2374: END IF;
2375:
2376: IF (p_error_code = g_SUCCESS) THEN
2377: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2373: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'derived po_number = '||p_ap_inv_lines_rec.po_number);
2374: END IF;
2375:
2376: IF (p_error_code = g_SUCCESS) THEN
2377: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2378: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Selecting from po_headers');
2379: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'segment1='||p_ap_inv_lines_rec.po_number);
2380: END IF;
2381: BEGIN
2374: END IF;
2375:
2376: IF (p_error_code = g_SUCCESS) THEN
2377: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2378: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Selecting from po_headers');
2379: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'segment1='||p_ap_inv_lines_rec.po_number);
2380: END IF;
2381: BEGIN
2382: SELECT po_header_id,
2375:
2376: IF (p_error_code = g_SUCCESS) THEN
2377: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2378: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Selecting from po_headers');
2379: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'segment1='||p_ap_inv_lines_rec.po_number);
2380: END IF;
2381: BEGIN
2382: SELECT po_header_id,
2383: closed_code,
2388: p_ipac_import_rec.vendor_id,
2389: p_ipac_import_rec.vendor_site_id
2390: FROM po_headers
2391: WHERE segment1 = p_ap_inv_lines_rec.po_number;
2392: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2393: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'po_header_id = '||p_ap_inv_lines_rec.po_header_id);
2394: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'closed_code = '||l_hdr_closed_code);
2395: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'vendor_id = '||p_ipac_import_rec.vendor_id);
2396: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'vendor_site_id = '||p_ipac_import_rec.vendor_site_id);
2389: p_ipac_import_rec.vendor_site_id
2390: FROM po_headers
2391: WHERE segment1 = p_ap_inv_lines_rec.po_number;
2392: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2393: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'po_header_id = '||p_ap_inv_lines_rec.po_header_id);
2394: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'closed_code = '||l_hdr_closed_code);
2395: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'vendor_id = '||p_ipac_import_rec.vendor_id);
2396: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'vendor_site_id = '||p_ipac_import_rec.vendor_site_id);
2397: END IF;
2390: FROM po_headers
2391: WHERE segment1 = p_ap_inv_lines_rec.po_number;
2392: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2393: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'po_header_id = '||p_ap_inv_lines_rec.po_header_id);
2394: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'closed_code = '||l_hdr_closed_code);
2395: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'vendor_id = '||p_ipac_import_rec.vendor_id);
2396: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'vendor_site_id = '||p_ipac_import_rec.vendor_site_id);
2397: END IF;
2398: IF (l_hdr_closed_code IN ('CLOSED','FINALLY CLOSED')) THEN
2391: WHERE segment1 = p_ap_inv_lines_rec.po_number;
2392: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2393: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'po_header_id = '||p_ap_inv_lines_rec.po_header_id);
2394: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'closed_code = '||l_hdr_closed_code);
2395: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'vendor_id = '||p_ipac_import_rec.vendor_id);
2396: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'vendor_site_id = '||p_ipac_import_rec.vendor_site_id);
2397: END IF;
2398: IF (l_hdr_closed_code IN ('CLOSED','FINALLY CLOSED')) THEN
2399: l_validation_err := 'Purchase Order is closed';
2392: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2393: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'po_header_id = '||p_ap_inv_lines_rec.po_header_id);
2394: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'closed_code = '||l_hdr_closed_code);
2395: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'vendor_id = '||p_ipac_import_rec.vendor_id);
2396: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'vendor_site_id = '||p_ipac_import_rec.vendor_site_id);
2397: END IF;
2398: IF (l_hdr_closed_code IN ('CLOSED','FINALLY CLOSED')) THEN
2399: l_validation_err := 'Purchase Order is closed';
2400: l_validation_code := 'PO_CLOSED';
2397: END IF;
2398: IF (l_hdr_closed_code IN ('CLOSED','FINALLY CLOSED')) THEN
2399: l_validation_err := 'Purchase Order is closed';
2400: l_validation_code := 'PO_CLOSED';
2401: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2402: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Validation Error:'||l_validation_code);
2403: END IF;
2404: END IF;
2405: EXCEPTION
2398: IF (l_hdr_closed_code IN ('CLOSED','FINALLY CLOSED')) THEN
2399: l_validation_err := 'Purchase Order is closed';
2400: l_validation_code := 'PO_CLOSED';
2401: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2402: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Validation Error:'||l_validation_code);
2403: END IF;
2404: END IF;
2405: EXCEPTION
2406: WHEN NO_DATA_FOUND THEN
2405: EXCEPTION
2406: WHEN NO_DATA_FOUND THEN
2407: l_validation_err := 'Invalid Purchase Order';
2408: l_validation_code := 'INVALID_PO_NUM';
2409: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2410: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'NO DATA Validation Error:'||l_validation_code);
2411: END IF;
2412: WHEN OTHERS THEN
2413: p_error_code := g_FAILURE;
2406: WHEN NO_DATA_FOUND THEN
2407: l_validation_err := 'Invalid Purchase Order';
2408: l_validation_code := 'INVALID_PO_NUM';
2409: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2410: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'NO DATA Validation Error:'||l_validation_code);
2411: END IF;
2412: WHEN OTHERS THEN
2413: p_error_code := g_FAILURE;
2414: p_error_desc := SQLERRM;
2412: WHEN OTHERS THEN
2413: p_error_code := g_FAILURE;
2414: p_error_desc := SQLERRM;
2415: l_location := l_module_name||'.select_po_headers';
2416: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2417: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
2418: END;
2419: END IF;
2420:
2413: p_error_code := g_FAILURE;
2414: p_error_desc := SQLERRM;
2415: l_location := l_module_name||'.select_po_headers';
2416: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2417: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
2418: END;
2419: END IF;
2420:
2421: IF (p_error_code = g_SUCCESS AND l_validation_code IS NULL) THEN
2419: END IF;
2420:
2421: IF (p_error_code = g_SUCCESS AND l_validation_code IS NULL) THEN
2422: BEGIN
2423: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2424: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Selecting from po_distributions and lines');
2425: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'po_header_id='||p_ap_inv_lines_rec.po_header_id);
2426: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'set_of_books_id='||g_set_of_books_id);
2427: END IF;
2420:
2421: IF (p_error_code = g_SUCCESS AND l_validation_code IS NULL) THEN
2422: BEGIN
2423: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2424: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Selecting from po_distributions and lines');
2425: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'po_header_id='||p_ap_inv_lines_rec.po_header_id);
2426: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'set_of_books_id='||g_set_of_books_id);
2427: END IF;
2428:
2421: IF (p_error_code = g_SUCCESS AND l_validation_code IS NULL) THEN
2422: BEGIN
2423: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2424: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Selecting from po_distributions and lines');
2425: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'po_header_id='||p_ap_inv_lines_rec.po_header_id);
2426: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'set_of_books_id='||g_set_of_books_id);
2427: END IF;
2428:
2429: SELECT COUNT(*)
2422: BEGIN
2423: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2424: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Selecting from po_distributions and lines');
2425: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'po_header_id='||p_ap_inv_lines_rec.po_header_id);
2426: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'set_of_books_id='||g_set_of_books_id);
2427: END IF;
2428:
2429: SELECT COUNT(*)
2430: INTO l_count_po_disb_lines
2433: WHERE pd.po_header_id = p_ap_inv_lines_rec.po_header_id
2434: AND pl.po_line_id = pd.po_line_id
2435: AND pd.set_of_books_id = g_set_of_books_id;
2436:
2437: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2438: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_count_po_disb_lines='||l_count_po_disb_lines);
2439: END IF;
2440:
2441: EXCEPTION
2434: AND pl.po_line_id = pd.po_line_id
2435: AND pd.set_of_books_id = g_set_of_books_id;
2436:
2437: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2438: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_count_po_disb_lines='||l_count_po_disb_lines);
2439: END IF;
2440:
2441: EXCEPTION
2442: WHEN OTHERS THEN
2442: WHEN OTHERS THEN
2443: p_error_code := g_FAILURE;
2444: p_error_desc := SQLERRM;
2445: l_location := l_module_name||'.select_po_distributions1';
2446: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2447: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
2448: END;
2449: END IF;
2450:
2443: p_error_code := g_FAILURE;
2444: p_error_desc := SQLERRM;
2445: l_location := l_module_name||'.select_po_distributions1';
2446: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2447: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
2448: END;
2449: END IF;
2450:
2451: IF (p_error_code = g_SUCCESS AND l_validation_code IS NULL) THEN
2449: END IF;
2450:
2451: IF (p_error_code = g_SUCCESS AND l_validation_code IS NULL) THEN
2452: BEGIN
2453: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2454: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Selecting from po_distributions, lines and ap_invoice_distributions');
2455: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'po_header_id='||p_ap_inv_lines_rec.po_header_id);
2456: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'set_of_books_id='||g_set_of_books_id);
2457: END IF;
2450:
2451: IF (p_error_code = g_SUCCESS AND l_validation_code IS NULL) THEN
2452: BEGIN
2453: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2454: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Selecting from po_distributions, lines and ap_invoice_distributions');
2455: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'po_header_id='||p_ap_inv_lines_rec.po_header_id);
2456: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'set_of_books_id='||g_set_of_books_id);
2457: END IF;
2458:
2451: IF (p_error_code = g_SUCCESS AND l_validation_code IS NULL) THEN
2452: BEGIN
2453: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2454: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Selecting from po_distributions, lines and ap_invoice_distributions');
2455: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'po_header_id='||p_ap_inv_lines_rec.po_header_id);
2456: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'set_of_books_id='||g_set_of_books_id);
2457: END IF;
2458:
2459: SELECT COUNT(*)
2452: BEGIN
2453: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2454: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Selecting from po_distributions, lines and ap_invoice_distributions');
2455: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'po_header_id='||p_ap_inv_lines_rec.po_header_id);
2456: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'set_of_books_id='||g_set_of_books_id);
2457: END IF;
2458:
2459: SELECT COUNT(*)
2460: INTO l_count_matched_disb_lines
2467: AND aid.final_match_flag = 'D'
2468: AND aid.set_of_books_id = pd.set_of_books_id
2469: AND aid.set_of_books_id = g_set_of_books_id ;
2470:
2471: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2472: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_count_matched_disb_lines='||l_count_matched_disb_lines);
2473: END IF;
2474: EXCEPTION
2475: WHEN OTHERS THEN
2468: AND aid.set_of_books_id = pd.set_of_books_id
2469: AND aid.set_of_books_id = g_set_of_books_id ;
2470:
2471: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2472: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_count_matched_disb_lines='||l_count_matched_disb_lines);
2473: END IF;
2474: EXCEPTION
2475: WHEN OTHERS THEN
2476: p_error_code := g_FAILURE;
2475: WHEN OTHERS THEN
2476: p_error_code := g_FAILURE;
2477: p_error_desc := SQLERRM;
2478: l_location := l_module_name||'.select_po_distributions2';
2479: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2480: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
2481: END;
2482: END IF;
2483:
2476: p_error_code := g_FAILURE;
2477: p_error_desc := SQLERRM;
2478: l_location := l_module_name||'.select_po_distributions2';
2479: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2480: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
2481: END;
2482: END IF;
2483:
2484: IF (p_error_code = g_SUCCESS AND l_validation_code IS NULL) THEN
2484: IF (p_error_code = g_SUCCESS AND l_validation_code IS NULL) THEN
2485: IF (l_count_po_disb_lines = l_count_matched_disb_lines) AND (l_count_matched_disb_lines <> 0) THEN
2486: l_validation_err := 'Purchase Order is finally matched';
2487: l_validation_code := 'PO_FINALLY_MATCHED';
2488: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2489: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Validation Error:'||l_validation_code);
2490: END IF;
2491: END IF;
2492: END IF;
2485: IF (l_count_po_disb_lines = l_count_matched_disb_lines) AND (l_count_matched_disb_lines <> 0) THEN
2486: l_validation_err := 'Purchase Order is finally matched';
2487: l_validation_code := 'PO_FINALLY_MATCHED';
2488: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2489: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Validation Error:'||l_validation_code);
2490: END IF;
2491: END IF;
2492: END IF;
2493:
2501: WHEN VALUE_ERROR THEN
2502: p_ap_inv_lines_rec.po_line_number := NULL;
2503: l_validation_err := 'Invalid Purchase Order Line Number';
2504: l_validation_code := 'INVALID_LINE_NUM';
2505: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2506: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Validation Error:'||l_validation_code);
2507: END IF;
2508: WHEN OTHERS THEN
2509: p_error_code := g_FAILURE;
2502: p_ap_inv_lines_rec.po_line_number := NULL;
2503: l_validation_err := 'Invalid Purchase Order Line Number';
2504: l_validation_code := 'INVALID_LINE_NUM';
2505: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2506: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Validation Error:'||l_validation_code);
2507: END IF;
2508: WHEN OTHERS THEN
2509: p_error_code := g_FAILURE;
2510: p_error_desc := SQLERRM;
2508: WHEN OTHERS THEN
2509: p_error_code := g_FAILURE;
2510: p_error_desc := SQLERRM;
2511: l_location := l_module_name||'.check_po_line_number';
2512: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2513: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
2514: END;
2515: END IF;
2516: END IF;
2509: p_error_code := g_FAILURE;
2510: p_error_desc := SQLERRM;
2511: l_location := l_module_name||'.check_po_line_number';
2512: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2513: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
2514: END;
2515: END IF;
2516: END IF;
2517:
2515: END IF;
2516: END IF;
2517:
2518: IF (p_error_code = g_SUCCESS AND l_validation_code IS NULL) THEN
2519: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2520: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'po_line_number='||p_ap_inv_lines_rec.po_line_number);
2521: END IF;
2522: BEGIN
2523: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2516: END IF;
2517:
2518: IF (p_error_code = g_SUCCESS AND l_validation_code IS NULL) THEN
2519: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2520: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'po_line_number='||p_ap_inv_lines_rec.po_line_number);
2521: END IF;
2522: BEGIN
2523: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2524: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Selecting from po_lines');
2519: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2520: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'po_line_number='||p_ap_inv_lines_rec.po_line_number);
2521: END IF;
2522: BEGIN
2523: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2524: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Selecting from po_lines');
2525: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'po_header_id = '||p_ap_inv_lines_rec.po_header_id);
2526: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'line_num = '||p_ap_inv_lines_rec.po_line_number);
2527: END IF;
2520: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'po_line_number='||p_ap_inv_lines_rec.po_line_number);
2521: END IF;
2522: BEGIN
2523: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2524: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Selecting from po_lines');
2525: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'po_header_id = '||p_ap_inv_lines_rec.po_header_id);
2526: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'line_num = '||p_ap_inv_lines_rec.po_line_number);
2527: END IF;
2528:
2521: END IF;
2522: BEGIN
2523: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2524: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Selecting from po_lines');
2525: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'po_header_id = '||p_ap_inv_lines_rec.po_header_id);
2526: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'line_num = '||p_ap_inv_lines_rec.po_line_number);
2527: END IF;
2528:
2529: SELECT pl.po_line_id,
2522: BEGIN
2523: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2524: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Selecting from po_lines');
2525: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'po_header_id = '||p_ap_inv_lines_rec.po_header_id);
2526: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'line_num = '||p_ap_inv_lines_rec.po_line_number);
2527: END IF;
2528:
2529: SELECT pl.po_line_id,
2530: pl.closed_code,
2535: FROM po_lines pl
2536: WHERE po_header_id = p_ap_inv_lines_rec.po_header_id
2537: AND line_num = NVL(p_ap_inv_lines_rec.po_line_number, 1);
2538:
2539: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2540: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Selecting from po_lines');
2541: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'po_line_id = '||p_ap_inv_lines_rec.po_line_id);
2542: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'closed_code = '||l_line_closed_code);
2543: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'unit_meas_lookup_code = '||p_ap_inv_lines_rec.po_unit_of_measure);
2536: WHERE po_header_id = p_ap_inv_lines_rec.po_header_id
2537: AND line_num = NVL(p_ap_inv_lines_rec.po_line_number, 1);
2538:
2539: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2540: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Selecting from po_lines');
2541: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'po_line_id = '||p_ap_inv_lines_rec.po_line_id);
2542: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'closed_code = '||l_line_closed_code);
2543: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'unit_meas_lookup_code = '||p_ap_inv_lines_rec.po_unit_of_measure);
2544: END IF;
2537: AND line_num = NVL(p_ap_inv_lines_rec.po_line_number, 1);
2538:
2539: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2540: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Selecting from po_lines');
2541: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'po_line_id = '||p_ap_inv_lines_rec.po_line_id);
2542: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'closed_code = '||l_line_closed_code);
2543: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'unit_meas_lookup_code = '||p_ap_inv_lines_rec.po_unit_of_measure);
2544: END IF;
2545:
2538:
2539: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2540: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Selecting from po_lines');
2541: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'po_line_id = '||p_ap_inv_lines_rec.po_line_id);
2542: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'closed_code = '||l_line_closed_code);
2543: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'unit_meas_lookup_code = '||p_ap_inv_lines_rec.po_unit_of_measure);
2544: END IF;
2545:
2546: IF (l_line_closed_code IN ('CLOSED','FINALLY CLOSED')) THEN
2539: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2540: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Selecting from po_lines');
2541: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'po_line_id = '||p_ap_inv_lines_rec.po_line_id);
2542: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'closed_code = '||l_line_closed_code);
2543: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'unit_meas_lookup_code = '||p_ap_inv_lines_rec.po_unit_of_measure);
2544: END IF;
2545:
2546: IF (l_line_closed_code IN ('CLOSED','FINALLY CLOSED')) THEN
2547: l_validation_err := 'Purchase Order Line Number is closed';
2545:
2546: IF (l_line_closed_code IN ('CLOSED','FINALLY CLOSED')) THEN
2547: l_validation_err := 'Purchase Order Line Number is closed';
2548: l_validation_code := 'PO_LINE_NUM_CLOSED';
2549: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2550: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Validation Error:'||l_validation_code);
2551: END IF;
2552: END IF;
2553: EXCEPTION
2546: IF (l_line_closed_code IN ('CLOSED','FINALLY CLOSED')) THEN
2547: l_validation_err := 'Purchase Order Line Number is closed';
2548: l_validation_code := 'PO_LINE_NUM_CLOSED';
2549: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2550: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Validation Error:'||l_validation_code);
2551: END IF;
2552: END IF;
2553: EXCEPTION
2554: WHEN NO_DATA_FOUND THEN
2553: EXCEPTION
2554: WHEN NO_DATA_FOUND THEN
2555: l_validation_err := 'Invalid Purchase Order Line Number';
2556: l_validation_code := 'INVALID_LINE_NUM';
2557: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2558: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'NO DATA Validation Error:'||l_validation_code);
2559: END IF;
2560: WHEN OTHERS THEN
2561: p_error_code := g_FAILURE;
2554: WHEN NO_DATA_FOUND THEN
2555: l_validation_err := 'Invalid Purchase Order Line Number';
2556: l_validation_code := 'INVALID_LINE_NUM';
2557: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2558: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'NO DATA Validation Error:'||l_validation_code);
2559: END IF;
2560: WHEN OTHERS THEN
2561: p_error_code := g_FAILURE;
2562: p_error_desc := SQLERRM;
2560: WHEN OTHERS THEN
2561: p_error_code := g_FAILURE;
2562: p_error_desc := SQLERRM;
2563: l_location := l_module_name||'.select_po_lines';
2564: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2565: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
2566: END;
2567: END IF;
2568:
2561: p_error_code := g_FAILURE;
2562: p_error_desc := SQLERRM;
2563: l_location := l_module_name||'.select_po_lines';
2564: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2565: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
2566: END;
2567: END IF;
2568:
2569: IF (p_error_code = g_SUCCESS AND l_validation_code IS NULL) THEN
2567: END IF;
2568:
2569: IF (p_error_code = g_SUCCESS AND l_validation_code IS NULL) THEN
2570: BEGIN
2571: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2572: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Selecting from po_distributions');
2573: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'po_line_id = '||p_ap_inv_lines_rec.po_line_id);
2574: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'set_of_books_id = '||g_set_of_books_id);
2575: END IF;
2568:
2569: IF (p_error_code = g_SUCCESS AND l_validation_code IS NULL) THEN
2570: BEGIN
2571: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2572: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Selecting from po_distributions');
2573: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'po_line_id = '||p_ap_inv_lines_rec.po_line_id);
2574: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'set_of_books_id = '||g_set_of_books_id);
2575: END IF;
2576:
2569: IF (p_error_code = g_SUCCESS AND l_validation_code IS NULL) THEN
2570: BEGIN
2571: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2572: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Selecting from po_distributions');
2573: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'po_line_id = '||p_ap_inv_lines_rec.po_line_id);
2574: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'set_of_books_id = '||g_set_of_books_id);
2575: END IF;
2576:
2577: SELECT COUNT(*)
2570: BEGIN
2571: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2572: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Selecting from po_distributions');
2573: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'po_line_id = '||p_ap_inv_lines_rec.po_line_id);
2574: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'set_of_books_id = '||g_set_of_books_id);
2575: END IF;
2576:
2577: SELECT COUNT(*)
2578: INTO l_count_po_disb_lines
2579: FROM po_distributions pd
2580: WHERE pd.po_line_id = p_ap_inv_lines_rec.po_line_id
2581: AND pd.set_of_books_id = g_set_of_books_id;
2582:
2583: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2584: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_count_po_disb_lines='||l_count_po_disb_lines);
2585: END IF;
2586:
2587: EXCEPTION
2580: WHERE pd.po_line_id = p_ap_inv_lines_rec.po_line_id
2581: AND pd.set_of_books_id = g_set_of_books_id;
2582:
2583: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2584: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_count_po_disb_lines='||l_count_po_disb_lines);
2585: END IF;
2586:
2587: EXCEPTION
2588: WHEN OTHERS THEN
2588: WHEN OTHERS THEN
2589: p_error_code := g_FAILURE;
2590: p_error_desc := SQLERRM;
2591: l_location := l_module_name||'.select_po_distributions3';
2592: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2593: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
2594: END;
2595: END IF;
2596:
2589: p_error_code := g_FAILURE;
2590: p_error_desc := SQLERRM;
2591: l_location := l_module_name||'.select_po_distributions3';
2592: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2593: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
2594: END;
2595: END IF;
2596:
2597: IF (p_error_code = g_SUCCESS AND l_validation_code IS NULL) THEN
2595: END IF;
2596:
2597: IF (p_error_code = g_SUCCESS AND l_validation_code IS NULL) THEN
2598: BEGIN
2599: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2600: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Selecting from po_distributions and ap_invoice_distributions');
2601: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'po_line_id = '||p_ap_inv_lines_rec.po_line_id);
2602: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'set_of_books_id = '||g_set_of_books_id);
2603: END IF;
2596:
2597: IF (p_error_code = g_SUCCESS AND l_validation_code IS NULL) THEN
2598: BEGIN
2599: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2600: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Selecting from po_distributions and ap_invoice_distributions');
2601: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'po_line_id = '||p_ap_inv_lines_rec.po_line_id);
2602: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'set_of_books_id = '||g_set_of_books_id);
2603: END IF;
2604: SELECT COUNT(*)
2597: IF (p_error_code = g_SUCCESS AND l_validation_code IS NULL) THEN
2598: BEGIN
2599: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2600: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Selecting from po_distributions and ap_invoice_distributions');
2601: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'po_line_id = '||p_ap_inv_lines_rec.po_line_id);
2602: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'set_of_books_id = '||g_set_of_books_id);
2603: END IF;
2604: SELECT COUNT(*)
2605: INTO l_count_matched_disb_lines
2598: BEGIN
2599: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2600: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Selecting from po_distributions and ap_invoice_distributions');
2601: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'po_line_id = '||p_ap_inv_lines_rec.po_line_id);
2602: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'set_of_books_id = '||g_set_of_books_id);
2603: END IF;
2604: SELECT COUNT(*)
2605: INTO l_count_matched_disb_lines
2606: FROM ap_invoice_distributions aid ,
2609: AND pd.po_line_id = p_ap_inv_lines_rec.po_line_id
2610: AND aid.final_match_flag = 'D'
2611: AND aid.set_of_books_id = pd.set_of_books_id
2612: AND aid.set_of_books_id = g_set_of_books_id;
2613: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2614: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_count_matched_disb_lines='||l_count_matched_disb_lines);
2615: END IF;
2616: EXCEPTION
2617: WHEN OTHERS THEN
2610: AND aid.final_match_flag = 'D'
2611: AND aid.set_of_books_id = pd.set_of_books_id
2612: AND aid.set_of_books_id = g_set_of_books_id;
2613: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2614: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_count_matched_disb_lines='||l_count_matched_disb_lines);
2615: END IF;
2616: EXCEPTION
2617: WHEN OTHERS THEN
2618: p_error_code := g_FAILURE;
2617: WHEN OTHERS THEN
2618: p_error_code := g_FAILURE;
2619: p_error_desc := SQLERRM;
2620: l_location := l_module_name||'.select_po_distributions4';
2621: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2622: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
2623: END;
2624: END IF;
2625:
2618: p_error_code := g_FAILURE;
2619: p_error_desc := SQLERRM;
2620: l_location := l_module_name||'.select_po_distributions4';
2621: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2622: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
2623: END;
2624: END IF;
2625:
2626: IF (p_error_code = g_SUCCESS AND l_validation_code IS NULL) THEN
2626: IF (p_error_code = g_SUCCESS AND l_validation_code IS NULL) THEN
2627: IF (l_count_po_disb_lines = l_count_matched_disb_lines) AND (l_count_matched_disb_lines <> 0) THEN
2628: l_validation_err := 'Purchase Order Line Number is finally matched';
2629: l_validation_code := 'PO_LINE_NUM_FINALLY_MATCHED';
2630: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2631: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Validation Error:'||l_validation_code);
2632: END IF;
2633: END IF;
2634: END IF;
2627: IF (l_count_po_disb_lines = l_count_matched_disb_lines) AND (l_count_matched_disb_lines <> 0) THEN
2628: l_validation_err := 'Purchase Order Line Number is finally matched';
2629: l_validation_code := 'PO_LINE_NUM_FINALLY_MATCHED';
2630: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2631: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Validation Error:'||l_validation_code);
2632: END IF;
2633: END IF;
2634: END IF;
2635:
2638: /*
2639: --Check whether Recurring Invoice has been created for
2640: --the PO_NUMBER and LINE_NUMBER.
2641: BEGIN
2642: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2643: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Selecting from ap_recurring_payments_v');
2644: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'po_line_id = '||p_ap_inv_lines_rec.po_line_id);
2645: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'po_header_id = '||p_ap_inv_lines_rec.po_header_id);
2646: END IF;
2639: --Check whether Recurring Invoice has been created for
2640: --the PO_NUMBER and LINE_NUMBER.
2641: BEGIN
2642: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2643: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Selecting from ap_recurring_payments_v');
2644: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'po_line_id = '||p_ap_inv_lines_rec.po_line_id);
2645: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'po_header_id = '||p_ap_inv_lines_rec.po_header_id);
2646: END IF;
2647: l_exists := 0;
2640: --the PO_NUMBER and LINE_NUMBER.
2641: BEGIN
2642: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2643: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Selecting from ap_recurring_payments_v');
2644: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'po_line_id = '||p_ap_inv_lines_rec.po_line_id);
2645: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'po_header_id = '||p_ap_inv_lines_rec.po_header_id);
2646: END IF;
2647: l_exists := 0;
2648: SELECT COUNT(*)
2641: BEGIN
2642: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2643: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Selecting from ap_recurring_payments_v');
2644: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'po_line_id = '||p_ap_inv_lines_rec.po_line_id);
2645: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'po_header_id = '||p_ap_inv_lines_rec.po_header_id);
2646: END IF;
2647: l_exists := 0;
2648: SELECT COUNT(*)
2649: INTO l_exists
2649: INTO l_exists
2650: FROM ap_recurring_payments_v aprpv
2651: WHERE aprpv.po_header_id = p_ap_inv_lines_rec.po_header_id
2652: AND aprpv.po_line_id = p_ap_inv_lines_rec.po_line_id;
2653: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2654: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_exists='||l_exists);
2655: END IF;
2656: EXCEPTION
2657: WHEN OTHERS THEN
2650: FROM ap_recurring_payments_v aprpv
2651: WHERE aprpv.po_header_id = p_ap_inv_lines_rec.po_header_id
2652: AND aprpv.po_line_id = p_ap_inv_lines_rec.po_line_id;
2653: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2654: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_exists='||l_exists);
2655: END IF;
2656: EXCEPTION
2657: WHEN OTHERS THEN
2658: p_error_code := g_FAILURE;
2657: WHEN OTHERS THEN
2658: p_error_code := g_FAILURE;
2659: p_error_desc := SQLERRM;
2660: l_location := l_module_name||'.ap_recurring_payments_v';
2661: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2662: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
2663: END ;
2664: */
2665: --process recurring invoice;
2658: p_error_code := g_FAILURE;
2659: p_error_desc := SQLERRM;
2660: l_location := l_module_name||'.ap_recurring_payments_v';
2661: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2662: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
2663: END ;
2664: */
2665: --process recurring invoice;
2666: -- IF (p_error_code = g_SUCCESS AND l_exists > 0) THEN
2663: END ;
2664: */
2665: --process recurring invoice;
2666: -- IF (p_error_code = g_SUCCESS AND l_exists > 0) THEN
2667: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2668: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling process_recurr_invoice');
2669: END IF;
2670: process_recurr_invoice
2671: (
2664: */
2665: --process recurring invoice;
2666: -- IF (p_error_code = g_SUCCESS AND l_exists > 0) THEN
2667: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2668: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling process_recurr_invoice');
2669: END IF;
2670: process_recurr_invoice
2671: (
2672: p_po_num => p_ap_inv_lines_rec.po_number,
2680: p_validation_err => l_validation_err,
2681: p_error_code => p_error_code,
2682: p_error_desc => p_error_desc
2683: );
2684: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2685: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'process_recurr_invoice returned');
2686: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code ='||p_error_code);
2687: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
2688: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_invoice_found ='||l_invoice_found);
2681: p_error_code => p_error_code,
2682: p_error_desc => p_error_desc
2683: );
2684: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2685: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'process_recurr_invoice returned');
2686: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code ='||p_error_code);
2687: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
2688: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_invoice_found ='||l_invoice_found);
2689: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_validation_code ='||l_validation_code);
2682: p_error_desc => p_error_desc
2683: );
2684: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2685: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'process_recurr_invoice returned');
2686: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code ='||p_error_code);
2687: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
2688: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_invoice_found ='||l_invoice_found);
2689: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_validation_code ='||l_validation_code);
2690: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_validation_err ='||l_validation_err);
2683: );
2684: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2685: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'process_recurr_invoice returned');
2686: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code ='||p_error_code);
2687: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
2688: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_invoice_found ='||l_invoice_found);
2689: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_validation_code ='||l_validation_code);
2690: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_validation_err ='||l_validation_err);
2691: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_recurr_invoice_id ='||l_recurr_invoice_id);
2684: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2685: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'process_recurr_invoice returned');
2686: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code ='||p_error_code);
2687: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
2688: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_invoice_found ='||l_invoice_found);
2689: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_validation_code ='||l_validation_code);
2690: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_validation_err ='||l_validation_err);
2691: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_recurr_invoice_id ='||l_recurr_invoice_id);
2692: END IF;
2685: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'process_recurr_invoice returned');
2686: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code ='||p_error_code);
2687: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
2688: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_invoice_found ='||l_invoice_found);
2689: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_validation_code ='||l_validation_code);
2690: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_validation_err ='||l_validation_err);
2691: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_recurr_invoice_id ='||l_recurr_invoice_id);
2692: END IF;
2693: -- END IF;
2686: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code ='||p_error_code);
2687: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
2688: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_invoice_found ='||l_invoice_found);
2689: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_validation_code ='||l_validation_code);
2690: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_validation_err ='||l_validation_err);
2691: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_recurr_invoice_id ='||l_recurr_invoice_id);
2692: END IF;
2693: -- END IF;
2694: END IF;
2687: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
2688: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_invoice_found ='||l_invoice_found);
2689: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_validation_code ='||l_validation_code);
2690: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_validation_err ='||l_validation_err);
2691: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_recurr_invoice_id ='||l_recurr_invoice_id);
2692: END IF;
2693: -- END IF;
2694: END IF;
2695:
2693: -- END IF;
2694: END IF;
2695:
2696: IF (l_validation_code IS NOT NULL AND p_error_code = g_SUCCESS) THEN
2697: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2698: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling insert_error');
2699: END IF;
2700: insert_error
2701: (
2694: END IF;
2695:
2696: IF (l_validation_code IS NOT NULL AND p_error_code = g_SUCCESS) THEN
2697: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2698: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling insert_error');
2699: END IF;
2700: insert_error
2701: (
2702: p_ipac_import_id => p_ipac_import_rec.ipac_import_id,
2704: p_validation_err => l_validation_err,
2705: p_error_code => p_error_code,
2706: p_error_desc => p_error_desc
2707: );
2708: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2709: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'insert_error returned');
2710: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code ='||p_error_code);
2711: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
2712: END IF;
2705: p_error_code => p_error_code,
2706: p_error_desc => p_error_desc
2707: );
2708: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2709: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'insert_error returned');
2710: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code ='||p_error_code);
2711: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
2712: END IF;
2713: IF (p_error_code = g_SUCCESS) THEN
2706: p_error_desc => p_error_desc
2707: );
2708: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2709: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'insert_error returned');
2710: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code ='||p_error_code);
2711: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
2712: END IF;
2713: IF (p_error_code = g_SUCCESS) THEN
2714: p_ipac_import_rec.record_status := g_status_error;
2707: );
2708: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2709: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'insert_error returned');
2710: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code ='||p_error_code);
2711: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
2712: END IF;
2713: IF (p_error_code = g_SUCCESS) THEN
2714: p_ipac_import_rec.record_status := g_status_error;
2715: END IF;
2719: p_ipac_import_rec.record_status := g_status_processed;
2720: p_ipac_import_rec.invoice_id := l_recurr_invoice_id;
2721: END IF;
2722:
2723: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2724: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_ipac_import_rec.record_status ='||p_ipac_import_rec.record_status);
2725: END IF;
2726:
2727: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2720: p_ipac_import_rec.invoice_id := l_recurr_invoice_id;
2721: END IF;
2722:
2723: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2724: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_ipac_import_rec.record_status ='||p_ipac_import_rec.record_status);
2725: END IF;
2726:
2727: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2728: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
2723: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2724: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_ipac_import_rec.record_status ='||p_ipac_import_rec.record_status);
2725: END IF;
2726:
2727: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2728: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
2729: END IF;
2730: EXCEPTION
2731: WHEN OTHERS THEN
2724: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_ipac_import_rec.record_status ='||p_ipac_import_rec.record_status);
2725: END IF;
2726:
2727: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2728: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
2729: END IF;
2730: EXCEPTION
2731: WHEN OTHERS THEN
2732: p_error_code := g_FAILURE;
2731: WHEN OTHERS THEN
2732: p_error_code := g_FAILURE;
2733: p_error_desc := SQLERRM;
2734: l_location := l_module_name||'.final_exception';
2735: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2736: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
2737: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2738: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
2739: END IF;
2732: p_error_code := g_FAILURE;
2733: p_error_desc := SQLERRM;
2734: l_location := l_module_name||'.final_exception';
2735: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2736: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
2737: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2738: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
2739: END IF;
2740: END;
2733: p_error_desc := SQLERRM;
2734: l_location := l_module_name||'.final_exception';
2735: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2736: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
2737: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2738: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
2739: END IF;
2740: END;
2741:
2734: l_location := l_module_name||'.final_exception';
2735: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2736: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
2737: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2738: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
2739: END IF;
2740: END;
2741:
2742:
2755: --* Global Vars : g_module_name READ *--
2756: --* : g_SUCCESS READ *--
2757: --* : g_WARNING READ *--
2758: --* : g_ERROR READ *--
2759: --* : fnd_log.level_statement READ *--
2760: --* : fnd_log.g_current_runtime_level READ *--
2761: --* : fnd_log.level_unexpected READ *--
2762: --* : fnd_log.level_procedure READ *--
2763: --* : g_enter READ *--
2756: --* : g_SUCCESS READ *--
2757: --* : g_WARNING READ *--
2758: --* : g_ERROR READ *--
2759: --* : fnd_log.level_statement READ *--
2760: --* : fnd_log.g_current_runtime_level READ *--
2761: --* : fnd_log.level_unexpected READ *--
2762: --* : fnd_log.level_procedure READ *--
2763: --* : g_enter READ *--
2764: --* : g_exit READ *--
2757: --* : g_WARNING READ *--
2758: --* : g_ERROR READ *--
2759: --* : fnd_log.level_statement READ *--
2760: --* : fnd_log.g_current_runtime_level READ *--
2761: --* : fnd_log.level_unexpected READ *--
2762: --* : fnd_log.level_procedure READ *--
2763: --* : g_enter READ *--
2764: --* : g_exit READ *--
2765: --* Called from : process_data *--
2758: --* : g_ERROR READ *--
2759: --* : fnd_log.level_statement READ *--
2760: --* : fnd_log.g_current_runtime_level READ *--
2761: --* : fnd_log.level_unexpected READ *--
2762: --* : fnd_log.level_procedure READ *--
2763: --* : g_enter READ *--
2764: --* : g_exit READ *--
2765: --* Called from : process_data *--
2766: --* Calls : insert_invoice_hdr *--
2789: l_rowcount NUMBER;
2790: BEGIN
2791: l_module_name := g_module_name || 'save_or_erase_invoice';
2792: p_error_code := g_SUCCESS;
2793: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2794: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
2795: END IF;
2796:
2797: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2790: BEGIN
2791: l_module_name := g_module_name || 'save_or_erase_invoice';
2792: p_error_code := g_SUCCESS;
2793: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2794: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
2795: END IF;
2796:
2797: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2798: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,'p_previous_inv_number = '||p_previous_inv_number);
2793: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2794: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
2795: END IF;
2796:
2797: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2798: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,'p_previous_inv_number = '||p_previous_inv_number);
2799: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,'p_okay_to_insert_inv = '||p_okay_to_insert_inv);
2800: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,'p_total_invoice_lines = '||p_total_invoice_lines);
2801: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,'p_total_invoices(IN) = '||p_total_invoices);
2794: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
2795: END IF;
2796:
2797: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2798: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,'p_previous_inv_number = '||p_previous_inv_number);
2799: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,'p_okay_to_insert_inv = '||p_okay_to_insert_inv);
2800: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,'p_total_invoice_lines = '||p_total_invoice_lines);
2801: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,'p_total_invoices(IN) = '||p_total_invoices);
2802: END IF;
2795: END IF;
2796:
2797: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2798: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,'p_previous_inv_number = '||p_previous_inv_number);
2799: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,'p_okay_to_insert_inv = '||p_okay_to_insert_inv);
2800: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,'p_total_invoice_lines = '||p_total_invoice_lines);
2801: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,'p_total_invoices(IN) = '||p_total_invoices);
2802: END IF;
2803:
2796:
2797: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2798: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,'p_previous_inv_number = '||p_previous_inv_number);
2799: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,'p_okay_to_insert_inv = '||p_okay_to_insert_inv);
2800: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,'p_total_invoice_lines = '||p_total_invoice_lines);
2801: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,'p_total_invoices(IN) = '||p_total_invoices);
2802: END IF;
2803:
2804: IF ((p_previous_inv_number IS NOT NULL) AND (p_okay_to_insert_inv = 'Y')) THEN
2797: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2798: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,'p_previous_inv_number = '||p_previous_inv_number);
2799: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,'p_okay_to_insert_inv = '||p_okay_to_insert_inv);
2800: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,'p_total_invoice_lines = '||p_total_invoice_lines);
2801: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,'p_total_invoices(IN) = '||p_total_invoices);
2802: END IF;
2803:
2804: IF ((p_previous_inv_number IS NOT NULL) AND (p_okay_to_insert_inv = 'Y')) THEN
2805: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2801: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,'p_total_invoices(IN) = '||p_total_invoices);
2802: END IF;
2803:
2804: IF ((p_previous_inv_number IS NOT NULL) AND (p_okay_to_insert_inv = 'Y')) THEN
2805: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2806: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling insert_invoice_hdr');
2807: END IF;
2808: insert_invoice_hdr
2809: (
2802: END IF;
2803:
2804: IF ((p_previous_inv_number IS NOT NULL) AND (p_okay_to_insert_inv = 'Y')) THEN
2805: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2806: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling insert_invoice_hdr');
2807: END IF;
2808: insert_invoice_hdr
2809: (
2810: p_invoice_hdr_rec => p_ap_inv_hdr_rec,
2810: p_invoice_hdr_rec => p_ap_inv_hdr_rec,
2811: p_error_code => p_error_code,
2812: p_error_desc => p_error_desc
2813: );
2814: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2815: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'insert_invoice_hdr returned');
2816: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code ='||p_error_code);
2817: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
2818: END IF;
2811: p_error_code => p_error_code,
2812: p_error_desc => p_error_desc
2813: );
2814: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2815: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'insert_invoice_hdr returned');
2816: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code ='||p_error_code);
2817: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
2818: END IF;
2819: p_total_invoices := p_total_invoices + 1;
2812: p_error_desc => p_error_desc
2813: );
2814: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2815: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'insert_invoice_hdr returned');
2816: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code ='||p_error_code);
2817: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
2818: END IF;
2819: p_total_invoices := p_total_invoices + 1;
2820: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2813: );
2814: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2815: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'insert_invoice_hdr returned');
2816: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code ='||p_error_code);
2817: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
2818: END IF;
2819: p_total_invoices := p_total_invoices + 1;
2820: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2821: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_total_invoices='||p_total_invoices);
2816: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code ='||p_error_code);
2817: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
2818: END IF;
2819: p_total_invoices := p_total_invoices + 1;
2820: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2821: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_total_invoices='||p_total_invoices);
2822: END IF;
2823: END IF;
2824:
2817: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
2818: END IF;
2819: p_total_invoices := p_total_invoices + 1;
2820: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2821: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_total_invoices='||p_total_invoices);
2822: END IF;
2823: END IF;
2824:
2825: --****************************************************************************************--
2828: IF (p_error_code = g_SUCCESS) THEN
2829: IF ((p_previous_inv_number IS NOT NULL) AND (p_okay_to_insert_inv = 'N')) THEN
2830: IF (p_total_invoice_lines > 0) THEN
2831: BEGIN
2832: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2833: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Deleting ap_invoice_lines_interface');
2834: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'invoice_id='||p_ap_inv_hdr_rec.invoice_id);
2835: END IF;
2836:
2829: IF ((p_previous_inv_number IS NOT NULL) AND (p_okay_to_insert_inv = 'N')) THEN
2830: IF (p_total_invoice_lines > 0) THEN
2831: BEGIN
2832: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2833: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Deleting ap_invoice_lines_interface');
2834: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'invoice_id='||p_ap_inv_hdr_rec.invoice_id);
2835: END IF;
2836:
2837: DELETE ap_invoice_lines_interface
2830: IF (p_total_invoice_lines > 0) THEN
2831: BEGIN
2832: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2833: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Deleting ap_invoice_lines_interface');
2834: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'invoice_id='||p_ap_inv_hdr_rec.invoice_id);
2835: END IF;
2836:
2837: DELETE ap_invoice_lines_interface
2838: WHERE invoice_id = p_ap_inv_hdr_rec.invoice_id;
2836:
2837: DELETE ap_invoice_lines_interface
2838: WHERE invoice_id = p_ap_inv_hdr_rec.invoice_id;
2839: l_rowcount := SQL%ROWCOUNT;
2840: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2841: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,'Deleted '||l_rowcount||' rows from ap_invoice_lines_interface.');
2842: END IF;
2843: EXCEPTION
2844: WHEN OTHERS THEN
2837: DELETE ap_invoice_lines_interface
2838: WHERE invoice_id = p_ap_inv_hdr_rec.invoice_id;
2839: l_rowcount := SQL%ROWCOUNT;
2840: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2841: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,'Deleted '||l_rowcount||' rows from ap_invoice_lines_interface.');
2842: END IF;
2843: EXCEPTION
2844: WHEN OTHERS THEN
2845: p_error_code := g_FAILURE;
2844: WHEN OTHERS THEN
2845: p_error_code := g_FAILURE;
2846: p_error_desc := SQLERRM;
2847: l_location := l_module_name||'delete_ap_invoice_lines_interface';
2848: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2849: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
2850: END;
2851: END IF;
2852: END IF;
2845: p_error_code := g_FAILURE;
2846: p_error_desc := SQLERRM;
2847: l_location := l_module_name||'delete_ap_invoice_lines_interface';
2848: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2849: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
2850: END;
2851: END IF;
2852: END IF;
2853: END IF;
2851: END IF;
2852: END IF;
2853: END IF;
2854:
2855: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2856: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,'p_total_invoices(OUT) = '||p_total_invoices);
2857: END IF;
2858: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2859: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
2852: END IF;
2853: END IF;
2854:
2855: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2856: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,'p_total_invoices(OUT) = '||p_total_invoices);
2857: END IF;
2858: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2859: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
2860: END IF;
2854:
2855: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2856: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,'p_total_invoices(OUT) = '||p_total_invoices);
2857: END IF;
2858: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2859: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
2860: END IF;
2861: EXCEPTION
2862: WHEN OTHERS THEN
2855: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2856: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,'p_total_invoices(OUT) = '||p_total_invoices);
2857: END IF;
2858: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2859: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
2860: END IF;
2861: EXCEPTION
2862: WHEN OTHERS THEN
2863: p_error_code := g_FAILURE;
2862: WHEN OTHERS THEN
2863: p_error_code := g_FAILURE;
2864: p_error_desc := SQLERRM;
2865: l_location := l_module_name||'.final_exception';
2866: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2867: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
2868: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2869: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
2870: END IF;
2863: p_error_code := g_FAILURE;
2864: p_error_desc := SQLERRM;
2865: l_location := l_module_name||'.final_exception';
2866: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2867: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
2868: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2869: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
2870: END IF;
2871: END;
2864: p_error_desc := SQLERRM;
2865: l_location := l_module_name||'.final_exception';
2866: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2867: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
2868: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2869: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
2870: END IF;
2871: END;
2872:
2865: l_location := l_module_name||'.final_exception';
2866: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2867: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
2868: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2869: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
2870: END IF;
2871: END;
2872:
2873: --****************************************************************************************--
2885: --* Global Vars : g_module_name READ *--
2886: --* : g_SUCCESS READ *--
2887: --* : g_WARNING READ *--
2888: --* : g_ERROR READ *--
2889: --* : fnd_log.level_statement READ *--
2890: --* : fnd_log.g_current_runtime_level READ *--
2891: --* : fnd_log.level_unexpected READ *--
2892: --* : fnd_log.level_procedure READ *--
2893: --* : g_enter READ *--
2886: --* : g_SUCCESS READ *--
2887: --* : g_WARNING READ *--
2888: --* : g_ERROR READ *--
2889: --* : fnd_log.level_statement READ *--
2890: --* : fnd_log.g_current_runtime_level READ *--
2891: --* : fnd_log.level_unexpected READ *--
2892: --* : fnd_log.level_procedure READ *--
2893: --* : g_enter READ *--
2894: --* : g_exit READ *--
2887: --* : g_WARNING READ *--
2888: --* : g_ERROR READ *--
2889: --* : fnd_log.level_statement READ *--
2890: --* : fnd_log.g_current_runtime_level READ *--
2891: --* : fnd_log.level_unexpected READ *--
2892: --* : fnd_log.level_procedure READ *--
2893: --* : g_enter READ *--
2894: --* : g_exit READ *--
2895: --* Called from : main *--
2888: --* : g_ERROR READ *--
2889: --* : fnd_log.level_statement READ *--
2890: --* : fnd_log.g_current_runtime_level READ *--
2891: --* : fnd_log.level_unexpected READ *--
2892: --* : fnd_log.level_procedure READ *--
2893: --* : g_enter READ *--
2894: --* : g_exit READ *--
2895: --* Called from : main *--
2896: --* Calls : save_or_erase_invoice *--
2950: l_ok_to_insert_inv := 'Y';
2951: l_current_inv_lines := 0;
2952: l_no_of_invoices_inserted := 0;
2953:
2954: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2955: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
2956: END IF;
2957:
2958: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2951: l_current_inv_lines := 0;
2952: l_no_of_invoices_inserted := 0;
2953:
2954: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2955: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
2956: END IF;
2957:
2958: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2959: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_data_file_name = '||p_data_file_name);
2954: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
2955: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
2956: END IF;
2957:
2958: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2959: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_data_file_name = '||p_data_file_name);
2960: -- fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_transaction_code = '||p_transaction_code);
2961: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_agency_location_code = '||p_agency_location_code);
2962: END IF;
2955: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
2956: END IF;
2957:
2958: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2959: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_data_file_name = '||p_data_file_name);
2960: -- fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_transaction_code = '||p_transaction_code);
2961: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_agency_location_code = '||p_agency_location_code);
2962: END IF;
2963:
2956: END IF;
2957:
2958: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2959: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_data_file_name = '||p_data_file_name);
2960: -- fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_transaction_code = '||p_transaction_code);
2961: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_agency_location_code = '||p_agency_location_code);
2962: END IF;
2963:
2964: IF (p_error_code = g_SUCCESS) THEN
2957:
2958: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2959: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_data_file_name = '||p_data_file_name);
2960: -- fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_transaction_code = '||p_transaction_code);
2961: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_agency_location_code = '||p_agency_location_code);
2962: END IF;
2963:
2964: IF (p_error_code = g_SUCCESS) THEN
2965: --****************************************************************************************--
2965: --****************************************************************************************--
2966: --* Pre process the data to get a group_id handle on the data and to update the who *--
2967: --* who columns *--
2968: --****************************************************************************************--
2969: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2970: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling pre_process_data');
2971: END IF;
2972: pre_process_data
2973: (
2966: --* Pre process the data to get a group_id handle on the data and to update the who *--
2967: --* who columns *--
2968: --****************************************************************************************--
2969: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2970: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling pre_process_data');
2971: END IF;
2972: pre_process_data
2973: (
2974: p_data_file_name => p_data_file_name,
2977: p_group_id => p_group_id,
2978: p_error_code => p_error_code,
2979: p_error_desc => p_error_desc
2980: );
2981: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2982: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'pre_process_data returned');
2983: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code ='||p_error_code);
2984: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
2985: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_group_id ='||p_group_id);
2978: p_error_code => p_error_code,
2979: p_error_desc => p_error_desc
2980: );
2981: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2982: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'pre_process_data returned');
2983: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code ='||p_error_code);
2984: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
2985: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_group_id ='||p_group_id);
2986: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_batch_name ='||p_batch_name);
2979: p_error_desc => p_error_desc
2980: );
2981: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2982: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'pre_process_data returned');
2983: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code ='||p_error_code);
2984: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
2985: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_group_id ='||p_group_id);
2986: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_batch_name ='||p_batch_name);
2987: END IF;
2980: );
2981: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2982: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'pre_process_data returned');
2983: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code ='||p_error_code);
2984: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
2985: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_group_id ='||p_group_id);
2986: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_batch_name ='||p_batch_name);
2987: END IF;
2988: END IF;
2981: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
2982: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'pre_process_data returned');
2983: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code ='||p_error_code);
2984: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
2985: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_group_id ='||p_group_id);
2986: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_batch_name ='||p_batch_name);
2987: END IF;
2988: END IF;
2989:
2982: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'pre_process_data returned');
2983: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code ='||p_error_code);
2984: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
2985: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_group_id ='||p_group_id);
2986: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_batch_name ='||p_batch_name);
2987: END IF;
2988: END IF;
2989:
2990: IF (p_error_code = g_SUCCESS) THEN
3018: --****************************************************************************************--
3019: FOR ipac_import_record IN ipac_import_cursor (p_group_id) LOOP
3020: l_ipac_import_record := ipac_import_record;
3021: l_ipac_import_record.record_status := g_status_no_process;
3022: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3023: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Processing Invoice = '||l_ipac_import_record.invoice_number);
3024: END IF;
3025:
3026: IF (p_error_code = g_SUCCESS) THEN
3019: FOR ipac_import_record IN ipac_import_cursor (p_group_id) LOOP
3020: l_ipac_import_record := ipac_import_record;
3021: l_ipac_import_record.record_status := g_status_no_process;
3022: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3023: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Processing Invoice = '||l_ipac_import_record.invoice_number);
3024: END IF;
3025:
3026: IF (p_error_code = g_SUCCESS) THEN
3027:
3031: --* determined. Once the invoice number changes, the old invoice header has to be *--
3032: --* written to the database. *--
3033: --****************************************************************************************--
3034:
3035: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3036: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_save_invoice_number='||l_save_invoice_number);
3037: END IF;
3038: IF ((l_save_invoice_number IS NULL) OR
3039: (l_save_invoice_number <> l_ipac_import_record.invoice_number)) THEN
3032: --* written to the database. *--
3033: --****************************************************************************************--
3034:
3035: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3036: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_save_invoice_number='||l_save_invoice_number);
3037: END IF;
3038: IF ((l_save_invoice_number IS NULL) OR
3039: (l_save_invoice_number <> l_ipac_import_record.invoice_number)) THEN
3040:
3041: --****************************************************************************************--
3042: --* Write the invoice header or delete invoice lines depending on the flag *--
3043: --* l_ok_to_insert_inv *--
3044: --****************************************************************************************--
3045: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3046: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling save_or_erase_invoice');
3047: END IF;
3048: save_or_erase_invoice
3049: (
3042: --* Write the invoice header or delete invoice lines depending on the flag *--
3043: --* l_ok_to_insert_inv *--
3044: --****************************************************************************************--
3045: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3046: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling save_or_erase_invoice');
3047: END IF;
3048: save_or_erase_invoice
3049: (
3050: p_ap_inv_hdr_rec => l_inv_hdrs_interface_rec,
3054: p_total_invoices => l_no_of_invoices_inserted,
3055: p_error_code => p_error_code,
3056: p_error_desc => p_error_desc
3057: );
3058: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3059: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling save_or_erase_invoice returned');
3060: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code ='||p_error_code);
3061: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
3062: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_no_of_invoices_inserted ='||l_no_of_invoices_inserted);
3055: p_error_code => p_error_code,
3056: p_error_desc => p_error_desc
3057: );
3058: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3059: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling save_or_erase_invoice returned');
3060: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code ='||p_error_code);
3061: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
3062: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_no_of_invoices_inserted ='||l_no_of_invoices_inserted);
3063: END IF;
3056: p_error_desc => p_error_desc
3057: );
3058: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3059: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling save_or_erase_invoice returned');
3060: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code ='||p_error_code);
3061: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
3062: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_no_of_invoices_inserted ='||l_no_of_invoices_inserted);
3063: END IF;
3064:
3057: );
3058: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3059: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling save_or_erase_invoice returned');
3060: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code ='||p_error_code);
3061: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
3062: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_no_of_invoices_inserted ='||l_no_of_invoices_inserted);
3063: END IF;
3064:
3065: --****************************************************************************************--
3058: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3059: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling save_or_erase_invoice returned');
3060: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code ='||p_error_code);
3061: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
3062: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_no_of_invoices_inserted ='||l_no_of_invoices_inserted);
3063: END IF;
3064:
3065: --****************************************************************************************--
3066: --* Initialize all variables for processing a new invoice header *--
3083: --****************************************************************************************--
3084: SELECT ap_invoices_interface_s.NEXTVAL
3085: INTO l_inv_hdrs_interface_rec.invoice_id
3086: FROM DUAL;
3087: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3088: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'invoice_id ='||l_inv_hdrs_interface_rec.invoice_id);
3089: END IF;
3090: EXCEPTION
3091: WHEN OTHERS THEN
3084: SELECT ap_invoices_interface_s.NEXTVAL
3085: INTO l_inv_hdrs_interface_rec.invoice_id
3086: FROM DUAL;
3087: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3088: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'invoice_id ='||l_inv_hdrs_interface_rec.invoice_id);
3089: END IF;
3090: EXCEPTION
3091: WHEN OTHERS THEN
3092: p_error_code := g_FAILURE;
3091: WHEN OTHERS THEN
3092: p_error_code := g_FAILURE;
3093: p_error_desc := SQLERRM;
3094: l_location := l_module_name||'select_ap_invoices_interface_s';
3095: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
3096: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
3097: END;
3098: END IF;
3099: END IF;
3092: p_error_code := g_FAILURE;
3093: p_error_desc := SQLERRM;
3094: l_location := l_module_name||'select_ap_invoices_interface_s';
3095: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
3096: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
3097: END;
3098: END IF;
3099: END IF;
3100: END IF;
3131: --* po_header_id, po_line_id, po_number, po_line_number, vendor_id and vendor_site_id *--
3132: --* back to l_ipac_import_record and l_inv_lines_interface_rec *--
3133: --****************************************************************************************--
3134: IF (p_error_code = g_SUCCESS) THEN
3135: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3136: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling validate_po');
3137: END IF;
3138: validate_po
3139: (
3132: --* back to l_ipac_import_record and l_inv_lines_interface_rec *--
3133: --****************************************************************************************--
3134: IF (p_error_code = g_SUCCESS) THEN
3135: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3136: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling validate_po');
3137: END IF;
3138: validate_po
3139: (
3140: p_ipac_import_rec => l_ipac_import_record,
3141: p_ap_inv_lines_rec => l_inv_lines_interface_rec,
3142: p_error_code => p_error_code,
3143: p_error_desc => p_error_desc
3144: );
3145: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3146: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling validate_po returned');
3147: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code ='||p_error_code);
3148: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
3149: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'record_status ='||l_ipac_import_record.record_status);
3142: p_error_code => p_error_code,
3143: p_error_desc => p_error_desc
3144: );
3145: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3146: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling validate_po returned');
3147: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code ='||p_error_code);
3148: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
3149: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'record_status ='||l_ipac_import_record.record_status);
3150: END IF;
3143: p_error_desc => p_error_desc
3144: );
3145: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3146: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling validate_po returned');
3147: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code ='||p_error_code);
3148: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
3149: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'record_status ='||l_ipac_import_record.record_status);
3150: END IF;
3151: END IF;
3144: );
3145: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3146: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling validate_po returned');
3147: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code ='||p_error_code);
3148: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
3149: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'record_status ='||l_ipac_import_record.record_status);
3150: END IF;
3151: END IF;
3152:
3145: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3146: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling validate_po returned');
3147: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code ='||p_error_code);
3148: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
3149: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'record_status ='||l_ipac_import_record.record_status);
3150: END IF;
3151: END IF;
3152:
3153: --****************************************************************************************--
3158: --****************************************************************************************--
3159: IF (p_error_code = g_SUCCESS) THEN
3160: IF (l_ipac_import_record.record_status IN (g_status_error, g_status_processed)) THEN
3161: l_ok_to_insert_inv := 'N';
3162: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3163: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Going to FINISHED_PROCESS');
3164: END IF;
3165: GOTO FINISHED_PROCESS;
3166: END IF;
3159: IF (p_error_code = g_SUCCESS) THEN
3160: IF (l_ipac_import_record.record_status IN (g_status_error, g_status_processed)) THEN
3161: l_ok_to_insert_inv := 'N';
3162: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3163: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Going to FINISHED_PROCESS');
3164: END IF;
3165: GOTO FINISHED_PROCESS;
3166: END IF;
3167:
3178: --****************************************************************************************--
3179: --* Validate the receiver DUNS and DUNS+4 information. *--
3180: --****************************************************************************************--
3181: IF (p_error_code = g_SUCCESS) THEN
3182: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3183: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling validate_duns');
3184: END IF;
3185: validate_duns
3186: (
3179: --* Validate the receiver DUNS and DUNS+4 information. *--
3180: --****************************************************************************************--
3181: IF (p_error_code = g_SUCCESS) THEN
3182: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3183: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling validate_duns');
3184: END IF;
3185: validate_duns
3186: (
3187: p_ipac_import_rec => l_ipac_import_record,
3187: p_ipac_import_rec => l_ipac_import_record,
3188: p_error_code => p_error_code,
3189: p_error_desc => p_error_desc
3190: );
3191: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3192: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling validate_duns returned');
3193: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code ='||p_error_code);
3194: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
3195: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'record_status ='||l_ipac_import_record.record_status);
3188: p_error_code => p_error_code,
3189: p_error_desc => p_error_desc
3190: );
3191: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3192: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling validate_duns returned');
3193: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code ='||p_error_code);
3194: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
3195: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'record_status ='||l_ipac_import_record.record_status);
3196: END IF;
3189: p_error_desc => p_error_desc
3190: );
3191: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3192: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling validate_duns returned');
3193: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code ='||p_error_code);
3194: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
3195: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'record_status ='||l_ipac_import_record.record_status);
3196: END IF;
3197: END IF;
3190: );
3191: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3192: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling validate_duns returned');
3193: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code ='||p_error_code);
3194: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
3195: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'record_status ='||l_ipac_import_record.record_status);
3196: END IF;
3197: END IF;
3198:
3191: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3192: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling validate_duns returned');
3193: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code ='||p_error_code);
3194: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
3195: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'record_status ='||l_ipac_import_record.record_status);
3196: END IF;
3197: END IF;
3198:
3199: --****************************************************************************************--
3202: --****************************************************************************************--
3203: IF (p_error_code = g_SUCCESS) THEN
3204: IF (l_ipac_import_record.record_status = g_status_error) THEN
3205: l_ok_to_insert_inv := 'N';
3206: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3207: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Going to FINISHED_PROCESS');
3208: END IF;
3209: GOTO FINISHED_PROCESS;
3210: END IF;
3203: IF (p_error_code = g_SUCCESS) THEN
3204: IF (l_ipac_import_record.record_status = g_status_error) THEN
3205: l_ok_to_insert_inv := 'N';
3206: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3207: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Going to FINISHED_PROCESS');
3208: END IF;
3209: GOTO FINISHED_PROCESS;
3210: END IF;
3211: END IF;
3216: --* But the invoice lines interface requires unit_of_measure and not uom *--
3217: --* Also make sure that the PO UOM is same as File UOM *--
3218: --****************************************************************************************--
3219: IF (p_error_code = g_SUCCESS AND l_ok_to_insert_inv = 'Y') THEN
3220: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3221: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling resolve_uom');
3222: END IF;
3223: resolve_uom
3224: (
3217: --* Also make sure that the PO UOM is same as File UOM *--
3218: --****************************************************************************************--
3219: IF (p_error_code = g_SUCCESS AND l_ok_to_insert_inv = 'Y') THEN
3220: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3221: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling resolve_uom');
3222: END IF;
3223: resolve_uom
3224: (
3225: p_ipac_import_id => l_ipac_import_record.ipac_import_id,
3228: p_record_status => l_ipac_import_record.record_status,
3229: p_error_code => p_error_code,
3230: p_error_desc => p_error_desc
3231: );
3232: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3233: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling resolve_uom returned');
3234: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code ='||p_error_code);
3235: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
3236: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_unit_of_measure ='||l_inv_lines_interface_rec.po_unit_of_measure);
3229: p_error_code => p_error_code,
3230: p_error_desc => p_error_desc
3231: );
3232: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3233: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling resolve_uom returned');
3234: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code ='||p_error_code);
3235: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
3236: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_unit_of_measure ='||l_inv_lines_interface_rec.po_unit_of_measure);
3237: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'record_status ='||l_ipac_import_record.record_status);
3230: p_error_desc => p_error_desc
3231: );
3232: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3233: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling resolve_uom returned');
3234: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code ='||p_error_code);
3235: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
3236: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_unit_of_measure ='||l_inv_lines_interface_rec.po_unit_of_measure);
3237: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'record_status ='||l_ipac_import_record.record_status);
3238: END IF;
3231: );
3232: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3233: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling resolve_uom returned');
3234: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code ='||p_error_code);
3235: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
3236: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_unit_of_measure ='||l_inv_lines_interface_rec.po_unit_of_measure);
3237: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'record_status ='||l_ipac_import_record.record_status);
3238: END IF;
3239: END IF;
3232: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3233: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling resolve_uom returned');
3234: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code ='||p_error_code);
3235: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
3236: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_unit_of_measure ='||l_inv_lines_interface_rec.po_unit_of_measure);
3237: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'record_status ='||l_ipac_import_record.record_status);
3238: END IF;
3239: END IF;
3240:
3233: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling resolve_uom returned');
3234: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code ='||p_error_code);
3235: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
3236: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_unit_of_measure ='||l_inv_lines_interface_rec.po_unit_of_measure);
3237: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'record_status ='||l_ipac_import_record.record_status);
3238: END IF;
3239: END IF;
3240:
3241: IF (p_error_code = g_SUCCESS) THEN
3240:
3241: IF (p_error_code = g_SUCCESS) THEN
3242: IF (l_ipac_import_record.record_status = g_status_error) THEN
3243: l_ok_to_insert_inv := 'N';
3244: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3245: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Going to FINISHED_PROCESS');
3246: END IF;
3247: GOTO FINISHED_PROCESS;
3248: END IF;
3241: IF (p_error_code = g_SUCCESS) THEN
3242: IF (l_ipac_import_record.record_status = g_status_error) THEN
3243: l_ok_to_insert_inv := 'N';
3244: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3245: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Going to FINISHED_PROCESS');
3246: END IF;
3247: GOTO FINISHED_PROCESS;
3248: END IF;
3249: END IF;
3253: --* Remember we haven't inserted the header record unitl now. This happens when the *--
3254: --* invoice number changes. *--
3255: --****************************************************************************************--
3256: IF (p_error_code = g_SUCCESS AND l_ok_to_insert_inv = 'Y') THEN
3257: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3258: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling insert_invoice_line');
3259: END IF;
3260: insert_invoice_line
3261: (
3254: --* invoice number changes. *--
3255: --****************************************************************************************--
3256: IF (p_error_code = g_SUCCESS AND l_ok_to_insert_inv = 'Y') THEN
3257: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3258: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling insert_invoice_line');
3259: END IF;
3260: insert_invoice_line
3261: (
3262: p_invoice_lines_rec => l_inv_lines_interface_rec,
3262: p_invoice_lines_rec => l_inv_lines_interface_rec,
3263: p_error_code => p_error_code,
3264: p_error_desc => p_error_desc
3265: );
3266: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3267: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling insert_invoice_line returned');
3268: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code ='||p_error_code);
3269: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
3270: END IF;
3263: p_error_code => p_error_code,
3264: p_error_desc => p_error_desc
3265: );
3266: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3267: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling insert_invoice_line returned');
3268: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code ='||p_error_code);
3269: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
3270: END IF;
3271: l_current_inv_lines := l_current_inv_lines + 1;
3264: p_error_desc => p_error_desc
3265: );
3266: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3267: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling insert_invoice_line returned');
3268: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code ='||p_error_code);
3269: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
3270: END IF;
3271: l_current_inv_lines := l_current_inv_lines + 1;
3272: l_ipac_import_record.record_status := g_status_processed;
3265: );
3266: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3267: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling insert_invoice_line returned');
3268: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code ='||p_error_code);
3269: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
3270: END IF;
3271: l_current_inv_lines := l_current_inv_lines + 1;
3272: l_ipac_import_record.record_status := g_status_processed;
3273: ELSE
3276:
3277: <
3278: IF (p_error_code = g_SUCCESS) THEN
3279: BEGIN
3280: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3281: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Updating fv_ipac_import');
3282: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'record_status='||l_ipac_import_record.record_status);
3283: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'invoice_id='||l_ipac_import_record.invoice_id);
3284: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'invoice_line_id='||l_ipac_import_record.invoice_line_id);
3277: <
3278: IF (p_error_code = g_SUCCESS) THEN
3279: BEGIN
3280: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3281: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Updating fv_ipac_import');
3282: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'record_status='||l_ipac_import_record.record_status);
3283: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'invoice_id='||l_ipac_import_record.invoice_id);
3284: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'invoice_line_id='||l_ipac_import_record.invoice_line_id);
3285: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'actual_po_number='||l_ipac_import_record.actual_po_number);
3278: IF (p_error_code = g_SUCCESS) THEN
3279: BEGIN
3280: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3281: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Updating fv_ipac_import');
3282: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'record_status='||l_ipac_import_record.record_status);
3283: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'invoice_id='||l_ipac_import_record.invoice_id);
3284: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'invoice_line_id='||l_ipac_import_record.invoice_line_id);
3285: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'actual_po_number='||l_ipac_import_record.actual_po_number);
3286: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'actual_po_line_number='||l_ipac_import_record.actual_po_line_number);
3279: BEGIN
3280: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3281: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Updating fv_ipac_import');
3282: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'record_status='||l_ipac_import_record.record_status);
3283: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'invoice_id='||l_ipac_import_record.invoice_id);
3284: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'invoice_line_id='||l_ipac_import_record.invoice_line_id);
3285: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'actual_po_number='||l_ipac_import_record.actual_po_number);
3286: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'actual_po_line_number='||l_ipac_import_record.actual_po_line_number);
3287: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'vendor_id='||l_ipac_import_record.vendor_id);
3280: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3281: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Updating fv_ipac_import');
3282: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'record_status='||l_ipac_import_record.record_status);
3283: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'invoice_id='||l_ipac_import_record.invoice_id);
3284: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'invoice_line_id='||l_ipac_import_record.invoice_line_id);
3285: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'actual_po_number='||l_ipac_import_record.actual_po_number);
3286: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'actual_po_line_number='||l_ipac_import_record.actual_po_line_number);
3287: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'vendor_id='||l_ipac_import_record.vendor_id);
3288: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'vendor_site_id='||l_ipac_import_record.vendor_site_id);
3281: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Updating fv_ipac_import');
3282: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'record_status='||l_ipac_import_record.record_status);
3283: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'invoice_id='||l_ipac_import_record.invoice_id);
3284: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'invoice_line_id='||l_ipac_import_record.invoice_line_id);
3285: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'actual_po_number='||l_ipac_import_record.actual_po_number);
3286: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'actual_po_line_number='||l_ipac_import_record.actual_po_line_number);
3287: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'vendor_id='||l_ipac_import_record.vendor_id);
3288: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'vendor_site_id='||l_ipac_import_record.vendor_site_id);
3289: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'ipac_import_id='||l_ipac_import_record.ipac_import_id);
3282: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'record_status='||l_ipac_import_record.record_status);
3283: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'invoice_id='||l_ipac_import_record.invoice_id);
3284: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'invoice_line_id='||l_ipac_import_record.invoice_line_id);
3285: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'actual_po_number='||l_ipac_import_record.actual_po_number);
3286: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'actual_po_line_number='||l_ipac_import_record.actual_po_line_number);
3287: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'vendor_id='||l_ipac_import_record.vendor_id);
3288: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'vendor_site_id='||l_ipac_import_record.vendor_site_id);
3289: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'ipac_import_id='||l_ipac_import_record.ipac_import_id);
3290: END IF;
3283: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'invoice_id='||l_ipac_import_record.invoice_id);
3284: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'invoice_line_id='||l_ipac_import_record.invoice_line_id);
3285: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'actual_po_number='||l_ipac_import_record.actual_po_number);
3286: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'actual_po_line_number='||l_ipac_import_record.actual_po_line_number);
3287: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'vendor_id='||l_ipac_import_record.vendor_id);
3288: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'vendor_site_id='||l_ipac_import_record.vendor_site_id);
3289: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'ipac_import_id='||l_ipac_import_record.ipac_import_id);
3290: END IF;
3291: UPDATE fv_ipac_import fii
3284: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'invoice_line_id='||l_ipac_import_record.invoice_line_id);
3285: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'actual_po_number='||l_ipac_import_record.actual_po_number);
3286: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'actual_po_line_number='||l_ipac_import_record.actual_po_line_number);
3287: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'vendor_id='||l_ipac_import_record.vendor_id);
3288: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'vendor_site_id='||l_ipac_import_record.vendor_site_id);
3289: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'ipac_import_id='||l_ipac_import_record.ipac_import_id);
3290: END IF;
3291: UPDATE fv_ipac_import fii
3292: SET record_status = l_ipac_import_record.record_status,
3285: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'actual_po_number='||l_ipac_import_record.actual_po_number);
3286: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'actual_po_line_number='||l_ipac_import_record.actual_po_line_number);
3287: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'vendor_id='||l_ipac_import_record.vendor_id);
3288: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'vendor_site_id='||l_ipac_import_record.vendor_site_id);
3289: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'ipac_import_id='||l_ipac_import_record.ipac_import_id);
3290: END IF;
3291: UPDATE fv_ipac_import fii
3292: SET record_status = l_ipac_import_record.record_status,
3293: invoice_id = l_ipac_import_record.invoice_id,
3298: vendor_id = l_inv_hdrs_interface_rec.vendor_id,
3299: vendor_site_id = l_inv_hdrs_interface_rec.vendor_site_id
3300: WHERE fii.ipac_import_id = l_ipac_import_record.ipac_import_id;
3301: l_rowcount := SQL%ROWCOUNT;
3302: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3303: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,'Updated '||l_rowcount||' rows in fv_ipac_import.');
3304: END IF;
3305: EXCEPTION
3306: WHEN OTHERS THEN
3299: vendor_site_id = l_inv_hdrs_interface_rec.vendor_site_id
3300: WHERE fii.ipac_import_id = l_ipac_import_record.ipac_import_id;
3301: l_rowcount := SQL%ROWCOUNT;
3302: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3303: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,'Updated '||l_rowcount||' rows in fv_ipac_import.');
3304: END IF;
3305: EXCEPTION
3306: WHEN OTHERS THEN
3307: p_error_code := g_FAILURE;
3306: WHEN OTHERS THEN
3307: p_error_code := g_FAILURE;
3308: p_error_desc := SQLERRM;
3309: l_location := l_module_name||'update_fv_ipac_import';
3310: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
3311: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
3312: END;
3313: END IF;
3314:
3307: p_error_code := g_FAILURE;
3308: p_error_desc := SQLERRM;
3309: l_location := l_module_name||'update_fv_ipac_import';
3310: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
3311: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
3312: END;
3313: END IF;
3314:
3315: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3311: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
3312: END;
3313: END IF;
3314:
3315: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3316: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,'p_error_code1='||p_error_code);
3317: END IF;
3318: IF (p_error_code <> g_SUCCESS) THEN
3319: EXIT;
3312: END;
3313: END IF;
3314:
3315: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3316: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,'p_error_code1='||p_error_code);
3317: END IF;
3318: IF (p_error_code <> g_SUCCESS) THEN
3319: EXIT;
3320: END IF;
3322: END LOOP;
3323:
3324: --Insert the last invoice too.
3325: IF (p_error_code = g_SUCCESS) THEN
3326: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3327: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling save_or_erase_invoice1');
3328: END IF;
3329: save_or_erase_invoice
3330: (
3323:
3324: --Insert the last invoice too.
3325: IF (p_error_code = g_SUCCESS) THEN
3326: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3327: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling save_or_erase_invoice1');
3328: END IF;
3329: save_or_erase_invoice
3330: (
3331: p_ap_inv_hdr_rec => l_inv_hdrs_interface_rec,
3335: p_total_invoices => l_no_of_invoices_inserted,
3336: p_error_code => p_error_code,
3337: p_error_desc => p_error_desc
3338: );
3339: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3340: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling save_or_erase_invoice returned');
3341: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code ='||p_error_code);
3342: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
3343: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_no_of_invoices_inserted ='||l_no_of_invoices_inserted);
3336: p_error_code => p_error_code,
3337: p_error_desc => p_error_desc
3338: );
3339: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3340: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling save_or_erase_invoice returned');
3341: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code ='||p_error_code);
3342: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
3343: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_no_of_invoices_inserted ='||l_no_of_invoices_inserted);
3344: END IF;
3337: p_error_desc => p_error_desc
3338: );
3339: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3340: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling save_or_erase_invoice returned');
3341: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code ='||p_error_code);
3342: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
3343: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_no_of_invoices_inserted ='||l_no_of_invoices_inserted);
3344: END IF;
3345: END IF;
3338: );
3339: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3340: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling save_or_erase_invoice returned');
3341: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code ='||p_error_code);
3342: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
3343: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_no_of_invoices_inserted ='||l_no_of_invoices_inserted);
3344: END IF;
3345: END IF;
3346: END IF;
3339: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3340: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling save_or_erase_invoice returned');
3341: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code ='||p_error_code);
3342: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc ='||p_error_desc);
3343: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_no_of_invoices_inserted ='||l_no_of_invoices_inserted);
3344: END IF;
3345: END IF;
3346: END IF;
3347:
3348: IF (l_no_of_invoices_inserted > 0) THEN
3349: p_ok_to_import := 'Y';
3350: END IF;
3351:
3352: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3353: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_batch_name='||p_batch_name);
3354: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_group_id='||p_group_id);
3355: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_ok_to_import='||p_ok_to_import);
3356: END IF;
3349: p_ok_to_import := 'Y';
3350: END IF;
3351:
3352: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3353: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_batch_name='||p_batch_name);
3354: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_group_id='||p_group_id);
3355: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_ok_to_import='||p_ok_to_import);
3356: END IF;
3357:
3350: END IF;
3351:
3352: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3353: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_batch_name='||p_batch_name);
3354: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_group_id='||p_group_id);
3355: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_ok_to_import='||p_ok_to_import);
3356: END IF;
3357:
3358: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3351:
3352: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3353: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_batch_name='||p_batch_name);
3354: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_group_id='||p_group_id);
3355: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_ok_to_import='||p_ok_to_import);
3356: END IF;
3357:
3358: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3359: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
3354: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_group_id='||p_group_id);
3355: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_ok_to_import='||p_ok_to_import);
3356: END IF;
3357:
3358: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3359: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
3360: END IF;
3361:
3362: EXCEPTION
3355: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_ok_to_import='||p_ok_to_import);
3356: END IF;
3357:
3358: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3359: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
3360: END IF;
3361:
3362: EXCEPTION
3363: WHEN OTHERS THEN
3363: WHEN OTHERS THEN
3364: p_error_code := g_FAILURE;
3365: p_error_desc := SQLERRM;
3366: l_location := l_module_name||'.final_exception';
3367: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
3368: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
3369: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3370: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
3371: END IF;
3364: p_error_code := g_FAILURE;
3365: p_error_desc := SQLERRM;
3366: l_location := l_module_name||'.final_exception';
3367: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
3368: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
3369: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3370: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
3371: END IF;
3372: END;
3365: p_error_desc := SQLERRM;
3366: l_location := l_module_name||'.final_exception';
3367: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
3368: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
3369: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3370: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
3371: END IF;
3372: END;
3373:
3366: l_location := l_module_name||'.final_exception';
3367: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
3368: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
3369: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3370: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
3371: END IF;
3372: END;
3373:
3374: --****************************************************************************************--
3379: --* : p_retcode Return Code to concurrent process *--
3380: --* Global Vars : g_module_name READ *--
3381: --* : g_SUCCESS READ *--
3382: --* : g_ERROR READ *--
3383: --* : fnd_log.level_statement READ *--
3384: --* : fnd_log.g_current_runtime_level READ *--
3385: --* : fnd_log.level_unexpected READ *--
3386: --* : fnd_log.level_procedure READ *--
3387: --* : g_enter READ *--
3380: --* Global Vars : g_module_name READ *--
3381: --* : g_SUCCESS READ *--
3382: --* : g_ERROR READ *--
3383: --* : fnd_log.level_statement READ *--
3384: --* : fnd_log.g_current_runtime_level READ *--
3385: --* : fnd_log.level_unexpected READ *--
3386: --* : fnd_log.level_procedure READ *--
3387: --* : g_enter READ *--
3388: --* : g_exit READ *--
3381: --* : g_SUCCESS READ *--
3382: --* : g_ERROR READ *--
3383: --* : fnd_log.level_statement READ *--
3384: --* : fnd_log.g_current_runtime_level READ *--
3385: --* : fnd_log.level_unexpected READ *--
3386: --* : fnd_log.level_procedure READ *--
3387: --* : g_enter READ *--
3388: --* : g_exit READ *--
3389: --* Called from : load_data_file *--
3382: --* : g_ERROR READ *--
3383: --* : fnd_log.level_statement READ *--
3384: --* : fnd_log.g_current_runtime_level READ *--
3385: --* : fnd_log.level_unexpected READ *--
3386: --* : fnd_log.level_procedure READ *--
3387: --* : g_enter READ *--
3388: --* : g_exit READ *--
3389: --* Called from : load_data_file *--
3390: --* Calls : fv_utility.debug_mesg *--
3403: l_rowcount NUMBER;
3404: BEGIN
3405: l_module_name := g_module_name || 'cleanup_previous_failed_run';
3406: p_error_code := g_SUCCESS;
3407: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3408: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
3409: END IF;
3410:
3411: BEGIN
3404: BEGIN
3405: l_module_name := g_module_name || 'cleanup_previous_failed_run';
3406: p_error_code := g_SUCCESS;
3407: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3408: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
3409: END IF;
3410:
3411: BEGIN
3412: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3408: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
3409: END IF;
3410:
3411: BEGIN
3412: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3413: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Deleting fv_ipac_import');
3414: END IF;
3415: DELETE fv_ipac_import
3416: WHERE record_status = 'IMPORTED';
3409: END IF;
3410:
3411: BEGIN
3412: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3413: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Deleting fv_ipac_import');
3414: END IF;
3415: DELETE fv_ipac_import
3416: WHERE record_status = 'IMPORTED';
3417: l_rowcount := SQL%ROWCOUNT;
3414: END IF;
3415: DELETE fv_ipac_import
3416: WHERE record_status = 'IMPORTED';
3417: l_rowcount := SQL%ROWCOUNT;
3418: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3419: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,'Deleted '||l_rowcount||' rows from fv_ipac_import.');
3420: END IF;
3421: EXCEPTION
3422: WHEN OTHERS THEN
3415: DELETE fv_ipac_import
3416: WHERE record_status = 'IMPORTED';
3417: l_rowcount := SQL%ROWCOUNT;
3418: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3419: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,'Deleted '||l_rowcount||' rows from fv_ipac_import.');
3420: END IF;
3421: EXCEPTION
3422: WHEN OTHERS THEN
3423: p_error_code := g_FAILURE;
3422: WHEN OTHERS THEN
3423: p_error_code := g_FAILURE;
3424: p_error_desc := SQLERRM;
3425: l_location := l_module_name||'.delete_fv_ipac_import';
3426: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
3427: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
3428: END;
3429: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3430: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
3423: p_error_code := g_FAILURE;
3424: p_error_desc := SQLERRM;
3425: l_location := l_module_name||'.delete_fv_ipac_import';
3426: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
3427: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
3428: END;
3429: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3430: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
3431: END IF;
3425: l_location := l_module_name||'.delete_fv_ipac_import';
3426: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
3427: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
3428: END;
3429: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3430: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
3431: END IF;
3432:
3433: EXCEPTION
3426: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
3427: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
3428: END;
3429: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3430: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
3431: END IF;
3432:
3433: EXCEPTION
3434: WHEN OTHERS THEN
3434: WHEN OTHERS THEN
3435: p_error_code := g_FAILURE;
3436: p_error_desc := SQLERRM;
3437: l_location := l_module_name||'.final_exception';
3438: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
3439: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
3440: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3441: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
3442: END IF;
3435: p_error_code := g_FAILURE;
3436: p_error_desc := SQLERRM;
3437: l_location := l_module_name||'.final_exception';
3438: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
3439: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
3440: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3441: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
3442: END IF;
3443: END;
3436: p_error_desc := SQLERRM;
3437: l_location := l_module_name||'.final_exception';
3438: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
3439: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
3440: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3441: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
3442: END IF;
3443: END;
3444:
3437: l_location := l_module_name||'.final_exception';
3438: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
3439: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
3440: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3441: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
3442: END IF;
3443: END;
3444:
3445: --****************************************************************************************--
3453: --* : p_retcode OUT Return Code to concurrent process *--
3454: --* Global Vars : g_module_name READ *--
3455: --* : g_SUCCESS READ *--
3456: --* : g_ERROR READ *--
3457: --* : fnd_log.level_statement READ *--
3458: --* : fnd_log.g_current_runtime_level READ *--
3459: --* : fnd_log.level_unexpected READ *--
3460: --* : fnd_log.level_procedure READ *--
3461: --* : g_enter READ *--
3454: --* Global Vars : g_module_name READ *--
3455: --* : g_SUCCESS READ *--
3456: --* : g_ERROR READ *--
3457: --* : fnd_log.level_statement READ *--
3458: --* : fnd_log.g_current_runtime_level READ *--
3459: --* : fnd_log.level_unexpected READ *--
3460: --* : fnd_log.level_procedure READ *--
3461: --* : g_enter READ *--
3462: --* : g_exit READ *--
3455: --* : g_SUCCESS READ *--
3456: --* : g_ERROR READ *--
3457: --* : fnd_log.level_statement READ *--
3458: --* : fnd_log.g_current_runtime_level READ *--
3459: --* : fnd_log.level_unexpected READ *--
3460: --* : fnd_log.level_procedure READ *--
3461: --* : g_enter READ *--
3462: --* : g_exit READ *--
3463: --* Called from : main *--
3456: --* : g_ERROR READ *--
3457: --* : fnd_log.level_statement READ *--
3458: --* : fnd_log.g_current_runtime_level READ *--
3459: --* : fnd_log.level_unexpected READ *--
3460: --* : fnd_log.level_procedure READ *--
3461: --* : g_enter READ *--
3462: --* : g_exit READ *--
3463: --* Called from : main *--
3464: --* Calls : fv_utility.debug_mesg *--
3489: BEGIN
3490: l_module_name := g_module_name || 'cleanup_current_failed_run';
3491: p_error_code := g_SUCCESS;
3492: RETURN;
3493: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3494: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
3495: END IF;
3496: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3497: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_group_id = '||p_group_id);
3490: l_module_name := g_module_name || 'cleanup_current_failed_run';
3491: p_error_code := g_SUCCESS;
3492: RETURN;
3493: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3494: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
3495: END IF;
3496: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3497: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_group_id = '||p_group_id);
3498: END IF;
3492: RETURN;
3493: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3494: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
3495: END IF;
3496: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3497: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_group_id = '||p_group_id);
3498: END IF;
3499:
3500: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3493: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3494: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
3495: END IF;
3496: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3497: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_group_id = '||p_group_id);
3498: END IF;
3499:
3500: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3501: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Getting into cursor import_rec');
3496: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3497: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_group_id = '||p_group_id);
3498: END IF;
3499:
3500: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3501: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Getting into cursor import_rec');
3502: END IF;
3503:
3504: FOR import_rec IN (SELECT invoice_number
3497: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_group_id = '||p_group_id);
3498: END IF;
3499:
3500: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3501: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Getting into cursor import_rec');
3502: END IF;
3503:
3504: FOR import_rec IN (SELECT invoice_number
3505: FROM fv_ipac_import
3505: FROM fv_ipac_import
3506: WHERE group_id = p_group_id
3507: AND record_status = g_status_error) LOOP
3508:
3509: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3510: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Currently Processing Invoice Number = '||import_rec.invoice_number);
3511: END IF;
3512:
3513: IF (p_error_code = g_SUCCESS) THEN
3506: WHERE group_id = p_group_id
3507: AND record_status = g_status_error) LOOP
3508:
3509: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3510: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Currently Processing Invoice Number = '||import_rec.invoice_number);
3511: END IF;
3512:
3513: IF (p_error_code = g_SUCCESS) THEN
3514: BEGIN
3511: END IF;
3512:
3513: IF (p_error_code = g_SUCCESS) THEN
3514: BEGIN
3515: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3516: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Deleting ap_interface_rejections1');
3517: END IF;
3518: DELETE ap_interface_rejections
3519: WHERE parent_table = 'AP_INVOICE_LINES_INTERFACE'
3512:
3513: IF (p_error_code = g_SUCCESS) THEN
3514: BEGIN
3515: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3516: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Deleting ap_interface_rejections1');
3517: END IF;
3518: DELETE ap_interface_rejections
3519: WHERE parent_table = 'AP_INVOICE_LINES_INTERFACE'
3520: AND parent_id IN (SELECT invoice_line_id
3523: WHERE aii.invoice_num = import_rec.invoice_number
3524: AND aii.group_id = p_group_id
3525: AND aii.invoice_id = aili.invoice_id);
3526: l_rowcount := SQL%ROWCOUNT;
3527: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3528: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,'Deleted '||l_rowcount||' rows from ap_interface_rejections1.');
3529: END IF;
3530: EXCEPTION
3531: WHEN OTHERS THEN
3524: AND aii.group_id = p_group_id
3525: AND aii.invoice_id = aili.invoice_id);
3526: l_rowcount := SQL%ROWCOUNT;
3527: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3528: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,'Deleted '||l_rowcount||' rows from ap_interface_rejections1.');
3529: END IF;
3530: EXCEPTION
3531: WHEN OTHERS THEN
3532: p_error_code := g_FAILURE;
3531: WHEN OTHERS THEN
3532: p_error_code := g_FAILURE;
3533: p_error_desc := SQLERRM;
3534: l_location := l_module_name||'.delete_ap_interface_rejections1';
3535: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
3536: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
3537: END;
3538: END IF;
3539:
3532: p_error_code := g_FAILURE;
3533: p_error_desc := SQLERRM;
3534: l_location := l_module_name||'.delete_ap_interface_rejections1';
3535: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
3536: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
3537: END;
3538: END IF;
3539:
3540: IF (p_error_code = g_SUCCESS) THEN
3538: END IF;
3539:
3540: IF (p_error_code = g_SUCCESS) THEN
3541: BEGIN
3542: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3543: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Deleting ap_interface_rejections2');
3544: END IF;
3545: DELETE ap_interface_rejections
3546: WHERE parent_table = 'AP_INVOICES_INTERFACE'
3539:
3540: IF (p_error_code = g_SUCCESS) THEN
3541: BEGIN
3542: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3543: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Deleting ap_interface_rejections2');
3544: END IF;
3545: DELETE ap_interface_rejections
3546: WHERE parent_table = 'AP_INVOICES_INTERFACE'
3547: AND parent_id IN (SELECT invoice_id
3548: FROM ap_invoices_interface aii
3549: WHERE aii.invoice_num = import_rec.invoice_number
3550: AND aii.group_id = p_group_id);
3551: l_rowcount := SQL%ROWCOUNT;
3552: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3553: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,'Deleted '||l_rowcount||' rows from ap_interface_rejections2.');
3554: END IF;
3555: EXCEPTION
3556: WHEN OTHERS THEN
3549: WHERE aii.invoice_num = import_rec.invoice_number
3550: AND aii.group_id = p_group_id);
3551: l_rowcount := SQL%ROWCOUNT;
3552: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3553: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,'Deleted '||l_rowcount||' rows from ap_interface_rejections2.');
3554: END IF;
3555: EXCEPTION
3556: WHEN OTHERS THEN
3557: p_error_code := g_FAILURE;
3556: WHEN OTHERS THEN
3557: p_error_code := g_FAILURE;
3558: p_error_desc := SQLERRM;
3559: l_location := l_module_name||'.delete_ap_interface_rejections2';
3560: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
3561: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
3562: END;
3563: END IF;
3564:
3557: p_error_code := g_FAILURE;
3558: p_error_desc := SQLERRM;
3559: l_location := l_module_name||'.delete_ap_interface_rejections2';
3560: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
3561: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
3562: END;
3563: END IF;
3564:
3565: IF (p_error_code = g_SUCCESS) THEN
3563: END IF;
3564:
3565: IF (p_error_code = g_SUCCESS) THEN
3566: BEGIN
3567: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3568: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Deleting ap_invoice_lines_interface');
3569: END IF;
3570: DELETE ap_invoice_lines_interface
3571: WHERE invoice_id IN (SELECT invoice_id
3564:
3565: IF (p_error_code = g_SUCCESS) THEN
3566: BEGIN
3567: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3568: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Deleting ap_invoice_lines_interface');
3569: END IF;
3570: DELETE ap_invoice_lines_interface
3571: WHERE invoice_id IN (SELECT invoice_id
3572: FROM ap_invoices_interface
3572: FROM ap_invoices_interface
3573: WHERE invoice_num = import_rec.invoice_number
3574: AND group_id = p_group_id);
3575: l_rowcount := SQL%ROWCOUNT;
3576: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3577: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,'Deleted '||l_rowcount||' rows from ap_invoice_lines_interface.');
3578: END IF;
3579: EXCEPTION
3580: WHEN OTHERS THEN
3573: WHERE invoice_num = import_rec.invoice_number
3574: AND group_id = p_group_id);
3575: l_rowcount := SQL%ROWCOUNT;
3576: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3577: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,'Deleted '||l_rowcount||' rows from ap_invoice_lines_interface.');
3578: END IF;
3579: EXCEPTION
3580: WHEN OTHERS THEN
3581: p_error_code := g_FAILURE;
3580: WHEN OTHERS THEN
3581: p_error_code := g_FAILURE;
3582: p_error_desc := SQLERRM;
3583: l_location := l_module_name||'.delete_ap_invoice_lines_interface';
3584: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
3585: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
3586: END;
3587: END IF;
3588:
3581: p_error_code := g_FAILURE;
3582: p_error_desc := SQLERRM;
3583: l_location := l_module_name||'.delete_ap_invoice_lines_interface';
3584: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
3585: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
3586: END;
3587: END IF;
3588:
3589:
3588:
3589:
3590: IF (p_error_code = g_SUCCESS) THEN
3591: BEGIN
3592: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3593: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Deleting ap_invoices_interface');
3594: END IF;
3595: DELETE ap_invoices_interface
3596: WHERE invoice_num = import_rec.invoice_number
3589:
3590: IF (p_error_code = g_SUCCESS) THEN
3591: BEGIN
3592: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3593: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Deleting ap_invoices_interface');
3594: END IF;
3595: DELETE ap_invoices_interface
3596: WHERE invoice_num = import_rec.invoice_number
3597: AND group_id = p_group_id;
3595: DELETE ap_invoices_interface
3596: WHERE invoice_num = import_rec.invoice_number
3597: AND group_id = p_group_id;
3598: l_rowcount := SQL%ROWCOUNT;
3599: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3600: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,'Deleted '||l_rowcount||' rows from ap_invoices_interface.');
3601: END IF;
3602: EXCEPTION
3603: WHEN OTHERS THEN
3596: WHERE invoice_num = import_rec.invoice_number
3597: AND group_id = p_group_id;
3598: l_rowcount := SQL%ROWCOUNT;
3599: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3600: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,'Deleted '||l_rowcount||' rows from ap_invoices_interface.');
3601: END IF;
3602: EXCEPTION
3603: WHEN OTHERS THEN
3604: p_error_code := g_FAILURE;
3603: WHEN OTHERS THEN
3604: p_error_code := g_FAILURE;
3605: p_error_desc := SQLERRM;
3606: l_location := l_module_name||'.delete_ap_invoices_interface';
3607: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
3608: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
3609: END;
3610: END IF;
3611:
3604: p_error_code := g_FAILURE;
3605: p_error_desc := SQLERRM;
3606: l_location := l_module_name||'.delete_ap_invoices_interface';
3607: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
3608: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
3609: END;
3610: END IF;
3611:
3612: IF (p_error_code = g_SUCCESS) THEN
3610: END IF;
3611:
3612: IF (p_error_code = g_SUCCESS) THEN
3613: BEGIN
3614: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3615: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Updating fv_ipac_import');
3616: END IF;
3617: UPDATE fv_ipac_import
3618: SET record_status = g_status_other_error
3611:
3612: IF (p_error_code = g_SUCCESS) THEN
3613: BEGIN
3614: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3615: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Updating fv_ipac_import');
3616: END IF;
3617: UPDATE fv_ipac_import
3618: SET record_status = g_status_other_error
3619: WHERE group_id = p_group_id
3619: WHERE group_id = p_group_id
3620: AND invoice_number = import_rec.invoice_number
3621: AND record_status <> g_status_error;
3622: l_rowcount := SQL%ROWCOUNT;
3623: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3624: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,'Updated '||l_rowcount||' rows in fv_ipac_import.');
3625: END IF;
3626: EXCEPTION
3627: WHEN OTHERS THEN
3620: AND invoice_number = import_rec.invoice_number
3621: AND record_status <> g_status_error;
3622: l_rowcount := SQL%ROWCOUNT;
3623: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3624: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,'Updated '||l_rowcount||' rows in fv_ipac_import.');
3625: END IF;
3626: EXCEPTION
3627: WHEN OTHERS THEN
3628: p_error_code := g_FAILURE;
3627: WHEN OTHERS THEN
3628: p_error_code := g_FAILURE;
3629: p_error_desc := SQLERRM;
3630: l_location := l_module_name||'.update_fv_ipac_import';
3631: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
3632: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
3633: END;
3634: END IF;
3635:
3628: p_error_code := g_FAILURE;
3629: p_error_desc := SQLERRM;
3630: l_location := l_module_name||'.update_fv_ipac_import';
3631: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
3632: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
3633: END;
3634: END IF;
3635:
3636: IF (p_error_code <> g_SUCCESS) THEN
3637: EXIT;
3638: END IF;
3639:
3640: END LOOP;
3641: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3642: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Out of cursor import_rec');
3643: END IF;
3644:
3645: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3638: END IF;
3639:
3640: END LOOP;
3641: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3642: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Out of cursor import_rec');
3643: END IF;
3644:
3645: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3646: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
3641: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3642: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Out of cursor import_rec');
3643: END IF;
3644:
3645: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3646: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
3647: END IF;
3648:
3649: EXCEPTION
3642: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Out of cursor import_rec');
3643: END IF;
3644:
3645: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3646: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
3647: END IF;
3648:
3649: EXCEPTION
3650: WHEN OTHERS THEN
3650: WHEN OTHERS THEN
3651: p_error_code := g_FAILURE;
3652: p_error_desc := SQLERRM;
3653: l_location := l_module_name||'.final_exception';
3654: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
3655: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
3656: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3657: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
3658: END IF;
3651: p_error_code := g_FAILURE;
3652: p_error_desc := SQLERRM;
3653: l_location := l_module_name||'.final_exception';
3654: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
3655: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
3656: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3657: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
3658: END IF;
3659: END;
3652: p_error_desc := SQLERRM;
3653: l_location := l_module_name||'.final_exception';
3654: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
3655: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
3656: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3657: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
3658: END IF;
3659: END;
3660: --****************************************************************************************--
3653: l_location := l_module_name||'.final_exception';
3654: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
3655: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
3656: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3657: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
3658: END IF;
3659: END;
3660: --****************************************************************************************--
3661: --* Name : move_data_to_history *--
3667: --* : p_retcode OUT Return Code to concurrent process *--
3668: --* Global Vars : g_module_name READ *--
3669: --* : g_SUCCESS READ *--
3670: --* : g_ERROR READ *--
3671: --* : fnd_log.level_statement READ *--
3672: --* : fnd_log.g_current_runtime_level READ *--
3673: --* : fnd_log.level_unexpected READ *--
3674: --* : fnd_log.level_procedure READ *--
3675: --* : g_enter READ *--
3668: --* Global Vars : g_module_name READ *--
3669: --* : g_SUCCESS READ *--
3670: --* : g_ERROR READ *--
3671: --* : fnd_log.level_statement READ *--
3672: --* : fnd_log.g_current_runtime_level READ *--
3673: --* : fnd_log.level_unexpected READ *--
3674: --* : fnd_log.level_procedure READ *--
3675: --* : g_enter READ *--
3676: --* : g_exit READ *--
3669: --* : g_SUCCESS READ *--
3670: --* : g_ERROR READ *--
3671: --* : fnd_log.level_statement READ *--
3672: --* : fnd_log.g_current_runtime_level READ *--
3673: --* : fnd_log.level_unexpected READ *--
3674: --* : fnd_log.level_procedure READ *--
3675: --* : g_enter READ *--
3676: --* : g_exit READ *--
3677: --* Called from : main *--
3670: --* : g_ERROR READ *--
3671: --* : fnd_log.level_statement READ *--
3672: --* : fnd_log.g_current_runtime_level READ *--
3673: --* : fnd_log.level_unexpected READ *--
3674: --* : fnd_log.level_procedure READ *--
3675: --* : g_enter READ *--
3676: --* : g_exit READ *--
3677: --* Called from : main *--
3678: --* Calls : fv_utility.debug_mesg *--
3695: l_rowcount NUMBER;
3696: BEGIN
3697: l_module_name := g_module_name || 'move_data_to_history';
3698: p_error_code := g_SUCCESS;
3699: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3700: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
3701: END IF;
3702: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3703: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_group_id = '||p_group_id);
3696: BEGIN
3697: l_module_name := g_module_name || 'move_data_to_history';
3698: p_error_code := g_SUCCESS;
3699: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3700: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
3701: END IF;
3702: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3703: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_group_id = '||p_group_id);
3704: END IF;
3698: p_error_code := g_SUCCESS;
3699: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3700: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
3701: END IF;
3702: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3703: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_group_id = '||p_group_id);
3704: END IF;
3705:
3706: BEGIN
3699: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
3700: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
3701: END IF;
3702: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
3703: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_group_id = '||p_group_id);
3704: END IF;
3705:
3706: BEGIN
3707: INSERT INTO fv_ipac_import_history
4020: FROM fv_ipac_import
4021: WHERE group_id = p_group_id
4022: AND record_status = g_status_processed;
4023: l_rowcount := SQL%ROWCOUNT;
4024: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
4025: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,'Inserted '||l_rowcount||' rows into fv_ipac_import_history.');
4026: END IF;
4027: EXCEPTION
4028: WHEN OTHERS THEN
4021: WHERE group_id = p_group_id
4022: AND record_status = g_status_processed;
4023: l_rowcount := SQL%ROWCOUNT;
4024: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
4025: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,'Inserted '||l_rowcount||' rows into fv_ipac_import_history.');
4026: END IF;
4027: EXCEPTION
4028: WHEN OTHERS THEN
4029: p_error_code := g_FAILURE;
4028: WHEN OTHERS THEN
4029: p_error_code := g_FAILURE;
4030: p_error_desc := SQLERRM;
4031: l_location := l_module_name||'.insert_fv_ipac_import_history';
4032: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
4033: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
4034: END;
4035:
4036: BEGIN
4029: p_error_code := g_FAILURE;
4030: p_error_desc := SQLERRM;
4031: l_location := l_module_name||'.insert_fv_ipac_import_history';
4032: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
4033: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
4034: END;
4035:
4036: BEGIN
4037: DELETE FROM fv_ipac_import
4037: DELETE FROM fv_ipac_import
4038: WHERE group_id = p_group_id
4039: AND record_status = g_status_processed;
4040: l_rowcount := SQL%ROWCOUNT;
4041: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
4042: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,'Deleted '||l_rowcount||' rows from fv_ipac_import.');
4043: END IF;
4044: EXCEPTION
4045: WHEN OTHERS THEN
4038: WHERE group_id = p_group_id
4039: AND record_status = g_status_processed;
4040: l_rowcount := SQL%ROWCOUNT;
4041: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
4042: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,'Deleted '||l_rowcount||' rows from fv_ipac_import.');
4043: END IF;
4044: EXCEPTION
4045: WHEN OTHERS THEN
4046: p_error_code := g_FAILURE;
4045: WHEN OTHERS THEN
4046: p_error_code := g_FAILURE;
4047: p_error_desc := SQLERRM;
4048: l_location := l_module_name||'.delete_fv_ipac_import';
4049: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
4050: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
4051: END;
4052:
4053: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
4046: p_error_code := g_FAILURE;
4047: p_error_desc := SQLERRM;
4048: l_location := l_module_name||'.delete_fv_ipac_import';
4049: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
4050: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
4051: END;
4052:
4053: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
4054: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
4049: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
4050: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
4051: END;
4052:
4053: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
4054: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
4055: END IF;
4056: EXCEPTION
4057: WHEN OTHERS THEN
4050: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
4051: END;
4052:
4053: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
4054: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
4055: END IF;
4056: EXCEPTION
4057: WHEN OTHERS THEN
4058: p_error_code := g_FAILURE;
4057: WHEN OTHERS THEN
4058: p_error_code := g_FAILURE;
4059: p_error_desc := SQLERRM;
4060: l_location := l_module_name||'.final_exception';
4061: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
4062: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
4063: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
4064: fv_utility.debug_mesg(fnd_log.level_procedure, l_location,g_exit||'('||p_error_code||')');
4065: END IF;
4058: p_error_code := g_FAILURE;
4059: p_error_desc := SQLERRM;
4060: l_location := l_module_name||'.final_exception';
4061: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
4062: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
4063: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
4064: fv_utility.debug_mesg(fnd_log.level_procedure, l_location,g_exit||'('||p_error_code||')');
4065: END IF;
4066: END;
4059: p_error_desc := SQLERRM;
4060: l_location := l_module_name||'.final_exception';
4061: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
4062: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
4063: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
4064: fv_utility.debug_mesg(fnd_log.level_procedure, l_location,g_exit||'('||p_error_code||')');
4065: END IF;
4066: END;
4067:
4060: l_location := l_module_name||'.final_exception';
4061: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
4062: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
4063: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
4064: fv_utility.debug_mesg(fnd_log.level_procedure, l_location,g_exit||'('||p_error_code||')');
4065: END IF;
4066: END;
4067:
4068: --****************************************************************************************--
4076: --* : g_module_name READ *--
4077: --* : g_SUCCESS READ *--
4078: --* : g_ERROR READ *--
4079: --* : g_WARNING READ *--
4080: --* : fnd_log.level_statement READ *--
4081: --* : fnd_log.g_current_runtime_level READ *--
4082: --* : fnd_log.level_unexpected READ *--
4083: --* : fnd_log.level_procedure READ *--
4084: --* : g_enter READ *--
4077: --* : g_SUCCESS READ *--
4078: --* : g_ERROR READ *--
4079: --* : g_WARNING READ *--
4080: --* : fnd_log.level_statement READ *--
4081: --* : fnd_log.g_current_runtime_level READ *--
4082: --* : fnd_log.level_unexpected READ *--
4083: --* : fnd_log.level_procedure READ *--
4084: --* : g_enter READ *--
4085: --* : g_exit READ *--
4078: --* : g_ERROR READ *--
4079: --* : g_WARNING READ *--
4080: --* : fnd_log.level_statement READ *--
4081: --* : fnd_log.g_current_runtime_level READ *--
4082: --* : fnd_log.level_unexpected READ *--
4083: --* : fnd_log.level_procedure READ *--
4084: --* : g_enter READ *--
4085: --* : g_exit READ *--
4086: --* Called from : main *--
4079: --* : g_WARNING READ *--
4080: --* : fnd_log.level_statement READ *--
4081: --* : fnd_log.g_current_runtime_level READ *--
4082: --* : fnd_log.level_unexpected READ *--
4083: --* : fnd_log.level_procedure READ *--
4084: --* : g_enter READ *--
4085: --* : g_exit READ *--
4086: --* Called from : main *--
4087: --* Calls : cleanup_previous_failed_run *--
4120: l_message VARCHAR2(100);
4121: BEGIN
4122: l_module_name := g_module_name || 'load_data_file';
4123: p_error_code := g_SUCCESS;
4124: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
4125: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
4126: END IF;
4127: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4128: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_data_file_name = '||p_data_file_name);
4121: BEGIN
4122: l_module_name := g_module_name || 'load_data_file';
4123: p_error_code := g_SUCCESS;
4124: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
4125: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
4126: END IF;
4127: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4128: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_data_file_name = '||p_data_file_name);
4129: END IF;
4123: p_error_code := g_SUCCESS;
4124: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
4125: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
4126: END IF;
4127: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4128: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_data_file_name = '||p_data_file_name);
4129: END IF;
4130:
4131: l_directory_path := fnd_profile.value('FV_DOWNLOAD_TREASURY_FILES_DIRECTORY');
4124: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
4125: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
4126: END IF;
4127: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4128: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_data_file_name = '||p_data_file_name);
4129: END IF;
4130:
4131: l_directory_path := fnd_profile.value('FV_DOWNLOAD_TREASURY_FILES_DIRECTORY');
4132:
4129: END IF;
4130:
4131: l_directory_path := fnd_profile.value('FV_DOWNLOAD_TREASURY_FILES_DIRECTORY');
4132:
4133: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4134: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_directory_path = '||l_directory_path);
4135: END IF;
4136:
4137: IF (l_directory_path IS NULL) THEN
4130:
4131: l_directory_path := fnd_profile.value('FV_DOWNLOAD_TREASURY_FILES_DIRECTORY');
4132:
4133: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4134: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_directory_path = '||l_directory_path);
4135: END IF;
4136:
4137: IF (l_directory_path IS NULL) THEN
4138: p_error_code := g_FAILURE;
4136:
4137: IF (l_directory_path IS NULL) THEN
4138: p_error_code := g_FAILURE;
4139: p_error_desc := 'The directory path is not set in the "FV:Download Treasury Files Directory" profile';
4140: fv_utility.log_mesg(fnd_log.level_error, l_module_name,p_error_desc) ;
4141: END IF;
4142:
4143: IF (p_error_code = g_SUCCESS) THEN
4144: --
4150: ELSE
4151: l_data_file := l_directory_path || '/' || p_data_file_name;
4152: END IF;
4153:
4154: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4155: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_data_file = '||l_data_file);
4156: END IF;
4157:
4158: END IF;
4151: l_data_file := l_directory_path || '/' || p_data_file_name;
4152: END IF;
4153:
4154: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4155: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_data_file = '||l_data_file);
4156: END IF;
4157:
4158: END IF;
4159:
4157:
4158: END IF;
4159:
4160: IF (p_error_code = g_SUCCESS) THEN
4161: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4162: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling cleanup_previous_failed_run');
4163: END IF;
4164: cleanup_previous_failed_run
4165: (
4158: END IF;
4159:
4160: IF (p_error_code = g_SUCCESS) THEN
4161: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4162: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling cleanup_previous_failed_run');
4163: END IF;
4164: cleanup_previous_failed_run
4165: (
4166: p_error_code => p_error_code,
4171: IF (p_error_code = g_SUCCESS) THEN
4172: --
4173: -- Submit request to execute SQL*Loader.
4174: --
4175: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4176: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Submitting request');
4177: END IF;
4178:
4179:
4172: --
4173: -- Submit request to execute SQL*Loader.
4174: --
4175: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4176: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Submitting request');
4177: END IF;
4178:
4179:
4180: fnd_request.set_org_id(g_org_id);
4189: ) ;
4190: IF (l_request_id = 0) THEN
4191: p_error_code := g_FAILURE;
4192: p_error_desc := 'Failed to submit request for SQL*LOADER';
4193: fv_utility.log_mesg(fnd_log.level_error, l_module_name,p_error_desc) ;
4194: ELSE
4195: COMMIT;
4196: END IF;
4197: END IF;
4196: END IF;
4197: END IF;
4198:
4199: IF (p_error_code = g_SUCCESS) THEN
4200: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4201: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Waiting for request to finish');
4202: END IF;
4203: l_request_wait_status := fnd_concurrent.wait_for_request
4204: (
4197: END IF;
4198:
4199: IF (p_error_code = g_SUCCESS) THEN
4200: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4201: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Waiting for request to finish');
4202: END IF;
4203: l_request_wait_status := fnd_concurrent.wait_for_request
4204: (
4205: request_id => l_request_id,
4212: message => l_message
4213: );
4214:
4215: COMMIT;
4216: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4217: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'wait_for_request retured');
4218: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_phase = '||l_phase);
4219: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_status = '||l_status);
4220: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_dev_phase = '||l_dev_phase);
4213: );
4214:
4215: COMMIT;
4216: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4217: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'wait_for_request retured');
4218: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_phase = '||l_phase);
4219: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_status = '||l_status);
4220: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_dev_phase = '||l_dev_phase);
4221: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_dev_status = '||l_dev_status);
4214:
4215: COMMIT;
4216: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4217: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'wait_for_request retured');
4218: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_phase = '||l_phase);
4219: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_status = '||l_status);
4220: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_dev_phase = '||l_dev_phase);
4221: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_dev_status = '||l_dev_status);
4222: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_message = '||l_message);
4215: COMMIT;
4216: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4217: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'wait_for_request retured');
4218: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_phase = '||l_phase);
4219: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_status = '||l_status);
4220: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_dev_phase = '||l_dev_phase);
4221: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_dev_status = '||l_dev_status);
4222: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_message = '||l_message);
4223: END IF;
4216: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4217: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'wait_for_request retured');
4218: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_phase = '||l_phase);
4219: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_status = '||l_status);
4220: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_dev_phase = '||l_dev_phase);
4221: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_dev_status = '||l_dev_status);
4222: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_message = '||l_message);
4223: END IF;
4224:
4217: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'wait_for_request retured');
4218: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_phase = '||l_phase);
4219: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_status = '||l_status);
4220: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_dev_phase = '||l_dev_phase);
4221: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_dev_status = '||l_dev_status);
4222: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_message = '||l_message);
4223: END IF;
4224:
4225: IF (l_request_wait_status = FALSE) THEN
4218: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_phase = '||l_phase);
4219: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_status = '||l_status);
4220: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_dev_phase = '||l_dev_phase);
4221: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_dev_status = '||l_dev_status);
4222: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_message = '||l_message);
4223: END IF;
4224:
4225: IF (l_request_wait_status = FALSE) THEN
4226: p_error_code := g_FAILURE;
4224:
4225: IF (l_request_wait_status = FALSE) THEN
4226: p_error_code := g_FAILURE;
4227: p_error_desc := 'Failed to load the IPAC Disbursement records-1.';
4228: fv_utility.log_mesg(fnd_log.level_error, l_module_name,p_error_desc) ;
4229: END IF;
4230: END IF;
4231:
4232: IF (p_error_code = g_SUCCESS) THEN
4234: NULL;
4235: ELSE
4236: p_error_code := g_FAILURE;
4237: p_error_desc := 'Failed to load the IPAC Disbursement records-2.';
4238: fv_utility.log_mesg(fnd_log.level_error, l_module_name,p_error_desc) ;
4239: END IF;
4240: END IF;
4241: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
4242: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
4237: p_error_desc := 'Failed to load the IPAC Disbursement records-2.';
4238: fv_utility.log_mesg(fnd_log.level_error, l_module_name,p_error_desc) ;
4239: END IF;
4240: END IF;
4241: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
4242: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
4243: END IF;
4244:
4245: EXCEPTION
4238: fv_utility.log_mesg(fnd_log.level_error, l_module_name,p_error_desc) ;
4239: END IF;
4240: END IF;
4241: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
4242: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
4243: END IF;
4244:
4245: EXCEPTION
4246: WHEN OTHERS THEN
4246: WHEN OTHERS THEN
4247: p_error_code := g_FAILURE;
4248: p_error_desc := SQLERRM;
4249: l_location := l_module_name||'.final_exception';
4250: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
4251: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
4252: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
4253: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
4254: END IF;
4247: p_error_code := g_FAILURE;
4248: p_error_desc := SQLERRM;
4249: l_location := l_module_name||'.final_exception';
4250: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
4251: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
4252: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
4253: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
4254: END IF;
4255: END;
4248: p_error_desc := SQLERRM;
4249: l_location := l_module_name||'.final_exception';
4250: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
4251: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
4252: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
4253: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
4254: END IF;
4255: END;
4256:
4249: l_location := l_module_name||'.final_exception';
4250: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
4251: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_error_desc) ;
4252: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
4253: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_error_code||')');
4254: END IF;
4255: END;
4256:
4257: --****************************************************************************************--
4269: --* Global Vars : g_module_name READ *--
4270: --* : g_SUCCESS READ *--
4271: --* : g_WARNING READ *--
4272: --* : g_ERROR READ *--
4273: --* : fnd_log.level_procedure READ *--
4274: --* : fnd_log.g_current_runtime_level READ *--
4275: --* : g_enter READ *--
4276: --* : g_exit READ *--
4277: --* : g_request_id READ *--
4270: --* : g_SUCCESS READ *--
4271: --* : g_WARNING READ *--
4272: --* : g_ERROR READ *--
4273: --* : fnd_log.level_procedure READ *--
4274: --* : fnd_log.g_current_runtime_level READ *--
4275: --* : g_enter READ *--
4276: --* : g_exit READ *--
4277: --* : g_request_id READ *--
4278: --* : g_userid READ *--
4316: BEGIN
4317: l_module_name := g_module_name || 'main';
4318: p_retcode := g_SUCCESS;
4319:
4320: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
4321: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
4322: END IF;
4323:
4324: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4317: l_module_name := g_module_name || 'main';
4318: p_retcode := g_SUCCESS;
4319:
4320: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
4321: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
4322: END IF;
4323:
4324: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4325: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_data_file_name = '||p_data_file_name);
4320: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
4321: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
4322: END IF;
4323:
4324: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4325: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_data_file_name = '||p_data_file_name);
4326: -- fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_transaction_code = '||p_transaction_code);
4327: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_agency_location_code = '||p_agency_location_code);
4328: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_payment_bank_acct_id = '||p_payment_bank_acct_id);
4321: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_enter);
4322: END IF;
4323:
4324: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4325: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_data_file_name = '||p_data_file_name);
4326: -- fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_transaction_code = '||p_transaction_code);
4327: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_agency_location_code = '||p_agency_location_code);
4328: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_payment_bank_acct_id = '||p_payment_bank_acct_id);
4329: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_payment_profile_id = '||p_payment_profile_id);
4322: END IF;
4323:
4324: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4325: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_data_file_name = '||p_data_file_name);
4326: -- fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_transaction_code = '||p_transaction_code);
4327: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_agency_location_code = '||p_agency_location_code);
4328: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_payment_bank_acct_id = '||p_payment_bank_acct_id);
4329: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_payment_profile_id = '||p_payment_profile_id);
4330: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_payment_document_id = '||p_payment_document_id);
4323:
4324: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4325: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_data_file_name = '||p_data_file_name);
4326: -- fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_transaction_code = '||p_transaction_code);
4327: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_agency_location_code = '||p_agency_location_code);
4328: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_payment_bank_acct_id = '||p_payment_bank_acct_id);
4329: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_payment_profile_id = '||p_payment_profile_id);
4330: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_payment_document_id = '||p_payment_document_id);
4331: -- fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_pay_trans_code = '||p_pay_trans_code);
4324: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4325: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_data_file_name = '||p_data_file_name);
4326: -- fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_transaction_code = '||p_transaction_code);
4327: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_agency_location_code = '||p_agency_location_code);
4328: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_payment_bank_acct_id = '||p_payment_bank_acct_id);
4329: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_payment_profile_id = '||p_payment_profile_id);
4330: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_payment_document_id = '||p_payment_document_id);
4331: -- fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_pay_trans_code = '||p_pay_trans_code);
4332: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'g_request_id = '||g_request_id);
4325: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_data_file_name = '||p_data_file_name);
4326: -- fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_transaction_code = '||p_transaction_code);
4327: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_agency_location_code = '||p_agency_location_code);
4328: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_payment_bank_acct_id = '||p_payment_bank_acct_id);
4329: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_payment_profile_id = '||p_payment_profile_id);
4330: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_payment_document_id = '||p_payment_document_id);
4331: -- fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_pay_trans_code = '||p_pay_trans_code);
4332: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'g_request_id = '||g_request_id);
4333: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'g_user_id = '||g_user_id);
4326: -- fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_transaction_code = '||p_transaction_code);
4327: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_agency_location_code = '||p_agency_location_code);
4328: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_payment_bank_acct_id = '||p_payment_bank_acct_id);
4329: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_payment_profile_id = '||p_payment_profile_id);
4330: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_payment_document_id = '||p_payment_document_id);
4331: -- fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_pay_trans_code = '||p_pay_trans_code);
4332: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'g_request_id = '||g_request_id);
4333: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'g_user_id = '||g_user_id);
4334: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'g_login_id = '||g_login_id);
4327: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_agency_location_code = '||p_agency_location_code);
4328: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_payment_bank_acct_id = '||p_payment_bank_acct_id);
4329: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_payment_profile_id = '||p_payment_profile_id);
4330: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_payment_document_id = '||p_payment_document_id);
4331: -- fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_pay_trans_code = '||p_pay_trans_code);
4332: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'g_request_id = '||g_request_id);
4333: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'g_user_id = '||g_user_id);
4334: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'g_login_id = '||g_login_id);
4335: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'g_org_id_id = '||g_org_id);
4328: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_payment_bank_acct_id = '||p_payment_bank_acct_id);
4329: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_payment_profile_id = '||p_payment_profile_id);
4330: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_payment_document_id = '||p_payment_document_id);
4331: -- fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_pay_trans_code = '||p_pay_trans_code);
4332: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'g_request_id = '||g_request_id);
4333: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'g_user_id = '||g_user_id);
4334: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'g_login_id = '||g_login_id);
4335: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'g_org_id_id = '||g_org_id);
4336: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'g_set_of_books_id = '||g_set_of_books_id);
4329: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_payment_profile_id = '||p_payment_profile_id);
4330: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_payment_document_id = '||p_payment_document_id);
4331: -- fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_pay_trans_code = '||p_pay_trans_code);
4332: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'g_request_id = '||g_request_id);
4333: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'g_user_id = '||g_user_id);
4334: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'g_login_id = '||g_login_id);
4335: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'g_org_id_id = '||g_org_id);
4336: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'g_set_of_books_id = '||g_set_of_books_id);
4337: END IF;
4330: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_payment_document_id = '||p_payment_document_id);
4331: -- fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_pay_trans_code = '||p_pay_trans_code);
4332: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'g_request_id = '||g_request_id);
4333: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'g_user_id = '||g_user_id);
4334: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'g_login_id = '||g_login_id);
4335: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'g_org_id_id = '||g_org_id);
4336: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'g_set_of_books_id = '||g_set_of_books_id);
4337: END IF;
4338:
4331: -- fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_pay_trans_code = '||p_pay_trans_code);
4332: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'g_request_id = '||g_request_id);
4333: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'g_user_id = '||g_user_id);
4334: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'g_login_id = '||g_login_id);
4335: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'g_org_id_id = '||g_org_id);
4336: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'g_set_of_books_id = '||g_set_of_books_id);
4337: END IF;
4338:
4339: /*
4332: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'g_request_id = '||g_request_id);
4333: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'g_user_id = '||g_user_id);
4334: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'g_login_id = '||g_login_id);
4335: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'g_org_id_id = '||g_org_id);
4336: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'g_set_of_books_id = '||g_set_of_books_id);
4337: END IF;
4338:
4339: /*
4340: *****************************************************************************
4342: *****************************************************************************
4343: */
4344: l_batch_control := NVL(fnd_profile.value('AP_USE_INV_BATCH_CONTROLS'),'N');
4345:
4346: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4347: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_batch_control = '||l_batch_control);
4348: END IF;
4349:
4350: IF (l_batch_control = 'N') THEN
4343: */
4344: l_batch_control := NVL(fnd_profile.value('AP_USE_INV_BATCH_CONTROLS'),'N');
4345:
4346: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4347: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'l_batch_control = '||l_batch_control);
4348: END IF;
4349:
4350: IF (l_batch_control = 'N') THEN
4351: p_retcode := g_FAILURE;
4349:
4350: IF (l_batch_control = 'N') THEN
4351: p_retcode := g_FAILURE;
4352: p_errbuf := 'The profile option, "AP:Use Invoice Batch Controls" must be set to Yes for the Federal Administrator.';
4353: fv_utility.log_mesg(fnd_log.level_error, l_module_name,p_errbuf) ;
4354: END IF;
4355:
4356:
4357: /*
4360: *****************************************************************************
4361: */
4362: IF (p_retcode = g_SUCCESS) THEN
4363: BEGIN
4364: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4365: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Selecting from fv_operating_units');
4366: END IF;
4367: SELECT payables_ia_paygroup
4368: INTO g_ia_paygroup
4361: */
4362: IF (p_retcode = g_SUCCESS) THEN
4363: BEGIN
4364: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4365: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Selecting from fv_operating_units');
4366: END IF;
4367: SELECT payables_ia_paygroup
4368: INTO g_ia_paygroup
4369: FROM fv_operating_units
4367: SELECT payables_ia_paygroup
4368: INTO g_ia_paygroup
4369: FROM fv_operating_units
4370: WHERE set_of_books_id = g_set_of_books_id;
4371: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4372: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'g_ia_paygroup = '||g_ia_paygroup);
4373: END IF;
4374: EXCEPTION
4375: WHEN NO_DATA_FOUND THEN
4368: INTO g_ia_paygroup
4369: FROM fv_operating_units
4370: WHERE set_of_books_id = g_set_of_books_id;
4371: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4372: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'g_ia_paygroup = '||g_ia_paygroup);
4373: END IF;
4374: EXCEPTION
4375: WHEN NO_DATA_FOUND THEN
4376: p_retcode := g_FAILURE;
4374: EXCEPTION
4375: WHEN NO_DATA_FOUND THEN
4376: p_retcode := g_FAILURE;
4377: p_errbuf := 'No Paygroup defined on Define Federal Options Window ';
4378: fv_utility.log_mesg(fnd_log.level_error, l_module_name,p_errbuf);
4379: END;
4380: END IF;
4381:
4382: /*
4384: * Load the data file into table fv_ipac_import *
4385: *****************************************************************************
4386: */
4387: IF (p_retcode = g_SUCCESS) THEN
4388: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4389: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling load_data_file');
4390: END IF;
4391: load_data_file
4392: (
4385: *****************************************************************************
4386: */
4387: IF (p_retcode = g_SUCCESS) THEN
4388: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4389: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling load_data_file');
4390: END IF;
4391: load_data_file
4392: (
4393: p_data_file_name => p_data_file_name,
4393: p_data_file_name => p_data_file_name,
4394: p_error_code => p_retcode,
4395: p_error_desc => p_errbuf
4396: );
4397: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4398: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'load_data_file returned');
4399: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code = '||p_retcode);
4400: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc = '||p_errbuf);
4401: END IF;
4394: p_error_code => p_retcode,
4395: p_error_desc => p_errbuf
4396: );
4397: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4398: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'load_data_file returned');
4399: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code = '||p_retcode);
4400: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc = '||p_errbuf);
4401: END IF;
4402: END IF;
4395: p_error_desc => p_errbuf
4396: );
4397: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4398: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'load_data_file returned');
4399: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code = '||p_retcode);
4400: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc = '||p_errbuf);
4401: END IF;
4402: END IF;
4403:
4396: );
4397: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4398: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'load_data_file returned');
4399: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code = '||p_retcode);
4400: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc = '||p_errbuf);
4401: END IF;
4402: END IF;
4403:
4404: /*
4406: * Process the data *
4407: *****************************************************************************
4408: */
4409: IF (p_retcode = g_SUCCESS) THEN
4410: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4411: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling process_data');
4412: END IF;
4413: process_data
4414: (
4407: *****************************************************************************
4408: */
4409: IF (p_retcode = g_SUCCESS) THEN
4410: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4411: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling process_data');
4412: END IF;
4413: process_data
4414: (
4415: p_data_file_name => p_data_file_name,
4419: p_ok_to_import => l_ok_to_import,
4420: p_error_code => p_retcode,
4421: p_error_desc => p_errbuf
4422: );
4423: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4424: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'process_data returned');
4425: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_batch_name = '||l_batch_name);
4426: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_group_id = '||l_group_id);
4427: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_ok_to_import = '||l_ok_to_import);
4420: p_error_code => p_retcode,
4421: p_error_desc => p_errbuf
4422: );
4423: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4424: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'process_data returned');
4425: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_batch_name = '||l_batch_name);
4426: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_group_id = '||l_group_id);
4427: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_ok_to_import = '||l_ok_to_import);
4428: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code = '||p_retcode);
4421: p_error_desc => p_errbuf
4422: );
4423: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4424: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'process_data returned');
4425: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_batch_name = '||l_batch_name);
4426: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_group_id = '||l_group_id);
4427: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_ok_to_import = '||l_ok_to_import);
4428: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code = '||p_retcode);
4429: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc = '||p_errbuf);
4422: );
4423: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4424: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'process_data returned');
4425: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_batch_name = '||l_batch_name);
4426: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_group_id = '||l_group_id);
4427: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_ok_to_import = '||l_ok_to_import);
4428: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code = '||p_retcode);
4429: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc = '||p_errbuf);
4430: END IF;
4423: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4424: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'process_data returned');
4425: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_batch_name = '||l_batch_name);
4426: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_group_id = '||l_group_id);
4427: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_ok_to_import = '||l_ok_to_import);
4428: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code = '||p_retcode);
4429: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc = '||p_errbuf);
4430: END IF;
4431: END IF;
4424: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'process_data returned');
4425: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_batch_name = '||l_batch_name);
4426: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_group_id = '||l_group_id);
4427: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_ok_to_import = '||l_ok_to_import);
4428: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code = '||p_retcode);
4429: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc = '||p_errbuf);
4430: END IF;
4431: END IF;
4432:
4425: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_batch_name = '||l_batch_name);
4426: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_group_id = '||l_group_id);
4427: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_ok_to_import = '||l_ok_to_import);
4428: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code = '||p_retcode);
4429: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc = '||p_errbuf);
4430: END IF;
4431: END IF;
4432:
4433: /*
4436: *****************************************************************************
4437: */
4438: IF (p_retcode = g_SUCCESS) THEN
4439: IF (l_ok_to_import = 'Y') THEN
4440: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4441: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling kick_off_ap_invoices_import');
4442: END IF;
4443: kick_off_ap_invoices_import
4444: (
4437: */
4438: IF (p_retcode = g_SUCCESS) THEN
4439: IF (l_ok_to_import = 'Y') THEN
4440: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4441: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling kick_off_ap_invoices_import');
4442: END IF;
4443: kick_off_ap_invoices_import
4444: (
4445: p_batch_name => l_batch_name,
4446: p_group_id => l_group_id,
4447: p_error_code => p_retcode,
4448: p_error_desc => p_errbuf
4449: );
4450: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4451: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'kick_off_ap_invoices_import returned');
4452: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code = '||p_retcode);
4453: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc = '||p_errbuf);
4454: END IF;
4447: p_error_code => p_retcode,
4448: p_error_desc => p_errbuf
4449: );
4450: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4451: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'kick_off_ap_invoices_import returned');
4452: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code = '||p_retcode);
4453: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc = '||p_errbuf);
4454: END IF;
4455: END IF;
4448: p_error_desc => p_errbuf
4449: );
4450: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4451: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'kick_off_ap_invoices_import returned');
4452: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code = '||p_retcode);
4453: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc = '||p_errbuf);
4454: END IF;
4455: END IF;
4456: END IF;
4449: );
4450: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4451: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'kick_off_ap_invoices_import returned');
4452: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code = '||p_retcode);
4453: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc = '||p_errbuf);
4454: END IF;
4455: END IF;
4456: END IF;
4457:
4457:
4458:
4459: IF (p_retcode = g_SUCCESS) THEN
4460: IF (l_ok_to_import = 'Y') THEN
4461: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4462: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling check_for_ap_import_errors');
4463: END IF;
4464: check_for_ap_import_errors
4465: (
4458:
4459: IF (p_retcode = g_SUCCESS) THEN
4460: IF (l_ok_to_import = 'Y') THEN
4461: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4462: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling check_for_ap_import_errors');
4463: END IF;
4464: check_for_ap_import_errors
4465: (
4466: p_group_id => l_group_id,
4466: p_group_id => l_group_id,
4467: p_error_code => p_retcode,
4468: p_error_desc => p_errbuf
4469: );
4470: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4471: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'check_for_ap_import_errors returned');
4472: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code = '||p_retcode);
4473: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc = '||p_errbuf);
4474: END IF;
4467: p_error_code => p_retcode,
4468: p_error_desc => p_errbuf
4469: );
4470: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4471: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'check_for_ap_import_errors returned');
4472: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code = '||p_retcode);
4473: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc = '||p_errbuf);
4474: END IF;
4475: END IF;
4468: p_error_desc => p_errbuf
4469: );
4470: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4471: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'check_for_ap_import_errors returned');
4472: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code = '||p_retcode);
4473: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc = '||p_errbuf);
4474: END IF;
4475: END IF;
4476: END IF;
4469: );
4470: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4471: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'check_for_ap_import_errors returned');
4472: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code = '||p_retcode);
4473: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc = '||p_errbuf);
4474: END IF;
4475: END IF;
4476: END IF;
4477: /*
4479: * Kick off the exception report *
4480: *****************************************************************************
4481: */
4482: IF (p_retcode = g_SUCCESS OR p_retcode = g_WARNING) THEN
4483: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4484: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling kick_off_exception_report');
4485: END IF;
4486: kick_off_exception_report
4487: (
4480: *****************************************************************************
4481: */
4482: IF (p_retcode = g_SUCCESS OR p_retcode = g_WARNING) THEN
4483: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4484: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling kick_off_exception_report');
4485: END IF;
4486: kick_off_exception_report
4487: (
4488: p_data_file_name => p_data_file_name,
4490: p_group_id => l_group_id,
4491: p_error_code => p_retcode,
4492: p_error_desc => p_errbuf
4493: );
4494: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4495: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'kick_off_exception_report returned');
4496: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code = '||p_retcode);
4497: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc = '||p_errbuf);
4498: END IF;
4491: p_error_code => p_retcode,
4492: p_error_desc => p_errbuf
4493: );
4494: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4495: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'kick_off_exception_report returned');
4496: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code = '||p_retcode);
4497: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc = '||p_errbuf);
4498: END IF;
4499: END IF;
4492: p_error_desc => p_errbuf
4493: );
4494: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4495: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'kick_off_exception_report returned');
4496: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code = '||p_retcode);
4497: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc = '||p_errbuf);
4498: END IF;
4499: END IF;
4500:
4493: );
4494: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4495: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'kick_off_exception_report returned');
4496: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code = '||p_retcode);
4497: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc = '||p_errbuf);
4498: END IF;
4499: END IF;
4500:
4501: /*
4503: * Kick off the ipac auto payment process *
4504: *****************************************************************************
4505: */
4506: IF (p_retcode = g_SUCCESS OR p_retcode = g_WARNING) THEN
4507: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4508: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling kick_off_ipac_auto_pmt_process');
4509: END IF;
4510: kick_off_ipac_auto_pmt_process
4511: (
4504: *****************************************************************************
4505: */
4506: IF (p_retcode = g_SUCCESS OR p_retcode = g_WARNING) THEN
4507: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4508: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling kick_off_ipac_auto_pmt_process');
4509: END IF;
4510: kick_off_ipac_auto_pmt_process
4511: (
4512: p_batch_name => l_batch_name,
4516: -- p_document_id => p_document_id,
4517: p_error_code => p_retcode,
4518: p_error_desc => p_errbuf
4519: );
4520: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4521: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'kick_off_ipac_auto_pmt_process returned');
4522: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code = '||p_retcode);
4523: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc = '||p_errbuf);
4524: END IF;
4517: p_error_code => p_retcode,
4518: p_error_desc => p_errbuf
4519: );
4520: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4521: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'kick_off_ipac_auto_pmt_process returned');
4522: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code = '||p_retcode);
4523: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc = '||p_errbuf);
4524: END IF;
4525: END IF;
4518: p_error_desc => p_errbuf
4519: );
4520: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4521: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'kick_off_ipac_auto_pmt_process returned');
4522: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code = '||p_retcode);
4523: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc = '||p_errbuf);
4524: END IF;
4525: END IF;
4526:
4519: );
4520: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4521: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'kick_off_ipac_auto_pmt_process returned');
4522: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code = '||p_retcode);
4523: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc = '||p_errbuf);
4524: END IF;
4525: END IF;
4526:
4527: IF (p_retcode = g_SUCCESS OR p_retcode = g_WARNING) THEN
4524: END IF;
4525: END IF;
4526:
4527: IF (p_retcode = g_SUCCESS OR p_retcode = g_WARNING) THEN
4528: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4529: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling cleanup_current_failed_run process');
4530: END IF;
4531: cleanup_current_failed_run
4532: (
4525: END IF;
4526:
4527: IF (p_retcode = g_SUCCESS OR p_retcode = g_WARNING) THEN
4528: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4529: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling cleanup_current_failed_run process');
4530: END IF;
4531: cleanup_current_failed_run
4532: (
4533: p_group_id => l_group_id,
4533: p_group_id => l_group_id,
4534: p_error_code => p_retcode,
4535: p_error_desc => p_errbuf
4536: );
4537: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4538: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'cleanup_current_failed_run returned');
4539: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code = '||p_retcode);
4540: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc = '||p_errbuf);
4541: END IF;
4534: p_error_code => p_retcode,
4535: p_error_desc => p_errbuf
4536: );
4537: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4538: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'cleanup_current_failed_run returned');
4539: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code = '||p_retcode);
4540: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc = '||p_errbuf);
4541: END IF;
4542: END IF;
4535: p_error_desc => p_errbuf
4536: );
4537: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4538: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'cleanup_current_failed_run returned');
4539: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code = '||p_retcode);
4540: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc = '||p_errbuf);
4541: END IF;
4542: END IF;
4543:
4536: );
4537: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4538: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'cleanup_current_failed_run returned');
4539: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code = '||p_retcode);
4540: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc = '||p_errbuf);
4541: END IF;
4542: END IF;
4543:
4544: /*
4546: * Move data to history table *
4547: *****************************************************************************
4548: */
4549: IF (p_retcode = g_SUCCESS OR p_retcode = g_WARNING) THEN
4550: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4551: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling move_data_to_history process');
4552: END IF;
4553: move_data_to_history
4554: (
4547: *****************************************************************************
4548: */
4549: IF (p_retcode = g_SUCCESS OR p_retcode = g_WARNING) THEN
4550: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4551: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Calling move_data_to_history process');
4552: END IF;
4553: move_data_to_history
4554: (
4555: p_group_id => l_group_id,
4555: p_group_id => l_group_id,
4556: p_error_code => p_retcode,
4557: p_error_desc => p_errbuf
4558: );
4559: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4560: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'move_data_to_history returned');
4561: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code = '||p_retcode);
4562: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc = '||p_errbuf);
4563: END IF;
4556: p_error_code => p_retcode,
4557: p_error_desc => p_errbuf
4558: );
4559: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4560: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'move_data_to_history returned');
4561: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code = '||p_retcode);
4562: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc = '||p_errbuf);
4563: END IF;
4564: END IF;
4557: p_error_desc => p_errbuf
4558: );
4559: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4560: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'move_data_to_history returned');
4561: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code = '||p_retcode);
4562: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc = '||p_errbuf);
4563: END IF;
4564: END IF;
4565:
4558: );
4559: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level) THEN
4560: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'move_data_to_history returned');
4561: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_code = '||p_retcode);
4562: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'p_error_desc = '||p_errbuf);
4563: END IF;
4564: END IF;
4565:
4566: IF (p_retcode = g_SUCCESS OR p_retcode = g_WARNING) THEN
4568: ELSE
4569: ROLLBACK;
4570: END IF;
4571:
4572: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
4573: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_retcode||')');
4574: END IF;
4575:
4576: EXCEPTION
4569: ROLLBACK;
4570: END IF;
4571:
4572: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
4573: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_retcode||')');
4574: END IF;
4575:
4576: EXCEPTION
4577: WHEN OTHERS THEN
4577: WHEN OTHERS THEN
4578: p_retcode := g_FAILURE;
4579: p_errbuf := SQLERRM;
4580: l_location := l_module_name||'.final_exception';
4581: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
4582: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_errbuf) ;
4583: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
4584: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_retcode||')');
4585: END IF;
4578: p_retcode := g_FAILURE;
4579: p_errbuf := SQLERRM;
4580: l_location := l_module_name||'.final_exception';
4581: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
4582: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_errbuf) ;
4583: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
4584: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_retcode||')');
4585: END IF;
4586: ROLLBACK;
4579: p_errbuf := SQLERRM;
4580: l_location := l_module_name||'.final_exception';
4581: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
4582: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_errbuf) ;
4583: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
4584: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_retcode||')');
4585: END IF;
4586: ROLLBACK;
4587: END;
4580: l_location := l_module_name||'.final_exception';
4581: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
4582: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_errbuf) ;
4583: IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
4584: fv_utility.debug_mesg(fnd_log.level_procedure, l_module_name,g_exit||'('||p_retcode||')');
4585: END IF;
4586: ROLLBACK;
4587: END;
4588: