209: /* Bug No : 6341012. SLA uptake. Encumbrance_Type_Ids are not required*/
210: -- p_purch_encumbrance_type_id IN financials_system_params_all.purch_encumbrance_type_id%TYPE,
211: p_cc_headers_rec IN igc_cc_headers%ROWTYPE,
212: p_cc_acct_lines_rec IN igc_cc_acct_lines%ROWTYPE,
213: p_cc_pmt_fcst_rec IN igc_cc_det_pf_v%ROWTYPE,
214: p_enc_type IN VARCHAR2,
215: p_enc_date IN DATE,
216: p_enc_amt IN NUMBER,
217: x_return_status OUT NOCOPY VARCHAR2,
386: l_interface_row_count NUMBER;
387:
388: l_cc_headers_rec igc_cc_headers%ROWTYPE;
389: l_cc_acct_lines_rec igc_cc_acct_lines%ROWTYPE;
390: l_cc_pmt_fcst_rec igc_cc_det_pf_v%ROWTYPE;
391:
392: l_enc_amt NUMBER := 0;
393: l_enc_date DATE;
394:
391:
392: l_enc_amt NUMBER := 0;
393: l_enc_date DATE;
394:
395: l_cc_det_pf_line_id igc_cc_det_pf.cc_det_pf_line_id%TYPE;
396:
397: l_debug VARCHAR2(1);
398:
399: l_batch_result_code VARCHAR2(3);
412:
413: /* Contract Commitment detail payment forecast */
414:
415: -- SELECT *
416: -- FROM igc_cc_det_pf_v
417: -- WHERE cc_acct_line_id = t_cc_acct_line_id;
418:
419: --Replaced the above query with the one below.
420: --Performance Tuning project. The record definition remains
459: ccdpf.last_updated_by,
460: ccdpf.last_update_login,
461: ccdpf.creation_date,
462: ccdpf.created_by
463: FROM igc_cc_det_pf ccdpf
464: WHERE cc_acct_line_id = t_cc_acct_line_id;
465:
466: /* Current year payment forecast lines only */
467:
590: BEGIN
591:
592: SELECT a.cc_det_pf_line_id
593: INTO l_cc_det_pf_line_id
594: FROM igc_cc_det_pf a
595: WHERE
596: a.cc_det_pf_line_num = (SELECT NVL(min(b.cc_det_pf_line_num) , -1)
597: FROM igc_cc_det_pf b
598: WHERE b.cc_acct_line_id = l_cc_acct_lines_rec.cc_acct_line_id AND
593: INTO l_cc_det_pf_line_id
594: FROM igc_cc_det_pf a
595: WHERE
596: a.cc_det_pf_line_num = (SELECT NVL(min(b.cc_det_pf_line_num) , -1)
597: FROM igc_cc_det_pf b
598: WHERE b.cc_acct_line_id = l_cc_acct_lines_rec.cc_acct_line_id AND
599: b.cc_det_pf_date = /* bug fix 1702768 */
600: (SELECT min(c.cc_det_pf_date)
601: FROM igc_cc_det_pf c
597: FROM igc_cc_det_pf b
598: WHERE b.cc_acct_line_id = l_cc_acct_lines_rec.cc_acct_line_id AND
599: b.cc_det_pf_date = /* bug fix 1702768 */
600: (SELECT min(c.cc_det_pf_date)
601: FROM igc_cc_det_pf c
602: WHERE c.cc_acct_line_id =
603: l_cc_acct_lines_rec.cc_acct_line_id AND
604: c.cc_det_pf_date >= p_target_date)
605: ) AND
606: a.cc_det_pf_date >= p_target_date AND
607: a.cc_acct_line_id = l_cc_acct_lines_rec.cc_acct_line_id;
608:
609: -- Replaced the following sql with the one below to eliminate
610: -- the use of igc_cc_det_pf_v
611: -- SELECT *
612: -- INTO l_cc_pmt_fcst_rec
613: -- FROM igc_cc_det_pf_v
614: -- WHERE cc_det_pf_line_id = l_cc_det_pf_line_id;
609: -- Replaced the following sql with the one below to eliminate
610: -- the use of igc_cc_det_pf_v
611: -- SELECT *
612: -- INTO l_cc_pmt_fcst_rec
613: -- FROM igc_cc_det_pf_v
614: -- WHERE cc_det_pf_line_id = l_cc_det_pf_line_id;
615:
616: SELECT ccdpf.ROWID,
617: ccdpf.cc_det_pf_line_id,
653: ccdpf.last_update_login,
654: ccdpf.creation_date,
655: ccdpf.created_by
656: INTO l_cc_pmt_fcst_rec
657: FROM igc_cc_det_pf ccdpf
658: WHERE cc_det_pf_line_id = l_cc_det_pf_line_id;
659: EXCEPTION
660: WHEN NO_DATA_FOUND
661: THEN
666: END;
667:
668: /* Get target pf encumbrance amt */
669:
670: -- Replaced igc_cc_det_pf_v with igc_cc_det_pf
671: -- Also replaced the following line
672: -- SELECT NVL(SUM(NVL(cc_det_pf_func_amt,0) - NVL(cc_det_pf_func_billed_amt,0)) ,0)
673: SELECT NVL(SUM(NVL(a.cc_det_pf_func_amt,0) -
674: NVL(IGC_CC_COMP_AMT_PKG.COMPUTE_PF_FUNC_BILLED_AMT(a.cc_det_pf_line_id, a.cc_det_pf_line_num, a.cc_acct_line_id),0)) ,0)
672: -- SELECT NVL(SUM(NVL(cc_det_pf_func_amt,0) - NVL(cc_det_pf_func_billed_amt,0)) ,0)
673: SELECT NVL(SUM(NVL(a.cc_det_pf_func_amt,0) -
674: NVL(IGC_CC_COMP_AMT_PKG.COMPUTE_PF_FUNC_BILLED_AMT(a.cc_det_pf_line_id, a.cc_det_pf_line_num, a.cc_acct_line_id),0)) ,0)
675: INTO l_enc_amt
676: FROM igc_cc_det_pf a
677: WHERE a.cc_acct_line_id = l_cc_acct_lines_rec.cc_acct_line_id
678: -- The check for det_pf_line is not correct.The amount calculated should not be from
679: -- the target payment forecast. Bug 2858425, 19 March 2003
680: -- AND cc_det_pf_line_id = l_cc_det_pf_line_id
1096: RETURN VARCHAR2
1097: IS
1098: l_cc_headers_rec igc_cc_headers%ROWTYPE;
1099: l_cc_acct_lines_rec igc_cc_acct_lines_v%ROWTYPE;
1100: l_cc_pmt_fcst_rec igc_cc_det_pf_v%ROWTYPE;
1101: l_cc_pf_target igc_cc_det_pf_v%ROWTYPE;
1102: l_rel_cc_headers_rec igc_cc_headers%ROWTYPE;
1103: l_action_hist_msg igc_cc_actions.cc_action_notes%TYPE;
1104: l_DUMMY VARCHAR2(1);
1097: IS
1098: l_cc_headers_rec igc_cc_headers%ROWTYPE;
1099: l_cc_acct_lines_rec igc_cc_acct_lines_v%ROWTYPE;
1100: l_cc_pmt_fcst_rec igc_cc_det_pf_v%ROWTYPE;
1101: l_cc_pf_target igc_cc_det_pf_v%ROWTYPE;
1102: l_rel_cc_headers_rec igc_cc_headers%ROWTYPE;
1103: l_action_hist_msg igc_cc_actions.cc_action_notes%TYPE;
1104: l_DUMMY VARCHAR2(1);
1105:
1107: -- modified for bug 2876467
1108: -- ccdpf.cc_det_pf_billed_amt changed to ccdpf.cc_det_pf_func_billed_amt
1109: -- Performance Tuning project. Replaced selection from views
1110: -- igc_cc_acct_lines_v with table igc_cc_acct_lines
1111: -- and igc_cc_det_pf_v with igc_cc_det_pf
1112: -- Replaced the following line as well
1113: -- AND (NVL(ccdpf.cc_det_pf_func_amt,0) - NVL(ccdpf.cc_det_pf_func_billed_amt,0) ) > 0
1114: CURSOR c_acct_lines(p_cc_header_id NUMBER)
1115: IS
1116: -- SELECT *
1117: -- FROM igc_cc_acct_lines_v ccal
1118: -- WHERE ccal.cc_header_id = p_cc_header_id
1119: -- AND exists
1120: -- ( Select 'x' FROM igc_cc_det_pf_v ccdpf
1121: -- WHERE ccdpf.cc_acct_line_id = ccal.cc_acct_line_id
1122: -- AND ccdpf.cc_det_pf_date >= p_start_date AND ccdpf.cc_det_pf_date <= p_end_date
1123: -- AND (ccdpf.cc_det_pf_func_amt-ccdpf.cc_det_pf_func_billed_amt) >0);
1124:
1186: ccal.tax_classif_code -- modified for Ebtax uptake (Bug No-6472296)
1187: FROM igc_cc_acct_lines ccal
1188: WHERE ccal.cc_header_id = p_cc_header_id
1189: AND exists ( SELECT 'x'
1190: FROM igc_cc_det_pf ccdpf
1191: WHERE ccdpf.cc_acct_line_id = ccal.cc_acct_line_id
1192: AND ccdpf.cc_det_pf_date >= p_start_date
1193: AND ccdpf.cc_det_pf_date <= p_end_date
1194: AND (ccdpf.cc_det_pf_func_amt -
1200: IS
1201:
1202: -- Modified the following sql for performance tuning.
1203: -- SELECT *
1204: -- FROM igc_cc_det_pf_v ccdpf
1205: -- WHERE ccdpf.cc_acct_line_id = p_cc_acct_line_id
1206: -- AND ccdpf.cc_det_pf_date >= p_start_date AND ccdpf.cc_det_pf_date <= p_end_date
1207: -- AND (ccdpf.cc_det_pf_func_amt-ccdpf.cc_det_pf_func_billed_amt) >0;
1208:
1245: ccdpf.last_updated_by,
1246: ccdpf.last_update_login,
1247: ccdpf.creation_date,
1248: ccdpf.created_by
1249: FROM igc_cc_det_pf ccdpf
1250: WHERE ccdpf.cc_acct_line_id = p_cc_acct_line_id
1251: AND ccdpf.cc_det_pf_date >= p_start_date
1252: AND ccdpf.cc_det_pf_date <= p_end_date
1253: AND (ccdpf.cc_det_pf_func_amt-IGC_CC_COMP_AMT_PKG.COMPUTE_PF_FUNC_BILLED_AMT(ccdpf.cc_det_pf_line_id, ccdpf.cc_det_pf_line_num, ccdpf.cc_acct_line_id)) >0;
1253: AND (ccdpf.cc_det_pf_func_amt-IGC_CC_COMP_AMT_PKG.COMPUTE_PF_FUNC_BILLED_AMT(ccdpf.cc_det_pf_line_id, ccdpf.cc_det_pf_line_num, ccdpf.cc_acct_line_id)) >0;
1254:
1255: CURSOR c_pf_amt_shift(p_cc_acct_line_id NUMBER,p_start_date DATE,p_end_date DATE)
1256: IS
1257: -- Performance Tuning, replaced the view igc_cc_det_pf_v
1258: -- igc_cc_det_pf. Also replaced the following 2 lines
1259: -- SELECT sum(ccdpf.cc_det_pf_func_amt-ccdpf.cc_det_pf_func_billed_amt) func_amt_shift, sum(ccdpf.cc_det_pf_entered_amt - ccdpf.cc_det_pf_billed_amt) amt_shift
1260: -- AND (ccdpf.cc_det_pf_func_amt-ccdpf.cc_det_pf_func_billed_amt) >0;
1261:
1254:
1255: CURSOR c_pf_amt_shift(p_cc_acct_line_id NUMBER,p_start_date DATE,p_end_date DATE)
1256: IS
1257: -- Performance Tuning, replaced the view igc_cc_det_pf_v
1258: -- igc_cc_det_pf. Also replaced the following 2 lines
1259: -- SELECT sum(ccdpf.cc_det_pf_func_amt-ccdpf.cc_det_pf_func_billed_amt) func_amt_shift, sum(ccdpf.cc_det_pf_entered_amt - ccdpf.cc_det_pf_billed_amt) amt_shift
1260: -- AND (ccdpf.cc_det_pf_func_amt-ccdpf.cc_det_pf_func_billed_amt) >0;
1261:
1262:
1263: SELECT sum(ccdpf.cc_det_pf_func_amt-
1264: IGC_CC_COMP_AMT_PKG.COMPUTE_PF_FUNC_BILLED_AMT(ccdpf.cc_det_pf_line_id, ccdpf.cc_det_pf_line_num, ccdpf.cc_acct_line_id)) func_amt_shift,
1265: sum(ccdpf.cc_det_pf_entered_amt -
1266: IGC_CC_COMP_AMT_PKG.COMPUTE_PF_BILLED_AMT(ccdpf.cc_det_pf_line_id, ccdpf.cc_det_pf_line_num, ccdpf.cc_acct_line_id)) amt_shift
1267: FROM igc_cc_det_pf ccdpf
1268: WHERE ccdpf.cc_acct_line_id = p_cc_acct_line_id
1269: AND ccdpf.cc_det_pf_date >= p_start_date
1270: AND ccdpf.cc_det_pf_date <= p_end_date
1271: AND (ccdpf.cc_det_pf_func_amt -
1270: AND ccdpf.cc_det_pf_date <= p_end_date
1271: AND (ccdpf.cc_det_pf_func_amt -
1272: IGC_CC_COMP_AMT_PKG.COMPUTE_PF_FUNC_BILLED_AMT(ccdpf.cc_det_pf_line_id, ccdpf.cc_det_pf_line_num, ccdpf.cc_acct_line_id)) >0;
1273:
1274: -- Replaced view igc_cc_det_pf_v with igc_cc_det_pf
1275: CURSOR c_pf_target (p_cc_acct_line_id NUMBER,p_target_date DATE)
1276: IS
1277: -- SELECT *
1278: -- FROM igc_cc_det_pf_v ccdpf
1274: -- Replaced view igc_cc_det_pf_v with igc_cc_det_pf
1275: CURSOR c_pf_target (p_cc_acct_line_id NUMBER,p_target_date DATE)
1276: IS
1277: -- SELECT *
1278: -- FROM igc_cc_det_pf_v ccdpf
1279:
1280: SELECT ccdpf.ROWID,
1281: ccdpf.cc_det_pf_line_id,
1282: ccdpf.cc_det_pf_line_num,
1316: ccdpf.last_updated_by,
1317: ccdpf.last_update_login,
1318: ccdpf.creation_date,
1319: ccdpf.created_by
1320: FROM igc_cc_det_pf ccdpf
1321: WHERE ccdpf.cc_acct_line_id = p_cc_acct_line_id
1322: AND ccdpf.cc_det_pf_date >= p_target_date
1323: AND ccdpf.cc_det_pf_line_num =
1324: (SELECT min(ccdpf1.cc_det_pf_line_num)
1321: WHERE ccdpf.cc_acct_line_id = p_cc_acct_line_id
1322: AND ccdpf.cc_det_pf_date >= p_target_date
1323: AND ccdpf.cc_det_pf_line_num =
1324: (SELECT min(ccdpf1.cc_det_pf_line_num)
1325: FROM igc_cc_det_pf ccdpf1
1326: WHERE ccdpf1.cc_acct_line_id = p_cc_acct_line_id
1327: AND ccdpf1.cc_det_pf_date = /* bug fix 1702768 */
1328: (SELECT MIN(ccdpf2.cc_det_pf_date)
1329: FROM igc_cc_det_pf ccdpf2
1325: FROM igc_cc_det_pf ccdpf1
1326: WHERE ccdpf1.cc_acct_line_id = p_cc_acct_line_id
1327: AND ccdpf1.cc_det_pf_date = /* bug fix 1702768 */
1328: (SELECT MIN(ccdpf2.cc_det_pf_date)
1329: FROM igc_cc_det_pf ccdpf2
1330: WHERE ccdpf2.cc_acct_line_id = p_cc_acct_line_id
1331: AND ccdpf2.cc_det_pf_date >= p_target_date)
1332: );
1333:
1338: l_hist_acct_row_id VARCHAR2(18);
1339: l_pf_row_id VARCHAR2(18);
1340: l_hist_pf_row_id VARCHAR2(18);
1341: l_action_row_id VARCHAR2(18);
1342: l_new_cc_det_pf_func_amt igc_cc_det_pf.cc_det_pf_func_amt%TYPE;
1343: l_new_cc_acct_func_amt igc_cc_acct_lines.cc_acct_func_amt%TYPE;
1344: l_api_version CONSTANT NUMBER := 1.0;
1345: l_init_msg_list VARCHAR2(1);
1346: l_commit VARCHAR2(1);
1409: EXIT WHEN c_pf_target%NOTFOUND;
1410:
1411: /* Update PF Line History */
1412: l_return_status := FND_API.G_RET_STS_SUCCESS;
1413: IGC_CC_DET_PF_HISTORY_PKG.Insert_Row(
1414: l_api_version,
1415: l_init_msg_list,
1416: l_commit,
1417: l_validation_level,
1479: l_cc_pf_target.cc_det_pf_encmbrnc_date := l_cc_pf_target.cc_det_pf_date;
1480:
1481: SELECT rowid
1482: INTO l_pf_row_id
1483: FROM igc_cc_det_pf
1484: WHERE cc_det_pf_line_id = l_cc_pf_target.cc_det_pf_line_id;
1485:
1486: IGC_CC_DET_PF_PKG.Update_Row(
1487: l_api_version,
1482: INTO l_pf_row_id
1483: FROM igc_cc_det_pf
1484: WHERE cc_det_pf_line_id = l_cc_pf_target.cc_det_pf_line_id;
1485:
1486: IGC_CC_DET_PF_PKG.Update_Row(
1487: l_api_version,
1488: l_init_msg_list,
1489: l_commit,
1490: l_validation_level,
1554: EXIT WHEN c_pf_lines%NOTFOUND;
1555:
1556: /* Update PF Line History */
1557: l_return_status := FND_API.G_RET_STS_SUCCESS;
1558: IGC_CC_DET_PF_HISTORY_PKG.Insert_Row(
1559: l_api_version,
1560: l_init_msg_list,
1561: l_commit,
1562: l_validation_level,
1639: END IF;
1640:
1641: SELECT rowid
1642: INTO l_pf_row_id
1643: FROM igc_cc_det_pf
1644: WHERE cc_det_pf_line_id = l_cc_pmt_fcst_rec.cc_det_pf_line_id;
1645:
1646: IGC_CC_DET_PF_PKG.Update_Row(
1647: l_api_version,
1642: INTO l_pf_row_id
1643: FROM igc_cc_det_pf
1644: WHERE cc_det_pf_line_id = l_cc_pmt_fcst_rec.cc_det_pf_line_id;
1645:
1646: IGC_CC_DET_PF_PKG.Update_Row(
1647: l_api_version,
1648: l_init_msg_list,
1649: l_commit,
1650: l_validation_level,
1966: l_sob_name VARCHAR2(30);
1967:
1968: -- Performance Tuning project. Replaced selection from views
1969: -- igc_cc_acct_lines_v with table igc_cc_acct_lines
1970: -- and igc_cc_det_pf_v with igc_cc_det_pf
1971: -- Replaced the following 2 lines a well
1972: -- sum (ccdpf.cc_det_pf_func_amt-ccdpf.cc_det_pf_func_billed_amt) tot_unbilled_amt
1973: -- AND (NVL(ccdpf.cc_det_pf_func_amt,0) - NVL(ccdpf.cc_det_pf_func_billed_amt,0) ) > 0
1974: CURSOR c1 (
1990: )
1991: ) tot_unbilled_amt
1992: FROM igc_cc_headers cchd,
1993: igc_cc_acct_lines ccal,
1994: igc_cc_det_pf ccdpf
1995: WHERE cchd.cc_header_id = ccal.cc_header_id
1996: AND ccal.cc_acct_line_id = ccdpf.cc_acct_line_id
1997: AND cchd.org_id = p_org_id
1998: AND cchd.set_of_books_id = p_set_of_books_id
2015: GROUP BY cchd.cc_header_id, cchd.cc_apprvl_status;
2016:
2017: -- Performance Tuning project. Replaced selection from views
2018: -- igc_cc_acct_lines_v with table igc_cc_acct_lines
2019: -- and igc_cc_det_pf_v with igc_cc_det_pf
2020: -- Replaced the following 2 lines a well
2021: -- sum (ccdpf.cc_det_pf_func_amt-ccdpf.cc_det_pf_func_billed_amt) tot_unbilled_amt
2022: -- AND (NVL(ccdpf.cc_det_pf_func_amt,0) - NVL(ccdpf.cc_det_pf_func_billed_amt,0) ) > 0
2023: CURSOR c2 (
2038: )
2039: ) tot_unbilled_amt
2040: FROM igc_cc_headers cchd,
2041: igc_cc_acct_lines ccal,
2042: igc_cc_det_pf ccdpf
2043: WHERE cchd.cc_header_id = ccal.cc_header_id
2044: AND ccal.cc_acct_line_id = ccdpf.cc_acct_line_id
2045: AND cchd.org_id = p_org_id
2046: AND cchd.set_of_books_id = p_set_of_books_id
2072: AND (ccpd.processed <> 'Y' OR ccpd.processed IS NULL);
2073:
2074: -- Performance Tuning project. Replaced selection from views
2075: -- igc_cc_acct_lines_v with table igc_cc_acct_lines
2076: -- and igc_cc_det_pf_v with igc_cc_det_pf
2077: -- Replaced the following line as well
2078: -- AND (NVL(ccdpf.cc_det_pf_func_amt,0) - NVL(ccdpf.cc_det_pf_func_billed_amt,0) ) > 0
2079: CURSOR c4 (
2080: p_org_id NUMBER,
2089: SELECT cchd.cc_header_id, cchd.cc_num, ccdpf.cc_acct_line_id,
2090: ccdpf.cc_det_pf_line_id, ccdpf.cc_det_pf_date
2091: FROM igc_cc_headers cchd,
2092: igc_cc_acct_lines ccal,
2093: igc_cc_det_pf ccdpf,
2094: igc_cc_process_data ccpd
2095: WHERE cchd.cc_header_id = ccpd.cc_header_id
2096: AND cchd.cc_header_id = ccal.cc_header_id
2097: AND ccal.cc_acct_line_id = ccdpf.cc_acct_line_id
2137: IS
2138: SELECT ccdpf.cc_acct_line_id, ccdpf.cc_det_pf_line_id,
2139: ccdpf.cc_det_pf_date
2140: FROM igc_cc_acct_lines ccal,
2141: igc_cc_det_pf ccdpf
2142: WHERE ccal.cc_header_id = p_cc_header_id
2143: AND ccal.cc_acct_line_id = ccdpf.cc_acct_line_id
2144: AND ccdpf.cc_det_pf_date >= p_start_date
2145: AND ccdpf.cc_det_pf_date <= p_end_date
2175: -- AND NOT EXISTS (SELECT 'X'
2176: -- FROM igc_cc_acct_lines_v ccal1
2177: -- WHERE ccal1.cc_header_id = cchd.cc_header_id
2178: -- AND NOT EXISTS (SELECT 'X'
2179: -- FROM igc_cc_det_pf_v ccdpf1
2180: -- WHERE ccdpf1.cc_acct_line_id = ccal1.cc_acct_line_id
2181: -- AND ccdpf1.cc_det_pf_date >= p_target_date )
2182: -- );
2183: CURSOR c7 (
2186: p_cc_header_id NUMBER
2187: )
2188: IS
2189: -- SELECT *
2190: -- FROM igc_cc_det_pf_v ccdpf
2191: SELECT ccdpf.ROWID, ccdpf.cc_det_pf_line_id, ccdpf.cc_det_pf_line_num,
2192: NULL cc_acct_line_num, ccdpf.cc_acct_line_id,
2193: NULL parent_det_pf_line_num, ccdpf.parent_det_pf_line_id,
2194: ccdpf.parent_acct_line_id, ccdpf.cc_det_pf_entered_amt,
2224: ccdpf.attribute9, ccdpf.attribute10, ccdpf.attribute11,
2225: ccdpf.attribute12, ccdpf.attribute13, ccdpf.attribute14,
2226: ccdpf.attribute15, ccdpf.last_update_date, ccdpf.last_updated_by,
2227: ccdpf.last_update_login, ccdpf.creation_date, ccdpf.created_by
2228: FROM igc_cc_det_pf ccdpf
2229: WHERE ccdpf.cc_acct_line_id = p_cc_acct_line_id
2230: AND ccdpf.cc_det_pf_date >= p_target_date
2231: AND ccdpf.cc_det_pf_line_num =
2232: (SELECT MIN (ccdpf1.cc_det_pf_line_num)
2229: WHERE ccdpf.cc_acct_line_id = p_cc_acct_line_id
2230: AND ccdpf.cc_det_pf_date >= p_target_date
2231: AND ccdpf.cc_det_pf_line_num =
2232: (SELECT MIN (ccdpf1.cc_det_pf_line_num)
2233: FROM igc_cc_det_pf ccdpf1
2234: WHERE ccdpf1.cc_acct_line_id = p_cc_acct_line_id
2235: AND ccdpf1.cc_det_pf_date = /* bug fix 1702768 */
2236: (SELECT MIN (ccdpf2.cc_det_pf_date)
2237: FROM igc_cc_det_pf ccdpf2
2233: FROM igc_cc_det_pf ccdpf1
2234: WHERE ccdpf1.cc_acct_line_id = p_cc_acct_line_id
2235: AND ccdpf1.cc_det_pf_date = /* bug fix 1702768 */
2236: (SELECT MIN (ccdpf2.cc_det_pf_date)
2237: FROM igc_cc_det_pf ccdpf2
2238: WHERE ccdpf2.cc_acct_line_id = p_cc_acct_line_id
2239: AND ccdpf2.cc_det_pf_date >= p_target_date));
2240:
2241: v1 c1%ROWTYPE;