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: ---------------------------------------------------------------------

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

899: IF l_fund_type = 'FULLY_ACCRUED' THEN -- for fully accrual budget
900: -- for a fully accrued custoemr fund the budgeted and utilized column and committed column get populated
901: -- gl_posted_flag is 'N'
902: IF l_accrual_basis = 'CUSTOMER' AND NVL(l_liability_flag, 'N') = 'Y' THEN
903: l_utilization_rec.gl_posted_flag := ozf_accrual_engine.G_GL_FLAG_NO; -- 'N', waiting for gl posting
904: l_gl_posted := true;
905: IF p_utilization_rec.utilization_type IN ('ADJUSTMENT', 'LEAD_ADJUSTMENT') AND
906: l_utilization_rec.orig_utilization_id IS NOT NULL THEN
907: -- fix bug 3348955 - gl posting to adjustment should be in sync with original order's utilization

Line 912: IF l_orig_gl_flag = ozf_accrual_engine.G_GL_FLAG_NO THEN

908: l_orig_gl_flag := NULL;
909: OPEN c_get_orig_gl_flag(l_utilization_rec.orig_utilization_id);
910: FETCH c_get_orig_gl_flag INTO l_orig_gl_flag;
911: CLOSE c_get_orig_gl_flag;
912: IF l_orig_gl_flag = ozf_accrual_engine.G_GL_FLAG_NO THEN
913: -- do not post to gl now, wait for the original utilization's posting
914: l_gl_posted := false;
915: END IF;
916: END IF; -- IF orig_utilization_id IS NOT NULL

Line 1010: IF l_orig_gl_flag = ozf_accrual_engine.G_GL_FLAG_NO THEN

1006: -- fix bug 3348955 - gl posting to adjustment should be in sync with original order's utilization
1007: OPEN c_get_orig_gl_flag(l_utilization_rec.orig_utilization_id);
1008: FETCH c_get_orig_gl_flag INTO l_orig_gl_flag;
1009: CLOSE c_get_orig_gl_flag;
1010: IF l_orig_gl_flag = ozf_accrual_engine.G_GL_FLAG_NO THEN
1011: -- do not post to gl now, wait for the original utilization's posting
1012: l_gl_posted := false;
1013: END IF;
1014: END IF; -- IF orig_utilization_id IS NOT NULL

Line 1028: IF l_orig_gl_flag = ozf_accrual_engine.G_GL_FLAG_NO THEN

1024: FETCH c_get_orig_gl_flag INTO l_orig_gl_flag;
1025: CLOSE c_get_orig_gl_flag;
1026: END IF;
1027:
1028: IF l_orig_gl_flag = ozf_accrual_engine.G_GL_FLAG_NO THEN
1029: -- do not post to gl now, wait for the original utilization's posting
1030: l_gl_posted := false;
1031: l_utilization_rec.gl_posted_flag := ozf_accrual_engine.G_GL_FLAG_NO;
1032: l_utilization_rec.amount_remaining := NULL; -- no amount remaining

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

1027:
1028: IF l_orig_gl_flag = ozf_accrual_engine.G_GL_FLAG_NO THEN
1029: -- do not post to gl now, wait for the original utilization's posting
1030: l_gl_posted := false;
1031: l_utilization_rec.gl_posted_flag := ozf_accrual_engine.G_GL_FLAG_NO;
1032: l_utilization_rec.amount_remaining := NULL; -- no amount remaining
1033: ELSE
1034: l_utilization_rec.amount_remaining := NULL; -- no amount remaining
1035: l_utilization_rec.gl_posted_flag := ozf_accrual_engine.G_GL_FLAG_NOLIAB; -- 'X', do not post to gl

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

