DBA Data[Home] [Help]

APPS.OZF_FUND_UTILIZED_PVT dependencies on OZF_ACCRUAL_ENGINE

Line 76: -- use constant ozf_accrual_engine.G_GL_FLAG_* for gl_posted_flag

72: -- 10/20/2003 yzhao fixed TEVA bug - customer accrual budget committed amount remains 0 when third party accrual happens
73: -- 11/14/2003 yzhao 11.5.10 populate both utilized_amt and earned_amt, added CHARGEBACK
74: -- 02/24/2004 yzhao 11.5.10 fix bug 3461280 - manual adj for off-invoice, should update paid amount
75: -- customer accrual without liability: no gl posting, do not update earned amount
76: -- use constant ozf_accrual_engine.G_GL_FLAG_* for gl_posted_flag
77: -- 19-AUG-2008 ateotia Bug # 7337263 fixed.
78: -- FP:11510-R12 7129397 - GOT ERROR ON OBJECT_VERSION_NUMBER IN INITIATE PAYMENT
79: -- Added a condition for Chargeback Batch using Fully Accrued budget.
80: -- 27/10/2009 muthsubr Over loaded create_utilization procedure for bug#8867381.

Line 147: -- use constant ozf_accrual_engine.G_GL_FLAG_* for gl_posted_flag

143: -- 10/20/2003 yzhao fixed TEVA bug - customer accrual budget committed amount remains 0 when third party accrual happens
144: -- 11/14/2003 yzhao 11.5.10 populate both utilized_amt and earned_amt, added CHARGEBACK
145: -- 02/24/2004 yzhao 11.5.10 fix bug 3461280 - manual adj for off-invoice, should update paid amount
146: -- customer accrual without liability: no gl posting, do not update earned amount
147: -- use constant ozf_accrual_engine.G_GL_FLAG_* for gl_posted_flag
148: -- 14-NOV-2008 ateotia Bug # 7129397 fixed.
149: -- Added a condition for Chargeback Batch using Fully Accrued, Accrue To - Sales budget.
150: -- 27/10/2009 muthsubr Added px_ozf_act_budgets_tbl, p_use_fund_staging_tables
151: -- px_ozf_funds_old_rectype, px_ozf_funds_new_rectype

Line 1110: l_utilization_rec.gl_posted_flag := ozf_accrual_engine.G_GL_FLAG_NO; -- 'N', waiting for gl posting

1106: IF l_fund_type = 'FULLY_ACCRUED' THEN -- for fully accrual budget
1107: -- for a fully accrued custoemr fund the budgeted and utilized column and committed column get populated
1108: -- gl_posted_flag is 'N'
1109: IF l_accrual_basis = 'CUSTOMER' AND NVL(l_liability_flag, 'N') = 'Y' THEN
1110: l_utilization_rec.gl_posted_flag := ozf_accrual_engine.G_GL_FLAG_NO; -- 'N', waiting for gl posting
1111: l_gl_posted := true;
1112: IF p_utilization_rec.utilization_type IN ('ADJUSTMENT', 'LEAD_ADJUSTMENT') AND
1113: l_utilization_rec.orig_utilization_id IS NOT NULL THEN
1114: -- fix bug 3348955 - gl posting to adjustment should be in sync with original order's utilization

Line 1119: IF l_orig_gl_flag = ozf_accrual_engine.G_GL_FLAG_NO THEN

1115: l_orig_gl_flag := NULL;
1116: OPEN c_get_orig_gl_flag(l_utilization_rec.orig_utilization_id);
1117: FETCH c_get_orig_gl_flag INTO l_orig_gl_flag;
1118: CLOSE c_get_orig_gl_flag;
1119: IF l_orig_gl_flag = ozf_accrual_engine.G_GL_FLAG_NO THEN
1120: -- do not post to gl now, wait for the original utilization's posting
1121: l_gl_posted := false;
1122: END IF;
1123: END IF; -- IF orig_utilization_id IS NOT NULL

Line 1285: IF l_orig_gl_flag = ozf_accrual_engine.G_GL_FLAG_NO THEN

1281: -- fix bug 3348955 - gl posting to adjustment should be in sync with original order's utilization
1282: OPEN c_get_orig_gl_flag(l_utilization_rec.orig_utilization_id);
1283: FETCH c_get_orig_gl_flag INTO l_orig_gl_flag;
1284: CLOSE c_get_orig_gl_flag;
1285: IF l_orig_gl_flag = ozf_accrual_engine.G_GL_FLAG_NO THEN
1286: -- do not post to gl now, wait for the original utilization's posting
1287: l_gl_posted := false;
1288: END IF;
1289: END IF; -- IF orig_utilization_id IS NOT NULL

Line 1303: IF l_orig_gl_flag = ozf_accrual_engine.G_GL_FLAG_NO THEN

1299: FETCH c_get_orig_gl_flag INTO l_orig_gl_flag;
1300: CLOSE c_get_orig_gl_flag;
1301: END IF;
1302:
1303: IF l_orig_gl_flag = ozf_accrual_engine.G_GL_FLAG_NO THEN
1304: -- do not post to gl now, wait for the original utilization's posting
1305: l_gl_posted := false;
1306: l_utilization_rec.gl_posted_flag := ozf_accrual_engine.G_GL_FLAG_NO;
1307: l_utilization_rec.amount_remaining := NULL; -- no amount remaining

Line 1306: l_utilization_rec.gl_posted_flag := ozf_accrual_engine.G_GL_FLAG_NO;

1302:
1303: IF l_orig_gl_flag = ozf_accrual_engine.G_GL_FLAG_NO THEN
1304: -- do not post to gl now, wait for the original utilization's posting
1305: l_gl_posted := false;
1306: l_utilization_rec.gl_posted_flag := ozf_accrual_engine.G_GL_FLAG_NO;
1307: l_utilization_rec.amount_remaining := NULL; -- no amount remaining
1308: ELSE
1309: l_utilization_rec.amount_remaining := NULL; -- no amount remaining
1310: l_utilization_rec.gl_posted_flag := ozf_accrual_engine.G_GL_FLAG_NOLIAB; -- 'X', do not post to gl

Line 1310: l_utilization_rec.gl_posted_flag := ozf_accrual_engine.G_GL_FLAG_NOLIAB; -- 'X', do not post to gl

1306: l_utilization_rec.gl_posted_flag := ozf_accrual_engine.G_GL_FLAG_NO;
1307: l_utilization_rec.amount_remaining := NULL; -- no amount remaining
1308: ELSE
1309: l_utilization_rec.amount_remaining := NULL; -- no amount remaining
1310: l_utilization_rec.gl_posted_flag := ozf_accrual_engine.G_GL_FLAG_NOLIAB; -- 'X', do not post to gl
1311: l_fund_rec.original_budget :=
1312: ( NVL (l_original_budget, 0)
1313: + NVL (l_utilization_rec.amount, 0)
1314: );

Line 1327: l_utilization_rec.gl_posted_flag := ozf_accrual_engine.G_GL_FLAG_NO; -- 'N', waiting for posting to gl

1323: + NVL(l_utilization_rec.fund_request_amount, 0);
1324: l_objfundsum_rec.univ_curr_utilized_amt := NVL(l_objfundsum_rec.univ_curr_utilized_amt, 0)
1325: + NVL(l_univ_curr_amount, 0);
1326: IF p_utilization_rec.utilization_type IN ('ACCRUAL', 'LEAD_ACCRUAL', 'CHARGEBACK') THEN
1327: l_utilization_rec.gl_posted_flag := ozf_accrual_engine.G_GL_FLAG_NO; -- 'N', waiting for posting to gl
1328: l_gl_posted := true;
1329: ELSE -- p_utilization_rec.utilization_type IN ('UTILIZED', 'ADJUSTMENT', 'LEAD_ADJUSTMENT')
1330: IF p_utilization_rec.component_type <> 'OFFR' THEN
1331:

Line 1333: l_utilization_rec.gl_posted_flag := ozf_accrual_engine.G_GL_FLAG_NO; -- 'N', waiting for posting to gl

1329: ELSE -- p_utilization_rec.utilization_type IN ('UTILIZED', 'ADJUSTMENT', 'LEAD_ADJUSTMENT')
1330: IF p_utilization_rec.component_type <> 'OFFR' THEN
1331:
1332: IF p_utilization_rec.component_type = 'PRIC' THEN
1333: l_utilization_rec.gl_posted_flag := ozf_accrual_engine.G_GL_FLAG_NO; -- 'N', waiting for posting to gl
1334: l_utilization_rec.amount_remaining := l_utilization_rec.amount;
1335: l_gl_posted := true;
1336: ELSE
1337: -- no gl posting for marketing objects, increase earned and paid amount immediately

