1: PACKAGE BODY PA_FUND_REVAL_PVT AS
2: --$Header: PAXFRPPB.pls 120.8.12020000.3 2012/07/30 07:11:34 chajha ship $
3:
4: /*----------------------------------------------------------------------------------------+
5: | Procedure : revaluate_funding |
65:
66:
67: IF G_DEBUG_MODE = 'Y' THEN
68:
69: PA_DEBUG.g_err_stage := '-----------Entering PA_FUND_REVAL_PVT.revaluate_funding-----------' ;
70: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
71:
72: l_LogMsg := 'Parameters : Project Id:' || p_project_id ||
73: ' Project Type Id:' || p_project_type_id ||
192: G_REVAL_FLAG := 'N';
193:
194: IF G_DEBUG_MODE = 'Y' THEN
195:
196: pa_debug.g_err_stage := '-----------Exiting PA_FUND_REVAL_PVT.revaluate_funding-----------' ;
197: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
198:
199: END IF;
200:
290:
291:
292: IF G_DEBUG_MODE = 'Y' THEN
293:
294: PA_DEBUG.g_err_stage := '-----------Entering PA_FUND_REVAL_PVT.validate_project_eligibility-----------' ;
295: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
296:
297: END IF;
298:
406: END IF;
407:
408: IF G_DEBUG_MODE = 'Y' THEN
409:
410: PA_DEBUG.g_err_stage := '-----------Exiting PA_FUND_REVAL_PVT.validate_project_eligibility-----------' ;
411: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
412:
413: END IF;
414:
531: x_msg_count := 0;
532:
533: IF G_DEBUG_MODE = 'Y' THEN
534:
535: PA_DEBUG.g_err_stage := '-----------Entering PA_FUND_REVAL_PVT.get_rsob_ids-----------' ;
536: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
537:
538: END IF;
539:
627: END LOOP;
628:
629: IF G_DEBUG_MODE = 'Y' THEN
630:
631: PA_DEBUG.g_err_stage := '-----------Exiting PA_FUND_REVAL_PVT.get_rsob_ids-----------' ;
632: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
633:
634: END IF;
635:
721: x_msg_count := 0;
722:
723: IF G_DEBUG_MODE = 'Y' THEN
724:
725: PA_DEBUG.g_err_stage := '-----------Entering PA_FUND_REVAL_PVT.get_start_end_proj_num-----------' ;
726: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
727:
728: END IF;
729:
831: ' End Proj No:' || x_to_proj_number ||
832: ' Proj Type Id:' || x_Project_type_id;
833: PA_FUND_REVAL_UTIL.Log_Message(p_message => l_LogMsg);
834:
835: PA_DEBUG.g_err_stage := '-----------Exiting PA_FUND_REVAL_PVT.get_start_end_proj_num-----------' ;
836: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
837:
838: END IF;
839:
902: x_reason_code := NULL;
903:
904: IF G_DEBUG_MODE = 'Y' THEN
905:
906: PA_DEBUG.g_err_stage := '-----------Entering PA_FUND_REVAL_PVT.Check_Unrel_invoice_revenue-----------' ;
907: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
908:
909: END IF;
910:
968: /* end of comment for bug Bug 8874394 */
969:
970: IF G_DEBUG_MODE = 'Y' THEN
971:
972: PA_DEBUG.g_err_stage := '-----------Exiting PA_FUND_REVAL_PVT.Check_Unrel_invoice_revenue-----------' ;
973: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
974:
975: END IF;
976:
1011: BEGIN
1012:
1013: IF G_DEBUG_MODE = 'Y' THEN
1014:
1015: PA_DEBUG.g_err_stage := '-----------Entering PA_FUND_REVAL_PVT.Check_reval_unbaseline_funds-----------' ;
1016: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
1017:
1018: END IF;
1019:
1026: AND budget_type_code = 'DRAFT');
1027:
1028: IF G_DEBUG_MODE = 'Y' THEN
1029:
1030: PA_DEBUG.g_err_stage := '-----------Exiting PA_FUND_REVAL_PVT.Check_reval_unbaseline_funds-----------' ;
1031: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
1032:
1033: END IF;
1034:
1098: x_msg_count := 0;
1099:
1100: IF G_DEBUG_MODE = 'Y' THEN
1101:
1102: PA_DEBUG.g_err_stage := '-----------Entering PA_FUND_REVAL_PVT.Delete_Unbaselined_Adjmts-----------' ;
1103: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
1104:
1105: END IF;
1106:
1200: CLOSE fund_recs;
1201:
1202: IF G_DEBUG_MODE = 'Y' THEN
1203:
1204: PA_DEBUG.g_err_stage := '-----------Exiting PA_FUND_REVAL_PVT.Delete_Unbaselined_Adjmts-----------' ;
1205: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
1206:
1207: END IF;
1208:
1276: x_msg_count := 0;
1277:
1278: IF G_DEBUG_MODE = 'Y' THEN
1279:
1280: PA_DEBUG.g_err_stage := '-----------Entering PA_FUND_REVAL_PVT.Insert_distribution_warnings-----------' ;
1281: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
1282:
1283: l_LogMsg := 'Reason :' || p_reason_code;
1284: PA_FUND_REVAL_UTIL.Log_Message(l_LogMsg);
1307: );
1308:
1309: IF G_DEBUG_MODE = 'Y' THEN
1310:
1311: PA_DEBUG.g_err_stage := '-----------Exiting PA_FUND_REVAL_PVT.Insert_distribution_warnings-----------' ;
1312: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
1313:
1314: END IF;
1315:
1465: x_msg_count := 0;
1466:
1467: IF G_DEBUG_MODE = 'Y' THEN
1468:
1469: PA_DEBUG.g_err_stage := '-----------Entering PA_FUND_REVAL_PVT.get_reval_projects-----------' ;
1470: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
1471:
1472: l_LogMsg := 'From prj:' || p_from_proj_number ||
1473: ' To prj:' || p_to_proj_number ||
1649: END LOOP ; /* Open_projects*/
1650:
1651: IF G_DEBUG_MODE = 'Y' THEN
1652:
1653: PA_DEBUG.g_err_stage := '-----------Exiting PA_FUND_REVAL_PVT.get_reval_projects-----------' ;
1654: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
1655:
1656: END IF;
1657:
1704: /* This CURSOR selects the summary project funding lines with non-zero baselined amount
1705: for the given project in primary set of book id only*/
1706:
1707: CURSOR get_spf_lines (l_ProjectId NUMBER) is
1708: SELECT PA_FUND_REVAL_PVT.G_SET_OF_BOOKS_ID set_of_books_id,
1709: SPF.agreement_id agreement_id,
1710: SPF.task_id task_id,
1711: SPF.funding_currency_code funding_currency_code,
1712: SPF.project_currency_code project_currency_code,
1737: new table gl_alc_ledger_rships_v and corresponding columns */
1738:
1739: /* mrc migration to SLA bug 4571438
1740: CURSOR get_all_spf_lines (l_ProjectId NUMBER) is
1741: (SELECT PA_FUND_REVAL_PVT.G_SET_OF_BOOKS_ID set_of_books_id,
1742: SPF.agreement_id agrmt_id,
1743: SPF.task_id task_id,
1744: SPF.funding_currency_code funding_currency_code,
1745: SPF.project_currency_code project_currency_code,
1833: x_msg_count := 0;
1834:
1835: IF G_DEBUG_MODE = 'Y' THEN
1836:
1837: PA_DEBUG.g_err_stage := '-----------Entering PA_FUND_REVAL_PVT.get_spf_lines-----------' ;
1838: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
1839:
1840: END IF;
1841:
2134: END IF;
2135:
2136: IF G_DEBUG_MODE = 'Y' THEN
2137:
2138: PA_DEBUG.g_err_stage := '-----------Exiting PA_FUND_REVAL_PVT.get_spf_lines-----------' ;
2139: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
2140:
2141: END IF;
2142:
2204: x_msg_count := 0;
2205:
2206: IF G_DEBUG_MODE = 'Y' THEN
2207:
2208: PA_DEBUG.g_err_stage := '-----------Entering PA_FUND_REVAL_PVT.process_spf_lines-----------' ;
2209: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
2210:
2211: l_LogMsg := 'Agreement Id:' || p_agreement_id ||
2212: ' Task Id:' || p_task_id ||
2426: END IF;
2427:
2428: IF G_DEBUG_MODE = 'Y' THEN
2429:
2430: PA_DEBUG.g_err_stage := '-----------Exiting PA_FUND_REVAL_PVT.process_spf_lines-----------' ;
2431: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
2432:
2433: END IF;
2434:
2501: /* This CURSOR fetches all retention invoice amount for a given project/agreement_id in
2502: primary sob */
2503:
2504: CURSOR get_retn_invoices IS
2505: SELECT PA_FUND_REVAL_PVT.G_SET_OF_BOOKS_ID set_of_books_id,
2506: di.draft_invoice_num,
2507: dii.projfunc_currency_code,
2508: dii.funding_currency_code,
2509: di.inv_currency_code,
2538: /* R12 : Ledger Architecture Changes : The table gl_mc_reporting_options will be obsolete, replace with
2539: new table gl_alc_ledger_rships_v and corresponding columns */
2540: /* mrc migration to SLA bug 4571438
2541: CURSOR get_all_retn_invoices IS
2542: (SELECT PA_FUND_REVAL_PVT.G_SET_OF_BOOKS_ID set_of_books_id,
2543: di.draft_invoice_num drft_inv_num,
2544: dii.projfunc_currency_code,
2545: dii.funding_currency_code,
2546: di.inv_currency_code,
2644: x_msg_count := 0;
2645:
2646: IF G_DEBUG_MODE = 'Y' THEN
2647:
2648: PA_DEBUG.g_err_stage := '-----------Entering PA_FUND_REVAL_PVT.get_retn_appl_amount-----------' ;
2649: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
2650:
2651: END IF;
2652:
2901: END IF;
2902:
2903: IF G_DEBUG_MODE = 'Y' THEN
2904:
2905: PA_DEBUG.g_err_stage := '-----------Exiting PA_FUND_REVAL_PVT.get_retn_appl_amount-----------' ;
2906: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
2907:
2908: END IF;
2909:
2988: x_msg_count := 0;
2989:
2990: IF G_DEBUG_MODE = 'Y' THEN
2991:
2992: PA_DEBUG.g_err_stage := '-----------Entering PA_FUND_REVAL_PVT.process_retention_invoice-----------' ;
2993: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
2994:
2995: END IF;
2996:
3208: END LOOP;
3209:
3210: IF G_DEBUG_MODE = 'Y' THEN
3211:
3212: PA_DEBUG.g_err_stage := '-----------Exiting PA_FUND_REVAL_PVT.process_retention_invoices-----------' ;
3213: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
3214:
3215: END IF;
3216:
3278: */
3279:
3280: CURSOR get_proj_invoices IS
3281: (SELECT 'REGULAR-PROJ' invoice_type,
3282: PA_FUND_REVAL_PVT.G_SET_OF_BOOKS_ID set_of_books_id,
3283: 0 task_id,
3284: di.draft_invoice_num drft_inv_num,
3285: dii.invproc_currency_code, dii.projfunc_currency_code, dii.funding_currency_code,
3286: di.inv_currency_code, di.system_reference, di.transfer_status_code,
3312: canceled_flag, cancel_credit_memo_flag, write_off_flag,
3313: decode(di.draft_invoice_num_credited, NULL, 'N', 'Y')
3314: UNION
3315: SELECT 'RETENTION-PROJ' invoice_type,
3316: PA_FUND_REVAL_PVT.G_SET_OF_BOOKS_ID set_of_books_id,
3317: 0 task_id,
3318: di.draft_invoice_num drft_inv_num,
3319: dii.invproc_currency_code, dii.projfunc_currency_code, dii.funding_currency_code,
3320: di.inv_currency_code, di.system_reference, di.transfer_status_code,
3355:
3356: /* mrc migration to SLA bug 4571438
3357: CURSOR get_all_proj_invoices IS
3358: (SELECT 'REGULAR-PROJ' invoice_type,
3359: PA_FUND_REVAL_PVT.G_SET_OF_BOOKS_ID set_of_books_id,
3360: 0 task_id,
3361: di.draft_invoice_num drft_inv_num,
3362: dii.invproc_currency_code, dii.projfunc_currency_code, dii.funding_currency_code,
3363: di.inv_currency_code, di.system_reference, di.transfer_status_code,
3388: canceled_flag, cancel_credit_memo_flag, write_off_flag,
3389: decode(di.draft_invoice_num_credited, NULL, 'N', 'Y')
3390: UNION
3391: SELECT 'RETENTION-PROJ' invoice_type,
3392: PA_FUND_REVAL_PVT.G_SET_OF_BOOKS_ID set_of_books_id,
3393: 0 task_id,
3394: di.draft_invoice_num drft_inv_num,
3395: dii.invproc_currency_code,
3396: dii.projfunc_currency_code,
3525: from RDL ERDL DII. These are eliminated by the check nvl(dii.task_id,0) <> 0
3526: */
3527: CURSOR get_task_invoices IS
3528: (SELECT 'REGULAR-TASK' invoice_type,
3529: PA_FUND_REVAL_PVT.G_SET_OF_BOOKS_ID set_of_books_id,
3530: dii.task_id,
3531: di.draft_invoice_num drft_inv_num,
3532: dii.invproc_currency_code, dii.projfunc_currency_code, dii.funding_currency_code,
3533: di.inv_currency_code, di.system_reference, di.transfer_status_code,
3597: canceled_flag, cancel_credit_memo_flag, write_off_flag,
3598: decode(di.draft_invoice_num_credited, NULL, 'N', 'Y')
3599: UNION
3600: SELECT 'RETENTION-TASK' invoice_type,
3601: PA_FUND_REVAL_PVT.G_SET_OF_BOOKS_ID set_of_books_id,
3602: dii.task_id,
3603: di.draft_invoice_num drft_inv_num,
3604: dii.invproc_currency_code, dii.projfunc_currency_code, dii.funding_currency_code,
3605: di.inv_currency_code, di.system_reference, di.transfer_status_code,
3640: new table gl_alc_ledger_rships_v and corresponding columns */
3641:
3642: /* mrc migration to SLA bug 4571438 CURSOR get_all_task_invoices IS
3643: (SELECT 'REGULAR-TASK' invoice_type,
3644: PA_FUND_REVAL_PVT.G_SET_OF_BOOKS_ID set_of_books_id,
3645: dii.task_id,
3646: di.draft_invoice_num drft_inv_num,
3647: dii.invproc_currency_code, dii.projfunc_currency_code, dii.funding_currency_code,
3648: di.inv_currency_code, di.system_reference, di.transfer_status_code,
3682: canceled_flag, cancel_credit_memo_flag, write_off_flag,
3683: decode(di.draft_invoice_num_credited, NULL, 'N', 'Y')
3684: UNION
3685: SELECT 'RETENTION-TASK' invoice_type,
3686: PA_FUND_REVAL_PVT.G_SET_OF_BOOKS_ID set_of_books_id,
3687: dii.task_id,
3688: di.draft_invoice_num drft_inv_num,
3689: dii.invproc_currency_code, dii.projfunc_currency_code, dii.funding_currency_code,
3690: di.inv_currency_code, di.system_reference, di.transfer_status_code,
3863: x_msg_count := 0;
3864:
3865: IF G_DEBUG_MODE = 'Y' THEN
3866:
3867: PA_DEBUG.g_err_stage := '-----------Entering PA_FUND_REVAL_PVT.get_invoice_components-----------' ;
3868: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
3869:
3870: END IF;
3871:
4542: END IF ;/* G_PRIMARY_ONLY */
4543:
4544: IF G_DEBUG_MODE = 'Y' THEN
4545:
4546: PA_DEBUG.g_err_stage := '-----------Exiting PA_FUND_REVAL_PVT.get_invoice_components-----------' ;
4547: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
4548:
4549: END IF;
4550:
4704:
4705:
4706: IF G_DEBUG_MODE = 'Y' THEN
4707:
4708: PA_DEBUG.g_err_stage := '-----------Entering PA_FUND_REVAL_PVT.derive_reval_components-----------' ;
4709: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
4710:
4711: END IF;
4712:
5812: END IF; /* project level funding */
5813:
5814: IF G_DEBUG_MODE = 'Y' THEN
5815:
5816: PA_DEBUG.g_err_stage := '-----------Exiting PA_FUND_REVAL_PVT.derive_reval_components-----------' ;
5817: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
5818:
5819: END IF;
5820:
5878:
5879: l_LogMsg VARCHAR2(250);
5880:
5881: CURSOR get_inv_total IS
5882: SELECT PA_FUND_REVAL_PVT.G_SET_OF_BOOKS_ID set_of_books_id,
5883: sum(dii.amount) amount,
5884: sum(dii.projfunc_bill_amount) projfunc_bill_amount,
5885: sum(dii.funding_bill_amount) funding_bill_amount,
5886: sum(dii.inv_amount) inv_amount
5899: new table gl_alc_ledger_rships_v and corresponding columns */
5900:
5901: /* mrc migration to SLA bug 4571438
5902: CURSOR get_all_inv_total IS
5903: (SELECT PA_FUND_REVAL_PVT.G_SET_OF_BOOKS_ID set_of_books_id,
5904: sum(dii.amount) amount,
5905: sum(dii.projfunc_bill_amount) projfunc_bill_amount,
5906: sum(dii.funding_bill_amount) funding_bill_amount,
5907: sum(dii.inv_amount) inv_amount
5947: x_msg_count := 0;
5948:
5949: IF G_DEBUG_MODE = 'Y' THEN
5950:
5951: PA_DEBUG.g_err_stage := '-----------Entering PA_FUND_REVAL_PVT.get_invoice_total-----------' ;
5952: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
5953:
5954: END IF;
5955:
6069: END IF;
6070:
6071: IF G_DEBUG_MODE = 'Y' THEN
6072:
6073: PA_DEBUG.g_err_stage := '-----------Exiting PA_FUND_REVAL_PVT.get_invoice_total-----------' ;
6074: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
6075:
6076: END IF;
6077:
6140: Since retained amount is stored only in invoice processing currency, it is prorated to get in
6141: project functional and funding currency */
6142:
6143: CURSOR rdl_amount IS
6144: SELECT PA_FUND_REVAL_PVT.G_SET_OF_BOOKS_ID set_of_books_id,
6145: SUM((rdl.retained_amount/rdl.bill_amount) * rdl.projfunc_bill_amount) retained_amt_pfc,
6146: SUM((rdl.retained_amount/rdl.bill_amount) * rdl.funding_bill_amount) retained_amt_fc
6147: FROM pa_cust_rev_dist_lines RDL, pa_draft_invoice_items DII,
6148: pa_draft_invoices DI
6159: /* R12 : Ledger Architecture Changes : The table gl_mc_reporting_options will be obsolete, replace with
6160: new table gl_alc_ledger_rships_v and corresponding columns */
6161:
6162: /* mrc migration to SLA bug 4571438 CURSOR rdl_amount_all IS
6163: (SELECT PA_FUND_REVAL_PVT.G_SET_OF_BOOKS_ID set_of_books_id,
6164: SUM((rdl.retained_amount/rdl.bill_amount) * rdl.projfunc_bill_amount) retained_amt_pfc,
6165: SUM((rdl.retained_amount/rdl.bill_amount) * rdl.funding_bill_amount) retained_amt_fc
6166: FROM pa_cust_rev_dist_lines RDL, pa_draft_invoice_items DII
6167: WHERE DII.project_id = p_project_id
6193: )
6194: ORDER by set_of_books_id; */
6195:
6196: CURSOR erdl_amount IS
6197: SELECT PA_FUND_REVAL_PVT.G_SET_OF_BOOKS_ID set_of_books_id,
6198: SUM((erdl.retained_amount/erdl.amount) * erdl.projfunc_bill_amount) retained_amt_pfc,
6199: SUM((erdl.retained_amount/erdl.amount) * erdl.funding_bill_amount) retained_amt_fc
6200: FROM pa_cust_event_rdl_all ERDL, pa_draft_invoice_items DII,
6201: pa_draft_invoices DI
6213: /* R12 : Ledger Architecture Changes : The table gl_mc_reporting_options will be obsolete, replace with
6214: new table gl_alc_ledger_rships_v and corresponding columns */
6215:
6216: /* mrc migration to SLA bug 4571438 CURSOR erdl_amount_all IS
6217: (SELECT PA_FUND_REVAL_PVT.G_SET_OF_BOOKS_ID set_of_books_id,
6218: SUM((erdl.retained_amount/erdl.amount) * erdl.projfunc_bill_amount) retained_amt_pfc,
6219: SUM((erdl.retained_amount/erdl.amount) * erdl.funding_bill_amount) retained_amt_fc
6220: FROM pa_cust_event_rdl_all ERDL, pa_draft_invoice_items DII
6221: WHERE DII.project_id = p_project_id
6250: )
6251: ORDER by set_of_books_id; */
6252:
6253: CURSOR dii_amount IS
6254: SELECT PA_FUND_REVAL_PVT.G_SET_OF_BOOKS_ID set_of_books_id,
6255: SUM((DII.retained_amount/DII.amount) * DII.projfunc_bill_amount) retained_amt_pfc,
6256: SUM((DII.retained_amount/DII.amount) * DII.funding_bill_amount) retained_amt_fc
6257: FROM pa_draft_invoice_items DII,pa_draft_invoices DI
6258: WHERE DII.project_id = p_project_id
6266: /* R12 : Ledger Architecture Changes : The table gl_mc_reporting_options will be obsolete, replace with
6267: new table gl_alc_ledger_rships_v and corresponding columns */
6268:
6269: /* mrc migration to SLA bug 4571438 CURSOR dii_amount_all IS
6270: (SELECT PA_FUND_REVAL_PVT.G_SET_OF_BOOKS_ID set_of_books_id,
6271: SUM((DII.retained_amount/DII.amount) * DII.projfunc_bill_amount) retained_amt_pfc,
6272: SUM((DII.retained_amount/DII.amount) * DII.funding_bill_amount) retained_amt_fc
6273: FROM pa_draft_invoice_items DII
6274: WHERE DII.project_id = p_project_id
6323: x_msg_count := 0;
6324:
6325: IF G_DEBUG_MODE = 'Y' THEN
6326:
6327: PA_DEBUG.g_err_stage := '-----------Entering PA_FUND_REVAL_PVT.get_retained_amount-----------' ;
6328: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
6329:
6330: l_LogMsg := 'Project Id:' || p_project_id ||
6331: ' Task Id:' || p_task_id ||
6684: x_RetainedAmtTab := l_RetainedAmtTab;
6685:
6686: IF G_DEBUG_MODE = 'Y' THEN
6687:
6688: PA_DEBUG.g_err_stage := '-----------Exiting PA_FUND_REVAL_PVT.get_retained_amount-----------' ;
6689: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
6690:
6691: END IF;
6692:
6765: x_msg_count := 0;
6766:
6767: IF G_DEBUG_MODE = 'Y' THEN
6768:
6769: PA_DEBUG.g_err_stage := '-----------Entering PA_FUND_REVAL_PVT.sum_retained_amount-----------' ;
6770: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
6771:
6772: END IF;
6773:
6803: END LOOP;
6804:
6805: IF G_DEBUG_MODE = 'Y' THEN
6806:
6807: PA_DEBUG.g_err_stage := '-----------Exiting PA_FUND_REVAL_PVT.sum_retained_amount-----------' ;
6808: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
6809:
6810: END IF;
6811:
6904: the current retained amount is adjusted */
6905:
6906: IF G_DEBUG_MODE = 'Y' THEN
6907:
6908: PA_DEBUG.g_err_stage := '-----------Entering PA_FUND_REVAL_PVT.adjust_appl_amount-----------' ;
6909: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
6910:
6911: l_LogMsg := 'Sob Id:' || p_SobId ;
6912: PA_FUND_REVAL_UTIL.Log_Message(p_message =>l_LogMsg);
6979: ' PFC Retn loss Amt:' || round(x_retn_loss_amt_pfc,4) ;
6980:
6981: PA_FUND_REVAL_UTIL.Log_Message(p_message =>l_LogMsg);
6982:
6983: PA_DEBUG.g_err_stage := '-----------Exiting PA_FUND_REVAL_PVT.adjust_appl_amount-----------' ;
6984: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
6985:
6986: END IF;
6987:
7045: a) project level funding
7046: */
7047:
7048: CURSOR get_proj_invoices IS
7049: SELECT PA_FUND_REVAL_PVT.G_SET_OF_BOOKS_ID set_of_books_id,
7050: 0 task_id,
7051: sum(dii.amount) amount,
7052: sum(dii.projfunc_bill_amount) projfunc_bill_amount,
7053: sum(dii.funding_bill_amount) funding_bill_amount
7068: /* R12 : Ledger Architecture Changes : The table gl_mc_reporting_options will be obsolete, replace with
7069: new table gl_alc_ledger_rships_v and corresponding columns */
7070:
7071: /* mrc migration to SLA bug 4571438 CURSOR get_all_proj_invoices IS
7072: (SELECT PA_FUND_REVAL_PVT.G_SET_OF_BOOKS_ID set_of_books_id,
7073: 0 task_id,
7074: sum(dii.amount) amount,
7075: sum(dii.projfunc_bill_amount) projfunc_bill_amount,
7076: sum(dii.funding_bill_amount) funding_bill_amount
7116: a) task level funding
7117: */
7118:
7119: CURSOR get_task_invoices IS
7120: SELECT PA_FUND_REVAL_PVT.G_SET_OF_BOOKS_ID set_of_books_id,
7121: dii.task_id,
7122: sum(dii.amount) amount,
7123: sum(dii.projfunc_bill_amount) projfunc_bill_amount,
7124: sum(dii.funding_bill_amount) funding_bill_amount
7140:
7141: /* This CURSOR is same as previous CURSOR except that ti will select for both primary and reporting set of
7142: books isd */
7143: /* mrc migration to SLA bug 4571438 CURSOR get_all_task_invoices IS
7144: (SELECT PA_FUND_REVAL_PVT.G_SET_OF_BOOKS_ID set_of_books_id,
7145: dii.task_id,
7146: sum(dii.amount) amount,
7147: sum(dii.projfunc_bill_amount) projfunc_bill_amount,
7148: sum(dii.funding_bill_amount) funding_bill_amount
7205: x_msg_count := 0;
7206:
7207: IF G_DEBUG_MODE = 'Y' THEN
7208:
7209: PA_DEBUG.g_err_stage := '-----------Entering PA_FUND_REVAL_PVT.get_sum_invoice_components-----------' ;
7210: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
7211:
7212: END IF;
7213:
7482: END IF ;/* G_PRIMARY_ONLY */
7483:
7484: IF G_DEBUG_MODE = 'Y' THEN
7485:
7486: PA_DEBUG.g_err_stage := '-----------Exiting PA_FUND_REVAL_PVT.get_sum_invoice_components-----------' ;
7487: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
7488:
7489: END IF;
7490:
7567: x_msg_count := 0;
7568:
7569: IF G_DEBUG_MODE = 'Y' THEN
7570:
7571: PA_DEBUG.g_err_stage := '-----------Entering PA_FUND_REVAL_PVT.populate_invoice_amount-----------' ;
7572: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
7573:
7574: END IF;
7575:
7750: END IF;
7751:
7752: IF G_DEBUG_MODE = 'Y' THEN
7753:
7754: PA_DEBUG.g_err_stage := '-----------Exiting PA_FUND_REVAL_PVT.populate_invoice_amount-----------' ;
7755: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
7756:
7757: END IF;
7758:
7888: x_msg_count := 0;
7889:
7890: IF G_DEBUG_MODE = 'Y' THEN
7891:
7892: PA_DEBUG.g_err_stage := '-----------Entering PA_FUND_REVAL_PVT.compute_adjustment_amounts-----------' ;
7893: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
7894:
7895: END IF;
7896:
9027: END LOOP; /* l_SobIdIdx loop */
9028:
9029: IF G_DEBUG_MODE = 'Y' THEN
9030:
9031: PA_DEBUG.g_err_stage := '-----------Exiting PA_FUND_REVAL_PVT.compute_adjustment_amounts-----------' ;
9032: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
9033:
9034: END IF;
9035:
9095: x_msg_count := 0;
9096:
9097: IF G_DEBUG_MODE = 'Y' THEN
9098:
9099: PA_DEBUG.g_err_stage := '-----------Entering PA_FUND_REVAL_PVT.insert_rejection_reason_spf-----------' ;
9100: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
9101:
9102: END IF;
9103:
9135: END IF;
9136:
9137: IF G_DEBUG_MODE = 'Y' THEN
9138:
9139: PA_DEBUG.g_err_stage := '-----------Exiting PA_FUND_REVAL_PVT.insert_rejection_reason_spf-----------' ;
9140: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
9141:
9142: END IF;
9143:
9217: x_msg_count := 0;
9218:
9219: IF G_DEBUG_MODE = 'Y' THEN
9220:
9221: PA_DEBUG.g_err_stage := '-----------Entering PA_FUND_REVAL_PVT.create_adustment_line-----------' ;
9222: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
9223:
9224: END IF;
9225:
9485: END IF; /* ((G_PRIMARY_ONLY = 'N') OR ( G_RevalCompTab(l_SobId).projfunc_allocated_amount <> 0) */
9486:
9487: IF G_DEBUG_MODE = 'Y' THEN
9488:
9489: PA_DEBUG.g_err_stage := '-----------Exiting PA_FUND_REVAL_PVT.create_adustment_line-----------' ;
9490: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
9491:
9492: END IF;
9493:
9580: x_msg_count := 0;
9581:
9582: IF G_DEBUG_MODE = 'Y' THEN
9583:
9584: PA_DEBUG.g_err_stage := '-----------Entering PA_FUND_REVAL_PVT.insert_event_record-----------' ;
9585: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
9586:
9587: END IF;
9588:
9719: END IF; /* ((p_bill_trans_rev_amount <> 0) OR (G_PRIMARY_ONLY = 'N')) */
9720:
9721: IF G_DEBUG_MODE = 'Y' THEN
9722:
9723: PA_DEBUG.g_err_stage := '-----------Exiting PA_FUND_REVAL_PVT.insert_event_record-----------' ;
9724: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
9725:
9726: END IF;
9727:
9794: x_msg_count := 0;
9795:
9796: IF G_DEBUG_MODE = 'Y' THEN
9797:
9798: PA_DEBUG.g_err_stage := '-----------Entering PA_FUND_REVAL_PVT.get_ar_amounts-----------' ;
9799: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
9800:
9801: END IF;
9802:
9899: x_ArAmtsTab := l_ArAmtsTab;
9900:
9901: IF G_DEBUG_MODE = 'Y' THEN
9902:
9903: PA_DEBUG.g_err_stage := '-----------Exiting PA_FUND_REVAL_PVT.get_ar_amounts-----------' ;
9904: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
9905:
9906: END IF;
9907:
9962: x_msg_count := 0;
9963:
9964: IF G_DEBUG_MODE = 'Y' THEN
9965:
9966: PA_DEBUG.g_err_stage := '-----------Entering PA_FUND_REVAL_PVT.clear_distribution_warnings-----------' ;
9967: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
9968:
9969: END IF;
9970:
9974: COMMIT;
9975:
9976: IF G_DEBUG_MODE = 'Y' THEN
9977:
9978: PA_DEBUG.g_err_stage := '-----------Exiting PA_FUND_REVAL_PVT.clear_distribution_warnings-----------' ;
9979: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
9980:
9981: END IF;
9982:
10042: x_msg_count := 0;
10043:
10044: IF G_DEBUG_MODE = 'Y' THEN
10045:
10046: PA_DEBUG.g_err_stage := '-----------Entering PA_FUND_REVAL_PVT.check_accrued_billed_level-----------' ;
10047: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
10048:
10049: END IF;
10050:
10121: END IF;
10122:
10123: IF G_DEBUG_MODE = 'Y' THEN
10124:
10125: PA_DEBUG.g_err_stage := '-----------Exiting PA_FUND_REVAL_PVT.check_accrued_billed_level-----------' ;
10126: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
10127:
10128: END IF;
10129:
10217: x_msg_count := 0;
10218:
10219: IF G_DEBUG_MODE = 'Y' THEN
10220:
10221: PA_DEBUG.g_err_stage := '-----------Entering PA_FUND_REVAL_PVT.get_delete_projects-----------' ;
10222: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
10223:
10224: l_LogMsg := 'From prj:' || p_from_proj_number ||
10225: ' To prj:' || p_to_proj_number ||
10261: END LOOP;
10262:
10263: IF G_DEBUG_MODE = 'Y' THEN
10264:
10265: PA_DEBUG.g_err_stage := '-----------Exiting PA_FUND_REVAL_PVT.get_delete_projects-----------' ;
10266: PA_FUND_REVAL_UTIL.Log_Message(p_message => PA_DEBUG.g_err_stage);
10267:
10268: END IF;
10269:
10292: END IF;
10293:
10294: END get_delete_projects;
10295:
10296: END PA_FUND_REVAL_PVT;