279: l_line_index NUMBER;
280:
281: BEGIN
282:
283: x_return_status := FND_API.g_ret_sts_success;
284:
285: OPEN c_no_groups;
286: FETCH c_no_groups INTO l_no_groups;
287: CLOSE c_no_groups;
375: END IF;
376:
377: EXCEPTION
378: WHEN OTHERS THEN
379: x_return_status := FND_API.g_ret_sts_unexp_error;
380:
381: FND_MESSAGE.set_name('OZF', 'OZF_OFFER_PARTY_STMT_FAILED');
382: FND_MESSAGE.set_token('ERR_MSG',SQLERRM);
383: FND_MSG_PUB.add;
386: THEN
387: FND_MSG_PUB.add_exc_msg(g_pkg_name, l_api_name);
388: END IF;
389:
390: FND_MSG_PUB.count_and_get(p_encoded => FND_API.g_false,
391: p_count => x_msg_count,
392: p_data => x_msg_data);
393: END refresh_parties;
394:
409: l_ignore NUMBER;
410: --
411: BEGIN
412: --
413: x_return_status := FND_API.g_ret_sts_success;
414:
415: -- denorm parties
416: FND_DSQL.init;
417: FND_DSQL.add_text('INSERT INTO ozf_na_customers_temp(');
442: x_party_stmt => l_stmt_offer);
443:
444: ozf_utility_pvt.write_conc_log('-- Refresh_Parties (-) With Status: ' || x_return_status );
445:
446: IF x_return_status = FND_API.g_ret_sts_unexp_error
447: THEN
448: RAISE FND_API.g_exc_unexpected_error;
449: END IF;
450:
444: ozf_utility_pvt.write_conc_log('-- Refresh_Parties (-) With Status: ' || x_return_status );
445:
446: IF x_return_status = FND_API.g_ret_sts_unexp_error
447: THEN
448: RAISE FND_API.g_exc_unexpected_error;
449: END IF;
450:
451: IF l_stmt_offer IS NOT NULL
452: THEN
475: END IF;
476:
477: EXCEPTION
478: WHEN OTHERS THEN
479: x_return_status := FND_API.g_ret_sts_unexp_error;
480:
481: ozf_utility_pvt.write_conc_log(l_stmt_debug);
482: ozf_utility_pvt.write_conc_log(SQLERRM);
483:
485: THEN
486: FND_MSG_PUB.add_exc_msg(g_pkg_name, l_api_name);
487: END IF;
488:
489: FND_MSG_PUB.count_and_get(p_encoded => FND_API.g_false,
490: p_count => x_msg_count,
491: p_data => x_msg_data);
492: END populate_customers;
493:
562: l_stmt_debug VARCHAR2(32000) := NULL;
563: l_excl_func_area_id NUMBER;
564:
565: BEGIN
566: x_return_status := FND_API.g_ret_sts_success;
567:
568: l_org_id := fnd_profile.value('QP_ORGANIZATION_ID');
569:
570: FOR l_product IN c_product
709: END LOOP;
710:
711: EXCEPTION
712: WHEN OTHERS THEN
713: x_return_status := FND_API.g_ret_sts_unexp_error;
714:
715: ozf_utility_pvt.write_conc_log(l_stmt_debug);
716: ozf_utility_pvt.write_conc_log(SQLERRM);
717:
719: THEN
720: FND_MSG_PUB.add_exc_msg(g_pkg_name, l_api_name);
721: END IF;
722:
723: FND_MSG_PUB.count_and_get(p_encoded => FND_API.g_false,
724: p_count => x_msg_count,
725: p_data => x_msg_data);
726: END populate_prod_line;
727:
774:
775: l_excl_func_area_id NUMBER;
776:
777: BEGIN
778: x_return_status := FND_API.g_ret_sts_success;
779:
780: l_org_id := fnd_profile.value('QP_ORGANIZATION_ID');
781: ozf_utility_pvt.write_conc_log(l_api_name);
782:
936:
937:
938: EXCEPTION
939: WHEN OTHERS THEN
940: x_return_status := FND_API.g_ret_sts_unexp_error;
941:
942: ozf_utility_pvt.write_conc_log(l_stmt_debug);
943: ozf_utility_pvt.write_conc_log(SQLERRM);
944:
946: THEN
947: FND_MSG_PUB.add_exc_msg(g_pkg_name, l_api_name);
948: END IF;
949:
950: FND_MSG_PUB.count_and_get(p_encoded => FND_API.g_false,
951: p_count => x_msg_count,
952: p_data => x_msg_data);
953:
954: END populate_prod_tier;
1419: THEN
1420: ozf_utility_pvt.write_conc_log('Processing exception Id = ' || l_exception_rec.na_conc_exception_id);
1421: END IF;
1422:
1423: l_return_status := FND_API.g_ret_sts_success; -- bug 3655853
1424:
1425: l_act_budgets_rec.act_budget_used_by_id := l_exception_rec.act_budget_used_by_id;
1426: l_act_budgets_rec.arc_act_budget_used_by := l_exception_rec.arc_act_budget_used_by;
1427: l_act_budgets_rec.budget_source_type := l_exception_rec.budget_source_type;
1466: || l_return_status);
1467: ozf_utility_pvt.write_conc_log('Utilization Amount Created: ' || l_utilized_amount);
1468: END IF;
1469:
1470: IF l_return_status = FND_API.g_ret_sts_success
1471: THEN
1472: --
1473: DELETE FROM ozf_na_conc_exceptions
1474: WHERE na_conc_exception_id = l_exception_rec.na_conc_exception_id;
2044: WHERE acct_site.cust_acct_site_id = site_use.cust_acct_site_id
2045: AND acct_site.cust_account_id = cust.cust_account_id
2046: AND site_use.site_use_id = p_invoice_to_org_id ;
2047:
2048: l_exchange_rate_type VARCHAR2(30) := FND_API.G_MISS_CHAR;
2049: l_order_line_tbl t_order_line_tbl;
2050: l_ar_trx_line_tbl t_ar_trx_line_tbl;
2051: l_return_line_tbl t_return_line_tbl; -- catch Weight ER
2052: -- Bug 11889816
2263: --AMITAMKU bug 14692296 - added BEGIN/EXCEPTION/END block for each net accrual offer so that program can continue for next offer if one offer fails
2264: BEGIN
2265: SAVEPOINT net_accrual_offer;
2266: --
2267: l_return_status := FND_API.g_ret_sts_success;
2268:
2269: ozf_utility_pvt.write_conc_log('-----------------------------------------');
2270: ozf_utility_pvt.write_conc_log('--');
2271: ozf_utility_pvt.write_conc_log('-------- Processing Offer: '|| l_net_accrual_offers.offer_name);
2362: ,l_msg_data);
2363:
2364: ozf_utility_pvt.write_conc_log('Populate_Customers (-) With Status: ' ||l_return_status);
2365:
2366: IF l_return_status = Fnd_Api.g_ret_sts_error
2367: THEN
2368: RAISE Fnd_Api.g_exc_error;
2369: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error
2370: THEN
2364: ozf_utility_pvt.write_conc_log('Populate_Customers (-) With Status: ' ||l_return_status);
2365:
2366: IF l_return_status = Fnd_Api.g_ret_sts_error
2367: THEN
2368: RAISE Fnd_Api.g_exc_error;
2369: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error
2370: THEN
2371: RAISE Fnd_Api.g_exc_unexpected_error;
2372: END IF;
2365:
2366: IF l_return_status = Fnd_Api.g_ret_sts_error
2367: THEN
2368: RAISE Fnd_Api.g_exc_error;
2369: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error
2370: THEN
2371: RAISE Fnd_Api.g_exc_unexpected_error;
2372: END IF;
2373: --
2367: THEN
2368: RAISE Fnd_Api.g_exc_error;
2369: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error
2370: THEN
2371: RAISE Fnd_Api.g_exc_unexpected_error;
2372: END IF;
2373: --
2374: END IF;
2375: ------------------------------------------------------
2401: --
2402: END IF;
2403: ---------------------------------------------------------
2404:
2405: IF l_return_status = Fnd_Api.g_ret_sts_error THEN
2406: RAISE Fnd_Api.g_exc_error;
2407: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error THEN
2408: RAISE Fnd_Api.g_exc_unexpected_error;
2409: END IF;
2402: END IF;
2403: ---------------------------------------------------------
2404:
2405: IF l_return_status = Fnd_Api.g_ret_sts_error THEN
2406: RAISE Fnd_Api.g_exc_error;
2407: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error THEN
2408: RAISE Fnd_Api.g_exc_unexpected_error;
2409: END IF;
2410:
2403: ---------------------------------------------------------
2404:
2405: IF l_return_status = Fnd_Api.g_ret_sts_error THEN
2406: RAISE Fnd_Api.g_exc_error;
2407: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error THEN
2408: RAISE Fnd_Api.g_exc_unexpected_error;
2409: END IF;
2410:
2411: --Bug 11889816 : start
2404:
2405: IF l_return_status = Fnd_Api.g_ret_sts_error THEN
2406: RAISE Fnd_Api.g_exc_error;
2407: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error THEN
2408: RAISE Fnd_Api.g_exc_unexpected_error;
2409: END IF;
2410:
2411: --Bug 11889816 : start
2412: -- Insert distinct products to OZF_NA_UNIQUE_PRODUCTS_TEMP table to be used in Order cursors
2497: FND_MESSAGE.set_name('OZF', 'OZF_SETL_GLDATE_INVALID');
2498: FND_MSG_PUB.add;
2499: END IF;
2500: ozf_utility_pvt.write_conc_log;
2501: RAISE FND_API.G_EXC_ERROR;
2502: END IF;
2503:
2504: l_return_status := FND_API.g_ret_sts_success;
2505:
2500: ozf_utility_pvt.write_conc_log;
2501: RAISE FND_API.G_EXC_ERROR;
2502: END IF;
2503:
2504: l_return_status := FND_API.g_ret_sts_success;
2505:
2506: IF G_DEBUG_LOW THEN
2507: ozf_utility_pvt.write_conc_log('Order Line_Id: '||l_order_line_tbl(i).line_id);
2508: END IF;
2606: l_line_amount := l_new_amount;
2607: END IF;
2608: ozf_utility_pvt.write_conc_log('l_line_amount converted : '|| l_line_amount);
2609:
2610: IF l_return_status = Fnd_Api.g_ret_sts_error
2611: THEN
2612: ozf_utility_pvt.write_conc_log('Exp Error from Convert_Currency: ' || l_return_status);
2613: RAISE Fnd_Api.g_exc_error;
2614: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error
2609:
2610: IF l_return_status = Fnd_Api.g_ret_sts_error
2611: THEN
2612: ozf_utility_pvt.write_conc_log('Exp Error from Convert_Currency: ' || l_return_status);
2613: RAISE Fnd_Api.g_exc_error;
2614: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error
2615: THEN
2616: ozf_utility_pvt.write_conc_log('Unexp Error from Convert_Currency: ' || l_return_status);
2617: RAISE Fnd_Api.g_exc_unexpected_error;
2610: IF l_return_status = Fnd_Api.g_ret_sts_error
2611: THEN
2612: ozf_utility_pvt.write_conc_log('Exp Error from Convert_Currency: ' || l_return_status);
2613: RAISE Fnd_Api.g_exc_error;
2614: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error
2615: THEN
2616: ozf_utility_pvt.write_conc_log('Unexp Error from Convert_Currency: ' || l_return_status);
2617: RAISE Fnd_Api.g_exc_unexpected_error;
2618: END IF;
2613: RAISE Fnd_Api.g_exc_error;
2614: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error
2615: THEN
2616: ozf_utility_pvt.write_conc_log('Unexp Error from Convert_Currency: ' || l_return_status);
2617: RAISE Fnd_Api.g_exc_unexpected_error;
2618: END IF;
2619: --
2620: END IF;
2621:
2626: IF G_DEBUG_LOW THEN
2627: ozf_utility_pvt.write_conc_log('Pv_Referral_Comp_Pub.Get_Beneficiary (+)');
2628: END IF;
2629: pv_referral_comp_pub.get_beneficiary (p_api_version => 1.0,
2630: p_init_msg_list => FND_API.g_true,
2631: p_commit => FND_API.g_false,
2632: p_validation_level => FND_API.g_valid_level_full,
2633: p_order_header_id => l_order_line_tbl(i).header_id,
2634: p_order_line_id => l_order_line_tbl(i).line_id,
2627: ozf_utility_pvt.write_conc_log('Pv_Referral_Comp_Pub.Get_Beneficiary (+)');
2628: END IF;
2629: pv_referral_comp_pub.get_beneficiary (p_api_version => 1.0,
2630: p_init_msg_list => FND_API.g_true,
2631: p_commit => FND_API.g_false,
2632: p_validation_level => FND_API.g_valid_level_full,
2633: p_order_header_id => l_order_line_tbl(i).header_id,
2634: p_order_line_id => l_order_line_tbl(i).line_id,
2635: p_offer_id => l_net_accrual_offers.offer_id,
2628: END IF;
2629: pv_referral_comp_pub.get_beneficiary (p_api_version => 1.0,
2630: p_init_msg_list => FND_API.g_true,
2631: p_commit => FND_API.g_false,
2632: p_validation_level => FND_API.g_valid_level_full,
2633: p_order_header_id => l_order_line_tbl(i).header_id,
2634: p_order_line_id => l_order_line_tbl(i).line_id,
2635: p_offer_id => l_net_accrual_offers.offer_id,
2636: x_beneficiary_id => l_beneficiary_id,
2642: ozf_utility_pvt.write_conc_log('Pv_Referral_Comp_Pub.Get_Beneficiary (-) With Status: '||l_return_status);
2643: ozf_utility_pvt.write_conc_log('l_benificiary_id / l_referral_id: '||l_beneficiary_id || ' / ' || l_referral_id);
2644: END IF;
2645:
2646: IF l_return_status = Fnd_Api.g_ret_sts_error
2647: THEN
2648: ozf_utility_pvt.write_conc_log('Exp Error from Get_Beneficiary: ' || l_return_status);
2649: RAISE Fnd_Api.g_exc_error;
2650: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error
2645:
2646: IF l_return_status = Fnd_Api.g_ret_sts_error
2647: THEN
2648: ozf_utility_pvt.write_conc_log('Exp Error from Get_Beneficiary: ' || l_return_status);
2649: RAISE Fnd_Api.g_exc_error;
2650: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error
2651: THEN
2652: ozf_utility_pvt.write_conc_log('Unexp Error from Get_Beneficiary: ' || l_return_status);
2653: RAISE Fnd_Api.g_exc_unexpected_error;
2646: IF l_return_status = Fnd_Api.g_ret_sts_error
2647: THEN
2648: ozf_utility_pvt.write_conc_log('Exp Error from Get_Beneficiary: ' || l_return_status);
2649: RAISE Fnd_Api.g_exc_error;
2650: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error
2651: THEN
2652: ozf_utility_pvt.write_conc_log('Unexp Error from Get_Beneficiary: ' || l_return_status);
2653: RAISE Fnd_Api.g_exc_unexpected_error;
2654: END IF;
2649: RAISE Fnd_Api.g_exc_error;
2650: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error
2651: THEN
2652: ozf_utility_pvt.write_conc_log('Unexp Error from Get_Beneficiary: ' || l_return_status);
2653: RAISE Fnd_Api.g_exc_unexpected_error;
2654: END IF;
2655: --
2656:
2657: IF ( l_beneficiary_id IS NOT NULL )
2766: THEN
2767: --
2768: IF ( l_beneficiary_id IS NULL
2769: OR
2770: l_beneficiary_id = fnd_api.g_miss_num )
2771: THEN
2772: --
2773: -- Benificiay Id can be NULL only for PV Net Accrual Offers
2774: -- If PV decides not to accrue for this customer, it returns NULL
2839: IF G_DEBUG_LOW THEN
2840: ozf_utility_pvt.write_conc_log('Req Curr/Req Amt/Util Amt: ' || l_act_budgets_rec.request_currency || '/' || l_act_budgets_rec.request_amount || '/' || l_utilized_amount);
2841: END IF;
2842:
2843: IF l_return_status = Fnd_Api.g_ret_sts_error
2844: THEN
2845: ozf_utility_pvt.write_conc_log('Exp Error: 111 Process_Act_Budgets: line_id ( '||l_order_line_tbl(i).line_id
2846: || ' ) Error: '||l_msg_data);
2847: log_exception(l_act_budgets_rec, l_act_util_rec);
2844: THEN
2845: ozf_utility_pvt.write_conc_log('Exp Error: 111 Process_Act_Budgets: line_id ( '||l_order_line_tbl(i).line_id
2846: || ' ) Error: '||l_msg_data);
2847: log_exception(l_act_budgets_rec, l_act_util_rec);
2848: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error
2849: THEN
2850: ozf_utility_pvt.write_conc_log('UnExp Error: 222 Process_Act_Budgets: line_id ( '||l_order_line_tbl(i).line_id
2851: || ' ) Error: '||l_msg_data);
2852: log_exception(l_act_budgets_rec, l_act_util_rec);
2908: l_utilization_type := 'ACCRUAL';
2909: l_reference_type := NULL;
2910: l_referral_id := NULL;
2911:
2912: IF l_beneficiary_id IS NULL OR l_beneficiary_id = fnd_api.g_miss_num
2913: THEN
2914: -- This condition will never occur.
2915: -- For PV offers, the Batch Mode is always NO and Beneficiary is always required
2916: -- for a Net Accrual Offer.
2959: IF G_DEBUG_LOW THEN
2960: ozf_utility_pvt.write_conc_log('Req Curr/Req Amt/Util Amt: ' || l_act_budgets_rec.request_currency || '/' || l_act_budgets_rec.request_amount || '/' || l_utilized_amount);
2961: END IF;
2962:
2963: IF l_return_status = Fnd_Api.g_ret_sts_error
2964: THEN
2965: ozf_utility_pvt.write_conc_log('Exp Error: 333 Process_Act_Budgets Error: '||l_msg_data );
2966: ozf_utility_pvt.write_conc_log('Exp Error: 333 Process_Act_Budgets Error: '|| SQLERRM );
2967: log_exception(l_act_budgets_rec, l_act_util_rec);
2964: THEN
2965: ozf_utility_pvt.write_conc_log('Exp Error: 333 Process_Act_Budgets Error: '||l_msg_data );
2966: ozf_utility_pvt.write_conc_log('Exp Error: 333 Process_Act_Budgets Error: '|| SQLERRM );
2967: log_exception(l_act_budgets_rec, l_act_util_rec);
2968: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error
2969: THEN
2970: ozf_utility_pvt.write_conc_log('UnExp 444 Error: Process_Act_Budgets Error: '||l_msg_data );
2971: log_exception(l_act_budgets_rec, l_act_util_rec);
2972: END IF;
2991:
2992: FOR l_na_rule_line IN c_na_rule_lines(l_net_accrual_offers.na_rule_header_id)
2993: LOOP
2994: --
2995: l_return_status := FND_API.g_ret_sts_success; -- bug 3655853
2996:
2997: OPEN c_na_deduction_rule(l_na_rule_line.na_deduction_rule_id);
2998: FETCH c_na_deduction_rule INTO l_na_deduction_rule;
2999: CLOSE c_na_deduction_rule;
3014: --
3015: l_ar_dedu_amount := 0;
3016: l_ar_trx_line_tbl.delete;
3017:
3018: l_return_status := FND_API.g_ret_sts_success; -- bug 3655853
3019:
3020: -- Always set Start Date to offer start date for AR transactions because
3021: -- A transaction "A" can be created on Date1
3022: -- Net Accrual Engine could have run on Date2.It will not pick "A"
3064: FND_MESSAGE.set_name('OZF', 'OZF_SETL_GLDATE_INVALID');
3065: FND_MSG_PUB.add;
3066: END IF;
3067: ozf_utility_pvt.write_conc_log;
3068: RAISE FND_API.G_EXC_ERROR;
3069: END IF;
3070: END IF;
3071:
3072: l_customer_qualified := validate_customer(l_ar_trx_line_tbl(i).bill_to_site_use_id,
3109: OR l_batch_mode = 'YES' THEN
3110: l_ar_trx_line_tbl(i).extended_amount := l_new_amount;
3111: END IF;
3112:
3113: IF l_return_status = Fnd_Api.g_ret_sts_error
3114: THEN
3115: ozf_utility_pvt.write_conc_log('Convert currency ' || l_return_status);
3116: RAISE Fnd_Api.g_exc_error;
3117: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error
3112:
3113: IF l_return_status = Fnd_Api.g_ret_sts_error
3114: THEN
3115: ozf_utility_pvt.write_conc_log('Convert currency ' || l_return_status);
3116: RAISE Fnd_Api.g_exc_error;
3117: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error
3118: THEN
3119: ozf_utility_pvt.write_conc_log('Convert currency ' || l_return_status);
3120: RAISE Fnd_Api.g_exc_unexpected_error;
3113: IF l_return_status = Fnd_Api.g_ret_sts_error
3114: THEN
3115: ozf_utility_pvt.write_conc_log('Convert currency ' || l_return_status);
3116: RAISE Fnd_Api.g_exc_error;
3117: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error
3118: THEN
3119: ozf_utility_pvt.write_conc_log('Convert currency ' || l_return_status);
3120: RAISE Fnd_Api.g_exc_unexpected_error;
3121: END IF;
3116: RAISE Fnd_Api.g_exc_error;
3117: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error
3118: THEN
3119: ozf_utility_pvt.write_conc_log('Convert currency ' || l_return_status);
3120: RAISE Fnd_Api.g_exc_unexpected_error;
3121: END IF;
3122: --
3123: END IF;
3124:
3268: END IF;
3269:
3270: l_utilized_amount := 0;
3271:
3272: IF l_return_status = Fnd_Api.g_ret_sts_error
3273: THEN
3274: ozf_utility_pvt.write_conc_log('Exceptin : Msg from Budget API 3 : '||l_msg_data);
3275: log_exception(l_act_budgets_rec, l_act_util_rec);
3276: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error
3272: IF l_return_status = Fnd_Api.g_ret_sts_error
3273: THEN
3274: ozf_utility_pvt.write_conc_log('Exceptin : Msg from Budget API 3 : '||l_msg_data);
3275: log_exception(l_act_budgets_rec, l_act_util_rec);
3276: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error
3277: THEN
3278: ozf_utility_pvt.write_conc_log('UnException : Msg from Budget API 3 : '||l_msg_data);
3279: log_exception(l_act_budgets_rec, l_act_util_rec);
3280: END IF;
3357: END IF;
3358:
3359: l_utilized_amount := 0;
3360:
3361: IF l_return_status = Fnd_Api.g_ret_sts_error
3362: THEN
3363: ozf_utility_pvt.write_conc_log('Exception : Msg from Budget API 4 : '||l_msg_data);
3364: log_exception(l_act_budgets_rec, l_act_util_rec);
3365: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error THEN
3361: IF l_return_status = Fnd_Api.g_ret_sts_error
3362: THEN
3363: ozf_utility_pvt.write_conc_log('Exception : Msg from Budget API 4 : '||l_msg_data);
3364: log_exception(l_act_budgets_rec, l_act_util_rec);
3365: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error THEN
3366: ozf_utility_pvt.write_conc_log('UnException : Msg from Budget API 4 : '||l_msg_data);
3367: log_exception(l_act_budgets_rec, l_act_util_rec);
3368: END IF;
3369:
3416: FND_MESSAGE.set_name('OZF', 'OZF_SETL_GLDATE_INVALID');
3417: FND_MSG_PUB.add;
3418: END IF;
3419: ozf_utility_pvt.write_conc_log;
3420: RAISE FND_API.G_EXC_ERROR;
3421: END IF;
3422: END IF;
3423:
3424: l_return_status := FND_API.g_ret_sts_success; -- bug 3655853
3420: RAISE FND_API.G_EXC_ERROR;
3421: END IF;
3422: END IF;
3423:
3424: l_return_status := FND_API.g_ret_sts_success; -- bug 3655853
3425:
3426: -- Original value is negtive
3427: l_return_line_tbl(i).invoiced_quantity := -1 * l_return_line_tbl(i).invoiced_quantity;
3428: l_line_amount := l_return_line_tbl(i).invoiced_quantity * l_return_line_tbl(i).unit_selling_price;
3507: OR l_batch_mode = 'YES' THEN
3508: l_line_amount := l_new_amount;
3509: END IF;
3510:
3511: IF l_return_status = Fnd_Api.g_ret_sts_error
3512: THEN
3513: ozf_utility_pvt.write_conc_log('Convert currency ' || l_return_status);
3514: RAISE Fnd_Api.g_exc_error;
3515: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error
3510:
3511: IF l_return_status = Fnd_Api.g_ret_sts_error
3512: THEN
3513: ozf_utility_pvt.write_conc_log('Convert currency ' || l_return_status);
3514: RAISE Fnd_Api.g_exc_error;
3515: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error
3516: THEN
3517: ozf_utility_pvt.write_conc_log('Convert currency ' || l_return_status);
3518: RAISE Fnd_Api.g_exc_unexpected_error;
3511: IF l_return_status = Fnd_Api.g_ret_sts_error
3512: THEN
3513: ozf_utility_pvt.write_conc_log('Convert currency ' || l_return_status);
3514: RAISE Fnd_Api.g_exc_error;
3515: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error
3516: THEN
3517: ozf_utility_pvt.write_conc_log('Convert currency ' || l_return_status);
3518: RAISE Fnd_Api.g_exc_unexpected_error;
3519: END IF;
3514: RAISE Fnd_Api.g_exc_error;
3515: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error
3516: THEN
3517: ozf_utility_pvt.write_conc_log('Convert currency ' || l_return_status);
3518: RAISE Fnd_Api.g_exc_unexpected_error;
3519: END IF;
3520: --
3521: END IF;
3522: --
3552: IF l_net_accrual_offers.custom_setup_id = 105
3553: THEN
3554: --
3555: pv_referral_comp_pub.get_beneficiary (p_api_version => 1.0,
3556: p_init_msg_list => FND_API.g_false,
3557: p_commit => FND_API.g_false,
3558: p_validation_level => FND_API.g_valid_level_full,
3559: p_order_header_id => l_return_line_tbl(i).header_id,
3560: p_order_line_id => l_return_line_tbl(i).line_id,
3553: THEN
3554: --
3555: pv_referral_comp_pub.get_beneficiary (p_api_version => 1.0,
3556: p_init_msg_list => FND_API.g_false,
3557: p_commit => FND_API.g_false,
3558: p_validation_level => FND_API.g_valid_level_full,
3559: p_order_header_id => l_return_line_tbl(i).header_id,
3560: p_order_line_id => l_return_line_tbl(i).line_id,
3561: p_offer_id => l_net_accrual_offers.offer_id,
3554: --
3555: pv_referral_comp_pub.get_beneficiary (p_api_version => 1.0,
3556: p_init_msg_list => FND_API.g_false,
3557: p_commit => FND_API.g_false,
3558: p_validation_level => FND_API.g_valid_level_full,
3559: p_order_header_id => l_return_line_tbl(i).header_id,
3560: p_order_line_id => l_return_line_tbl(i).line_id,
3561: p_offer_id => l_net_accrual_offers.offer_id,
3562: x_beneficiary_id => l_beneficiary_id,
3576: l_referral_id := NULL;
3577: --
3578: END IF;
3579:
3580: IF l_beneficiary_id IS NULL OR l_beneficiary_id = fnd_api.g_miss_num THEN
3581: NULL;
3582: ELSE
3583: --ninarasi fix for bug 15991204
3584: OPEN c_cust_number (l_return_line_tbl(i).invoice_to_org_id);
3643: END IF;
3644:
3645: l_utilized_amount := 0;
3646:
3647: IF l_return_status = Fnd_Api.g_ret_sts_error THEN
3648: ozf_utility_pvt.write_conc_log('Exception : Msg from Budget API 5 : '||l_msg_data);
3649: log_exception(l_act_budgets_rec, l_act_util_rec);
3650: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error THEN
3651: ozf_utility_pvt.write_conc_log('UnException : Msg from Budget API 5 : '||l_msg_data);
3646:
3647: IF l_return_status = Fnd_Api.g_ret_sts_error THEN
3648: ozf_utility_pvt.write_conc_log('Exception : Msg from Budget API 5 : '||l_msg_data);
3649: log_exception(l_act_budgets_rec, l_act_util_rec);
3650: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error THEN
3651: ozf_utility_pvt.write_conc_log('UnException : Msg from Budget API 5 : '||l_msg_data);
3652: log_exception(l_act_budgets_rec, l_act_util_rec);
3653: END IF;
3654: --
3724: END IF;
3725:
3726: l_utilized_amount := 0;
3727:
3728: IF l_return_status = Fnd_Api.g_ret_sts_error THEN
3729: ozf_utility_pvt.write_conc_log('Exception : Msg from Budget API 6 : '||l_msg_data);
3730: log_exception(l_act_budgets_rec, l_act_util_rec);
3731: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error THEN
3732: ozf_utility_pvt.write_conc_log('UnException : Msg from Budget API 6 : '||l_msg_data);
3727:
3728: IF l_return_status = Fnd_Api.g_ret_sts_error THEN
3729: ozf_utility_pvt.write_conc_log('Exception : Msg from Budget API 6 : '||l_msg_data);
3730: log_exception(l_act_budgets_rec, l_act_util_rec);
3731: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error THEN
3732: ozf_utility_pvt.write_conc_log('UnException : Msg from Budget API 6 : '||l_msg_data);
3733: log_exception(l_act_budgets_rec, l_act_util_rec);
3734: END IF;
3735:
3766: ,l_end_date
3767: ,l_net_accrual_offers.qp_list_header_id)
3768: LOOP
3769: --
3770: l_return_status := FND_API.g_ret_sts_success; -- bug 3655853
3771:
3772: l_customer_qualified := validate_customer(NULL, NULL, l_tm_line.cust_account_id);
3773:
3774: IF l_customer_qualified = 'Y'
3867: FND_MESSAGE.set_name('OZF', 'OZF_SETL_GLDATE_INVALID');
3868: FND_MSG_PUB.add;
3869: END IF;
3870: ozf_utility_pvt.write_conc_log;
3871: RAISE FND_API.G_EXC_ERROR;
3872: END IF;
3873: END IF;
3874:
3875: IF G_DEBUG_LOW THEN
3934: ,p_from_amount => l_tm_line.line_amount
3935: ,x_to_amount => l_tm_dedu_line_amt
3936: ,x_rate => l_rate);
3937: --
3938: IF l_return_status = Fnd_Api.g_ret_sts_error
3939: THEN
3940: --
3941: ozf_utility_pvt.write_conc_log('Convert currency ' || l_return_status);
3942: RAISE Fnd_Api.g_exc_error;
3938: IF l_return_status = Fnd_Api.g_ret_sts_error
3939: THEN
3940: --
3941: ozf_utility_pvt.write_conc_log('Convert currency ' || l_return_status);
3942: RAISE Fnd_Api.g_exc_error;
3943: --
3944: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error
3945: THEN
3946: --
3940: --
3941: ozf_utility_pvt.write_conc_log('Convert currency ' || l_return_status);
3942: RAISE Fnd_Api.g_exc_error;
3943: --
3944: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error
3945: THEN
3946: --
3947: ozf_utility_pvt.write_conc_log('Convert currency ' || l_return_status);
3948: RAISE Fnd_Api.g_exc_unexpected_error;
3944: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error
3945: THEN
3946: --
3947: ozf_utility_pvt.write_conc_log('Convert currency ' || l_return_status);
3948: RAISE Fnd_Api.g_exc_unexpected_error;
3949: --
3950: END IF;
3951: --added for bug 8688281
3952: ELSE
3952: ELSE
3953: l_tm_dedu_line_amt := l_tm_line.line_amount;
3954: END IF; --IF l_net_accrual_offers.fund_request_curr_code <> l_tm_line.currency_code
3955:
3956: IF l_return_status = Fnd_Api.g_ret_sts_error THEN
3957: RAISE Fnd_Api.g_exc_error;
3958: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error THEN
3959: RAISE Fnd_Api.g_exc_unexpected_error;
3960: END IF;
3953: l_tm_dedu_line_amt := l_tm_line.line_amount;
3954: END IF; --IF l_net_accrual_offers.fund_request_curr_code <> l_tm_line.currency_code
3955:
3956: IF l_return_status = Fnd_Api.g_ret_sts_error THEN
3957: RAISE Fnd_Api.g_exc_error;
3958: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error THEN
3959: RAISE Fnd_Api.g_exc_unexpected_error;
3960: END IF;
3961:
3954: END IF; --IF l_net_accrual_offers.fund_request_curr_code <> l_tm_line.currency_code
3955:
3956: IF l_return_status = Fnd_Api.g_ret_sts_error THEN
3957: RAISE Fnd_Api.g_exc_error;
3958: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error THEN
3959: RAISE Fnd_Api.g_exc_unexpected_error;
3960: END IF;
3961:
3962: -- Fix for Bug 16301672
3955:
3956: IF l_return_status = Fnd_Api.g_ret_sts_error THEN
3957: RAISE Fnd_Api.g_exc_error;
3958: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error THEN
3959: RAISE Fnd_Api.g_exc_unexpected_error;
3960: END IF;
3961:
3962: -- Fix for Bug 16301672
3963: IF l_reduce_line_amount THEN
4133: l_utilized_amount := 0;
4134:
4135: ozf_utility_pvt.write_conc_log('Msg from Budget API : '||l_msg_data);
4136:
4137: IF l_return_status = Fnd_Api.g_ret_sts_error THEN
4138: ozf_utility_pvt.write_conc_log('Exception : Msg from Budget API 7 : '||l_msg_data);
4139: log_exception(l_act_budgets_rec, l_act_util_rec);
4140: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error THEN
4141: ozf_utility_pvt.write_conc_log('UnException : Msg from Budget API 7 : '||l_msg_data);
4136:
4137: IF l_return_status = Fnd_Api.g_ret_sts_error THEN
4138: ozf_utility_pvt.write_conc_log('Exception : Msg from Budget API 7 : '||l_msg_data);
4139: log_exception(l_act_budgets_rec, l_act_util_rec);
4140: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error THEN
4141: ozf_utility_pvt.write_conc_log('UnException : Msg from Budget API 7 : '||l_msg_data);
4142: log_exception(l_act_budgets_rec, l_act_util_rec);
4143: END IF;
4144:
4224: FND_MESSAGE.set_name('OZF', 'OZF_SETL_GLDATE_INVALID');
4225: FND_MSG_PUB.add;
4226: END IF;
4227: ozf_utility_pvt.write_conc_log;
4228: RAISE FND_API.G_EXC_ERROR;
4229: END IF;
4230: END IF;
4231:
4232: l_return_status := FND_API.g_ret_sts_success;
4228: RAISE FND_API.G_EXC_ERROR;
4229: END IF;
4230: END IF;
4231:
4232: l_return_status := FND_API.g_ret_sts_success;
4233:
4234: l_idsm_line_processed := l_idsm_line_tbl(i).line_id;
4235:
4236: IF G_DEBUG_LOW THEN
4325: OR l_batch_mode = 'YES' THEN
4326: l_line_amount := l_new_amount;
4327: END IF;
4328:
4329: IF l_return_status = Fnd_Api.g_ret_sts_error
4330: THEN
4331: ozf_utility_pvt.write_conc_log('Exp Error from Convert_Currency: ' || l_return_status);
4332: RAISE Fnd_Api.g_exc_error;
4333: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error
4328:
4329: IF l_return_status = Fnd_Api.g_ret_sts_error
4330: THEN
4331: ozf_utility_pvt.write_conc_log('Exp Error from Convert_Currency: ' || l_return_status);
4332: RAISE Fnd_Api.g_exc_error;
4333: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error
4334: THEN
4335: ozf_utility_pvt.write_conc_log('Unexp Error from Convert_Currency: ' || l_return_status);
4336: RAISE Fnd_Api.g_exc_unexpected_error;
4329: IF l_return_status = Fnd_Api.g_ret_sts_error
4330: THEN
4331: ozf_utility_pvt.write_conc_log('Exp Error from Convert_Currency: ' || l_return_status);
4332: RAISE Fnd_Api.g_exc_error;
4333: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error
4334: THEN
4335: ozf_utility_pvt.write_conc_log('Unexp Error from Convert_Currency: ' || l_return_status);
4336: RAISE Fnd_Api.g_exc_unexpected_error;
4337: END IF;
4332: RAISE Fnd_Api.g_exc_error;
4333: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error
4334: THEN
4335: ozf_utility_pvt.write_conc_log('Unexp Error from Convert_Currency: ' || l_return_status);
4336: RAISE Fnd_Api.g_exc_unexpected_error;
4337: END IF;
4338: --
4339: END IF;
4340:
4345: IF G_DEBUG_LOW THEN
4346: ozf_utility_pvt.write_conc_log('Pv_Referral_Comp_Pub.Get_Beneficiary (+)');
4347: END IF;
4348: pv_referral_comp_pub.get_beneficiary (p_api_version => 1.0,
4349: p_init_msg_list => FND_API.g_true,
4350: p_commit => FND_API.g_false,
4351: p_validation_level => FND_API.g_valid_level_full,
4352: p_order_header_id => l_idsm_line_tbl(i).header_id,
4353: p_order_line_id => l_idsm_line_tbl(i).line_id,
4346: ozf_utility_pvt.write_conc_log('Pv_Referral_Comp_Pub.Get_Beneficiary (+)');
4347: END IF;
4348: pv_referral_comp_pub.get_beneficiary (p_api_version => 1.0,
4349: p_init_msg_list => FND_API.g_true,
4350: p_commit => FND_API.g_false,
4351: p_validation_level => FND_API.g_valid_level_full,
4352: p_order_header_id => l_idsm_line_tbl(i).header_id,
4353: p_order_line_id => l_idsm_line_tbl(i).line_id,
4354: p_offer_id => l_net_accrual_offers.offer_id,
4347: END IF;
4348: pv_referral_comp_pub.get_beneficiary (p_api_version => 1.0,
4349: p_init_msg_list => FND_API.g_true,
4350: p_commit => FND_API.g_false,
4351: p_validation_level => FND_API.g_valid_level_full,
4352: p_order_header_id => l_idsm_line_tbl(i).header_id,
4353: p_order_line_id => l_idsm_line_tbl(i).line_id,
4354: p_offer_id => l_net_accrual_offers.offer_id,
4355: x_beneficiary_id => l_beneficiary_id,
4361: ozf_utility_pvt.write_conc_log('Pv_Referral_Comp_Pub.Get_Beneficiary (-) With Status: ' || l_return_status);
4362: ozf_utility_pvt.write_conc_log('l_benificiary_id / l_referral_id: ' || l_beneficiary_id || ' / ' || l_referral_id);
4363: END IF;
4364:
4365: IF l_return_status = Fnd_Api.g_ret_sts_error
4366: THEN
4367: ozf_utility_pvt.write_conc_log('Exp Error from Get_Beneficiary: ' || l_return_status);
4368: RAISE Fnd_Api.g_exc_error;
4369: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error
4364:
4365: IF l_return_status = Fnd_Api.g_ret_sts_error
4366: THEN
4367: ozf_utility_pvt.write_conc_log('Exp Error from Get_Beneficiary: ' || l_return_status);
4368: RAISE Fnd_Api.g_exc_error;
4369: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error
4370: THEN
4371: ozf_utility_pvt.write_conc_log('Unexp Error from Get_Beneficiary: ' || l_return_status);
4372: RAISE Fnd_Api.g_exc_unexpected_error;
4365: IF l_return_status = Fnd_Api.g_ret_sts_error
4366: THEN
4367: ozf_utility_pvt.write_conc_log('Exp Error from Get_Beneficiary: ' || l_return_status);
4368: RAISE Fnd_Api.g_exc_error;
4369: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error
4370: THEN
4371: ozf_utility_pvt.write_conc_log('Unexp Error from Get_Beneficiary: ' || l_return_status);
4372: RAISE Fnd_Api.g_exc_unexpected_error;
4373: END IF;
4368: RAISE Fnd_Api.g_exc_error;
4369: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error
4370: THEN
4371: ozf_utility_pvt.write_conc_log('Unexp Error from Get_Beneficiary: ' || l_return_status);
4372: RAISE Fnd_Api.g_exc_unexpected_error;
4373: END IF;
4374: --
4375:
4376: IF ( l_beneficiary_id IS NOT NULL )
4427: THEN
4428: --
4429: IF ( l_beneficiary_id IS NULL
4430: OR
4431: l_beneficiary_id = fnd_api.g_miss_num )
4432: THEN
4433: --
4434: -- Benificiay Id can be NULL only for PV Net Accrual Offers
4435: -- If PV decides not to accrue for this customer, it returns NULL
4492: IF G_DEBUG_LOW THEN
4493: ozf_utility_pvt.write_conc_log('Req Curr/Req Amt/Util Amt: ' || l_act_budgets_rec.request_currency || '/' || l_act_budgets_rec.request_amount || '/' || l_utilized_amount);
4494: END IF;
4495:
4496: IF l_return_status = Fnd_Api.g_ret_sts_error
4497: THEN
4498: ozf_utility_pvt.write_conc_log('Exp Error 8 : Process_Act_Budgets: Resale line_id ( ' || l_idsm_line_tbl(i).line_id
4499: || ' ) Error: ' || l_msg_data);
4500: log_exception(l_act_budgets_rec, l_act_util_rec);
4497: THEN
4498: ozf_utility_pvt.write_conc_log('Exp Error 8 : Process_Act_Budgets: Resale line_id ( ' || l_idsm_line_tbl(i).line_id
4499: || ' ) Error: ' || l_msg_data);
4500: log_exception(l_act_budgets_rec, l_act_util_rec);
4501: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error
4502: THEN
4503: ozf_utility_pvt.write_conc_log('UnExp Error 8 : Process_Act_Budgets: Resale line_id ( ' || l_idsm_line_tbl(i).line_id
4504: || ' ) Error: ' || l_msg_data);
4505: log_exception(l_act_budgets_rec, l_act_util_rec);
4543: l_utilization_type := 'ACCRUAL';
4544: l_reference_type := NULL;
4545: l_referral_id := NULL;
4546:
4547: IF l_beneficiary_id IS NULL OR l_beneficiary_id = fnd_api.g_miss_num
4548: THEN
4549: -- This condition will never occur.
4550: -- For PV offers, the Batch Mode is always NO and Beneficiary is always required
4551: -- for a Net Accrual Offer.
4594: IF G_DEBUG_LOW THEN
4595: ozf_utility_pvt.write_conc_log('Req Curr/Req Amt/Util Amt: ' || l_act_budgets_rec.request_currency || '/' || l_act_budgets_rec.request_amount || '/' || l_utilized_amount);
4596: END IF;
4597:
4598: IF l_return_status = Fnd_Api.g_ret_sts_error
4599: THEN
4600: ozf_utility_pvt.write_conc_log('Exp Error 9 : Process_Act_Budgets Error: ' || l_msg_data );
4601: log_exception(l_act_budgets_rec, l_act_util_rec);
4602: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error
4598: IF l_return_status = Fnd_Api.g_ret_sts_error
4599: THEN
4600: ozf_utility_pvt.write_conc_log('Exp Error 9 : Process_Act_Budgets Error: ' || l_msg_data );
4601: log_exception(l_act_budgets_rec, l_act_util_rec);
4602: ELSIF l_return_status = Fnd_Api.g_ret_sts_unexp_error
4603: THEN
4604: ozf_utility_pvt.write_conc_log('UnExp Error 9 : Process_Act_Budgets Error: ' || l_msg_data );
4605: log_exception(l_act_budgets_rec, l_act_util_rec);
4606: END IF;
4625:
4626: --AMITAMKU bug 14692296 - added BEGIN/EXCEPTION/END block for each net accrual offer so that program can continue for next offer if one offer fails
4627: EXCEPTION
4628:
4629: WHEN FND_API.G_EXC_ERROR THEN
4630: ROLLBACK TO net_accrual_offer;
4631: -- Standard call to get message count and if count=1, get the message
4632: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE,
4633: p_count => l_msg_count,
4628:
4629: WHEN FND_API.G_EXC_ERROR THEN
4630: ROLLBACK TO net_accrual_offer;
4631: -- Standard call to get message count and if count=1, get the message
4632: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE,
4633: p_count => l_msg_count,
4634: p_data => l_msg_data);
4635:
4636: ERRBUF := l_msg_data;
4635:
4636: ERRBUF := l_msg_data;
4637: RETCODE := '1';
4638:
4639: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
4640: ROLLBACK TO net_accrual_offer;
4641: -- Standard call to get message count and if count=1, get the message
4642: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE,
4643: p_count => l_msg_count,
4638:
4639: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
4640: ROLLBACK TO net_accrual_offer;
4641: -- Standard call to get message count and if count=1, get the message
4642: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE,
4643: p_count => l_msg_count,
4644: p_data => l_msg_data);
4645:
4646: ERRBUF := l_msg_data;
4648:
4649: WHEN OTHERS THEN
4650: ROLLBACK TO net_accrual_offer;
4651: -- Standard call to get message count and if count=1, get the message
4652: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE,
4653: p_count => l_msg_count,
4654: p_data => l_msg_data);
4655: --ERRBUF := l_msg_data;
4656: ERRBUF := SQLERRM;
4669: ozf_utility_pvt.write_conc_log('-- Done -- ' || to_char(sysdate,'MM/DD/YYYY:HH:MM:SS'));
4670:
4671: Fnd_Msg_Pub.Count_AND_Get(p_count => l_msg_count,
4672: p_data => l_msg_data,
4673: p_encoded => Fnd_Api.G_FALSE);
4674:
4675: EXCEPTION
4676:
4677: WHEN OZF_Utility_PVT.resource_locked THEN
4676:
4677: WHEN OZF_Utility_PVT.resource_locked THEN
4678: OZF_Utility_PVT.Error_Message(p_message_name => 'OZF_API_RESOURCE_LOCKED');
4679:
4680: WHEN FND_API.G_EXC_ERROR THEN
4681: --ROLLBACK TO net_accrual_engine;
4682: ROLLBACK;
4683: -- Standard call to get message count and if count=1, get the message
4684: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE,
4680: WHEN FND_API.G_EXC_ERROR THEN
4681: --ROLLBACK TO net_accrual_engine;
4682: ROLLBACK;
4683: -- Standard call to get message count and if count=1, get the message
4684: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE,
4685: p_count => l_msg_count,
4686: p_data => l_msg_data);
4687:
4688: ERRBUF := l_msg_data;
4687:
4688: ERRBUF := l_msg_data;
4689: RETCODE := '2';
4690:
4691: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
4692: ROLLBACK ;
4693: -- Standard call to get message count and if count=1, get the message
4694: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE,
4695: p_count => l_msg_count,
4690:
4691: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
4692: ROLLBACK ;
4693: -- Standard call to get message count and if count=1, get the message
4694: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE,
4695: p_count => l_msg_count,
4696: p_data => l_msg_data);
4697:
4698: ERRBUF := l_msg_data;
4700:
4701: WHEN OTHERS THEN
4702: ROLLBACK ;
4703: -- Standard call to get message count and if count=1, get the message
4704: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE,
4705: p_count => l_msg_count,
4706: p_data => l_msg_data);
4707: --ERRBUF := l_msg_data;
4708: ERRBUF := SQLERRM;
4758: BEGIN
4759:
4760: SAVEPOINT retroactive_offer_adj;
4761:
4762: IF Fnd_Api.to_boolean(p_init_msg_list) THEN
4763: Fnd_Msg_Pub.initialize;
4764: END IF;
4765:
4766: x_return_status := Fnd_Api.g_ret_sts_success;
4762: IF Fnd_Api.to_boolean(p_init_msg_list) THEN
4763: Fnd_Msg_Pub.initialize;
4764: END IF;
4765:
4766: x_return_status := Fnd_Api.g_ret_sts_success;
4767:
4768: OPEN c_offer_type;
4769: FETCH c_offer_type INTO l_offer_type, l_tier_level, l_qp_list_header_id, l_custom_setup_id;
4770: CLOSE c_offer_type;
4785: END IF;
4786: END LOOP;
4787:
4788: EXCEPTION
4789: WHEN Fnd_Api.G_EXC_ERROR THEN
4790: x_return_status := Fnd_Api.g_ret_sts_error;
4791: ROLLBACK TO retroactive_offer_adj;
4792: Fnd_Msg_Pub.Count_AND_Get
4793: ( p_count => x_msg_count,
4786: END LOOP;
4787:
4788: EXCEPTION
4789: WHEN Fnd_Api.G_EXC_ERROR THEN
4790: x_return_status := Fnd_Api.g_ret_sts_error;
4791: ROLLBACK TO retroactive_offer_adj;
4792: Fnd_Msg_Pub.Count_AND_Get
4793: ( p_count => x_msg_count,
4794: p_data => x_msg_data,
4791: ROLLBACK TO retroactive_offer_adj;
4792: Fnd_Msg_Pub.Count_AND_Get
4793: ( p_count => x_msg_count,
4794: p_data => x_msg_data,
4795: p_encoded => Fnd_Api.G_FALSE
4796: );
4797: WHEN Fnd_Api.G_EXC_UNEXPECTED_ERROR THEN
4798: x_return_status := Fnd_Api.g_ret_sts_unexp_error;
4799: ROLLBACK TO retroactive_offer_adj;
4793: ( p_count => x_msg_count,
4794: p_data => x_msg_data,
4795: p_encoded => Fnd_Api.G_FALSE
4796: );
4797: WHEN Fnd_Api.G_EXC_UNEXPECTED_ERROR THEN
4798: x_return_status := Fnd_Api.g_ret_sts_unexp_error;
4799: ROLLBACK TO retroactive_offer_adj;
4800: Fnd_Msg_Pub.Count_AND_Get
4801: ( p_count => x_msg_count,
4794: p_data => x_msg_data,
4795: p_encoded => Fnd_Api.G_FALSE
4796: );
4797: WHEN Fnd_Api.G_EXC_UNEXPECTED_ERROR THEN
4798: x_return_status := Fnd_Api.g_ret_sts_unexp_error;
4799: ROLLBACK TO retroactive_offer_adj;
4800: Fnd_Msg_Pub.Count_AND_Get
4801: ( p_count => x_msg_count,
4802: p_data => x_msg_data,
4799: ROLLBACK TO retroactive_offer_adj;
4800: Fnd_Msg_Pub.Count_AND_Get
4801: ( p_count => x_msg_count,
4802: p_data => x_msg_data,
4803: p_encoded => Fnd_Api.G_FALSE
4804: );
4805: WHEN OTHERS THEN
4806: x_return_status := Fnd_Api.g_ret_sts_unexp_error;
4807: ROLLBACK TO retroactive_offer_adj;
4802: p_data => x_msg_data,
4803: p_encoded => Fnd_Api.G_FALSE
4804: );
4805: WHEN OTHERS THEN
4806: x_return_status := Fnd_Api.g_ret_sts_unexp_error;
4807: ROLLBACK TO retroactive_offer_adj;
4808: IF Fnd_Msg_Pub.Check_Msg_Level ( Fnd_Msg_Pub.G_MSG_LVL_UNEXP_ERROR ) THEN
4809: Fnd_Msg_Pub.Add_Exc_Msg( G_PKG_NAME,l_api_name);
4810: END IF;
4810: END IF;
4811: Fnd_Msg_Pub.Count_AND_Get
4812: ( p_count => x_msg_count,
4813: p_data => x_msg_data,
4814: p_encoded => Fnd_Api.G_FALSE
4815: );
4816:
4817: END retroactive_offer_adj;
4818:
4873:
4874: BEGIN
4875: SAVEPOINT offer_adj_new_product;
4876:
4877: IF Fnd_Api.to_boolean(p_init_msg_list) THEN
4878: Fnd_Msg_Pub.initialize;
4879: END IF;
4880:
4881: x_return_status := Fnd_Api.g_ret_sts_success;
4877: IF Fnd_Api.to_boolean(p_init_msg_list) THEN
4878: Fnd_Msg_Pub.initialize;
4879: END IF;
4880:
4881: x_return_status := Fnd_Api.g_ret_sts_success;
4882:
4883: OPEN c_offer_type;
4884: FETCH c_offer_type INTO l_offer_type,
4885: l_tier_level,
4934: --
4935: END LOOP;
4936:
4937: EXCEPTION
4938: WHEN Fnd_Api.G_EXC_ERROR THEN
4939: x_return_status := Fnd_Api.g_ret_sts_error;
4940: ROLLBACK TO offer_adj_new_product;
4941: Fnd_Msg_Pub.Count_AND_Get
4942: ( p_count => x_msg_count,
4935: END LOOP;
4936:
4937: EXCEPTION
4938: WHEN Fnd_Api.G_EXC_ERROR THEN
4939: x_return_status := Fnd_Api.g_ret_sts_error;
4940: ROLLBACK TO offer_adj_new_product;
4941: Fnd_Msg_Pub.Count_AND_Get
4942: ( p_count => x_msg_count,
4943: p_data => x_msg_data,
4940: ROLLBACK TO offer_adj_new_product;
4941: Fnd_Msg_Pub.Count_AND_Get
4942: ( p_count => x_msg_count,
4943: p_data => x_msg_data,
4944: p_encoded => Fnd_Api.G_FALSE
4945: );
4946: WHEN Fnd_Api.G_EXC_UNEXPECTED_ERROR THEN
4947: x_return_status := Fnd_Api.g_ret_sts_unexp_error;
4948: ROLLBACK TO offer_adj_new_product;
4942: ( p_count => x_msg_count,
4943: p_data => x_msg_data,
4944: p_encoded => Fnd_Api.G_FALSE
4945: );
4946: WHEN Fnd_Api.G_EXC_UNEXPECTED_ERROR THEN
4947: x_return_status := Fnd_Api.g_ret_sts_unexp_error;
4948: ROLLBACK TO offer_adj_new_product;
4949: Fnd_Msg_Pub.Count_AND_Get
4950: ( p_count => x_msg_count,
4943: p_data => x_msg_data,
4944: p_encoded => Fnd_Api.G_FALSE
4945: );
4946: WHEN Fnd_Api.G_EXC_UNEXPECTED_ERROR THEN
4947: x_return_status := Fnd_Api.g_ret_sts_unexp_error;
4948: ROLLBACK TO offer_adj_new_product;
4949: Fnd_Msg_Pub.Count_AND_Get
4950: ( p_count => x_msg_count,
4951: p_data => x_msg_data,
4948: ROLLBACK TO offer_adj_new_product;
4949: Fnd_Msg_Pub.Count_AND_Get
4950: ( p_count => x_msg_count,
4951: p_data => x_msg_data,
4952: p_encoded => Fnd_Api.G_FALSE
4953: );
4954: WHEN OTHERS THEN
4955: x_return_status := Fnd_Api.g_ret_sts_unexp_error;
4956: ROLLBACK TO offer_adj_new_product;
4951: p_data => x_msg_data,
4952: p_encoded => Fnd_Api.G_FALSE
4953: );
4954: WHEN OTHERS THEN
4955: x_return_status := Fnd_Api.g_ret_sts_unexp_error;
4956: ROLLBACK TO offer_adj_new_product;
4957: IF Fnd_Msg_Pub.Check_Msg_Level ( Fnd_Msg_Pub.G_MSG_LVL_UNEXP_ERROR ) THEN
4958: Fnd_Msg_Pub.Add_Exc_Msg( G_PKG_NAME,l_api_name);
4959: END IF;
4959: END IF;
4960: Fnd_Msg_Pub.Count_AND_Get
4961: ( p_count => x_msg_count,
4962: p_data => x_msg_data,
4963: p_encoded => Fnd_Api.G_FALSE
4964: );
4965:
4966: END offer_adj_new_product;
4967: