[Home] [Help]
19: l_org_id number;
20:
21: CURSOR claim_org_id_csr (p_id in number) IS
22: select org_id
23: from ozf_claims_all
24: where claim_id = p_id;
25:
26: CURSOR util_org_id_csr (p_id in number) IS
27: select org_id
33: IF p_source_table = 'OZF_FUNDS_UTILIZED_ALL_B' THEN
34: OPEN util_org_id_csr (p_source_id);
35: FETCH util_org_id_csr INTO l_org_id;
36: CLOSE util_org_id_csr;
37: ELSIF p_source_table = 'OZF_CLAIMS_ALL' THEN
38: OPEN claim_org_id_csr (p_source_id);
39: FETCH claim_org_id_csr INTO l_org_id;
40: CLOSE claim_org_id_csr;
41: END IF;
160: , f.price_adjustment_id
161: , f.cust_account_id
162: from ozf_claim_lines_util_all u
163: , ozf_claim_lines_all l
164: , ozf_claims_all c
165: , ozf_funds_utilized_all_b f
166: where u.claim_line_id = l.claim_line_id
167: and u.utilization_id = f.utilization_id
168: and l.claim_id = c.claim_id
178: , SUM(u.acctd_amount)
179: , c.currency_code
180: FROM ozf_claim_lines_util_all u
181: , ozf_claim_lines_all l
182: , ozf_claims_all c
183: WHERE l.claim_id = c.claim_id
184: AND l.earnings_associated_flag = 'T'
185: AND l.claim_line_id = u.claim_line_id
186: -- [END OF 11.5.9 BUG 4021967 Fixing]
205: , f.cust_account_id
206: , c.claim_id
207: from ozf_claim_lines_util_all u
208: , ozf_claim_lines_all l
209: , ozf_claims_all c
210: , ozf_funds_utilized_all_b f
211: where u.claim_line_id = l.claim_line_id
212: and u.utilization_id = f.utilization_id
213: and c.claim_id = l.claim_id
220: , l.acctd_amount
221: , c.currency_code
222: , c.claim_id
223: FROM ozf_claim_lines_all l
224: , ozf_claims_all c
225: WHERE l.claim_id = c.claim_id
226: --AND l.earnings_associated_flag = 'T'
227: AND l.claim_line_id = p_id;
228:
244: , f.cust_account_id
245: , c.claim_id
246: from ozf_claim_lines_util_all u
247: , ozf_claim_lines_all l
248: , ozf_claims_all c
249: , ozf_funds_utilized_all_b f
250: where u.claim_line_id = l.claim_line_id
251: and u.utilization_id = f.utilization_id
252: and c.claim_id = l.claim_id
268: , osp.gl_id_accr_promo_liab -- accrual liability account
269: , osp.gl_id_ded_clearing -- vendor clearing account
270: , osp.gl_rec_clearing_account -- receivables clearing account
271: FROM ozf_sys_parameters_all osp
272: , ozf_claims_all oc
273: WHERE osp.org_id = NVL(oc.org_id, -99)
274: AND oc.claim_id = p_id;
275:
276: -- default accounts from claim type
277: CURSOR get_claim_type_acc_csr(cv_claim_id in number) IS
278: select ct.gl_id_ded_clearing -- vendor clearing account
279: , ct.gl_id_ded_adj_clearing -- receivables clearing account
280: from ozf_claim_types_all_b ct
281: , ozf_claims_all c
282: where ct.claim_type_id = c.claim_type_id
283: and c.claim_id = cv_claim_id;
284:
285: -- get claim_id for a claim line
358:
359: -- R12.1 Enhancement
360: CURSOR get_claim_payment_method_csr(cv_claim_id in number) IS
361: select c.payment_method
362: from ozf_claims_all c
363: where c.claim_id = cv_claim_id;
364:
365: l_payment_method varchar2(30);
366:
439: l_acct_gen_tbl(l_rec_num).offer_id := null;
440: END IF;
441: CLOSE get_util_acc_csr;
442: END IF;
443: ELSIF upper(p_source_table) = 'OZF_CLAIMS_ALL' THEN
444: l_claim_id := p_source_id;
445:
446: -- get default accounts from system parameters
447: OPEN claim_get_sys_param_csr(l_claim_id);
870: CURSOR get_claim_class_csr(p_id in number) IS
871: SELECT c.claim_class
872: , c.set_of_books_id
873: , g.period_set_name
874: FROM ozf_claims_all c
875: , gl_sets_of_books g
876: WHERE c.set_of_books_id = g.set_of_books_id
877: AND c.claim_id = p_id;
878:
891: FND_MSG_PUB.add;
892: END IF;
893: x_return_status := FND_API.g_ret_sts_error;
894: END IF;
895: ELSIF upper(p_source_table) = 'OZF_CLAIMS_ALL' THEN
896: OPEN get_claim_class_csr(p_source_id);
897: FETCH get_claim_class_csr into l_type, x_sob_id, x_period_name;
898: CLOSE get_claim_class_csr;
899:
1003: IS
1004:
1005: CURSOR taxfor_csr (p_claim_id IN NUMBER)IS
1006: SELECT tax_for
1007: FROM ozf_claim_sttlmnt_methods_all csm,ozf_claims_all c
1008: WHERE csm.settlement_method = c.payment_method
1009: AND c.claim_id =p_claim_id
1010: AND csm.org_id = c.org_id;
1011:
1184: and fu.utilization_id = cv_utilization_id;
1185:
1186: CURSOR claim_number_csr(cv_claim_id IN NUMBER) IS
1187: select claim_number
1188: from ozf_claims_all
1189: where claim_id = cv_claim_id;
1190:
1191: BEGIN
1192: IF OZF_DEBUG_HIGH_ON THEN
1416: -- R12 changes end
1417:
1418: -- post to product on claim settlement if utilization is for product family
1419: -- R12.1 Enhancement: Checking for Accounting only
1420: IF upper(p_gl_rec.source_table) = 'OZF_CLAIMS_ALL' THEN
1421: IF p_gl_rec.event_type_code = 'SETTLE_BY_CHECK' OR
1422: p_gl_rec.event_type_code = 'SETTLE_BY_AP_INVOICE' OR
1423: p_gl_rec.event_type_code = 'SETTLE_BY_AP_DEBIT' OR
1424: p_gl_rec.event_type_code = 'SETTLE_BY_ACCOUNTING_ONLY' OR
1577: END IF;
1578: x_return_status := FND_API.g_ret_sts_error;
1579: END IF;
1580: -- for settlement by check and credit memos
1581: ELSIF upper(p_gl_rec.source_table) = 'OZF_CLAIMS_ALL' THEN
1582: --R12.1 Enhancement : checking for Accounting only
1583: IF p_gl_rec.event_type_code = 'SETTLE_BY_CHECK' OR
1584: p_gl_rec.event_type_code = 'SETTLE_BY_AP_INVOICE' OR
1585: p_gl_rec.event_type_code = 'SETTLE_BY_AP_DEBIT' OR
1831: CURSOR claim_gl_date_csr (p_id in number) IS
1832: select gl_date
1833: , claim_date
1834: , org_id
1835: from ozf_claims_all
1836: where claim_id = p_id;
1837:
1838: CURSOR util_gl_date_csr (p_id in number) IS
1839: select gl_date
1856: IF l_gl_date IS NULL THEN
1857: l_gl_date := SYSDATE;
1858: END IF;
1859:
1860: ELSIF p_source_table = 'OZF_CLAIMS_ALL' THEN
1861:
1862: OPEN claim_gl_date_csr (p_source_id);
1863: FETCH claim_gl_date_csr INTO l_gl_date, l_claim_date, l_org_id;
1864: CLOSE claim_gl_date_csr;
1900: l_org_id number;
1901:
1902: CURSOR claim_org_id_csr (p_id in number) IS
1903: select org_id
1904: from ozf_claims_all
1905: where claim_id = p_id;
1906:
1907: CURSOR util_org_id_csr (p_id in number) IS
1908: select org_id
1914: IF p_source_table = 'OZF_FUNDS_UTILIZED_ALL_B' THEN
1915: OPEN util_org_id_csr (p_source_id);
1916: FETCH util_org_id_csr INTO l_org_id;
1917: CLOSE util_org_id_csr;
1918: ELSIF p_source_table = 'OZF_CLAIMS_ALL' THEN
1919: OPEN claim_org_id_csr (p_source_id);
1920: FETCH claim_org_id_csr INTO l_org_id;
1921: CLOSE claim_org_id_csr;
1922: END IF;
2092: , SUM(u.fxgl_acctd_amount)
2093: , c.currency_code
2094: FROM ozf_claim_lines_util_all u
2095: , ozf_claim_lines_all l
2096: , ozf_claims_all c
2097: WHERE l.claim_id = c.claim_id
2098: AND l.earnings_associated_flag = 'T'
2099: AND l.claim_line_id = u.claim_line_id
2100: AND c.claim_id = p_claim_id
2167: --OZF_UTILITY_PVT.debug_message('Line Type Code assigned value: ' || x_amount_tbl(i).line_type_code);
2168: --OZF_UTILITY_PVT.debug_message('Processing Line: ' || i);
2169:
2170: -- Fix for Bug 7430768
2171: IF (upper(p_gl_rec.source_table) = 'OZF_CLAIMS_ALL' AND p_gl_rec.event_type_code = 'SETTLE_BY_OTHER'
2172: AND p_gl_rec.adjustment_type = 'N') THEN
2173: x_ae_line_tbl(i).entered_dr := (l_amount_tbl(i).entered_dr)*-1;
2174: x_ae_line_tbl(i).entered_cr := (l_amount_tbl(i).entered_cr)*-1;
2175: x_ae_line_tbl(i).accounted_dr := (l_amount_tbl(i).accounted_dr)*-1;
2216: END LOOP;
2217: --x_ae_line_tbl := l_ae_line_tbl;
2218:
2219: -- R12 FXGL Enhancement
2220: IF upper(p_gl_rec.source_table) = 'OZF_CLAIMS_ALL' THEN
2221: G_CLAIM_ID := p_gl_rec.source_id;
2222: l_rec_num := x_ae_line_tbl.count;
2223:
2224: l_line_type_code := get_account_type_code(
2488: CURSOR claim_gl_posting_csr(p_id in number) IS
2489: SELECT osp.post_to_gl
2490: , osp.transfer_to_gl_in
2491: FROM ozf_sys_parameters_all osp
2492: , ozf_claims_all oc
2493: WHERE osp.org_id = NVL(oc.org_id, -99)
2494: AND oc.claim_id = p_id;
2495:
2496: /*
2573: END IF;
2574: -- [END OF BUG 4039894 FIXING]
2575:
2576:
2577: IF upper(p_gl_rec.source_table) = 'OZF_CLAIMS_ALL' THEN
2578: -- check if post to gl flag in system parameter is set to T
2579: OPEN claim_gl_posting_csr(p_gl_rec.source_id);
2580: FETCH claim_gl_posting_csr INTO l_post_to_gl, l_transfer_to_gl_in;
2581: CLOSE claim_gl_posting_csr;
2601: END IF;
2602: END IF;
2603:
2604: -- check if claim has promotions. create gl entries only for promotional claims
2605: IF upper(p_gl_rec.source_table) = 'OZF_CLAIMS_ALL' THEN
2606: OPEN promo_claim_csr(p_gl_rec.source_id);
2607: FETCH promo_claim_csr INTO l_asso_amount;
2608: CLOSE promo_claim_csr;
2609:
3065: , org_id
3066: , accounting_date
3067: , object_version_number
3068: from ozf_acctng_events_all
3069: where source_table = 'OZF_CLAIMS_ALL'
3070: and source_id = p_source_id;
3071:
3072: -- Get header details for given accounting event
3073: CURSOR get_ae_header_csr( p_accounting_event_id in NUMBER ) IS
3728: END IF;
3729:
3730: l_gl_rec.event_status_code := 'ACCOUNTED';
3731: l_gl_rec.source_id := p_claim_id;
3732: l_gl_rec.source_table := 'OZF_CLAIMS_ALL';
3733: IF p_claim_class IN ('CLAIM', 'DEDUCTION') THEN
3734: l_gl_rec.adjustment_type := 'P';
3735: ELSIF p_claim_class IN ('CHARGE', 'OVERPAYMENT') THEN
3736: l_gl_rec.adjustment_type := 'N';