Line 1338: l_utilization_rec.gl_posted_flag := ozf_accrual_engine.G_GL_FLAG_NULL; -- null

1334: l_utilization_rec.amount_remaining := l_utilization_rec.amount;
1335: l_gl_posted := true;
1336: ELSE
1337: -- no gl posting for marketing objects, increase earned and paid amount immediately
1338: l_utilization_rec.gl_posted_flag := ozf_accrual_engine.G_GL_FLAG_NULL; -- null
1339: l_utilization_rec.amount_remaining := NULL; -- no amount remaining for off-invoice utilization/adjustment
1340: l_fund_rec.earned_amt := NVL (l_earned_amt, 0) + NVL (l_utilization_rec.amount, 0);
1341: l_fund_rec.paid_amt := NVL (l_paid_amt, 0) + NVL (l_utilization_rec.amount, 0);
1342: -- R12: yzhao ozf_object_fund_summary update earned and paid amt

Line 1359: l_utilization_rec.gl_posted_flag := ozf_accrual_engine.G_GL_FLAG_NO; -- 'N', waiting for posting to gl

1355:
1356: ELSE -- offer utilization
1357: IF p_utilization_rec.utilization_type IN ('ADJUSTMENT', 'LEAD_ADJUSTMENT') THEN
1358: --always post to gl for offer's adjustment, regardless of accrual offer or off-invoice offer
1359: l_utilization_rec.gl_posted_flag := ozf_accrual_engine.G_GL_FLAG_NO; -- 'N', waiting for posting to gl
1360: l_utilization_rec.amount_remaining := l_utilization_rec.amount;
1361: l_gl_posted := true;
1362: -- Bugfix : 10037158
1363: IF l_offer_type = 'TERMS' THEN

Line 1364: l_utilization_rec.gl_posted_flag := ozf_accrual_engine.G_GL_FLAG_NOLIAB; -- For Terms Upgrade offer 'X', do not post to gl

1360: l_utilization_rec.amount_remaining := l_utilization_rec.amount;
1361: l_gl_posted := true;
1362: -- Bugfix : 10037158
1363: IF l_offer_type = 'TERMS' THEN
1364: l_utilization_rec.gl_posted_flag := ozf_accrual_engine.G_GL_FLAG_NOLIAB; -- For Terms Upgrade offer 'X', do not post to gl
1365: l_gl_posted := false;
1366: END IF;
1367:
1368: IF l_utilization_rec.orig_utilization_id IS NOT NULL THEN

Line 1374: IF l_orig_gl_flag = ozf_accrual_engine.G_GL_FLAG_NO THEN

1370: l_orig_gl_flag := NULL;
1371: OPEN c_get_orig_gl_flag(l_utilization_rec.orig_utilization_id);
1372: FETCH c_get_orig_gl_flag INTO l_orig_gl_flag;
1373: CLOSE c_get_orig_gl_flag;
1374: IF l_orig_gl_flag = ozf_accrual_engine.G_GL_FLAG_NO THEN
1375: -- do not post to gl now, wait for the original utilization's posting
1376: l_gl_posted := false;
1377: END IF;
1378: IF l_utilization_rec.orig_utilization_id = -1 THEN -- for bug 6021635

Line 1385: IF l_utilization_rec.gl_posted_flag = ozf_accrual_engine.G_GL_FLAG_YES OR

1381: END IF; -- IF orig_utilization_id IS NOT NULL
1382: ELSE -- 'UTILIZED' for offer
1383: IF l_offer_type IN ('ACCRUAL', 'NET_ACCRUAL', 'LUMPSUM', 'SCAN_DATA') THEN
1384: -- handle case for reconcile when l_utilization_rec.gl_posted_flag passed.
1385: IF l_utilization_rec.gl_posted_flag = ozf_accrual_engine.G_GL_FLAG_YES OR
1386: l_utilization_rec.gl_posted_flag is NULL THEN
1387: l_offer_accrual_flag := true;
1388: END IF;
1389: ELSIF l_offer_type = 'VOLUME_OFFER' THEN

