73: p_module IN VARCHAR2,
74: p_message IN VARCHAR2
75: ) IS
76: BEGIN
77: fv_utility.debug_mesg(fnd_log.level_statement, p_module,p_message);
78: END;
79:
80: PROCEDURE initialize_global_variables
81: IS
159: WHEN OTHERS THEN
160: p_retcode := g_FAILURE;
161: p_errbuf := SQLERRM;
162: l_location := l_module_name||'.select_gl_period_statuses2';
163: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
164: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_errbuf) ;
165: END;
166: END IF;
167:
160: p_retcode := g_FAILURE;
161: p_errbuf := SQLERRM;
162: l_location := l_module_name||'.select_gl_period_statuses2';
163: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
164: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_errbuf) ;
165: END;
166: END IF;
167:
168:
419: p_retcode := g_FAILURE;
420: p_errbuf := SQLERRM;
421: debug(l_module_name,'l_location='||l_location);
422: l_location := l_module_name||'.final_exception';
423: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
424: fv_utility.log_mesg(fnd_log.level_unexpected, l_location, p_errbuf);
425: END missed_intervals;
426:
427: PROCEDURE submit_report
420: p_errbuf := SQLERRM;
421: debug(l_module_name,'l_location='||l_location);
422: l_location := l_module_name||'.final_exception';
423: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
424: fv_utility.log_mesg(fnd_log.level_unexpected, l_location, p_errbuf);
425: END missed_intervals;
426:
427: PROCEDURE submit_report
428: (
462: WHEN OTHERS THEN
463: p_retcode := g_FAILURE;
464: p_errbuf := SQLERRM;
465: l_location := l_module_name||'.final_exception';
466: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
467: fv_utility.log_mesg(fnd_log.level_unexpected, l_location, p_errbuf);
468: END submit_report;
469:
470: PROCEDURE interpret_dm_error
463: p_retcode := g_FAILURE;
464: p_errbuf := SQLERRM;
465: l_location := l_module_name||'.final_exception';
466: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
467: fv_utility.log_mesg(fnd_log.level_unexpected, l_location, p_errbuf);
468: END submit_report;
469:
470: PROCEDURE interpret_dm_error
471: (
531: WHEN OTHERS THEN
532: p_retcode := g_FAILURE;
533: p_errbuf := SQLERRM;
534: l_location := l_module_name||'.final_exception';
535: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
536: fv_utility.log_mesg(fnd_log.level_unexpected, l_location, p_errbuf);
537: END interpret_dm_error;
538:
539: PROCEDURE check_and_correct_rounding
532: p_retcode := g_FAILURE;
533: p_errbuf := SQLERRM;
534: l_location := l_module_name||'.final_exception';
535: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
536: fv_utility.log_mesg(fnd_log.level_unexpected, l_location, p_errbuf);
537: END interpret_dm_error;
538:
539: PROCEDURE check_and_correct_rounding
540: (
649: WHEN OTHERS THEN
650: p_retcode := g_FAILURE;
651: p_errbuf := SQLERRM;
652: l_location := l_module_name||'.final_exception';
653: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
654: fv_utility.log_mesg(fnd_log.level_unexpected, l_location, p_errbuf);
655: END;
656:
657: PROCEDURE create_dm
650: p_retcode := g_FAILURE;
651: p_errbuf := SQLERRM;
652: l_location := l_module_name||'.final_exception';
653: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
654: fv_utility.log_mesg(fnd_log.level_unexpected, l_location, p_errbuf);
655: END;
656:
657: PROCEDURE create_dm
658: (
761: WHEN OTHERS THEN
762: p_retcode := g_FAILURE;
763: p_errbuf := SQLERRM;
764: l_location := l_module_name||'.select_fv_ra_customer_trx_s';
765: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
766: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_errbuf) ;
767: END;
768: END IF;
769:
762: p_retcode := g_FAILURE;
763: p_errbuf := SQLERRM;
764: l_location := l_module_name||'.select_fv_ra_customer_trx_s';
765: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
766: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_errbuf) ;
767: END;
768: END IF;
769:
770: IF (p_retcode = g_SUCCESS) THEN
780: WHEN OTHERS THEN
781: p_retcode := g_FAILURE;
782: p_errbuf := SQLERRM;
783: l_location := l_module_name||'.select_ra_customer_trx_lines';
784: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
785: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_errbuf) ;
786: END;
787: END IF;
788:
781: p_retcode := g_FAILURE;
782: p_errbuf := SQLERRM;
783: l_location := l_module_name||'.select_ra_customer_trx_lines';
784: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
785: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_errbuf) ;
786: END;
787: END IF;
788:
789: IF (p_retcode = g_SUCCESS) THEN
1088: WHEN OTHERS THEN
1089: p_retcode := g_FAILURE;
1090: p_errbuf := SQLERRM;
1091: l_location := l_module_name||'.update_ra_customer_trx';
1092: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1093: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_errbuf) ;
1094: END;
1095: END IF;
1096:
1089: p_retcode := g_FAILURE;
1090: p_errbuf := SQLERRM;
1091: l_location := l_module_name||'.update_ra_customer_trx';
1092: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1093: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_errbuf) ;
1094: END;
1095: END IF;
1096:
1097:
1099: WHEN OTHERS THEN
1100: p_retcode := g_FAILURE;
1101: p_errbuf := SQLERRM;
1102: l_location := l_module_name||'.final_exception';
1103: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1104: fv_utility.log_mesg(fnd_log.level_unexpected, l_location, p_errbuf);
1105: END create_dm;
1106:
1107: PROCEDURE process_and_create_dm
1100: p_retcode := g_FAILURE;
1101: p_errbuf := SQLERRM;
1102: l_location := l_module_name||'.final_exception';
1103: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1104: fv_utility.log_mesg(fnd_log.level_unexpected, l_location, p_errbuf);
1105: END create_dm;
1106:
1107: PROCEDURE process_and_create_dm
1108: (
1261: WHEN OTHERS THEN
1262: p_retcode := g_FAILURE;
1263: p_errbuf := SQLERRM;
1264: l_location := l_module_name||'.insert_fv_ar_fin_chrg_invoices';
1265: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1266: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_errbuf) ;
1267: END;
1268: END IF;
1269:
1262: p_retcode := g_FAILURE;
1263: p_errbuf := SQLERRM;
1264: l_location := l_module_name||'.insert_fv_ar_fin_chrg_invoices';
1265: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1266: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_errbuf) ;
1267: END;
1268: END IF;
1269:
1270: IF (p_retcode = g_SUCCESS) THEN
1311: WHEN OTHERS THEN
1312: p_retcode := g_FAILURE;
1313: p_errbuf := SQLERRM;
1314: l_location := l_module_name||'.insert_fv_ar_fin_chrg_inv_lines';
1315: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1316: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_errbuf) ;
1317: END;
1318: END IF;
1319:
1312: p_retcode := g_FAILURE;
1313: p_errbuf := SQLERRM;
1314: l_location := l_module_name||'.insert_fv_ar_fin_chrg_inv_lines';
1315: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1316: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_errbuf) ;
1317: END;
1318: END IF;
1319:
1320: IF (p_retcode = g_SUCCESS) THEN
1349: WHEN OTHERS THEN
1350: p_retcode := g_FAILURE;
1351: p_errbuf := SQLERRM;
1352: l_location := l_module_name||'.update_fv_ar_fin_chrg_invoices (1)';
1353: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1354: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_errbuf) ;
1355: END;
1356: END IF;
1357:
1350: p_retcode := g_FAILURE;
1351: p_errbuf := SQLERRM;
1352: l_location := l_module_name||'.update_fv_ar_fin_chrg_invoices (1)';
1353: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1354: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_errbuf) ;
1355: END;
1356: END IF;
1357:
1358: IF (p_retcode = g_SUCCESS) THEN
1409: WHEN OTHERS THEN
1410: p_retcode := g_FAILURE;
1411: p_errbuf := SQLERRM;
1412: l_location := l_module_name||'.insert_fv_invoice_finance_chrgs';
1413: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1414: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_errbuf) ;
1415: END;
1416: END LOOP;
1417: END IF;
1410: p_retcode := g_FAILURE;
1411: p_errbuf := SQLERRM;
1412: l_location := l_module_name||'.insert_fv_invoice_finance_chrgs';
1413: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1414: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_errbuf) ;
1415: END;
1416: END LOOP;
1417: END IF;
1418:
1423: WHEN OTHERS THEN
1424: p_retcode := g_FAILURE;
1425: p_errbuf := SQLERRM;
1426: l_location := l_module_name||'.final_exception';
1427: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1428: fv_utility.log_mesg(fnd_log.level_unexpected, l_location, p_errbuf);
1429: END process_and_create_dm;
1430:
1431: PROCEDURE get_cvf_rate
1424: p_retcode := g_FAILURE;
1425: p_errbuf := SQLERRM;
1426: l_location := l_module_name||'.final_exception';
1427: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1428: fv_utility.log_mesg(fnd_log.level_unexpected, l_location, p_errbuf);
1429: END process_and_create_dm;
1430:
1431: PROCEDURE get_cvf_rate
1432: (
1463: p_retcode := g_FAILURE;
1464: p_errbuf := SQLERRM;
1465: debug(l_module_name,'l_location='||l_location);
1466: l_location := l_module_name||'.final_exception';
1467: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1468: fv_utility.log_mesg(fnd_log.level_unexpected, l_location, p_errbuf);
1469: END get_cvf_rate;
1470:
1471: PROCEDURE get_last_accrual_date
1464: p_errbuf := SQLERRM;
1465: debug(l_module_name,'l_location='||l_location);
1466: l_location := l_module_name||'.final_exception';
1467: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1468: fv_utility.log_mesg(fnd_log.level_unexpected, l_location, p_errbuf);
1469: END get_cvf_rate;
1470:
1471: PROCEDURE get_last_accrual_date
1472: (
1506: p_retcode := g_FAILURE;
1507: p_errbuf := SQLERRM;
1508: debug(l_module_name,'l_location='||l_location);
1509: l_location := l_module_name||'.final_exception';
1510: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1511: fv_utility.log_mesg(fnd_log.level_unexpected, l_location, p_errbuf);
1512: END get_last_accrual_date;
1513:
1514: PROCEDURE set_last_accrual_date
1507: p_errbuf := SQLERRM;
1508: debug(l_module_name,'l_location='||l_location);
1509: l_location := l_module_name||'.final_exception';
1510: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1511: fv_utility.log_mesg(fnd_log.level_unexpected, l_location, p_errbuf);
1512: END get_last_accrual_date;
1513:
1514: PROCEDURE set_last_accrual_date
1515: (
1562: p_retcode := g_FAILURE;
1563: p_errbuf := SQLERRM;
1564: debug(l_module_name,'l_location='||l_location);
1565: l_location := l_module_name||'.final_exception';
1566: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1567: fv_utility.log_mesg(fnd_log.level_unexpected, l_location, p_errbuf);
1568: END set_last_accrual_date;
1569:
1570: ----------------------------------------------------------------------------------------------
1563: p_errbuf := SQLERRM;
1564: debug(l_module_name,'l_location='||l_location);
1565: l_location := l_module_name||'.final_exception';
1566: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1567: fv_utility.log_mesg(fnd_log.level_unexpected, l_location, p_errbuf);
1568: END set_last_accrual_date;
1569:
1570: ----------------------------------------------------------------------------------------------
1571:
1865: WHEN OTHERS THEN
1866: p_retcode := g_FAILURE;
1867: p_errbuf := SQLERRM;
1868: l_location := l_module_name||'.select_ar_payment_schedules';
1869: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1870: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_errbuf) ;
1871: END;
1872: END IF;
1873:
1866: p_retcode := g_FAILURE;
1867: p_errbuf := SQLERRM;
1868: l_location := l_module_name||'.select_ar_payment_schedules';
1869: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
1870: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_errbuf) ;
1871: END;
1872: END IF;
1873:
1874: IF (NVL(l_old_invoice_id, -999) = main_rec.invoice_id AND
2060: WHEN OTHERS THEN
2061: p_retcode := g_FAILURE;
2062: p_errbuf := SQLERRM;
2063: l_location := l_module_name||'.final_exception';
2064: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2065: fv_utility.log_mesg(fnd_log.level_unexpected, l_location, p_errbuf);
2066: ROLLBACK;
2067: END;
2068:
2061: p_retcode := g_FAILURE;
2062: p_errbuf := SQLERRM;
2063: l_location := l_module_name||'.final_exception';
2064: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2065: fv_utility.log_mesg(fnd_log.level_unexpected, l_location, p_errbuf);
2066: ROLLBACK;
2067: END;
2068:
2069:
2130: WHEN OTHERS THEN
2131: p_retcode := g_FAILURE;
2132: p_errbuf := SQLERRM;
2133: l_location := l_module_name||'.select_gl_ledgers_public_v';
2134: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2135: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_errbuf) ;
2136: END;
2137:
2138: IF (p_retcode = g_SUCCESS) THEN
2131: p_retcode := g_FAILURE;
2132: p_errbuf := SQLERRM;
2133: l_location := l_module_name||'.select_gl_ledgers_public_v';
2134: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2135: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_errbuf) ;
2136: END;
2137:
2138: IF (p_retcode = g_SUCCESS) THEN
2139: FOR customer in c1 (g_set_of_books_id)
2138: IF (p_retcode = g_SUCCESS) THEN
2139: FOR customer in c1 (g_set_of_books_id)
2140: LOOP
2141: IF (fnd_log.level_statement >= g_CURRENT_LOG_LEVEL) THEN
2142: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name,'Updating waive flag for: '||customer.customer_id);
2143: END IF;
2144:
2145: BEGIN
2146:
2224: WHEN OTHERS THEN
2225: p_retcode := g_FAILURE;
2226: p_errbuf := SQLERRM;
2227: l_location := l_module_name||'.update_fv_cust_finance_chrgs';
2228: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2229: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_errbuf) ;
2230: END;
2231: END LOOP;
2232: END IF;
2225: p_retcode := g_FAILURE;
2226: p_errbuf := SQLERRM;
2227: l_location := l_module_name||'.update_fv_cust_finance_chrgs';
2228: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2229: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_errbuf) ;
2230: END;
2231: END LOOP;
2232: END IF;
2233:
2271: WHEN OTHERS THEN
2272: p_retcode := g_FAILURE;
2273: p_errbuf := SQLERRM;
2274: l_location := l_module_name||'.delete_fv_cust_finance_chrgs';
2275: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2276: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_errbuf) ;
2277: END;
2278:
2279: BEGIN
2272: p_retcode := g_FAILURE;
2273: p_errbuf := SQLERRM;
2274: l_location := l_module_name||'.delete_fv_cust_finance_chrgs';
2275: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2276: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_errbuf) ;
2277: END;
2278:
2279: BEGIN
2280: INSERT INTO fv_cust_finance_chrgs
2337: WHEN OTHERS THEN
2338: p_retcode := g_FAILURE;
2339: p_errbuf := SQLERRM;
2340: l_location := l_module_name||'.insert_fv_cust_finance_chrgs';
2341: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2342: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_errbuf) ;
2343: END;
2344: END IF;
2345:
2338: p_retcode := g_FAILURE;
2339: p_errbuf := SQLERRM;
2340: l_location := l_module_name||'.insert_fv_cust_finance_chrgs';
2341: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2342: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_errbuf) ;
2343: END;
2344: END IF;
2345:
2346: IF (p_retcode = g_SUCCESS) THEN
2421: WHEN OTHERS THEN
2422: p_retcode := g_FAILURE;
2423: p_errbuf := SQLERRM;
2424: l_location := l_module_name||'.insert_fv_cust_finance_chrgs';
2425: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2426: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_errbuf) ;
2427: END;
2428: END IF;
2429: IF (p_retcode = g_SUCCESS) THEN
2422: p_retcode := g_FAILURE;
2423: p_errbuf := SQLERRM;
2424: l_location := l_module_name||'.insert_fv_cust_finance_chrgs';
2425: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2426: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_errbuf) ;
2427: END;
2428: END IF;
2429: IF (p_retcode = g_SUCCESS) THEN
2430: BEGIN
2502: WHEN OTHERS THEN
2503: p_retcode := g_FAILURE;
2504: p_errbuf := SQLERRM;
2505: l_location := l_module_name||'.insert_fv_invoice_finance_chrgs';
2506: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2507: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_errbuf) ;
2508: END;
2509: END IF;
2510:
2503: p_retcode := g_FAILURE;
2504: p_errbuf := SQLERRM;
2505: l_location := l_module_name||'.insert_fv_invoice_finance_chrgs';
2506: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2507: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,p_errbuf) ;
2508: END;
2509: END IF;
2510:
2511: IF (p_retcode = g_SUCCESS) THEN
2523: argument3 => g_request_id
2524: );
2525:
2526: IF (fnd_log.level_statement >= g_CURRENT_LOG_LEVEL) THEN
2527: fv_utility.debug_mesg(fnd_log.level_statement, l_module_name, 'l_req_id = '||l_req_id);
2528: END IF;
2529:
2530:
2531: IF l_req_id = 0 THEN
2530:
2531: IF l_req_id = 0 THEN
2532: p_retcode := g_FAILURE;
2533: p_errbuf := 'Submitting the concurrent process, FVDCAFCO, failed contact System Admin.';
2534: fv_utility.log_mesg(fnd_log.level_error, l_module_name, p_errbuf);
2535: END IF;
2536: END IF;
2537:
2538: COMMIT;
2540: WHEN OTHERS THEN
2541: p_retcode := g_FAILURE;
2542: p_errbuf := SQLERRM;
2543: l_location := l_module_name||'.insert_fv_invoice_finance_chrgs';
2544: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2545: fv_utility.log_mesg(fnd_log.level_unexpected, l_module_name||'.final_exception', p_errbuf);
2546: ROLLBACK;
2547: END assign_finance_charge;
2548: BEGIN
2541: p_retcode := g_FAILURE;
2542: p_errbuf := SQLERRM;
2543: l_location := l_module_name||'.insert_fv_invoice_finance_chrgs';
2544: fv_utility.log_mesg(fnd_log.level_unexpected, l_location,l_location) ;
2545: fv_utility.log_mesg(fnd_log.level_unexpected, l_module_name||'.final_exception', p_errbuf);
2546: ROLLBACK;
2547: END assign_finance_charge;
2548: BEGIN
2549: initialize_global_variables;