1031: l_utilization_rec.gl_posted_flag := ozf_accrual_engine.G_GL_FLAG_NO;
1032: l_utilization_rec.amount_remaining := NULL; -- no amount remaining
1033: ELSE
1034: l_utilization_rec.amount_remaining := NULL; -- no amount remaining
1035: l_utilization_rec.gl_posted_flag := ozf_accrual_engine.G_GL_FLAG_NOLIAB; -- 'X', do not post to gl
1036: l_fund_rec.original_budget :=
1037: ( NVL (l_original_budget, 0)
1038: + NVL (l_utilization_rec.amount, 0)
1039: );

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

1048: + NVL(l_plan_curr_amount, 0);
1049: l_objfundsum_rec.univ_curr_utilized_amt := NVL(l_objfundsum_rec.univ_curr_utilized_amt, 0)
1050: + NVL(l_univ_curr_amount, 0);
1051: IF p_utilization_rec.utilization_type IN ('ACCRUAL', 'LEAD_ACCRUAL', 'CHARGEBACK') THEN
1052: l_utilization_rec.gl_posted_flag := ozf_accrual_engine.G_GL_FLAG_NO; -- 'N', waiting for posting to gl
1053: l_gl_posted := true;
1054: ELSE -- p_utilization_rec.utilization_type IN ('UTILIZED', 'ADJUSTMENT', 'LEAD_ADJUSTMENT')
1055: IF p_utilization_rec.component_type <> 'OFFR' THEN
1056:

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

1054: ELSE -- p_utilization_rec.utilization_type IN ('UTILIZED', 'ADJUSTMENT', 'LEAD_ADJUSTMENT')
1055: IF p_utilization_rec.component_type <> 'OFFR' THEN
1056:
1057: IF p_utilization_rec.component_type = 'PRIC' THEN
1058: l_utilization_rec.gl_posted_flag := ozf_accrual_engine.G_GL_FLAG_NO; -- 'N', waiting for posting to gl
1059: l_utilization_rec.amount_remaining := l_utilization_rec.amount;
1060: l_gl_posted := true;
1061: ELSE
1062: -- no gl posting for marketing objects, increase earned and paid amount immediately

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

1059: l_utilization_rec.amount_remaining := l_utilization_rec.amount;
1060: l_gl_posted := true;
1061: ELSE
1062: -- no gl posting for marketing objects, increase earned and paid amount immediately
1063: l_utilization_rec.gl_posted_flag := ozf_accrual_engine.G_GL_FLAG_NULL; -- null
1064: l_utilization_rec.amount_remaining := NULL; -- no amount remaining for off-invoice utilization/adjustment
1065: l_fund_rec.earned_amt := NVL (l_earned_amt, 0) + NVL (l_utilization_rec.amount, 0);
1066: l_fund_rec.paid_amt := NVL (l_paid_amt, 0) + NVL (l_utilization_rec.amount, 0);
1067: -- R12: yzhao ozf_object_fund_summary update earned and paid amt

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

1080:
1081: ELSE -- offer utilization
1082: IF p_utilization_rec.utilization_type IN ('ADJUSTMENT', 'LEAD_ADJUSTMENT') THEN
1083: --always post to gl for offer's adjustment, regardless of accrual offer or off-invoice offer
1084: l_utilization_rec.gl_posted_flag := ozf_accrual_engine.G_GL_FLAG_NO; -- 'N', waiting for posting to gl
1085: l_utilization_rec.amount_remaining := l_utilization_rec.amount;
1086: l_gl_posted := true;
1087: IF l_utilization_rec.orig_utilization_id IS NOT NULL THEN
1088: -- fix bug 3348955 - gl posting to adjustment should be in sync with original order's utilization

Line 1093: IF l_orig_gl_flag = ozf_accrual_engine.G_GL_FLAG_NO THEN

1089: l_orig_gl_flag := NULL;
1090: OPEN c_get_orig_gl_flag(l_utilization_rec.orig_utilization_id);
1091: FETCH c_get_orig_gl_flag INTO l_orig_gl_flag;
1092: CLOSE c_get_orig_gl_flag;
1093: IF l_orig_gl_flag = ozf_accrual_engine.G_GL_FLAG_NO THEN
1094: -- do not post to gl now, wait for the original utilization's posting
1095: l_gl_posted := false;
1096: END IF;
1097: IF l_utilization_rec.orig_utilization_id = -1 THEN -- for bug 6021635

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

1100: END IF; -- IF orig_utilization_id IS NOT NULL
1101: ELSE -- 'UTILIZED' for offer
1102: IF l_offer_type IN ('ACCRUAL', 'NET_ACCRUAL', 'LUMPSUM', 'SCAN_DATA') THEN
1103: -- handle case for reconcile when l_utilization_rec.gl_posted_flag passed.
1104: IF l_utilization_rec.gl_posted_flag = ozf_accrual_engine.G_GL_FLAG_YES OR
1105: l_utilization_rec.gl_posted_flag is NULL THEN
1106: l_offer_accrual_flag := true;
1107: END IF;
1108: ELSIF l_offer_type = 'VOLUME_OFFER' THEN

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

1106: l_offer_accrual_flag := true;
1107: END IF;
1108: ELSIF l_offer_type = 'VOLUME_OFFER' THEN
1109: IF l_volume_offer_type = 'OFF_INVOICE' THEN
1110: IF l_utilization_rec.gl_posted_flag = ozf_accrual_engine.G_GL_FLAG_NO OR
1111: l_utilization_rec.gl_posted_flag is NULL THEN
1112: l_offer_accrual_flag := false;
1113: END IF;
1114: ELSE

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

1111: l_utilization_rec.gl_posted_flag is NULL THEN
1112: l_offer_accrual_flag := false;
1113: END IF;
1114: ELSE
1115: IF l_utilization_rec.gl_posted_flag = ozf_accrual_engine.G_GL_FLAG_YES OR
1116: l_utilization_rec.gl_posted_flag is NULL THEN
1117: l_offer_accrual_flag := true;
1118: END IF;
1119: END IF;

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

1123: , l_utilization_rec.product_level_type, l_utilization_rec.product_id);
1124: FETCH c_get_deal_accrual_flag INTO l_tmp_id;
1125: CLOSE c_get_deal_accrual_flag;
1126: IF l_tmp_id = 1 THEN
1127: IF l_utilization_rec.gl_posted_flag = ozf_accrual_engine.G_GL_FLAG_YES OR
1128: l_utilization_rec.gl_posted_flag is NULL THEN
1129: l_offer_accrual_flag := true;
1130: END IF;
1131: ELSE

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

1128: l_utilization_rec.gl_posted_flag is NULL THEN
1129: l_offer_accrual_flag := true;
1130: END IF;
1131: ELSE
1132: IF l_utilization_rec.gl_posted_flag = ozf_accrual_engine.G_GL_FLAG_NO OR
1133: l_utilization_rec.gl_posted_flag is NULL THEN
1134: l_offer_accrual_flag := false;
1135: END IF;
1136: END IF;

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

1134: l_offer_accrual_flag := false;
1135: END IF;
1136: END IF;
1137: ELSE -- 'OFF_INVOICE', 'OID', 'ORDER', 'TERMS'
1138: IF l_utilization_rec.gl_posted_flag = ozf_accrual_engine.G_GL_FLAG_NO OR
1139: l_utilization_rec.gl_posted_flag is NULL THEN
1140: l_offer_accrual_flag := false;
1141: END IF;
1142: END IF;

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

1141: END IF;
1142: END IF;
1143:
1144: IF l_offer_accrual_flag THEN
1145: l_utilization_rec.gl_posted_flag := ozf_accrual_engine.G_GL_FLAG_NO; -- 'N', waiting for gl posting
1146: l_utilization_rec.amount_remaining := l_utilization_rec.amount;
1147: l_gl_posted := true;
1148: ELSIF l_offer_accrual_flag = false THEN
1149: IF p_utilization_rec.utilization_type IN ('ADJUSTMENT', 'LEAD_ADJUSTMENT') THEN

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