Line 1391: IF l_utilization_rec.gl_posted_flag = ozf_accrual_engine.G_GL_FLAG_NO OR

1387: l_offer_accrual_flag := true;
1388: END IF;
1389: ELSIF l_offer_type = 'VOLUME_OFFER' THEN
1390: IF l_volume_offer_type = 'OFF_INVOICE' THEN
1391: IF l_utilization_rec.gl_posted_flag = ozf_accrual_engine.G_GL_FLAG_NO OR
1392: l_utilization_rec.gl_posted_flag is NULL THEN
1393: l_offer_accrual_flag := false;
1394: END IF;
1395: ELSE

Line 1396: IF l_utilization_rec.gl_posted_flag = ozf_accrual_engine.G_GL_FLAG_YES OR

1392: l_utilization_rec.gl_posted_flag is NULL THEN
1393: l_offer_accrual_flag := false;
1394: END IF;
1395: ELSE
1396: IF l_utilization_rec.gl_posted_flag = ozf_accrual_engine.G_GL_FLAG_YES OR
1397: l_utilization_rec.gl_posted_flag is NULL THEN
1398: l_offer_accrual_flag := true;
1399: END IF;
1400: END IF;

Line 1408: IF l_utilization_rec.gl_posted_flag = ozf_accrual_engine.G_GL_FLAG_YES OR

1404: , l_utilization_rec.product_level_type, l_utilization_rec.product_id);
1405: FETCH c_get_deal_accrual_flag INTO l_tmp_id;
1406: CLOSE c_get_deal_accrual_flag;
1407: IF l_tmp_id = 1 THEN
1408: IF l_utilization_rec.gl_posted_flag = ozf_accrual_engine.G_GL_FLAG_YES OR
1409: l_utilization_rec.gl_posted_flag is NULL THEN
1410: l_offer_accrual_flag := true;
1411: END IF;
1412: ELSE

Line 1413: IF l_utilization_rec.gl_posted_flag = ozf_accrual_engine.G_GL_FLAG_NO OR

1409: l_utilization_rec.gl_posted_flag is NULL THEN
1410: l_offer_accrual_flag := true;
1411: END IF;
1412: ELSE
1413: IF l_utilization_rec.gl_posted_flag = ozf_accrual_engine.G_GL_FLAG_NO OR
1414: l_utilization_rec.gl_posted_flag is NULL THEN
1415: l_offer_accrual_flag := false;
1416: END IF;
1417: END IF;

Line 1419: IF l_utilization_rec.gl_posted_flag = ozf_accrual_engine.G_GL_FLAG_NO OR

1415: l_offer_accrual_flag := false;
1416: END IF;
1417: END IF;
1418: ELSE -- 'OFF_INVOICE', 'OID', 'ORDER', 'TERMS'
1419: IF l_utilization_rec.gl_posted_flag = ozf_accrual_engine.G_GL_FLAG_NO OR
1420: l_utilization_rec.gl_posted_flag is NULL THEN
1421: l_offer_accrual_flag := false;
1422: END IF;
1423: END IF;

Line 1426: l_utilization_rec.gl_posted_flag := ozf_accrual_engine.G_GL_FLAG_NO; -- 'N', waiting for gl posting

1422: END IF;
1423: END IF;
1424:
1425: IF l_offer_accrual_flag THEN
1426: l_utilization_rec.gl_posted_flag := ozf_accrual_engine.G_GL_FLAG_NO; -- 'N', waiting for gl posting
1427: l_utilization_rec.amount_remaining := l_utilization_rec.amount;
1428: l_gl_posted := true;
1429: ELSIF l_offer_accrual_flag = false THEN
1430: IF p_utilization_rec.utilization_type IN ('ADJUSTMENT', 'LEAD_ADJUSTMENT') THEN

Line 1439: l_utilization_rec.gl_posted_flag := ozf_accrual_engine.G_GL_FLAG_NULL; -- null

