229: -- Budgets model.
230: --
231: -- For the new FP model, the p_budget_type_code will be NULL!
232: --
233: -- p_pm_product_code - The PM vendor's product code stored in pa_budget_versions.
234: --
235: -- OUT Parameters
236: -- p_result - 'T' or 'F' (True/False)
237: -- p_err_code - Standard error code: 0, Success; x < 0, Unexpected Error;
344:
345: CURSOR l_lock_budget_csr (p_draft_version_id NUMBER)
346: IS
347: SELECT 'x'
348: FROM pa_budget_versions
349: WHERE budget_version_id = p_draft_version_id
350: FOR UPDATE NOWAIT;
351:
352: -- Local Variables
435: CLOSE l_lock_budget_csr;
436:
437: -- UPDATE Draft Budget Version
438:
439: UPDATE pa_budget_versions
440: SET budget_status_code = 'W'
441: , WF_status_code = 'REJECTED'
442: WHERE budget_version_id = l_draft_version_id;
443:
545: l_api_version_number NUMBER := G_api_version_number;
546:
547:
548: l_fin_plan_type_id NUMBER := NULL;
549: l_version_type pa_budget_versions.version_type%TYPE := NULL;
550: l_draft_version_id NUMBER := NULL;
551:
552: l_approver_role varchar2(50); -- Bug 6994708
553:
791:
792: l_warnings_only_flag VARCHAR2(1);
793: l_warnings_only VARCHAR2(1) := 'Y';
794: l_err_msg_count NUMBER := 0;
795: l_mark_as_original pa_budget_versions.current_original_flag%TYPE;
796: l_resource_list_id NUMBER;
797: l_project_type_class_code pa_project_types.project_type_class_code%TYPE;
798:
799: l_msg_count NUMBER;
809:
810: l_bgt_intg_flag VARCHAR2(1) := NULL;
811:
812: l_fin_plan_type_id NUMBER := NULL;
813: l_version_type pa_budget_versions.version_type%TYPE := NULL;
814: l_draft_version_id NUMBER := NULL;
815:
816:
817: --
1144: , p_budget_type_code VARCHAR2 )
1145:
1146: IS
1147: SELECT MAX(budget_version_id)
1148: FROM pa_budget_versions
1149: WHERE project_id = p_project_id
1150: AND budget_type_code = p_budget_type_code
1151: AND budget_status_code = 'B';
1152:
1159: , p_version_type VARCHAR2)
1160: IS
1161: SELECT budget_version_id
1162: , RECORD_VERSION_NUMBER
1163: FROM pa_budget_versions
1164: WHERE project_id = p_project_id
1165: AND current_flag = 'Y'
1166: and fin_plan_type_id = p_fin_plan_type_id
1167: and version_type = p_version_type;
1169:
1170: CURSOR l_fp_draft_csr ( p_draft_version_id NUMBER)
1171: IS
1172: SELECT RECORD_VERSION_NUMBER
1173: FROM pa_budget_versions
1174: WHERE budget_version_id = p_draft_version_id;
1175:
1176:
1177:
1197:
1198: l_warnings_only_flag VARCHAR2(1);
1199: l_warnings_only VARCHAR2(1) := 'Y';
1200: l_err_msg_count NUMBER;
1201: l_mark_as_original pa_budget_versions.current_original_flag%TYPE;
1202: l_resource_list_id NUMBER;
1203: l_project_type_class_code pa_project_types.project_type_class_code%TYPE;
1204:
1205: l_err_code NUMBER := 0;
1209: l_bgt_intg_flag VARCHAR2(1) := NULL;
1210: l_fck_req_flag VARCHAR2(1) := NULL;
1211:
1212: l_fin_plan_type_id NUMBER := NULL;
1213: l_version_type pa_budget_versions.version_type%TYPE := NULL;
1214: l_draft_version_id NUMBER := NULL;
1215: l_baselined_record_number NUMBER := NULL;
1216: l_draft_record_number NUMBER := NULL;
1217: l_fc_version_created_flag VARCHAR2(1);
1461:
1462: /* 4995380: Added code to set the WF status to 'REJECTED'
1463: so that the changes can be done and the Baseline can be submitted
1464: once again, if Baseline fails. */
1465: UPDATE pa_budget_versions
1466: SET budget_status_code = 'W'
1467: , wf_status_code = 'REJECTED'
1468: WHERE budget_version_id = l_draft_version_id;
1469:
1526: -- Since baseline will fail more often with new R12 functionality, Need to
1527: -- properly populate draft version semaphores.
1528: --
1529: -- Update WF Status on Draft Budget Version
1530: UPDATE pa_budget_versions SET
1531: budget_status_code = 'W'
1532: ,WF_status_code = 'REJECTED'
1533: WHERE budget_version_id = l_draft_version_id;
1534: -- -------------------------------------------------------------
1593: -- After Successfully calling BASELINE, Set The Budget_Status_Code
1594: -- Back To 'W' (Working) and wf_status_code to NULL.
1595: --
1596:
1597: UPDATE pa_budget_versions SET
1598: budget_status_code = 'W'
1599: , wf_status_code = NULL
1600: WHERE budget_version_id = l_draft_version_id;
1601:
1611: ELSE
1612: /* 4995380: Added code to set the WF status to 'REJECTED'
1613: so that the changes can be done and the Baseline can be submitted
1614: once again, if there are any errors and l_warnings_only = 'N'. */
1615: UPDATE pa_budget_versions
1616: SET budget_status_code = 'W'
1617: , wf_status_code = 'REJECTED'
1618: WHERE budget_version_id = l_draft_version_id;
1619: resultout := wf_engine.eng_completed||':'||'F';