1154: OPEN c_offinvoice_gl_post_flag(l_utilization_rec.org_id);
1155: FETCH c_offinvoice_gl_post_flag INTO l_offinvoice_gl_post_flag;
1156: CLOSE c_offinvoice_gl_post_flag;
1157: IF (l_offinvoice_gl_post_flag = 'F') THEN
1158: l_utilization_rec.gl_posted_flag := ozf_accrual_engine.G_GL_FLAG_NULL; -- null
1159: l_fund_rec.earned_amt := NVL (l_earned_amt, 0) + NVL (l_utilization_rec.amount, 0);
1160: -- R12: yzhao ozf_object_fund_summary update earned and paid amt
1161: l_objfundsum_rec.earned_amt := NVL(l_objfundsum_rec.earned_amt, 0) + NVL(l_utilization_rec.amount, 0);
1162: l_objfundsum_rec.plan_curr_earned_amt := NVL(l_objfundsum_rec.plan_curr_earned_amt, 0)

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

1174: l_objfundsum_rec.univ_curr_paid_amt := NVL(l_objfundsum_rec.univ_curr_paid_amt, 0)
1175: + NVL(l_univ_curr_amount, 0);
1176: END IF;
1177: ELSE
1178: l_utilization_rec.gl_posted_flag := ozf_accrual_engine.G_GL_FLAG_NO; -- 'N', waiting for posting to gl
1179: l_gl_posted := true;
1180: END IF;
1181: ELSE -- for reconcile when original gl_posted_flag = 'N' and 'F'
1182: l_gl_posted := false;

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

1573:
1574: --------------------------complete fund update-------------------------
1575: -- post to GL immediately for manual earning adjustments, and utilized offer type with 'post to gl' profile as yes
1576: -- the accrual type adjustment is taken care of in ozfacreb.pls
1577: IF l_gl_posted AND l_utilization_rec.gl_posted_flag = ozf_accrual_engine.G_GL_FLAG_NO AND
1578: l_utilization_rec.plan_type IN ( 'OFFR' , 'PRIC') THEN
1579: /* yzhao: 11.5.10 11/17/2003 create gl entry for off-invoice discount when profile is on
1580: -- IF l_utilization_rec.utilization_type NOT IN ('REQUEST', 'TRANSFER', 'SALES_ACCRUAL','UTILIZED')
1581: IF l_utilization_rec.utilization_type NOT IN ('REQUEST', 'TRANSFER', 'SALES_ACCRUAL') THEN

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

1625: END IF;
1626:
1627: -- yzhao: 03/27/2003 when gl posting succeeds, set the flag 'Y', otherwise 'F', ignore error and reprocess later
1628: IF l_return_status = fnd_api.g_ret_sts_success THEN
1629: l_gl_posted_flag := ozf_accrual_engine.G_GL_FLAG_YES; -- 'Y';
1630: --kdass 27-JUL-2005 - R12 change for paid adjustments
1631: IF l_utilization_rec.utilization_type = 'ADJUSTMENT' AND
1632: l_utilization_rec.adjustment_type IN ('INCREASE_PAID', 'DECREASE_PAID') THEN
1633: l_fund_rec.paid_amt := NVL(l_paid_amt,0) - NVL (l_utilization_rec.amount_remaining, 0);

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

1663: + NVL(l_univ_curr_amount, 0);
1664: END IF;
1665: END IF;
1666: ELSE
1667: l_gl_posted_flag := ozf_accrual_engine.G_GL_FLAG_FAIL; -- 'F';
1668: -- yzhao: 11/20 raise exception if gl posting failed for manual adjust earned amount
1669: IF l_utilization_rec.utilization_type IN ('ADJUSTMENT', 'CHARGEBACK', 'LEAD_ADJUSTMENT') AND
1670: l_utilization_rec.adjustment_type IN ('STANDARD', 'DECREASE_EARNED', 'DECREASE_COMM_EARNED') THEN
1671: fnd_message.set_name ('OZF', 'OZF_GL_POST_FAILURE');