249: AND object_type = 'OFFR'
250: AND object_id = p_offer_id;
251:
252: BEGIN
253: x_return_status := fnd_api.g_ret_sts_success;
254:
255: IF g_debug_flag = 'Y' THEN
256: ozf_utility_pvt.write_conc_log(' D: ENTER calculate_accrual_amount offer_id=' || p_src_id || ' p_earned_amt=' || p_earned_amt);
257: END IF;
369:
370: IF g_debug_flag = 'Y' THEN
371: ozf_utility_pvt.write_conc_log (' D: calculate_accrual_amount(): check_budget_qualification status: ' || l_return_status);
372: END IF;
373: IF l_return_status <> fnd_api.g_ret_sts_success THEN
374: l_eligible_flag := false;
375: END IF;
376: ELSE
377: l_eligible_flag := true;
422: -- And once you add another budget to the offer and RUN FAE with Run Exception Message param as Yes, the accruals will be created for the offer/budget.
423: -- Note that the amounts are in one currency
424: IF l_total_amount = 0 THEN
425: IF g_recal_flag = 'N' THEN --and p_earned_amt < 0 THEN -- ??? really needed ???
426: x_return_status := fnd_api.g_ret_sts_error;
427: RETURN;
428: END IF;
429: END IF;
430:
481: END IF;
482: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error) THEN
483: fnd_msg_pub.add_exc_msg (g_pkg_name, 'Calculate Accrual');
484: END IF;
485: x_return_status := fnd_api.g_ret_sts_unexp_error;
486: END calculate_accrual_amount;
487:
488: /*****************************************************************************************/
489: -- Start of Comments
565: -- Standard Start of API savepoint
566: SAVEPOINT create_actbudgets_rec;
567:
568: -- Initialize API return status to success
569: x_return_status := fnd_api.g_ret_sts_success;
570: /* Added for bug 7030415
571: This currency conversion is for approved_amount_fc column in ozf_act_budgets table.
572: Using the utilization org_id because to_currency is the functional currency of
573: order's org's ledger.*/
600: IF g_debug_flag = 'Y' THEN
601: ozf_utility_pvt.write_conc_log(l_full_name || 'calculate_functional_curr: ' || l_return_status);
602: END IF;
603:
604: IF l_return_status = fnd_api.g_ret_sts_error THEN
605: RAISE fnd_api.g_exc_error;
606: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
607: RAISE fnd_api.g_exc_unexpected_error;
608: END IF;
601: ozf_utility_pvt.write_conc_log(l_full_name || 'calculate_functional_curr: ' || l_return_status);
602: END IF;
603:
604: IF l_return_status = fnd_api.g_ret_sts_error THEN
605: RAISE fnd_api.g_exc_error;
606: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
607: RAISE fnd_api.g_exc_unexpected_error;
608: END IF;
609:
602: END IF;
603:
604: IF l_return_status = fnd_api.g_ret_sts_error THEN
605: RAISE fnd_api.g_exc_error;
606: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
607: RAISE fnd_api.g_exc_unexpected_error;
608: END IF;
609:
610: END IF;
603:
604: IF l_return_status = fnd_api.g_ret_sts_error THEN
605: RAISE fnd_api.g_exc_error;
606: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
607: RAISE fnd_api.g_exc_unexpected_error;
608: END IF;
609:
610: END IF;
611:
692: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error) THEN
693: fnd_message.set_name ('OZF', 'OZF_API_RECORD_NOT_FOUND');
694: fnd_msg_pub.ADD;
695: END IF;
696: RAISE fnd_api.g_exc_unexpected_error;
697: END IF;
698:
699: RETURN; -- exit from program.
700: END IF;
700: END IF;
701:
702: IF l_act_budgets_rec.request_currency IS NULL THEN
703: ozf_utility_pvt.write_conc_log ('OZF_ACT_BUDG_NO_CURRENCY');
704: x_return_status := fnd_api.g_ret_sts_error;
705: END IF;
706:
707:
708:
787: -- Standard call to get message count AND IF count is 1, get message info.
788: fnd_msg_pub.count_and_get (
789: p_count=> x_msg_count,
790: p_data=> x_msg_data,
791: p_encoded=> fnd_api.g_false
792: );
793:
794: EXCEPTION
795: WHEN fnd_api.g_exc_error THEN
791: p_encoded=> fnd_api.g_false
792: );
793:
794: EXCEPTION
795: WHEN fnd_api.g_exc_error THEN
796: ROLLBACK TO create_actbudgets_rec;
797: x_return_status := fnd_api.g_ret_sts_error;
798: fnd_msg_pub.count_and_get (
799: p_count=> x_msg_count,
793:
794: EXCEPTION
795: WHEN fnd_api.g_exc_error THEN
796: ROLLBACK TO create_actbudgets_rec;
797: x_return_status := fnd_api.g_ret_sts_error;
798: fnd_msg_pub.count_and_get (
799: p_count=> x_msg_count,
800: p_data=> x_msg_data,
801: p_encoded=> fnd_api.g_false
797: x_return_status := fnd_api.g_ret_sts_error;
798: fnd_msg_pub.count_and_get (
799: p_count=> x_msg_count,
800: p_data=> x_msg_data,
801: p_encoded=> fnd_api.g_false
802: );
803:
804: WHEN fnd_api.g_exc_unexpected_error THEN
805: ROLLBACK TO create_actbudgets_rec;
800: p_data=> x_msg_data,
801: p_encoded=> fnd_api.g_false
802: );
803:
804: WHEN fnd_api.g_exc_unexpected_error THEN
805: ROLLBACK TO create_actbudgets_rec;
806: x_return_status := fnd_api.g_ret_sts_unexp_error;
807: fnd_msg_pub.count_and_get (
808: p_count=> x_msg_count,
802: );
803:
804: WHEN fnd_api.g_exc_unexpected_error THEN
805: ROLLBACK TO create_actbudgets_rec;
806: x_return_status := fnd_api.g_ret_sts_unexp_error;
807: fnd_msg_pub.count_and_get (
808: p_count=> x_msg_count,
809: p_data=> x_msg_data,
810: p_encoded=>fnd_api.g_false
806: x_return_status := fnd_api.g_ret_sts_unexp_error;
807: fnd_msg_pub.count_and_get (
808: p_count=> x_msg_count,
809: p_data=> x_msg_data,
810: p_encoded=>fnd_api.g_false
811: );
812:
813: WHEN OTHERS THEN
814: ROLLBACK TO create_actbudgets_rec;
811: );
812:
813: WHEN OTHERS THEN
814: ROLLBACK TO create_actbudgets_rec;
815: x_return_status := fnd_api.g_ret_sts_unexp_error;
816:
817: fnd_msg_pub.count_and_get (
818: p_count=> x_msg_count,
819: p_data=> x_msg_data,
816:
817: fnd_msg_pub.count_and_get (
818: p_count=> x_msg_count,
819: p_data=> x_msg_data,
820: p_encoded=> fnd_api.g_false
821: );
822:
823: END create_actbudgets_rec;
824:
1152: ozf_utility_pvt.write_conc_log( l_full_name
1153: || ': start' || p_utilization_rec.utilization_type);
1154: END IF;
1155:
1156: x_return_status := fnd_api.g_ret_sts_success;
1157:
1158: --Bug 13463758 Decide if it is partial shipment/backorder/split
1159: --scenario and skip to update instead of insert.
1160: -- Update ozf_funds_utilized_allb_
1233: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error) THEN
1234: fnd_message.set_name ('OZF', 'OZF_API_RECORD_NOT_FOUND');
1235: fnd_msg_pub.ADD;
1236: END IF;
1237: RAISE fnd_api.g_exc_error;
1238: END IF;
1239: CLOSE c_fund_b;
1240:
1241: OPEN c_offinv_flag(l_utilization_rec.org_id);
1390: ,x_exchange_rate=> l_utilization_rec.exchange_rate
1391: ,x_return_status=> l_return_status
1392: );
1393:
1394: IF l_return_status = fnd_api.g_ret_sts_error THEN
1395: RAISE fnd_api.g_exc_error;
1396: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
1397: RAISE fnd_api.g_exc_unexpected_error;
1398: END IF;
1391: ,x_return_status=> l_return_status
1392: );
1393:
1394: IF l_return_status = fnd_api.g_ret_sts_error THEN
1395: RAISE fnd_api.g_exc_error;
1396: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
1397: RAISE fnd_api.g_exc_unexpected_error;
1398: END IF;
1399: -- END IF; --nepanda Fix for bug 8994266
1392: );
1393:
1394: IF l_return_status = fnd_api.g_ret_sts_error THEN
1395: RAISE fnd_api.g_exc_error;
1396: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
1397: RAISE fnd_api.g_exc_unexpected_error;
1398: END IF;
1399: -- END IF; --nepanda Fix for bug 8994266
1400:
1393:
1394: IF l_return_status = fnd_api.g_ret_sts_error THEN
1395: RAISE fnd_api.g_exc_error;
1396: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
1397: RAISE fnd_api.g_exc_unexpected_error;
1398: END IF;
1399: -- END IF; --nepanda Fix for bug 8994266
1400:
1401: -- yzhao: 10/20/2003 when object sources from sales accrual budget, the budget behaves like fixed budget.
1420: l_utilization_rec.fund_request_amount := l_utilization_rec.acctd_amount;
1421: ELSIF l_plan_currency = l_utilization_rec.currency_code THEN
1422: l_utilization_rec.fund_request_amount := l_utilization_rec.amount;
1423: ELSIF l_utilization_rec.fund_request_amount IS NULL OR
1424: l_utilization_rec.fund_request_amount = FND_API.G_MISS_NUM THEN
1425: --need to chk this for cancel/partialship and returned orders
1426: --where this amount will already be populated.
1427: ozf_utility_pvt.convert_currency (x_return_status => x_return_status
1428: ,p_from_currency => l_utilization_rec.plan_currency_code
1583: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
1584: fnd_message.set_name('OZF', 'OZF_UNIV_CURR_NOT_FOUND');
1585: fnd_msg_pub.add;
1586: END IF;
1587: RAISE fnd_api.g_exc_error;
1588: END IF;
1589:
1590: --rimehrot for R12, populate universal currency amount column
1591: IF g_universal_currency = l_utilization_rec.currency_code THEN
1618: IF g_debug_flag = 'Y' THEN
1619: ozf_utility_pvt.write_conc_log(l_api_name||' Converted Amount l_utilization_rec.univ_curr_amount: '|| l_utilization_rec.univ_curr_amount);
1620: ozf_utility_pvt.write_conc_log('Utilization amount is converted from request curr to universal curr to populate univ_curr_amount column in izf_funds_utilized_all_b');
1621: END IF;
1622: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
1623: RAISE fnd_api.g_exc_unexpected_error;
1624: ELSIF l_return_status = fnd_api.g_ret_sts_error THEN
1625: RAISE fnd_api.g_exc_error;
1626: END IF;
1619: ozf_utility_pvt.write_conc_log(l_api_name||' Converted Amount l_utilization_rec.univ_curr_amount: '|| l_utilization_rec.univ_curr_amount);
1620: ozf_utility_pvt.write_conc_log('Utilization amount is converted from request curr to universal curr to populate univ_curr_amount column in izf_funds_utilized_all_b');
1621: END IF;
1622: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
1623: RAISE fnd_api.g_exc_unexpected_error;
1624: ELSIF l_return_status = fnd_api.g_ret_sts_error THEN
1625: RAISE fnd_api.g_exc_error;
1626: END IF;
1627: /* Send the exchange rate for bug 7030415 */
1620: ozf_utility_pvt.write_conc_log('Utilization amount is converted from request curr to universal curr to populate univ_curr_amount column in izf_funds_utilized_all_b');
1621: END IF;
1622: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
1623: RAISE fnd_api.g_exc_unexpected_error;
1624: ELSIF l_return_status = fnd_api.g_ret_sts_error THEN
1625: RAISE fnd_api.g_exc_error;
1626: END IF;
1627: /* Send the exchange rate for bug 7030415 */
1628: ozf_utility_pvt.convert_currency (
1621: END IF;
1622: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
1623: RAISE fnd_api.g_exc_unexpected_error;
1624: ELSIF l_return_status = fnd_api.g_ret_sts_error THEN
1625: RAISE fnd_api.g_exc_error;
1626: END IF;
1627: /* Send the exchange rate for bug 7030415 */
1628: ozf_utility_pvt.convert_currency (
1629: p_from_currency=> l_utilization_rec.plan_currency_code
1639: ozf_utility_pvt.write_conc_log(l_api_name||' Converted Amount l_utilization_rec.univ_curr_amount_remaining: '|| l_utilization_rec.univ_curr_amount_remaining);
1640: ozf_utility_pvt.write_conc_log('Utilization amount is converted from request curr to universal curr to populate univ_curr_amount column in izf_funds_utilized_all_b');
1641: ozf_utility_pvt.write_conc_log('***************************END******************************');
1642: END IF;
1643: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
1644: RAISE fnd_api.g_exc_unexpected_error;
1645: ELSIF l_return_status = fnd_api.g_ret_sts_error THEN
1646: RAISE fnd_api.g_exc_error;
1647: END IF;
1640: ozf_utility_pvt.write_conc_log('Utilization amount is converted from request curr to universal curr to populate univ_curr_amount column in izf_funds_utilized_all_b');
1641: ozf_utility_pvt.write_conc_log('***************************END******************************');
1642: END IF;
1643: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
1644: RAISE fnd_api.g_exc_unexpected_error;
1645: ELSIF l_return_status = fnd_api.g_ret_sts_error THEN
1646: RAISE fnd_api.g_exc_error;
1647: END IF;
1648: END IF; -- g_universal_currency = l_utilization_rec.currency_code
1641: ozf_utility_pvt.write_conc_log('***************************END******************************');
1642: END IF;
1643: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
1644: RAISE fnd_api.g_exc_unexpected_error;
1645: ELSIF l_return_status = fnd_api.g_ret_sts_error THEN
1646: RAISE fnd_api.g_exc_error;
1647: END IF;
1648: END IF; -- g_universal_currency = l_utilization_rec.currency_code
1649:
1642: END IF;
1643: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
1644: RAISE fnd_api.g_exc_unexpected_error;
1645: ELSIF l_return_status = fnd_api.g_ret_sts_error THEN
1646: RAISE fnd_api.g_exc_error;
1647: END IF;
1648: END IF; -- g_universal_currency = l_utilization_rec.currency_code
1649:
1650: --Fix for Bug 12657908
1867: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error) THEN
1868: fnd_message.set_name ('OZF', 'OZF_API_RECORD_NOT_FOUND');
1869: fnd_msg_pub.ADD;
1870: END IF;
1871: RAISE fnd_api.g_exc_error;
1872: END IF;
1873: CLOSE c_mc_trans;
1874: */
1875: -- rimehrot changed for R12, Populate new table ozf_object_fund_summary
1951: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error) THEN
1952: fnd_message.set_name ('OZF', 'OZF_API_RECORD_NOT_FOUND');
1953: fnd_msg_pub.ADD;
1954: END IF;
1955: RAISE fnd_api.g_exc_error;
1956: END IF;
1957: CLOSE c_accrual_budget_reqeust;
1958:
1959: UPDATE ozf_act_budgets
1979: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error) THEN
1980: fnd_message.set_name ('OZF', 'OZF_API_RECORD_NOT_FOUND');
1981: fnd_msg_pub.ADD;
1982: END IF;
1983: RAISE fnd_api.g_exc_error;
1984: END IF;
1985: CLOSE c_budget_request_utilrec;
1986:
1987: -- populate request amount in ozf_funds_utilized_all_b record
2097: l_objfundsum_rec.object_type := l_utilization_rec.component_type;
2098: l_objfundsum_rec.object_id := l_utilization_rec.component_id;
2099: ozf_objfundsum_pvt.create_objfundsum(
2100: p_api_version => 1.0,
2101: p_init_msg_list => Fnd_Api.G_FALSE,
2102: p_validation_level => Fnd_Api.G_VALID_LEVEL_NONE,
2103: p_objfundsum_rec => l_objfundsum_rec,
2104: x_return_status => l_return_status,
2105: x_msg_count => x_msg_count,
2098: l_objfundsum_rec.object_id := l_utilization_rec.component_id;
2099: ozf_objfundsum_pvt.create_objfundsum(
2100: p_api_version => 1.0,
2101: p_init_msg_list => Fnd_Api.G_FALSE,
2102: p_validation_level => Fnd_Api.G_VALID_LEVEL_NONE,
2103: p_objfundsum_rec => l_objfundsum_rec,
2104: x_return_status => l_return_status,
2105: x_msg_count => x_msg_count,
2106: x_msg_data => x_msg_data,
2105: x_msg_count => x_msg_count,
2106: x_msg_data => x_msg_data,
2107: x_objfundsum_id => l_objfundsum_id
2108: );
2109: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
2110: RAISE fnd_api.g_exc_unexpected_error;
2111: ELSIF l_return_status = fnd_api.g_ret_sts_error THEN
2112: RAISE fnd_api.g_exc_error;
2113: END IF;
2106: x_msg_data => x_msg_data,
2107: x_objfundsum_id => l_objfundsum_id
2108: );
2109: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
2110: RAISE fnd_api.g_exc_unexpected_error;
2111: ELSIF l_return_status = fnd_api.g_ret_sts_error THEN
2112: RAISE fnd_api.g_exc_error;
2113: END IF;
2114: ELSE
2107: x_objfundsum_id => l_objfundsum_id
2108: );
2109: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
2110: RAISE fnd_api.g_exc_unexpected_error;
2111: ELSIF l_return_status = fnd_api.g_ret_sts_error THEN
2112: RAISE fnd_api.g_exc_error;
2113: END IF;
2114: ELSE
2115: ozf_objfundsum_pvt.update_objfundsum(
2108: );
2109: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
2110: RAISE fnd_api.g_exc_unexpected_error;
2111: ELSIF l_return_status = fnd_api.g_ret_sts_error THEN
2112: RAISE fnd_api.g_exc_error;
2113: END IF;
2114: ELSE
2115: ozf_objfundsum_pvt.update_objfundsum(
2116: p_api_version => 1.0,
2113: END IF;
2114: ELSE
2115: ozf_objfundsum_pvt.update_objfundsum(
2116: p_api_version => 1.0,
2117: p_init_msg_list => Fnd_Api.G_FALSE,
2118: p_validation_level => Fnd_Api.G_VALID_LEVEL_NONE,
2119: p_objfundsum_rec => l_objfundsum_rec,
2120: x_return_status => l_return_status,
2121: x_msg_count => x_msg_count,
2114: ELSE
2115: ozf_objfundsum_pvt.update_objfundsum(
2116: p_api_version => 1.0,
2117: p_init_msg_list => Fnd_Api.G_FALSE,
2118: p_validation_level => Fnd_Api.G_VALID_LEVEL_NONE,
2119: p_objfundsum_rec => l_objfundsum_rec,
2120: x_return_status => l_return_status,
2121: x_msg_count => x_msg_count,
2122: x_msg_data => x_msg_data
2120: x_return_status => l_return_status,
2121: x_msg_count => x_msg_count,
2122: x_msg_data => x_msg_data
2123: );
2124: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
2125: RAISE fnd_api.g_exc_unexpected_error;
2126: ELSIF l_return_status = fnd_api.g_ret_sts_error THEN
2127: RAISE fnd_api.g_exc_error;
2128: END IF;
2121: x_msg_count => x_msg_count,
2122: x_msg_data => x_msg_data
2123: );
2124: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
2125: RAISE fnd_api.g_exc_unexpected_error;
2126: ELSIF l_return_status = fnd_api.g_ret_sts_error THEN
2127: RAISE fnd_api.g_exc_error;
2128: END IF;
2129: END IF;
2122: x_msg_data => x_msg_data
2123: );
2124: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
2125: RAISE fnd_api.g_exc_unexpected_error;
2126: ELSIF l_return_status = fnd_api.g_ret_sts_error THEN
2127: RAISE fnd_api.g_exc_error;
2128: END IF;
2129: END IF;
2130: -- rimehrot: end changes for R12
2123: );
2124: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
2125: RAISE fnd_api.g_exc_unexpected_error;
2126: ELSIF l_return_status = fnd_api.g_ret_sts_error THEN
2127: RAISE fnd_api.g_exc_error;
2128: END IF;
2129: END IF;
2130: -- rimehrot: end changes for R12
2131:
2152:
2153: fnd_msg_pub.count_and_get (
2154: p_count=> x_msg_count,
2155: p_data=> x_msg_data,
2156: p_encoded=> fnd_api.g_false
2157: );
2158:
2159: EXCEPTION
2160: WHEN fnd_api.g_exc_error THEN
2156: p_encoded=> fnd_api.g_false
2157: );
2158:
2159: EXCEPTION
2160: WHEN fnd_api.g_exc_error THEN
2161: ROLLBACK TO create_utilized_rec;
2162: x_return_status := fnd_api.g_ret_sts_error;
2163: fnd_msg_pub.count_and_get (
2164: p_count=> x_msg_count,
2158:
2159: EXCEPTION
2160: WHEN fnd_api.g_exc_error THEN
2161: ROLLBACK TO create_utilized_rec;
2162: x_return_status := fnd_api.g_ret_sts_error;
2163: fnd_msg_pub.count_and_get (
2164: p_count=> x_msg_count,
2165: p_data=> x_msg_data,
2166: p_encoded=> fnd_api.g_false
2162: x_return_status := fnd_api.g_ret_sts_error;
2163: fnd_msg_pub.count_and_get (
2164: p_count=> x_msg_count,
2165: p_data=> x_msg_data,
2166: p_encoded=> fnd_api.g_false
2167: );
2168:
2169: WHEN fnd_api.g_exc_unexpected_error THEN
2170: ROLLBACK TO create_utilized_rec;
2165: p_data=> x_msg_data,
2166: p_encoded=> fnd_api.g_false
2167: );
2168:
2169: WHEN fnd_api.g_exc_unexpected_error THEN
2170: ROLLBACK TO create_utilized_rec;
2171: x_return_status := fnd_api.g_ret_sts_unexp_error;
2172: fnd_msg_pub.count_and_get (
2173: p_count=> x_msg_count,
2167: );
2168:
2169: WHEN fnd_api.g_exc_unexpected_error THEN
2170: ROLLBACK TO create_utilized_rec;
2171: x_return_status := fnd_api.g_ret_sts_unexp_error;
2172: fnd_msg_pub.count_and_get (
2173: p_count=> x_msg_count,
2174: p_data=> x_msg_data,
2175: p_encoded=> fnd_api.g_false
2171: x_return_status := fnd_api.g_ret_sts_unexp_error;
2172: fnd_msg_pub.count_and_get (
2173: p_count=> x_msg_count,
2174: p_data=> x_msg_data,
2175: p_encoded=> fnd_api.g_false
2176: );
2177:
2178: WHEN OTHERS THEN
2179: ROLLBACK TO create_utilized_rec;
2176: );
2177:
2178: WHEN OTHERS THEN
2179: ROLLBACK TO create_utilized_rec;
2180: x_return_status := fnd_api.g_ret_sts_unexp_error;
2181: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error) THEN
2182: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
2183: END IF;
2184: fnd_msg_pub.count_and_get (
2183: END IF;
2184: fnd_msg_pub.count_and_get (
2185: p_count=> x_msg_count,
2186: p_data=> x_msg_data,
2187: p_encoded=> fnd_api.g_false
2188: );
2189:
2190:
2191: END create_utilized_rec;
2250:
2251: l_offer_info c_offer_info%ROWTYPE;
2252: BEGIN
2253: SAVEPOINT create_fund_utilization_acr;
2254: x_return_status := fnd_api.g_ret_sts_success;
2255: IF g_debug_flag = 'Y' THEN
2256: ozf_utility_pvt.write_conc_log (' D: Enter create_fund_utilization() ');
2257: END IF;
2258: l_act_util_rec.product_level_type := 'PRODUCT';
2311: ,p_ledger_id => l_ledger_id -- yzhao: added for R12
2312: ,p_org_id =>l_act_util_rec.org_id -- nirprasa added to get conversion type for bug 7030415
2313: );
2314:
2315: IF x_return_status <> fnd_api.g_ret_sts_success THEN
2316: ozf_utility_pvt.write_conc_log (': create Act Budgets Failed '||x_return_status);
2317: IF x_return_status = fnd_api.g_ret_sts_error THEN
2318: RAISE fnd_api.g_exc_error;
2319: ELSIF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
2313: );
2314:
2315: IF x_return_status <> fnd_api.g_ret_sts_success THEN
2316: ozf_utility_pvt.write_conc_log (': create Act Budgets Failed '||x_return_status);
2317: IF x_return_status = fnd_api.g_ret_sts_error THEN
2318: RAISE fnd_api.g_exc_error;
2319: ELSIF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
2320: RAISE fnd_api.g_exc_unexpected_error;
2321: END IF;
2314:
2315: IF x_return_status <> fnd_api.g_ret_sts_success THEN
2316: ozf_utility_pvt.write_conc_log (': create Act Budgets Failed '||x_return_status);
2317: IF x_return_status = fnd_api.g_ret_sts_error THEN
2318: RAISE fnd_api.g_exc_error;
2319: ELSIF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
2320: RAISE fnd_api.g_exc_unexpected_error;
2321: END IF;
2322: END IF;
2315: IF x_return_status <> fnd_api.g_ret_sts_success THEN
2316: ozf_utility_pvt.write_conc_log (': create Act Budgets Failed '||x_return_status);
2317: IF x_return_status = fnd_api.g_ret_sts_error THEN
2318: RAISE fnd_api.g_exc_error;
2319: ELSIF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
2320: RAISE fnd_api.g_exc_unexpected_error;
2321: END IF;
2322: END IF;
2323:
2316: ozf_utility_pvt.write_conc_log (': create Act Budgets Failed '||x_return_status);
2317: IF x_return_status = fnd_api.g_ret_sts_error THEN
2318: RAISE fnd_api.g_exc_error;
2319: ELSIF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
2320: RAISE fnd_api.g_exc_unexpected_error;
2321: END IF;
2322: END IF;
2323:
2324: l_act_util_rec.ams_activity_budget_id := l_activity_id;
2331: );
2332:
2333: x_utilization_id := l_utilization_id;
2334:
2335: IF x_return_status <>fnd_api.g_ret_sts_success THEN
2336: ozf_utility_pvt.write_conc_log (': create utilization Failed '||x_return_status);
2337: IF x_return_status = fnd_api.g_ret_sts_error THEN
2338: RAISE fnd_api.g_exc_error;
2339: ELSIF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
2333: x_utilization_id := l_utilization_id;
2334:
2335: IF x_return_status <>fnd_api.g_ret_sts_success THEN
2336: ozf_utility_pvt.write_conc_log (': create utilization Failed '||x_return_status);
2337: IF x_return_status = fnd_api.g_ret_sts_error THEN
2338: RAISE fnd_api.g_exc_error;
2339: ELSIF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
2340: RAISE fnd_api.g_exc_unexpected_error;
2341: END IF;
2334:
2335: IF x_return_status <>fnd_api.g_ret_sts_success THEN
2336: ozf_utility_pvt.write_conc_log (': create utilization Failed '||x_return_status);
2337: IF x_return_status = fnd_api.g_ret_sts_error THEN
2338: RAISE fnd_api.g_exc_error;
2339: ELSIF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
2340: RAISE fnd_api.g_exc_unexpected_error;
2341: END IF;
2342: END IF;
2335: IF x_return_status <>fnd_api.g_ret_sts_success THEN
2336: ozf_utility_pvt.write_conc_log (': create utilization Failed '||x_return_status);
2337: IF x_return_status = fnd_api.g_ret_sts_error THEN
2338: RAISE fnd_api.g_exc_error;
2339: ELSIF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
2340: RAISE fnd_api.g_exc_unexpected_error;
2341: END IF;
2342: END IF;
2343:
2336: ozf_utility_pvt.write_conc_log (': create utilization Failed '||x_return_status);
2337: IF x_return_status = fnd_api.g_ret_sts_error THEN
2338: RAISE fnd_api.g_exc_error;
2339: ELSIF x_return_status = fnd_api.g_ret_sts_unexp_error THEN
2340: RAISE fnd_api.g_exc_unexpected_error;
2341: END IF;
2342: END IF;
2343:
2344: fnd_msg_pub.count_and_get (
2343:
2344: fnd_msg_pub.count_and_get (
2345: p_count=> x_msg_count,
2346: p_data=>x_msg_data,
2347: p_encoded=> fnd_api.g_false
2348: );
2349: EXCEPTION
2350: WHEN fnd_api.g_exc_error THEN
2351: ROLLBACK TO create_fund_utilization_acr;
2346: p_data=>x_msg_data,
2347: p_encoded=> fnd_api.g_false
2348: );
2349: EXCEPTION
2350: WHEN fnd_api.g_exc_error THEN
2351: ROLLBACK TO create_fund_utilization_acr;
2352: x_return_status := fnd_api.g_ret_sts_error;
2353: fnd_msg_pub.count_and_get (
2354: p_count=> x_msg_count
2348: );
2349: EXCEPTION
2350: WHEN fnd_api.g_exc_error THEN
2351: ROLLBACK TO create_fund_utilization_acr;
2352: x_return_status := fnd_api.g_ret_sts_error;
2353: fnd_msg_pub.count_and_get (
2354: p_count=> x_msg_count
2355: ,p_data=> x_msg_data
2356: ,p_encoded=> fnd_api.g_false
2352: x_return_status := fnd_api.g_ret_sts_error;
2353: fnd_msg_pub.count_and_get (
2354: p_count=> x_msg_count
2355: ,p_data=> x_msg_data
2356: ,p_encoded=> fnd_api.g_false
2357: );
2358: WHEN fnd_api.g_exc_unexpected_error THEN
2359: ROLLBACK TO create_fund_utilization_acr;
2360: x_return_status := fnd_api.g_ret_sts_unexp_error;
2354: p_count=> x_msg_count
2355: ,p_data=> x_msg_data
2356: ,p_encoded=> fnd_api.g_false
2357: );
2358: WHEN fnd_api.g_exc_unexpected_error THEN
2359: ROLLBACK TO create_fund_utilization_acr;
2360: x_return_status := fnd_api.g_ret_sts_unexp_error;
2361: fnd_msg_pub.count_and_get (
2362: p_count=> x_msg_count
2356: ,p_encoded=> fnd_api.g_false
2357: );
2358: WHEN fnd_api.g_exc_unexpected_error THEN
2359: ROLLBACK TO create_fund_utilization_acr;
2360: x_return_status := fnd_api.g_ret_sts_unexp_error;
2361: fnd_msg_pub.count_and_get (
2362: p_count=> x_msg_count
2363: ,p_data=> x_msg_data
2364: ,p_encoded=> fnd_api.g_false
2360: x_return_status := fnd_api.g_ret_sts_unexp_error;
2361: fnd_msg_pub.count_and_get (
2362: p_count=> x_msg_count
2363: ,p_data=> x_msg_data
2364: ,p_encoded=> fnd_api.g_false
2365: );
2366: WHEN OTHERS THEN
2367: ROLLBACK TO create_fund_utilization_acr;
2368: x_return_status := fnd_api.g_ret_sts_unexp_error;
2364: ,p_encoded=> fnd_api.g_false
2365: );
2366: WHEN OTHERS THEN
2367: ROLLBACK TO create_fund_utilization_acr;
2368: x_return_status := fnd_api.g_ret_sts_unexp_error;
2369:
2370: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error) THEN
2371: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
2372: END IF;
2373:
2374: fnd_msg_pub.count_and_get (
2375: p_count=> x_msg_count
2376: ,p_data=> x_msg_data
2377: ,p_encoded=> fnd_api.g_false
2378: );
2379: END create_fund_utilization;
2380:
2381: /*----------------------------------------------------------------------------
2412: l_ship_to_site_use_id NUMBER;
2413: l_utilization_id NUMBER;
2414:
2415: l_order_org_id NUMBER;
2416: l_exchange_rate_type VARCHAR2(30) := FND_API.G_MISS_CHAR ;
2417:
2418: -- Added by rimehrot for R12
2419: CURSOR c_get_price_adj_dtl (p_price_adjustment_id IN NUMBER) IS
2420: SELECT creation_date
2460: l_offer_type c_offer_type%ROWTYPE;
2461:
2462:
2463: BEGIN
2464: x_return_status := fnd_api.g_ret_sts_success;
2465:
2466: IF g_debug_flag = 'Y' THEN
2467: ozf_utility_pvt.write_conc_log(' D: Enter post_accrual_to_budget p_adj_amt_tbl count=' || p_adj_amt_tbl.count);
2468: END IF;
2494: IF g_debug_flag = 'Y' THEN
2495: ozf_utility_pvt.write_conc_log (' D: post_adjust_to_budget(): Calculate Accrual Amount returns' || l_return_status);
2496: END IF;
2497:
2498: IF l_return_status <> fnd_api.g_ret_sts_success THEN
2499: IF l_return_status = fnd_api.g_ret_sts_error THEN
2500: RAISE fnd_api.g_exc_error;
2501: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
2502: RAISE fnd_api.g_exc_unexpected_error;
2495: ozf_utility_pvt.write_conc_log (' D: post_adjust_to_budget(): Calculate Accrual Amount returns' || l_return_status);
2496: END IF;
2497:
2498: IF l_return_status <> fnd_api.g_ret_sts_success THEN
2499: IF l_return_status = fnd_api.g_ret_sts_error THEN
2500: RAISE fnd_api.g_exc_error;
2501: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
2502: RAISE fnd_api.g_exc_unexpected_error;
2503: END IF;
2496: END IF;
2497:
2498: IF l_return_status <> fnd_api.g_ret_sts_success THEN
2499: IF l_return_status = fnd_api.g_ret_sts_error THEN
2500: RAISE fnd_api.g_exc_error;
2501: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
2502: RAISE fnd_api.g_exc_unexpected_error;
2503: END IF;
2504: END IF;
2497:
2498: IF l_return_status <> fnd_api.g_ret_sts_success THEN
2499: IF l_return_status = fnd_api.g_ret_sts_error THEN
2500: RAISE fnd_api.g_exc_error;
2501: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
2502: RAISE fnd_api.g_exc_unexpected_error;
2503: END IF;
2504: END IF;
2505:
2498: IF l_return_status <> fnd_api.g_ret_sts_success THEN
2499: IF l_return_status = fnd_api.g_ret_sts_error THEN
2500: RAISE fnd_api.g_exc_error;
2501: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
2502: RAISE fnd_api.g_exc_unexpected_error;
2503: END IF;
2504: END IF;
2505:
2506: --- if this is not funded by a parent campaign or any budget the error OUT NOCOPY saying no budgte found
2623: ozf_utility_pvt.write_conc_log('Adjustment amount is converted from offer curr to budgets curr to populate parent_src_apprvd_amt column in izf_act_budgets table and amount column of ozf_funds_utilized_all_b table');
2624: ozf_utility_pvt.write_conc_log('***************************END******************************');
2625: END IF;
2626:
2627: IF l_return_status <> fnd_api.g_ret_sts_success THEN
2628: IF g_debug_flag = 'Y' THEN
2629: ozf_utility_pvt.write_conc_log (' D: post_adjust_to_budget() convert currency failed. No posting to budget. Return');
2630: END IF;
2631: RAISE fnd_api.g_exc_unexpected_error;
2627: IF l_return_status <> fnd_api.g_ret_sts_success THEN
2628: IF g_debug_flag = 'Y' THEN
2629: ozf_utility_pvt.write_conc_log (' D: post_adjust_to_budget() convert currency failed. No posting to budget. Return');
2630: END IF;
2631: RAISE fnd_api.g_exc_unexpected_error;
2632: END IF;
2633: l_act_budgets_rec.parent_src_apprvd_amt :=l_converted_adj_amount;
2634: END IF;
2635:
2690: x_return_status => l_return_status,
2691: x_msg_count => x_msg_count,
2692: x_msg_data => x_msg_data
2693: );
2694: IF l_return_status <> fnd_api.g_ret_sts_success THEN
2695: IF g_debug_flag = 'Y' THEN
2696: ozf_utility_pvt.write_conc_log ('D: post_adjust_to_budget() create_fund_utilization() returns error. Exception');
2697: END IF;
2698: RAISE fnd_api.g_exc_unexpected_error;
2694: IF l_return_status <> fnd_api.g_ret_sts_success THEN
2695: IF g_debug_flag = 'Y' THEN
2696: ozf_utility_pvt.write_conc_log ('D: post_adjust_to_budget() create_fund_utilization() returns error. Exception');
2697: END IF;
2698: RAISE fnd_api.g_exc_unexpected_error;
2699: END IF;
2700:
2701: <
2702:
2721: IF g_debug_flag = 'Y' THEN
2722: ozf_utility_pvt.write_conc_log('D: Ends of post_accrual_to_budget');
2723: END IF;
2724:
2725: x_return_status := fnd_api.g_ret_sts_success;
2726:
2727: fnd_msg_pub.count_and_get (
2728: p_count=> x_msg_count,
2729: p_data=> x_msg_data,
2726:
2727: fnd_msg_pub.count_and_get (
2728: p_count=> x_msg_count,
2729: p_data=> x_msg_data,
2730: p_encoded=> fnd_api.g_false
2731: );
2732:
2733: EXCEPTION
2734: --nepanda : Added exception block for normal errors and unexpected errors, before checking for OTHERS
2731: );
2732:
2733: EXCEPTION
2734: --nepanda : Added exception block for normal errors and unexpected errors, before checking for OTHERS
2735: WHEN fnd_api.g_exc_error THEN
2736: x_return_status := fnd_api.g_ret_sts_error;
2737: ozf_utility_pvt.write_conc_log (' /**************EXCEPTION in ozf_accrual_engine.post_accrual_to_budget');
2738: fnd_msg_pub.count_and_get (
2739: p_count=> x_msg_count,
2732:
2733: EXCEPTION
2734: --nepanda : Added exception block for normal errors and unexpected errors, before checking for OTHERS
2735: WHEN fnd_api.g_exc_error THEN
2736: x_return_status := fnd_api.g_ret_sts_error;
2737: ozf_utility_pvt.write_conc_log (' /**************EXCEPTION in ozf_accrual_engine.post_accrual_to_budget');
2738: fnd_msg_pub.count_and_get (
2739: p_count=> x_msg_count,
2740: p_data=> x_msg_data,
2737: ozf_utility_pvt.write_conc_log (' /**************EXCEPTION in ozf_accrual_engine.post_accrual_to_budget');
2738: fnd_msg_pub.count_and_get (
2739: p_count=> x_msg_count,
2740: p_data=> x_msg_data,
2741: p_encoded=> fnd_api.g_false
2742: );
2743: WHEN fnd_api.g_exc_unexpected_error THEN
2744: x_return_status := fnd_api.g_ret_sts_unexp_error;
2745: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error) THEN
2739: p_count=> x_msg_count,
2740: p_data=> x_msg_data,
2741: p_encoded=> fnd_api.g_false
2742: );
2743: WHEN fnd_api.g_exc_unexpected_error THEN
2744: x_return_status := fnd_api.g_ret_sts_unexp_error;
2745: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error) THEN
2746: fnd_msg_pub.add_exc_msg ('ozf_accrual_engine', 'post_accrual_to_budget');
2747: END IF;
2740: p_data=> x_msg_data,
2741: p_encoded=> fnd_api.g_false
2742: );
2743: WHEN fnd_api.g_exc_unexpected_error THEN
2744: x_return_status := fnd_api.g_ret_sts_unexp_error;
2745: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error) THEN
2746: fnd_msg_pub.add_exc_msg ('ozf_accrual_engine', 'post_accrual_to_budget');
2747: END IF;
2748: ozf_utility_pvt.write_conc_log (' /**************UNEXPECTED EXCEPTION in ozf_accrual_engine.post_accrual_to_budget');
2748: ozf_utility_pvt.write_conc_log (' /**************UNEXPECTED EXCEPTION in ozf_accrual_engine.post_accrual_to_budget');
2749: fnd_msg_pub.count_and_get (
2750: p_count=> x_msg_count,
2751: p_data=> x_msg_data,
2752: p_encoded=> fnd_api.g_false
2753: );
2754: WHEN OTHERS THEN
2755: x_return_status := fnd_api.g_ret_sts_unexp_error;
2756: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error) THEN
2751: p_data=> x_msg_data,
2752: p_encoded=> fnd_api.g_false
2753: );
2754: WHEN OTHERS THEN
2755: x_return_status := fnd_api.g_ret_sts_unexp_error;
2756: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error) THEN
2757: fnd_msg_pub.add_exc_msg ('ozf_accrual_engine', 'post_accrual_to_budget');
2758: END IF;
2759: ozf_utility_pvt.write_conc_log (' /**************UNEXPECTED EXCEPTION in ozf_accrual_engine.post_accrual_to_budget');
2759: ozf_utility_pvt.write_conc_log (' /**************UNEXPECTED EXCEPTION in ozf_accrual_engine.post_accrual_to_budget');
2760: fnd_msg_pub.count_and_get (
2761: p_count=> x_msg_count,
2762: p_data=> x_msg_data,
2763: p_encoded=> fnd_api.g_false
2764: );
2765: END post_accrual_to_budget;
2766:
2767: ------------------------------------------------------------------------------
2777: -- updated mpande 12/28/2001 -- added line and header info also
2778: ------------------------------------------------------------------------------
2779: PROCEDURE adjust_accrual (
2780: p_api_version IN NUMBER,
2781: p_init_msg_list IN VARCHAR2 := fnd_api.g_false,
2782: p_commit IN VARCHAR2 := fnd_api.g_false,
2783: p_validation_level IN NUMBER := fnd_api.g_valid_level_full,
2784: x_return_status OUT NOCOPY VARCHAR2,
2785: x_msg_count OUT NOCOPY NUMBER,
2778: ------------------------------------------------------------------------------
2779: PROCEDURE adjust_accrual (
2780: p_api_version IN NUMBER,
2781: p_init_msg_list IN VARCHAR2 := fnd_api.g_false,
2782: p_commit IN VARCHAR2 := fnd_api.g_false,
2783: p_validation_level IN NUMBER := fnd_api.g_valid_level_full,
2784: x_return_status OUT NOCOPY VARCHAR2,
2785: x_msg_count OUT NOCOPY NUMBER,
2786: x_msg_data OUT NOCOPY VARCHAR2,
2779: PROCEDURE adjust_accrual (
2780: p_api_version IN NUMBER,
2781: p_init_msg_list IN VARCHAR2 := fnd_api.g_false,
2782: p_commit IN VARCHAR2 := fnd_api.g_false,
2783: p_validation_level IN NUMBER := fnd_api.g_valid_level_full,
2784: x_return_status OUT NOCOPY VARCHAR2,
2785: x_msg_count OUT NOCOPY NUMBER,
2786: x_msg_data OUT NOCOPY VARCHAR2,
2787: p_line_adj_tbl IN oe_order_pub.line_adj_tbl_type,
2786: x_msg_data OUT NOCOPY VARCHAR2,
2787: p_line_adj_tbl IN oe_order_pub.line_adj_tbl_type,
2788: p_old_line_adj_tbl IN oe_order_pub.line_adj_tbl_type,
2789: p_header_rec IN oe_order_pub.header_rec_type := NULL,
2790: p_exception_queue IN VARCHAR2 := fnd_api.g_false
2791:
2792: ) IS
2793: l_return_status VARCHAR2 (10) := fnd_api.g_ret_sts_success;
2794: l_api_name CONSTANT VARCHAR2 (30) := 'Adjust_Accrual';
2789: p_header_rec IN oe_order_pub.header_rec_type := NULL,
2790: p_exception_queue IN VARCHAR2 := fnd_api.g_false
2791:
2792: ) IS
2793: l_return_status VARCHAR2 (10) := fnd_api.g_ret_sts_success;
2794: l_api_name CONSTANT VARCHAR2 (30) := 'Adjust_Accrual';
2795: l_api_version CONSTANT NUMBER := 1.0;
2796: l_earned_amount NUMBER;
2797: l_old_earned_amount NUMBER;
2829: l_util_exists NUMBER;
2830: l_new_line_id NUMBER;
2831:
2832: l_order_org_id NUMBER;
2833: l_exchange_rate_type VARCHAR2(30) := FND_API.G_MISS_CHAR;
2834: l_offer_transaction_curr VARCHAR2(30);
2835:
2836: CURSOR c_line_info (p_line_id IN NUMBER) IS
2837: SELECT line.inventory_item_id,
2966:
2967: BEGIN
2968: SAVEPOINT adjust_accrual;
2969: -- Standard call to check for call compatibility.
2970: IF NOT fnd_api.compatible_api_call (l_api_version, p_api_version, l_api_name, g_pkg_name) THEN
2971: RAISE fnd_api.g_exc_unexpected_error;
2972: END IF;
2973: -- Initialize message list IF p_init_msg_list is set to TRUE.
2974: IF fnd_api.to_boolean (p_init_msg_list) THEN
2967: BEGIN
2968: SAVEPOINT adjust_accrual;
2969: -- Standard call to check for call compatibility.
2970: IF NOT fnd_api.compatible_api_call (l_api_version, p_api_version, l_api_name, g_pkg_name) THEN
2971: RAISE fnd_api.g_exc_unexpected_error;
2972: END IF;
2973: -- Initialize message list IF p_init_msg_list is set to TRUE.
2974: IF fnd_api.to_boolean (p_init_msg_list) THEN
2975: fnd_msg_pub.initialize;
2970: IF NOT fnd_api.compatible_api_call (l_api_version, p_api_version, l_api_name, g_pkg_name) THEN
2971: RAISE fnd_api.g_exc_unexpected_error;
2972: END IF;
2973: -- Initialize message list IF p_init_msg_list is set to TRUE.
2974: IF fnd_api.to_boolean (p_init_msg_list) THEN
2975: fnd_msg_pub.initialize;
2976: END IF;
2977: -- Initialize API return status to success
2978: x_return_status := fnd_api.g_ret_sts_success;
2974: IF fnd_api.to_boolean (p_init_msg_list) THEN
2975: fnd_msg_pub.initialize;
2976: END IF;
2977: -- Initialize API return status to success
2978: x_return_status := fnd_api.g_ret_sts_success;
2979:
2980: <
2981:
2982: IF g_debug_flag = 'Y' THEN
2986: l_adj_amt_tbl.DELETE;
2987:
2988: FOR i IN NVL (p_line_adj_tbl.FIRST, 1) .. NVL (p_line_adj_tbl.LAST, 0)
2989: LOOP
2990: x_return_status := fnd_api.g_ret_sts_success;
2991: SAVEPOINT line_adjustment;
2992:
2993: IF g_debug_flag = 'Y' THEN
2994: ozf_utility_pvt.write_conc_log (' /++++++++ ADJUSTMENT DEBUG MESSAGE START +++++++++/' );
3050:
3051: --bug 8253115 - Negative accruals are not created for manually deleted modifiers.
3052: --When modifiers are deleted manually from booked orders, we get UPDATE message with applied_flag = N
3053: --instead of DELETE message with applied_flag = Y, so for this record changed the operation to DELETE
3054: IF p_exception_queue = fnd_api.g_true AND p_line_adj_tbl (i).operation = 'CREATE' THEN
3055: l_operation := 'UPDATE' ;
3056: ELSIF p_line_adj_tbl (i).operation = 'UPDATE' AND p_line_adj_tbl (i).applied_flag = 'N' THEN
3057: l_operation := 'DELETE';
3058: ELSIF p_line_adj_tbl (i).applied_flag = 'Y' THEN
3116: IF l_custom_setup_id = 118 THEN --ER9447673
3117: MO_GLOBAL.set_policy_context('S', l_order_org_id);
3118: l_column_name := FND_PROFILE.VALUE('OZF_ITEM_COST_COLUMN');
3119:
3120: IF l_column_name IS NOT NULL AND l_column_name <> FND_API.G_MISS_CHAR THEN
3121: l_stmt := 'SELECT ' || l_column_name ||' FROM oe_order_lines_all WHERE line_id = :1 AND org_id = :2';
3122:
3123: IF g_debug_flag = 'Y' THEN
3124: ozf_utility_pvt.write_conc_log('Query to obtain purchase price '||l_stmt);
3264: ozf_utility_pvt.write_conc_log('***************************END******************************');
3265: ozf_utility_pvt.write_conc_log('x_return_status: ' || x_return_status);
3266: END IF;
3267:
3268: IF x_return_status <> fnd_api.g_ret_sts_success THEN
3269: GOTO l_endoflineadjloop;
3270: END IF;
3271:
3272: l_earned_amount := l_conv_earned_amount;
3314: IF l_custom_setup_id = 118 THEN --ER9447673
3315: MO_GLOBAL.set_policy_context('S', l_order_org_id);
3316: l_column_name := FND_PROFILE.VALUE('OZF_ITEM_COST_COLUMN');
3317:
3318: IF l_column_name IS NOT NULL AND l_column_name <> FND_API.G_MISS_CHAR THEN
3319: l_stmt := 'SELECT ' || l_column_name ||' FROM oe_order_lines_all WHERE line_id = :1 AND org_id = :2';
3320:
3321: IF g_debug_flag = 'Y' THEN
3322: ozf_utility_pvt.write_conc_log('Query to obtain purchase price '||l_stmt);
3455: );
3456:
3457: ozf_utility_pvt.write_conc_log('x_return_status: ' || x_return_status);
3458:
3459: IF x_return_status <> fnd_api.g_ret_sts_success THEN
3460: GOTO l_endoflineadjloop;
3461: END IF;
3462:
3463: l_new_adjustment_amount := l_conv_adjustment_amount;
3548: 'create utlization from cancelled order returns '|| l_return_status
3549: );
3550: END IF;
3551:
3552: IF l_return_status <> fnd_api.g_ret_sts_success THEN
3553: GOTO l_endoflineadjloop;
3554: END IF;
3555:
3556: -- If gl_posted_flag of original accrual has been posted, call post_accrual_to_gl
3637: l_adj_amt_tbl (l_count).cost_price_currency_code:= l_order_curr;
3638: END IF;
3639: <
3640:
3641: IF x_return_status <> fnd_api.g_ret_sts_success THEN
3642: IF g_debug_flag = 'Y' THEN
3643: ozf_utility_pvt.write_conc_log (
3644: ' /****** Adjustment Failure *******/ Offer Id: "'|| p_line_adj_tbl(i).list_header_id ||'"' || 'Price Adjustment Id'||p_line_adj_tbl (i).price_adjustment_id);
3645: END IF;
3644: ' /****** Adjustment Failure *******/ Offer Id: "'|| p_line_adj_tbl(i).list_header_id ||'"' || 'Price Adjustment Id'||p_line_adj_tbl (i).price_adjustment_id);
3645: END IF;
3646: -- Initialize the Message list for Next Processing
3647: ROLLBACK TO line_adjustment;
3648: x_return_status := fnd_api.g_ret_sts_error ;
3649: EXIT;
3650: ELSE
3651: IF g_debug_flag = 'Y' THEN
3652: ozf_utility_pvt.write_conc_log(
3672: x_return_status := l_return_status;
3673: fnd_msg_pub.count_and_get (
3674: p_count=> x_msg_count,
3675: p_data=> x_msg_data,
3676: p_encoded=> fnd_api.g_false
3677: );
3678:
3679: EXCEPTION
3680: --nepanda : Added exception block for normal errors and unexpected errors, before checking for OTHERS
3677: );
3678:
3679: EXCEPTION
3680: --nepanda : Added exception block for normal errors and unexpected errors, before checking for OTHERS
3681: WHEN fnd_api.g_exc_error THEN
3682: x_return_status := fnd_api.g_ret_sts_error;
3683: fnd_msg_pub.count_and_get (
3684: p_count=> x_msg_count,
3685: p_data=> x_msg_data,
3678:
3679: EXCEPTION
3680: --nepanda : Added exception block for normal errors and unexpected errors, before checking for OTHERS
3681: WHEN fnd_api.g_exc_error THEN
3682: x_return_status := fnd_api.g_ret_sts_error;
3683: fnd_msg_pub.count_and_get (
3684: p_count=> x_msg_count,
3685: p_data=> x_msg_data,
3686: p_encoded=> fnd_api.g_false
3682: x_return_status := fnd_api.g_ret_sts_error;
3683: fnd_msg_pub.count_and_get (
3684: p_count=> x_msg_count,
3685: p_data=> x_msg_data,
3686: p_encoded=> fnd_api.g_false
3687: );
3688: WHEN fnd_api.g_exc_unexpected_error THEN
3689: x_return_status := fnd_api.g_ret_sts_unexp_error;
3690:
3684: p_count=> x_msg_count,
3685: p_data=> x_msg_data,
3686: p_encoded=> fnd_api.g_false
3687: );
3688: WHEN fnd_api.g_exc_unexpected_error THEN
3689: x_return_status := fnd_api.g_ret_sts_unexp_error;
3690:
3691: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error) THEN
3692: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
3685: p_data=> x_msg_data,
3686: p_encoded=> fnd_api.g_false
3687: );
3688: WHEN fnd_api.g_exc_unexpected_error THEN
3689: x_return_status := fnd_api.g_ret_sts_unexp_error;
3690:
3691: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error) THEN
3692: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
3693: END IF;
3694: ozf_utility_pvt.write_conc_log(' /**************UNEXPECTED EXCEPTION in adjust_accrual *************/');
3695: fnd_msg_pub.count_and_get (
3696: p_count=> x_msg_count,
3697: p_data=> x_msg_data,
3698: p_encoded=> fnd_api.g_false
3699: );
3700: WHEN OTHERS THEN
3701: x_return_status := fnd_api.g_ret_sts_unexp_error;
3702:
3697: p_data=> x_msg_data,
3698: p_encoded=> fnd_api.g_false
3699: );
3700: WHEN OTHERS THEN
3701: x_return_status := fnd_api.g_ret_sts_unexp_error;
3702:
3703: ozf_utility_pvt.write_conc_log(' /**************UNEXPECTED EXCEPTION in adjust_accrual *************/');
3704: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error) THEN
3705: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
3707:
3708: fnd_msg_pub.count_and_get (
3709: p_count=> x_msg_count,
3710: p_data=> x_msg_data,
3711: p_encoded=> fnd_api.g_false
3712: );
3713: END adjust_accrual;
3714: ------------------------------------------------------------------------------
3715: -- Procedure Name
3754: -- modified yzhao 03/19/2003 added posting to GL for shipped order lines
3755: ------------------------------------------------------------------------------
3756: PROCEDURE adjust_changed_order (
3757: p_api_version IN NUMBER,
3758: p_init_msg_list IN VARCHAR2 := fnd_api.g_false,
3759: p_commit IN VARCHAR2 := fnd_api.g_false,
3760: p_validation_level IN NUMBER := fnd_api.g_valid_level_full,
3761: x_return_status OUT NOCOPY VARCHAR2,
3762: x_msg_count OUT NOCOPY NUMBER,
3755: ------------------------------------------------------------------------------
3756: PROCEDURE adjust_changed_order (
3757: p_api_version IN NUMBER,
3758: p_init_msg_list IN VARCHAR2 := fnd_api.g_false,
3759: p_commit IN VARCHAR2 := fnd_api.g_false,
3760: p_validation_level IN NUMBER := fnd_api.g_valid_level_full,
3761: x_return_status OUT NOCOPY VARCHAR2,
3762: x_msg_count OUT NOCOPY NUMBER,
3763: x_msg_data OUT NOCOPY VARCHAR2,
3756: PROCEDURE adjust_changed_order (
3757: p_api_version IN NUMBER,
3758: p_init_msg_list IN VARCHAR2 := fnd_api.g_false,
3759: p_commit IN VARCHAR2 := fnd_api.g_false,
3760: p_validation_level IN NUMBER := fnd_api.g_valid_level_full,
3761: x_return_status OUT NOCOPY VARCHAR2,
3762: x_msg_count OUT NOCOPY NUMBER,
3763: x_msg_data OUT NOCOPY VARCHAR2,
3764: p_header_rec IN oe_order_pub.header_rec_type,
4115: l_utilization_amount NUMBER;
4116: l_unit_selling_price NUMBER;
4117: l_unit_discount NUMBER;
4118: l_exchange_rate_date DATE;
4119: l_exchange_rate_type VARCHAR2(30) := FND_API.G_MISS_CHAR;
4120:
4121: l_adjusted_amount NUMBER;
4122: c_purchase_price purchase_price_cursor_type;
4123: l_column_name VARCHAR2(15);
4138:
4139: BEGIN
4140: SAVEPOINT adjust_changed_order;
4141: -- Standard call to check for call compatibility.
4142: IF NOT fnd_api.compatible_api_call (l_api_version, p_api_version, l_api_name, g_pkg_name) THEN
4143: RAISE fnd_api.g_exc_unexpected_error;
4144: END IF;
4145: -- Initialize message list IF p_init_msg_list is set to TRUE.
4146: IF fnd_api.to_boolean (p_init_msg_list) THEN
4139: BEGIN
4140: SAVEPOINT adjust_changed_order;
4141: -- Standard call to check for call compatibility.
4142: IF NOT fnd_api.compatible_api_call (l_api_version, p_api_version, l_api_name, g_pkg_name) THEN
4143: RAISE fnd_api.g_exc_unexpected_error;
4144: END IF;
4145: -- Initialize message list IF p_init_msg_list is set to TRUE.
4146: IF fnd_api.to_boolean (p_init_msg_list) THEN
4147: fnd_msg_pub.initialize;
4142: IF NOT fnd_api.compatible_api_call (l_api_version, p_api_version, l_api_name, g_pkg_name) THEN
4143: RAISE fnd_api.g_exc_unexpected_error;
4144: END IF;
4145: -- Initialize message list IF p_init_msg_list is set to TRUE.
4146: IF fnd_api.to_boolean (p_init_msg_list) THEN
4147: fnd_msg_pub.initialize;
4148: END IF;
4149: -- Initialize API return status to success
4150: x_return_status := fnd_api.g_ret_sts_success;
4146: IF fnd_api.to_boolean (p_init_msg_list) THEN
4147: fnd_msg_pub.initialize;
4148: END IF;
4149: -- Initialize API return status to success
4150: x_return_status := fnd_api.g_ret_sts_success;
4151: <
4152:
4153: IF g_debug_flag = 'Y' THEN
4154: ozf_utility_pvt.write_conc_log (
4250: ozf_utility_pvt.write_conc_log (
4251: ' D: create utlization from cancelled order returns '|| l_return_status);
4252: END IF;
4253:
4254: IF l_return_status <> fnd_api.g_ret_sts_success THEN
4255: GOTO l_endoflineadjloop;
4256: END IF;
4257: --- quit when the total earned amount is adjusted
4258: <
4337: ozf_utility_pvt.write_conc_log (
4338: ' D: create utlization from RMA order: ' || l_return_status);
4339: END IF;
4340:
4341: IF l_return_status <> fnd_api.g_ret_sts_success THEN
4342: GOTO l_endoflineadjloop;
4343: END IF;
4344: --- quit when the total earned amount is adjusted
4345: <
4403:
4404: IF l_custom_setup_id = 118 THEN
4405: l_column_name := FND_PROFILE.VALUE('OZF_ITEM_COST_COLUMN');
4406:
4407: IF l_column_name IS NOT NULL AND l_column_name <> FND_API.G_MISS_CHAR THEN
4408: l_stmt := 'SELECT ' || l_column_name ||' FROM oe_order_lines_all WHERE line_id = :1';
4409:
4410: IF g_debug_flag = 'Y' THEN
4411: ozf_utility_pvt.write_conc_log('Query to obtain purchase price ' || l_stmt);
4572: ozf_utility_pvt.write_conc_log (' retrun status for create _fund_utilization of '|| l_return_status ||
4573: ' when partial shipping. ' );
4574: END IF;
4575:
4576: IF l_return_status <> fnd_api.g_ret_sts_success THEN
4577: GOTO l_endoflineadjloop;
4578: END IF;
4579: /* yzhao: fix bug 3778200 - partial shipment after offer adjustment.
4580: if line is splitted to have new line for unshipped quantity, new price adjustment need to pass to the offer adjustment
4619: x_msg_count=> x_msg_count,
4620: x_msg_data=> x_msg_data
4621: );
4622:
4623: IF l_return_status <> fnd_api.g_ret_sts_success THEN
4624: GOTO l_endoflineadjloop;
4625: END IF;
4626:
4627: END IF;-- end loop of old_adjustment_rec.utilization_type
4778: END IF;
4779:
4780: OZF_SALES_TRANSACTIONS_PVT.Create_Transaction (
4781: p_api_version => 1.0
4782: ,p_init_msg_list => FND_API.G_FALSE
4783: ,p_commit => FND_API.G_FALSE
4784: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
4785: ,p_transaction_rec => l_sales_transaction_rec
4786: ,x_sales_transaction_id => l_sales_transaction_id
4779:
4780: OZF_SALES_TRANSACTIONS_PVT.Create_Transaction (
4781: p_api_version => 1.0
4782: ,p_init_msg_list => FND_API.G_FALSE
4783: ,p_commit => FND_API.G_FALSE
4784: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
4785: ,p_transaction_rec => l_sales_transaction_rec
4786: ,x_sales_transaction_id => l_sales_transaction_id
4787: ,x_return_status => l_return_status
4780: OZF_SALES_TRANSACTIONS_PVT.Create_Transaction (
4781: p_api_version => 1.0
4782: ,p_init_msg_list => FND_API.G_FALSE
4783: ,p_commit => FND_API.G_FALSE
4784: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
4785: ,p_transaction_rec => l_sales_transaction_rec
4786: ,x_sales_transaction_id => l_sales_transaction_id
4787: ,x_return_status => l_return_status
4788: ,x_msg_data => x_msg_data
4792: IF g_debug_flag = 'Y' THEN
4793: ozf_utility_pvt.write_conc_log(' Create_Transaction' || l_return_status);
4794: END IF;
4795:
4796: IF l_return_status <> fnd_api.g_ret_sts_success THEN
4797: GOTO l_endoflineadjloop;
4798: END IF;
4799: END IF; -- NVL(l_sales_trans,0)
4800:
4894: || ' post_accrual_to_gl(util_id=' || l_utilIdTbl(t_i) || ') returns ' || l_return_status
4895: || ' x_gl_posted_flag=' || l_gl_posted_flag);
4896: END IF;
4897: -- yzhao: 03/04/2004 post gl for related accruals from offer adjustment or object reconcile
4898: IF l_return_status = fnd_api.g_ret_sts_success AND l_gl_posted_flag = G_GL_FLAG_YES THEN
4899: post_related_accrual_to_gl(
4900: p_utilization_id => l_utilIdTbl(t_i)
4901: , p_utilization_type => l_utilTypeTbl(t_i)
4902: , p_gl_date => l_gl_date
4923:
4924: END IF; -- IF l_gl_date IS NOT NULL
4925:
4926: <
4927: IF l_return_status <> fnd_api.g_ret_sts_success THEN
4928: -- Write Relelvant Messages
4929: IF g_debug_flag = 'Y' THEN
4930: ozf_utility_pvt.write_conc_log (
4931: ' /*************************** DEBUG MESSAGE END *************************/' ||
4937: -- Initialize the Message list for NExt Processing
4938: fnd_msg_pub.initialize;
4939: ROLLBACK TO line_adjustment;
4940: -- return a status error
4941: x_return_status := fnd_api.g_ret_sts_error ;
4942: --5/30/2002 Added to exit the loop because we want to perform handle exception to put the me
4943: -- go out of the loop because we put this message in the exception queue
4944: EXIT;
4945: ELSIF l_return_status = fnd_api.g_ret_sts_success THEN
4941: x_return_status := fnd_api.g_ret_sts_error ;
4942: --5/30/2002 Added to exit the loop because we want to perform handle exception to put the me
4943: -- go out of the loop because we put this message in the exception queue
4944: EXIT;
4945: ELSIF l_return_status = fnd_api.g_ret_sts_success THEN
4946: IF g_debug_flag = 'Y' THEN
4947: ozf_utility_pvt.write_conc_log (' /*************************** DEBUG MESSAGE END *********************/'||
4948: ' /****** Line Adjustment Success *******/ p_line_tbl(i).line_id ' || p_line_tbl(i).line_id );
4949: END IF;
4959: -- Standard call to get message count and IF count is 1, get message info.
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: EXCEPTION
4966: --nepanda : Added exception block for normal errors and unexpected errors, before checking for OTHERS
4967: WHEN fnd_api.g_exc_error THEN
4963: p_encoded=> fnd_api.g_false
4964: );
4965: EXCEPTION
4966: --nepanda : Added exception block for normal errors and unexpected errors, before checking for OTHERS
4967: WHEN fnd_api.g_exc_error THEN
4968: x_return_status := fnd_api.g_ret_sts_error;
4969: ozf_utility_pvt.write_conc_log (' /**************EXCEPTION in ozf_accrual_engine.adjust_changed_order');
4970: fnd_msg_pub.count_and_get (
4971: p_count=> x_msg_count,
4964: );
4965: EXCEPTION
4966: --nepanda : Added exception block for normal errors and unexpected errors, before checking for OTHERS
4967: WHEN fnd_api.g_exc_error THEN
4968: x_return_status := fnd_api.g_ret_sts_error;
4969: ozf_utility_pvt.write_conc_log (' /**************EXCEPTION in ozf_accrual_engine.adjust_changed_order');
4970: fnd_msg_pub.count_and_get (
4971: p_count=> x_msg_count,
4972: p_data=> x_msg_data,
4969: ozf_utility_pvt.write_conc_log (' /**************EXCEPTION in ozf_accrual_engine.adjust_changed_order');
4970: fnd_msg_pub.count_and_get (
4971: p_count=> x_msg_count,
4972: p_data=> x_msg_data,
4973: p_encoded=> fnd_api.g_false
4974: );
4975: WHEN fnd_api.g_exc_unexpected_error THEN
4976: x_return_status := fnd_api.g_ret_sts_unexp_error;
4977:
4971: p_count=> x_msg_count,
4972: p_data=> x_msg_data,
4973: p_encoded=> fnd_api.g_false
4974: );
4975: WHEN fnd_api.g_exc_unexpected_error THEN
4976: x_return_status := fnd_api.g_ret_sts_unexp_error;
4977:
4978: ozf_utility_pvt.write_conc_log (' /**************UNEXPECTED EXCEPTION in ozf_accrual_engine.adjust_changed_order');
4979: ozf_utility_pvt.write_conc_log(' D: adjust_changed_order: exception. errcode=' || sqlcode || ' msg: ' || substr(sqlerrm, 1, 3000));
4972: p_data=> x_msg_data,
4973: p_encoded=> fnd_api.g_false
4974: );
4975: WHEN fnd_api.g_exc_unexpected_error THEN
4976: x_return_status := fnd_api.g_ret_sts_unexp_error;
4977:
4978: ozf_utility_pvt.write_conc_log (' /**************UNEXPECTED EXCEPTION in ozf_accrual_engine.adjust_changed_order');
4979: ozf_utility_pvt.write_conc_log(' D: adjust_changed_order: exception. errcode=' || sqlcode || ' msg: ' || substr(sqlerrm, 1, 3000));
4980:
4984:
4985: fnd_msg_pub.count_and_get (
4986: p_count=> x_msg_count,
4987: p_data=> x_msg_data,
4988: p_encoded=> fnd_api.g_false
4989: );
4990: WHEN OTHERS THEN
4991: x_return_status := fnd_api.g_ret_sts_unexp_error;
4992:
4987: p_data=> x_msg_data,
4988: p_encoded=> fnd_api.g_false
4989: );
4990: WHEN OTHERS THEN
4991: x_return_status := fnd_api.g_ret_sts_unexp_error;
4992:
4993: ozf_utility_pvt.write_conc_log (' /**************UNEXPECTED EXCEPTION in ozf_accrual_engine.adjust_changed_order');
4994: ozf_utility_pvt.write_conc_log(' D: adjust_changed_order: exception. errcode=' || sqlcode || ' msg: ' || substr(sqlerrm, 1, 3000));
4995:
4999:
5000: fnd_msg_pub.count_and_get (
5001: p_count=> x_msg_count,
5002: p_data=> x_msg_data,
5003: p_encoded=> fnd_api.g_false
5004: );
5005: END adjust_changed_order;
5006:
5007: ------------------------------------------------------------------------------
5129: );
5130: --
5131: --///added by mpande to write a error message to the list
5132: --if not sucess add a error message to th emessage listx
5133: IF NOT (l_return_status = fnd_api.g_ret_sts_success) THEN
5134: ozf_utility_pvt.write_conc_log ('Queue Return Error ');
5135:
5136: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error) THEN
5137: fnd_message.set_name ('OZF', 'OZF_FUND_ASO_ORD_FEEDBACK_FAIL');
5142: END IF;
5143: -- Check return status
5144: -- if success call adjust_accrual
5145: --
5146: IF l_return_status = fnd_api.g_ret_sts_success THEN
5147: IF (l_line_adj_tbl.COUNT <> 0) THEN
5148: IF g_debug_flag = 'Y' THEN
5149: ozf_utility_pvt.write_conc_log ('ADJUSTMENT ');
5150: END IF;
5150: END IF;
5151:
5152: adjust_accrual (
5153: p_api_version=> 1.0
5154: ,p_init_msg_list=> fnd_api.g_true
5155: ,x_return_status=> l_return_status
5156: ,x_msg_count=> l_msg_count
5157: ,x_msg_data=> l_msg_data
5158: ,p_line_adj_tbl=> l_line_adj_tbl
5163: ozf_utility_pvt.write_conc_log ( 'ADJUSTMENT STATUS ' || l_return_status);
5164: END IF;
5165: END IF;
5166: END IF;
5167: --l_return_status := fnd_api.g_ret_sts_success;
5168: IF l_return_status = fnd_api.g_ret_sts_success THEN
5169: IF (l_line_tbl.COUNT <> 0) THEN
5170: IF g_debug_flag = 'Y' THEN
5171: ozf_utility_pvt.write_conc_log ('LINE');
5164: END IF;
5165: END IF;
5166: END IF;
5167: --l_return_status := fnd_api.g_ret_sts_success;
5168: IF l_return_status = fnd_api.g_ret_sts_success THEN
5169: IF (l_line_tbl.COUNT <> 0) THEN
5170: IF g_debug_flag = 'Y' THEN
5171: ozf_utility_pvt.write_conc_log ('LINE');
5172: END IF;
5171: ozf_utility_pvt.write_conc_log ('LINE');
5172: END IF;
5173: adjust_changed_order (
5174: p_api_version=> 1.0
5175: ,p_init_msg_list=> fnd_api.g_true
5176: ,x_return_status=> l_return_status
5177: ,x_msg_count=> l_msg_count
5178: ,x_msg_data=> l_msg_data
5179: ,p_header_rec=> l_header_rec
5196: -- Check return status of functional process,
5197: -- rollback to undo processing
5198: -- if not success write the error message to the log file
5199:
5200: IF NOT (l_return_status = fnd_api.g_ret_sts_success) THEN
5201: --fnd_file.put_line(--fnd_file.log, 'before writinf concurrenct log '||l_return_status);
5202: ozf_utility_pvt.write_conc_log ('D: Error in one of the process');
5203:
5204: ROLLBACK TO get_message_loop_savepoint;
5205: x_retcode := 1;
5206: x_errbuf := l_msg_data;
5207: END IF;
5208:
5209: IF NOT (l_return_status = fnd_api.g_ret_sts_success) THEN
5210: /*Enqueue the failed message into the Order Feedback Exception Queue. This data
5211: can be dequeued subsequently by using the GET_EXCEPTION API */
5212: IF g_debug_flag = 'Y' THEN
5213: ozf_utility_pvt.write_conc_log ('In handle queue exception ');
5213: ozf_utility_pvt.write_conc_log ('In handle queue exception ');
5214: END IF;
5215: aso_order_feedback_pub.handle_exception (
5216: p_api_version=> 1.0,
5217: p_init_msg_list=> fnd_api.g_false,
5218: p_commit=> fnd_api.g_false,
5219: x_return_status=> l_return_status,
5220: x_msg_count=> l_msg_count,
5221: x_msg_data=> l_msg_data,
5214: END IF;
5215: aso_order_feedback_pub.handle_exception (
5216: p_api_version=> 1.0,
5217: p_init_msg_list=> fnd_api.g_false,
5218: p_commit=> fnd_api.g_false,
5219: x_return_status=> l_return_status,
5220: x_msg_count=> l_msg_count,
5221: x_msg_data=> l_msg_data,
5222: p_app_short_name=> 'OZF',
5251: END IF;
5252: -- Quit the procedure IF the queue is empty
5253: ozf_utility_pvt.write_conc_log (' /*************************** END OF QUEUE MESSAGE *************************/');
5254:
5255: EXIT WHEN l_return_status = fnd_api.g_ret_sts_unexp_error;
5256: EXIT WHEN l_no_more_messages = fnd_api.g_true;
5257: l_que_msg_count := l_que_msg_count + 1 ;
5258: EXIT WHEN l_que_msg_count = g_message_count; --nirprasa, added for bug 8435487 FP of bug 8218560
5259: IF l_return_status = fnd_api.g_ret_sts_success THEN
5252: -- Quit the procedure IF the queue is empty
5253: ozf_utility_pvt.write_conc_log (' /*************************** END OF QUEUE MESSAGE *************************/');
5254:
5255: EXIT WHEN l_return_status = fnd_api.g_ret_sts_unexp_error;
5256: EXIT WHEN l_no_more_messages = fnd_api.g_true;
5257: l_que_msg_count := l_que_msg_count + 1 ;
5258: EXIT WHEN l_que_msg_count = g_message_count; --nirprasa, added for bug 8435487 FP of bug 8218560
5259: IF l_return_status = fnd_api.g_ret_sts_success THEN
5260: COMMIT;
5255: EXIT WHEN l_return_status = fnd_api.g_ret_sts_unexp_error;
5256: EXIT WHEN l_no_more_messages = fnd_api.g_true;
5257: l_que_msg_count := l_que_msg_count + 1 ;
5258: EXIT WHEN l_que_msg_count = g_message_count; --nirprasa, added for bug 8435487 FP of bug 8218560
5259: IF l_return_status = fnd_api.g_ret_sts_success THEN
5260: COMMIT;
5261: x_retcode := 0;
5262: END IF;
5263: EXCEPTION
5260: COMMIT;
5261: x_retcode := 0;
5262: END IF;
5263: EXCEPTION
5264: WHEN FND_API.G_EXC_ERROR THEN
5265: ROLLBACK TO get_message_loop_savepoint;
5266: ozf_utility_pvt.write_conc_log('FALIED');
5267: ozf_utility_pvt.write_conc_log;
5268:
5265: ROLLBACK TO get_message_loop_savepoint;
5266: ozf_utility_pvt.write_conc_log('FALIED');
5267: ozf_utility_pvt.write_conc_log;
5268:
5269: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
5270: ROLLBACK TO get_message_loop_savepoint;
5271: ozf_utility_pvt.write_conc_log('FALIED');
5272: ozf_utility_pvt.write_conc_log;
5273:
5302: END IF;
5303:
5304:
5305: EXCEPTION
5306: WHEN fnd_api.g_exc_error THEN
5307: ozf_utility_pvt.write_conc_log ('QUEUE PROCESSED ' ||to_char(l_que_msg_count) ||'MESSAGES' );
5308: x_retcode := 1;
5309: WHEN fnd_api.g_exc_unexpected_error THEN
5310: ozf_utility_pvt.write_conc_log ('QUEUE PROCESSED ' ||to_char(l_que_msg_count) || 'MESSAGES' );
5305: EXCEPTION
5306: WHEN fnd_api.g_exc_error THEN
5307: ozf_utility_pvt.write_conc_log ('QUEUE PROCESSED ' ||to_char(l_que_msg_count) ||'MESSAGES' );
5308: x_retcode := 1;
5309: WHEN fnd_api.g_exc_unexpected_error THEN
5310: ozf_utility_pvt.write_conc_log ('QUEUE PROCESSED ' ||to_char(l_que_msg_count) || 'MESSAGES' );
5311: x_retcode := 1;
5312: WHEN OTHERS THEN
5313: ozf_utility_pvt.write_conc_log ('QUEUE PROCESSED '|| to_char(l_que_msg_count) ||'MESSAGES' );
5422: --
5423: --ozf_utility_pvt.debug_message('l_return_status ='||l_return_status );
5424: --///added by mpande to write a error message to the list
5425: --if not sucess add a error message to th emessage list
5426: IF NOT (l_return_status = fnd_api.g_ret_sts_success) THEN
5427: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error) THEN
5428: fnd_message.set_name ('OZF', 'OZF_FUND_ASO_ORD_FEEDBACK_FAIL');
5429: fnd_msg_pub.ADD;
5430: END IF;
5433: END IF;
5434: -- Check return status
5435: -- if success call adjust_accrual
5436: --
5437: IF l_return_status = fnd_api.g_ret_sts_success THEN
5438: IF (l_line_adj_tbl.COUNT <> 0) THEN
5439: ozf_utility_pvt.write_conc_log ('In get exception adjustment');
5440:
5441: adjust_accrual (
5439: ozf_utility_pvt.write_conc_log ('In get exception adjustment');
5440:
5441: adjust_accrual (
5442: p_api_version=> 1.0,
5443: p_init_msg_list=> fnd_api.g_true,
5444: x_return_status=> l_return_status,
5445: x_msg_count=> l_msg_count,
5446: x_msg_data=> l_msg_data,
5447: p_line_adj_tbl=> l_line_adj_tbl,
5446: x_msg_data=> l_msg_data,
5447: p_line_adj_tbl=> l_line_adj_tbl,
5448: p_old_line_adj_tbl=> l_old_line_adj_tbl,
5449: p_header_rec=> l_header_rec,
5450: p_exception_queue => fnd_api.g_true
5451: );
5452: ozf_utility_pvt.write_conc_log ('ADJUSTMENT EXCEPTION STATUS'||l_return_status);
5453:
5454: END IF;
5452: ozf_utility_pvt.write_conc_log ('ADJUSTMENT EXCEPTION STATUS'||l_return_status);
5453:
5454: END IF;
5455: END IF;
5456: IF l_return_status = fnd_api.g_ret_sts_success THEN
5457: IF (l_line_tbl.COUNT <> 0) THEN
5458: ozf_utility_pvt.write_conc_log (' D: EXCEPTON QUEUE Start processing line');
5459:
5460: adjust_changed_order (
5458: ozf_utility_pvt.write_conc_log (' D: EXCEPTON QUEUE Start processing line');
5459:
5460: adjust_changed_order (
5461: p_api_version=> 1.0,
5462: p_init_msg_list=> fnd_api.g_true,
5463: x_return_status=> l_return_status,
5464: x_msg_count=> l_msg_count,
5465: x_msg_data=> l_msg_data,
5466: p_header_rec=> l_header_rec,
5481: --
5482: -- Check return status of functional process,
5483: -- rollback to undo processing
5484: -- if not success write the error message to the log file
5485: IF NOT (l_return_status = fnd_api.g_ret_sts_success) THEN
5486: l_navigation := DBMS_AQ.NEXT_MESSAGE;
5487: ROLLBACK TO get_excep_loop_savepoint;
5488: --x_retcode := 1;
5489: x_errbuf := l_msg_data;
5488: --x_retcode := 1;
5489: x_errbuf := l_msg_data;
5490: END IF;
5491: -- Quit the procedure IF the queue is empty
5492: EXIT WHEN l_return_status = fnd_api.g_ret_sts_unexp_error;
5493: EXIT WHEN l_no_more_messages = fnd_api.g_true;
5494:
5495: IF l_return_status = fnd_api.g_ret_sts_success THEN
5496:
5489: x_errbuf := l_msg_data;
5490: END IF;
5491: -- Quit the procedure IF the queue is empty
5492: EXIT WHEN l_return_status = fnd_api.g_ret_sts_unexp_error;
5493: EXIT WHEN l_no_more_messages = fnd_api.g_true;
5494:
5495: IF l_return_status = fnd_api.g_ret_sts_success THEN
5496:
5497: aso_order_feedback_pub.get_exception (
5491: -- Quit the procedure IF the queue is empty
5492: EXIT WHEN l_return_status = fnd_api.g_ret_sts_unexp_error;
5493: EXIT WHEN l_no_more_messages = fnd_api.g_true;
5494:
5495: IF l_return_status = fnd_api.g_ret_sts_success THEN
5496:
5497: aso_order_feedback_pub.get_exception (
5498: p_api_version=> 1.0,
5499: x_return_status=> l_return_status,
5532: x_action_request_tbl=> l_action_request_tbl
5533: );
5534:
5535: --added for bug 8435487
5536: IF NOT (l_return_status = fnd_api.g_ret_sts_success) THEN
5537: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error) THEN
5538: fnd_message.set_name ('OZF', 'OZF_FUND_ASO_ORD_FEEDBACK_FAIL');
5539: fnd_msg_pub.ADD;
5540: END IF;
5549: ozf_utility_pvt.write_conc_log;
5550: FND_MSG_PUB.INITIALIZE;
5551: END IF;
5552: EXCEPTION
5553: WHEN FND_API.G_EXC_ERROR THEN
5554: ROLLBACK TO get_excep_loop_savepoint;
5555: ozf_utility_pvt.write_conc_log('FALIED');
5556: ozf_utility_pvt.write_conc_log;
5557:
5554: ROLLBACK TO get_excep_loop_savepoint;
5555: ozf_utility_pvt.write_conc_log('FALIED');
5556: ozf_utility_pvt.write_conc_log;
5557:
5558: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
5559: ROLLBACK TO get_excep_loop_savepoint;
5560: ozf_utility_pvt.write_conc_log('FALIED');
5561: ozf_utility_pvt.write_conc_log;
5562:
5571: ozf_utility_pvt.write_conc_log;
5572: END;
5573: END LOOP exception_loop;
5574: EXCEPTION
5575: WHEN fnd_api.g_exc_error THEN
5576: x_retcode := 1;
5577: WHEN fnd_api.g_exc_unexpected_error THEN
5578: x_retcode := 1;
5579: WHEN OTHERS THEN
5573: END LOOP exception_loop;
5574: EXCEPTION
5575: WHEN fnd_api.g_exc_error THEN
5576: x_retcode := 1;
5577: WHEN fnd_api.g_exc_unexpected_error THEN
5578: x_retcode := 1;
5579: WHEN OTHERS THEN
5580: x_retcode := 1;
5581: END get_exception_message;
5823: l_earned_amt NUMBER;
5824: l_rollup_earned_amt NUMBER;
5825: l_liability_flag VARCHAR2(1);
5826: l_accrual_basis VARCHAR2(30);
5827: l_exchange_rate_type VARCHAR2(30) := FND_API.G_MISS_CHAR; --nirprasa
5828:
5829: --//Bugfix : 10037158
5830: l_offer_type varchar2(30);
5831:
5948:
5949: IF l_gl_posted_flag = G_GL_FLAG_NO THEN
5950: OZF_GL_INTERFACE_PVT.Post_Accrual_To_GL (
5951: p_api_version => 1.0
5952: ,p_init_msg_list => fnd_api.g_false
5953: ,p_commit => fnd_api.g_false
5954: ,p_validation_level => fnd_api.g_valid_level_full
5955:
5956: ,p_utilization_id => p_util_utilization_id
5949: IF l_gl_posted_flag = G_GL_FLAG_NO THEN
5950: OZF_GL_INTERFACE_PVT.Post_Accrual_To_GL (
5951: p_api_version => 1.0
5952: ,p_init_msg_list => fnd_api.g_false
5953: ,p_commit => fnd_api.g_false
5954: ,p_validation_level => fnd_api.g_valid_level_full
5955:
5956: ,p_utilization_id => p_util_utilization_id
5957: ,p_event_type_code => l_event_type_code
5950: OZF_GL_INTERFACE_PVT.Post_Accrual_To_GL (
5951: p_api_version => 1.0
5952: ,p_init_msg_list => fnd_api.g_false
5953: ,p_commit => fnd_api.g_false
5954: ,p_validation_level => fnd_api.g_valid_level_full
5955:
5956: ,p_utilization_id => p_util_utilization_id
5957: ,p_event_type_code => l_event_type_code
5958:
5965: ozf_utility_pvt.write_conc_log (' D: post_accrual_to_gl() create_gl_entry for utilization id '
5966: || p_util_utilization_id || ' returns ' || l_return_status);
5967: END IF;
5968:
5969: IF l_return_status = fnd_api.g_ret_sts_success THEN
5970: l_gl_posted_flag := G_GL_FLAG_YES; -- 'Y';
5971: ELSE
5972: -- do not raise exception for gl posting error. Just mark it as failed and deal with it later
5973: l_gl_posted_flag := G_GL_FLAG_FAIL; -- 'F';
5974: -- 07/17/2003 yzhao: log error message
5975: fnd_msg_pub.count_and_get (
5976: p_count => x_msg_count,
5977: p_data => x_msg_data,
5978: p_encoded => fnd_api.g_false
5979: );
5980: ozf_utility_pvt.write_conc_log(' /****** Failed to post to GL ******/ for utilization id ' || p_util_utilization_id);
5981:
5982: ozf_utility_pvt.write_conc_log;
6004: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
6005: fnd_message.set_name('OZF', 'OZF_UNIV_CURR_NOT_FOUND');
6006: fnd_msg_pub.add;
6007: END IF;
6008: RAISE fnd_api.g_exc_error;
6009: END IF;
6010:
6011: --Added for bug 7030415
6012: OPEN c_get_conversion_type(p_util_org_id);
6035: ozf_utility_pvt.write_conc_log('Utilization amount is converted from fund curr to universal curr');
6036: ozf_utility_pvt.write_conc_log('***************************END******************************');
6037: END IF;
6038:
6039: IF l_return_status = fnd_api.g_ret_sts_error THEN
6040: RAISE fnd_api.g_exc_error;
6041: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
6042: RAISE fnd_api.g_exc_unexpected_error;
6043: END IF;
6036: ozf_utility_pvt.write_conc_log('***************************END******************************');
6037: END IF;
6038:
6039: IF l_return_status = fnd_api.g_ret_sts_error THEN
6040: RAISE fnd_api.g_exc_error;
6041: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
6042: RAISE fnd_api.g_exc_unexpected_error;
6043: END IF;
6044:
6037: END IF;
6038:
6039: IF l_return_status = fnd_api.g_ret_sts_error THEN
6040: RAISE fnd_api.g_exc_error;
6041: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
6042: RAISE fnd_api.g_exc_unexpected_error;
6043: END IF;
6044:
6045: IF l_gl_posted_flag = G_GL_FLAG_NOLIAB THEN
6038:
6039: IF l_return_status = fnd_api.g_ret_sts_error THEN
6040: RAISE fnd_api.g_exc_error;
6041: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
6042: RAISE fnd_api.g_exc_unexpected_error;
6043: END IF;
6044:
6045: IF l_gl_posted_flag = G_GL_FLAG_NOLIAB THEN
6046: l_orig_amt := p_util_amount;
6091: + NVL(l_new_univ_amt, 0);
6092: --rimehrot, for R12
6093: ozf_objfundsum_pvt.update_objfundsum(
6094: p_api_version => 1.0,
6095: p_init_msg_list => Fnd_Api.G_FALSE,
6096: p_validation_level => Fnd_Api.G_VALID_LEVEL_NONE,
6097: p_objfundsum_rec => l_objfundsum_rec,
6098: x_return_status => l_return_status,
6099: x_msg_count => x_msg_count,
6092: --rimehrot, for R12
6093: ozf_objfundsum_pvt.update_objfundsum(
6094: p_api_version => 1.0,
6095: p_init_msg_list => Fnd_Api.G_FALSE,
6096: p_validation_level => Fnd_Api.G_VALID_LEVEL_NONE,
6097: p_objfundsum_rec => l_objfundsum_rec,
6098: x_return_status => l_return_status,
6099: x_msg_count => x_msg_count,
6100: x_msg_data => x_msg_data
6098: x_return_status => l_return_status,
6099: x_msg_count => x_msg_count,
6100: x_msg_data => x_msg_data
6101: );
6102: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
6103: RAISE fnd_api.g_exc_unexpected_error;
6104: ELSIF l_return_status = fnd_api.g_ret_sts_error THEN
6105: RAISE fnd_api.g_exc_error;
6106: END IF;
6099: x_msg_count => x_msg_count,
6100: x_msg_data => x_msg_data
6101: );
6102: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
6103: RAISE fnd_api.g_exc_unexpected_error;
6104: ELSIF l_return_status = fnd_api.g_ret_sts_error THEN
6105: RAISE fnd_api.g_exc_error;
6106: END IF;
6107: -- end R12 changes
6100: x_msg_data => x_msg_data
6101: );
6102: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
6103: RAISE fnd_api.g_exc_unexpected_error;
6104: ELSIF l_return_status = fnd_api.g_ret_sts_error THEN
6105: RAISE fnd_api.g_exc_error;
6106: END IF;
6107: -- end R12 changes
6108:
6101: );
6102: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
6103: RAISE fnd_api.g_exc_unexpected_error;
6104: ELSIF l_return_status = fnd_api.g_ret_sts_error THEN
6105: RAISE fnd_api.g_exc_error;
6106: END IF;
6107: -- end R12 changes
6108:
6109: END IF; -- p_util_utilization_type = 'SALES_ACCRUAL'
6151: END IF; -- end of plan_type
6152:
6153:
6154: x_gl_posted_flag := l_gl_posted_flag;
6155: x_return_status := fnd_api.g_ret_sts_success;
6156:
6157: IF g_debug_flag = 'Y' THEN
6158: ozf_utility_pvt.write_conc_log (' D: post_accrual_to_gl() ENDs for utilization id ' || p_util_utilization_id
6159: || ' final gl_posted_flag=' || x_gl_posted_flag);
6162: EXCEPTION
6163: WHEN OTHERS THEN
6164: ROLLBACK TO post_accrual_to_gl_sp;
6165: ozf_utility_pvt.write_conc_log(' D: post_accrual_to_gl(): exception ');
6166: x_return_status := fnd_api.g_ret_sts_unexp_error;
6167: fnd_msg_pub.count_and_get (
6168: p_count => x_msg_count,
6169: p_data => x_msg_data,
6170: p_encoded => fnd_api.g_false
6166: x_return_status := fnd_api.g_ret_sts_unexp_error;
6167: fnd_msg_pub.count_and_get (
6168: p_count => x_msg_count,
6169: p_data => x_msg_data,
6170: p_encoded => fnd_api.g_false
6171: );
6172: END post_accrual_to_gl;
6173:
6174:
6291: , x_msg_data => l_msg_data
6292: );
6293: END IF;
6294:
6295: IF l_return_status <> fnd_api.g_ret_sts_success THEN
6296: -- failed again. Leave as it is.
6297: IF g_debug_flag = 'Y' THEN
6298: ozf_utility_pvt.write_conc_log(' /****** Failed to post to GL ******/ for utilization id ' || l_utilIdTbl(i));
6299: END IF;
6540: || ') returns ' || l_return_status || ' x_gl_posted_flag' || l_gl_posted_flag);
6541: END IF;
6542:
6543: -- yzhao: 03/04/2004 post gl for related accruals from offer adjustment or object reconcile
6544: IF l_return_status = fnd_api.g_ret_sts_success AND l_gl_posted_flag = G_GL_FLAG_YES THEN
6545: post_related_accrual_to_gl(
6546: p_utilization_id => l_utilIdTbl(i)
6547: , p_utilization_type => 'UTILIZED'
6548: , p_gl_date => l_gl_date
6571: ozf_utility_pvt.write_conc_log(' D: post_offinvoice_to_gl(): exception ');
6572: fnd_msg_pub.count_and_get (
6573: p_count => l_msg_count,
6574: p_data => l_msg_data,
6575: p_encoded => fnd_api.g_false
6576: );
6577: x_errbuf := l_msg_data;
6578: END post_offinvoice_to_gl;
6579:
6673: EXIT WHEN c_get_related_accrual%NOTFOUND;
6674: END LOOP; -- bulk fetch
6675: CLOSE c_get_related_accrual;
6676:
6677: x_return_status := fnd_api.g_ret_sts_success;
6678: IF g_debug_flag = 'Y' THEN
6679: ozf_utility_pvt.write_conc_log (' D: post_related_accrual_to_gl() ENDs for utilization id ' || p_utilization_id);
6680: END IF;
6681:
6682: EXCEPTION
6683: WHEN OTHERS THEN
6684: ROLLBACK TO post_related_accrual_to_gl_sp;
6685: ozf_utility_pvt.write_conc_log(' D: post_related_accrual_to_gl(): exception ');
6686: x_return_status := fnd_api.g_ret_sts_unexp_error;
6687: fnd_msg_pub.count_and_get (
6688: p_count => x_msg_count,
6689: p_data => x_msg_data,
6690: p_encoded => fnd_api.g_false
6686: x_return_status := fnd_api.g_ret_sts_unexp_error;
6687: fnd_msg_pub.count_and_get (
6688: p_count => x_msg_count,
6689: p_data => x_msg_data,
6690: p_encoded => fnd_api.g_false
6691: );
6692:
6693: END post_related_accrual_to_gl;
6694:
6969: - NVL(p_univ_curr_amount, 0)
6970: + NVL(l_conv_univ_amount, 0);
6971:
6972: ozf_objfundsum_pvt.update_objfundsum(p_api_version => 1.0,
6973: p_init_msg_list => Fnd_Api.G_FALSE,
6974: p_validation_level => Fnd_Api.G_VALID_LEVEL_NONE,
6975: p_objfundsum_rec => l_objfundsum_rec,
6976: x_return_status => l_return_status,
6977: x_msg_count => x_msg_count,
6970: + NVL(l_conv_univ_amount, 0);
6971:
6972: ozf_objfundsum_pvt.update_objfundsum(p_api_version => 1.0,
6973: p_init_msg_list => Fnd_Api.G_FALSE,
6974: p_validation_level => Fnd_Api.G_VALID_LEVEL_NONE,
6975: p_objfundsum_rec => l_objfundsum_rec,
6976: x_return_status => l_return_status,
6977: x_msg_count => x_msg_count,
6978: x_msg_data => x_msg_data
6976: x_return_status => l_return_status,
6977: x_msg_count => x_msg_count,
6978: x_msg_data => x_msg_data
6979: );
6980: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
6981: RAISE fnd_api.g_exc_unexpected_error;
6982: ELSIF l_return_status = fnd_api.g_ret_sts_error THEN
6983: RAISE fnd_api.g_exc_error;
6984: END IF;
6977: x_msg_count => x_msg_count,
6978: x_msg_data => x_msg_data
6979: );
6980: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
6981: RAISE fnd_api.g_exc_unexpected_error;
6982: ELSIF l_return_status = fnd_api.g_ret_sts_error THEN
6983: RAISE fnd_api.g_exc_error;
6984: END IF;
6985:
6978: x_msg_data => x_msg_data
6979: );
6980: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
6981: RAISE fnd_api.g_exc_unexpected_error;
6982: ELSIF l_return_status = fnd_api.g_ret_sts_error THEN
6983: RAISE fnd_api.g_exc_error;
6984: END IF;
6985:
6986: --update activity table
6979: );
6980: IF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
6981: RAISE fnd_api.g_exc_unexpected_error;
6982: ELSIF l_return_status = fnd_api.g_ret_sts_error THEN
6983: RAISE fnd_api.g_exc_error;
6984: END IF;
6985:
6986: --update activity table
6987: OPEN c_act_budget_rec(p_util_plan_id);
7061: ozf_utility_pvt.write_conc_log('recalculate_earnings(): exception ');
7062: fnd_msg_pub.count_and_get (
7063: p_count => l_msg_count,
7064: p_data => l_msg_data,
7065: p_encoded => fnd_api.g_false
7066: );
7067:
7068:
7069: x_return_status := fnd_api.g_ret_sts_success;
7065: p_encoded => fnd_api.g_false
7066: );
7067:
7068:
7069: x_return_status := fnd_api.g_ret_sts_success;
7070: IF g_debug_flag = 'Y' THEN
7071: ozf_utility_pvt.write_conc_log (' D: recalculate_earnings() ENDs for utilization id ' || p_util_utilization_id);
7072: END IF;
7073: END recalculate_earnings;