1435: OPEN c_offinvoice_gl_post_flag(l_utilization_rec.org_id);
1436: FETCH c_offinvoice_gl_post_flag INTO l_offinvoice_gl_post_flag;
1437: CLOSE c_offinvoice_gl_post_flag;
1438: IF (l_offinvoice_gl_post_flag = 'F') THEN
1439: l_utilization_rec.gl_posted_flag := ozf_accrual_engine.G_GL_FLAG_NULL; -- null
1440: l_fund_rec.earned_amt := NVL (l_earned_amt, 0) + NVL (l_utilization_rec.amount, 0);
1441: -- R12: yzhao ozf_object_fund_summary update earned and paid amt
1442: l_objfundsum_rec.earned_amt := NVL(l_objfundsum_rec.earned_amt, 0) + NVL(l_utilization_rec.amount, 0);
1443: l_objfundsum_rec.plan_curr_earned_amt := NVL(l_objfundsum_rec.plan_curr_earned_amt, 0)

Line 1459: l_utilization_rec.gl_posted_flag := ozf_accrual_engine.G_GL_FLAG_NO; -- 'N', waiting for posting to gl

1455: l_objfundsum_rec.univ_curr_paid_amt := NVL(l_objfundsum_rec.univ_curr_paid_amt, 0)
1456: + NVL(l_univ_curr_amount, 0);
1457: END IF;
1458: ELSE
1459: l_utilization_rec.gl_posted_flag := ozf_accrual_engine.G_GL_FLAG_NO; -- 'N', waiting for posting to gl
1460: l_gl_posted := true;
1461: END IF;
1462: ELSE -- for reconcile when original gl_posted_flag = 'N' and 'F'
1463: l_gl_posted := false;

Line 1981: IF l_gl_posted AND l_utilization_rec.gl_posted_flag = ozf_accrual_engine.G_GL_FLAG_NO AND

1977:
1978: --------------------------complete fund update-------------------------
1979: -- post to GL immediately for manual earning adjustments, and utilized offer type with 'post to gl' profile as yes
1980: -- the accrual type adjustment is taken care of in ozfacreb.pls
1981: IF l_gl_posted AND l_utilization_rec.gl_posted_flag = ozf_accrual_engine.G_GL_FLAG_NO AND
1982: l_utilization_rec.plan_type IN ( 'OFFR' , 'PRIC') THEN
1983: /* yzhao: 11.5.10 11/17/2003 create gl entry for off-invoice discount when profile is on
1984: -- IF l_utilization_rec.utilization_type NOT IN ('REQUEST', 'TRANSFER', 'SALES_ACCRUAL','UTILIZED')
1985: IF l_utilization_rec.utilization_type NOT IN ('REQUEST', 'TRANSFER', 'SALES_ACCRUAL') THEN

Line 2047: l_gl_posted_flag := ozf_accrual_engine.G_GL_FLAG_YES; -- 'Y';

2043: END IF;
2044:
2045: -- yzhao: 03/27/2003 when gl posting succeeds, set the flag 'Y', otherwise 'F', ignore error and reprocess later
2046: IF l_return_status = fnd_api.g_ret_sts_success THEN
2047: l_gl_posted_flag := ozf_accrual_engine.G_GL_FLAG_YES; -- 'Y';
2048: --kdass 27-JUL-2005 - R12 change for paid adjustments
2049: IF l_utilization_rec.utilization_type = 'ADJUSTMENT' AND
2050: l_utilization_rec.adjustment_type IN ('INCREASE_PAID', 'DECREASE_PAID') THEN
2051: l_fund_rec.paid_amt := NVL(l_paid_amt,0) - NVL (l_utilization_rec.amount_remaining, 0);

Line 2089: l_gl_posted_flag := ozf_accrual_engine.G_GL_FLAG_FAIL; -- 'F';

2085: + NVL(l_univ_curr_amount, 0);
2086: END IF;
2087: END IF;
2088: ELSE
2089: l_gl_posted_flag := ozf_accrual_engine.G_GL_FLAG_FAIL; -- 'F';
2090: -- yzhao: 11/20 raise exception if gl posting failed for manual adjust earned amount
2091: IF l_utilization_rec.utilization_type IN ('ADJUSTMENT', 'CHARGEBACK', 'LEAD_ADJUSTMENT') AND
2092: l_utilization_rec.adjustment_type IN ('STANDARD', 'DECREASE_EARNED', 'DECREASE_COMM_EARNED') THEN
2093: fnd_message.set_name ('OZF', 'OZF_GL_POST_FAILURE');