98: p_error_code := null;
99:
100: l_procedure_name := 'RECORD_BURDEN_AMOUNTS:';
101: IF L_DEBUG = 'Y' THEN
102: gms_error_pkg.gms_debug(l_procedure_name||'Start','C');
103: END IF;
104:
105: If l_plsql_counter > 0 then -- I
106: For x in 1..l_plsql_counter
188: null;
189: End If; -- I
190: -- l_posted_flag := 'Y';
191: IF L_DEBUG = 'Y' THEN
192: gms_error_pkg.gms_debug(l_procedure_name||'End','C');
193: END IF;
194:
195: Exception
196: When others then
194:
195: Exception
196: When others then
197: IF L_DEBUG = 'Y' THEN
198: gms_error_pkg.gms_debug(l_procedure_name||SQLERRM,'C');
199: END IF;
200: p_error_code := 'E';
201: End Record_burden_amounts;
202:
214: Begin
215: p_error_code := null;
216: l_procedure_name := 'POST_BURDEN_AMOUNTS:';
217: IF L_DEBUG = 'Y' THEN
218: gms_error_pkg.gms_debug(l_procedure_name||'Start','C');
219: END IF;
220:
221: -- 1. Get gms_bc_packet records for burdne posting
222: For x in 1..p_plsql_count
281:
282: End Loop;
283:
284: IF L_DEBUG = 'Y' THEN
285: gms_error_pkg.gms_debug(l_procedure_name||'End','C');
286: END IF;
287: Exception
288: When others then
289: IF L_DEBUG = 'Y' THEN
286: END IF;
287: Exception
288: When others then
289: IF L_DEBUG = 'Y' THEN
290: gms_error_pkg.gms_debug(l_procedure_name||SQLERRM,'C');
291: END IF;
292: p_error_code := 'E';
293: End Post_burden_amounts;
294: ----------------------------------------------------------------------------------------
371: Exception
372:
373: When Others then
374:
375: gms_error_pkg.gms_message ( x_err_name=> 'GMS_UNEXPECTED_ERROR',
376: x_token_name1 => 'PROGRAM_NAME',
377: x_token_val1 => l_stage,
378: x_token_name2 => 'SQLCODE',
379: x_token_val2 => SQLCODE,
507: End if; --IF x_time_phased_type_code = 'R' THEN
508:
509: EXCEPTION
510: WHEN OTHERS THEN
511: gms_error_pkg.gms_message ( x_err_name=> 'GMS_UNEXPECTED_ERROR',
512: x_token_name1 => 'PROGRAM_NAME',
513: x_token_val1 => x_error_procedure_name||'.'||x_error_stage,
514: x_token_name2 => 'SQLCODE',
515: x_token_val2 => SQLCODE,
648:
649: l_rec := err_table.COUNT;
650:
651: --fnd_file.put_line(FND_FILE.OUTPUT,'---------- Records that Errored Out NOCOPY -----------');
652: gms_error_pkg.gms_output('---------- Records that Errored Out NOCOPY -----------');
653:
654: for l_records in 1..l_rec
655: loop
656:
653:
654: for l_records in 1..l_rec
655: loop
656:
657: gms_error_pkg.gms_output('----- Record Number: '||l_records||' ----');
658: gms_error_pkg.gms_output('---- Record -----');
659:
660: gms_error_pkg.gms_output('Expenditure_item_id :'||Err_table(l_records).exp_item_id);
661: gms_error_pkg.gms_output('Adl Line num :'||Err_table(l_records).adl);
654: for l_records in 1..l_rec
655: loop
656:
657: gms_error_pkg.gms_output('----- Record Number: '||l_records||' ----');
658: gms_error_pkg.gms_output('---- Record -----');
659:
660: gms_error_pkg.gms_output('Expenditure_item_id :'||Err_table(l_records).exp_item_id);
661: gms_error_pkg.gms_output('Adl Line num :'||Err_table(l_records).adl);
662: gms_error_pkg.gms_output('Award_id :'||Err_table(l_records).award_id);
656:
657: gms_error_pkg.gms_output('----- Record Number: '||l_records||' ----');
658: gms_error_pkg.gms_output('---- Record -----');
659:
660: gms_error_pkg.gms_output('Expenditure_item_id :'||Err_table(l_records).exp_item_id);
661: gms_error_pkg.gms_output('Adl Line num :'||Err_table(l_records).adl);
662: gms_error_pkg.gms_output('Award_id :'||Err_table(l_records).award_id);
663: gms_error_pkg.gms_output('Project_Id :'||Err_table(l_records).project_id);
664: gms_error_pkg.gms_output('Task_id :'||Err_table(l_records).task_id);
657: gms_error_pkg.gms_output('----- Record Number: '||l_records||' ----');
658: gms_error_pkg.gms_output('---- Record -----');
659:
660: gms_error_pkg.gms_output('Expenditure_item_id :'||Err_table(l_records).exp_item_id);
661: gms_error_pkg.gms_output('Adl Line num :'||Err_table(l_records).adl);
662: gms_error_pkg.gms_output('Award_id :'||Err_table(l_records).award_id);
663: gms_error_pkg.gms_output('Project_Id :'||Err_table(l_records).project_id);
664: gms_error_pkg.gms_output('Task_id :'||Err_table(l_records).task_id);
665: gms_error_pkg.gms_output('Amount :'||Err_table(l_records).amount);
658: gms_error_pkg.gms_output('---- Record -----');
659:
660: gms_error_pkg.gms_output('Expenditure_item_id :'||Err_table(l_records).exp_item_id);
661: gms_error_pkg.gms_output('Adl Line num :'||Err_table(l_records).adl);
662: gms_error_pkg.gms_output('Award_id :'||Err_table(l_records).award_id);
663: gms_error_pkg.gms_output('Project_Id :'||Err_table(l_records).project_id);
664: gms_error_pkg.gms_output('Task_id :'||Err_table(l_records).task_id);
665: gms_error_pkg.gms_output('Amount :'||Err_table(l_records).amount);
666: gms_error_pkg.gms_output('Reason :'||Err_table(l_records).reason);
659:
660: gms_error_pkg.gms_output('Expenditure_item_id :'||Err_table(l_records).exp_item_id);
661: gms_error_pkg.gms_output('Adl Line num :'||Err_table(l_records).adl);
662: gms_error_pkg.gms_output('Award_id :'||Err_table(l_records).award_id);
663: gms_error_pkg.gms_output('Project_Id :'||Err_table(l_records).project_id);
664: gms_error_pkg.gms_output('Task_id :'||Err_table(l_records).task_id);
665: gms_error_pkg.gms_output('Amount :'||Err_table(l_records).amount);
666: gms_error_pkg.gms_output('Reason :'||Err_table(l_records).reason);
667:
660: gms_error_pkg.gms_output('Expenditure_item_id :'||Err_table(l_records).exp_item_id);
661: gms_error_pkg.gms_output('Adl Line num :'||Err_table(l_records).adl);
662: gms_error_pkg.gms_output('Award_id :'||Err_table(l_records).award_id);
663: gms_error_pkg.gms_output('Project_Id :'||Err_table(l_records).project_id);
664: gms_error_pkg.gms_output('Task_id :'||Err_table(l_records).task_id);
665: gms_error_pkg.gms_output('Amount :'||Err_table(l_records).amount);
666: gms_error_pkg.gms_output('Reason :'||Err_table(l_records).reason);
667:
668: gms_error_pkg.gms_output('---- Record Details ----');
661: gms_error_pkg.gms_output('Adl Line num :'||Err_table(l_records).adl);
662: gms_error_pkg.gms_output('Award_id :'||Err_table(l_records).award_id);
663: gms_error_pkg.gms_output('Project_Id :'||Err_table(l_records).project_id);
664: gms_error_pkg.gms_output('Task_id :'||Err_table(l_records).task_id);
665: gms_error_pkg.gms_output('Amount :'||Err_table(l_records).amount);
666: gms_error_pkg.gms_output('Reason :'||Err_table(l_records).reason);
667:
668: gms_error_pkg.gms_output('---- Record Details ----');
669: gms_error_pkg.gms_output('Person Id :'||Res_table(l_records).Person_Id);
662: gms_error_pkg.gms_output('Award_id :'||Err_table(l_records).award_id);
663: gms_error_pkg.gms_output('Project_Id :'||Err_table(l_records).project_id);
664: gms_error_pkg.gms_output('Task_id :'||Err_table(l_records).task_id);
665: gms_error_pkg.gms_output('Amount :'||Err_table(l_records).amount);
666: gms_error_pkg.gms_output('Reason :'||Err_table(l_records).reason);
667:
668: gms_error_pkg.gms_output('---- Record Details ----');
669: gms_error_pkg.gms_output('Person Id :'||Res_table(l_records).Person_Id);
670: gms_error_pkg.gms_output('Job Id :'||Res_table(l_records).Job_id);
664: gms_error_pkg.gms_output('Task_id :'||Err_table(l_records).task_id);
665: gms_error_pkg.gms_output('Amount :'||Err_table(l_records).amount);
666: gms_error_pkg.gms_output('Reason :'||Err_table(l_records).reason);
667:
668: gms_error_pkg.gms_output('---- Record Details ----');
669: gms_error_pkg.gms_output('Person Id :'||Res_table(l_records).Person_Id);
670: gms_error_pkg.gms_output('Job Id :'||Res_table(l_records).Job_id);
671: gms_error_pkg.gms_output('Org_Id :'||Res_table(l_records).org_id);
672: gms_error_pkg.gms_output('Expenditure_type :'||Res_table(l_records).expenditure_type);
665: gms_error_pkg.gms_output('Amount :'||Err_table(l_records).amount);
666: gms_error_pkg.gms_output('Reason :'||Err_table(l_records).reason);
667:
668: gms_error_pkg.gms_output('---- Record Details ----');
669: gms_error_pkg.gms_output('Person Id :'||Res_table(l_records).Person_Id);
670: gms_error_pkg.gms_output('Job Id :'||Res_table(l_records).Job_id);
671: gms_error_pkg.gms_output('Org_Id :'||Res_table(l_records).org_id);
672: gms_error_pkg.gms_output('Expenditure_type :'||Res_table(l_records).expenditure_type);
673: gms_error_pkg.gms_output('Non Labor resource :'||Res_table(l_records).nlr);
666: gms_error_pkg.gms_output('Reason :'||Err_table(l_records).reason);
667:
668: gms_error_pkg.gms_output('---- Record Details ----');
669: gms_error_pkg.gms_output('Person Id :'||Res_table(l_records).Person_Id);
670: gms_error_pkg.gms_output('Job Id :'||Res_table(l_records).Job_id);
671: gms_error_pkg.gms_output('Org_Id :'||Res_table(l_records).org_id);
672: gms_error_pkg.gms_output('Expenditure_type :'||Res_table(l_records).expenditure_type);
673: gms_error_pkg.gms_output('Non Labor resource :'||Res_table(l_records).nlr);
674: gms_error_pkg.gms_output('Expenditure Category :'||Res_table(l_records).exp_category);
667:
668: gms_error_pkg.gms_output('---- Record Details ----');
669: gms_error_pkg.gms_output('Person Id :'||Res_table(l_records).Person_Id);
670: gms_error_pkg.gms_output('Job Id :'||Res_table(l_records).Job_id);
671: gms_error_pkg.gms_output('Org_Id :'||Res_table(l_records).org_id);
672: gms_error_pkg.gms_output('Expenditure_type :'||Res_table(l_records).expenditure_type);
673: gms_error_pkg.gms_output('Non Labor resource :'||Res_table(l_records).nlr);
674: gms_error_pkg.gms_output('Expenditure Category :'||Res_table(l_records).exp_category);
675: gms_error_pkg.gms_output('Revenue Category :'||Res_table(l_records).rev_category);
668: gms_error_pkg.gms_output('---- Record Details ----');
669: gms_error_pkg.gms_output('Person Id :'||Res_table(l_records).Person_Id);
670: gms_error_pkg.gms_output('Job Id :'||Res_table(l_records).Job_id);
671: gms_error_pkg.gms_output('Org_Id :'||Res_table(l_records).org_id);
672: gms_error_pkg.gms_output('Expenditure_type :'||Res_table(l_records).expenditure_type);
673: gms_error_pkg.gms_output('Non Labor resource :'||Res_table(l_records).nlr);
674: gms_error_pkg.gms_output('Expenditure Category :'||Res_table(l_records).exp_category);
675: gms_error_pkg.gms_output('Revenue Category :'||Res_table(l_records).rev_category);
676: gms_error_pkg.gms_output('Non Labor resource Org Id :'||Res_table(l_records).nlr_org_id);
669: gms_error_pkg.gms_output('Person Id :'||Res_table(l_records).Person_Id);
670: gms_error_pkg.gms_output('Job Id :'||Res_table(l_records).Job_id);
671: gms_error_pkg.gms_output('Org_Id :'||Res_table(l_records).org_id);
672: gms_error_pkg.gms_output('Expenditure_type :'||Res_table(l_records).expenditure_type);
673: gms_error_pkg.gms_output('Non Labor resource :'||Res_table(l_records).nlr);
674: gms_error_pkg.gms_output('Expenditure Category :'||Res_table(l_records).exp_category);
675: gms_error_pkg.gms_output('Revenue Category :'||Res_table(l_records).rev_category);
676: gms_error_pkg.gms_output('Non Labor resource Org Id :'||Res_table(l_records).nlr_org_id);
677: gms_error_pkg.gms_output('System Linkage :'||Res_table(l_records).sys_link);
670: gms_error_pkg.gms_output('Job Id :'||Res_table(l_records).Job_id);
671: gms_error_pkg.gms_output('Org_Id :'||Res_table(l_records).org_id);
672: gms_error_pkg.gms_output('Expenditure_type :'||Res_table(l_records).expenditure_type);
673: gms_error_pkg.gms_output('Non Labor resource :'||Res_table(l_records).nlr);
674: gms_error_pkg.gms_output('Expenditure Category :'||Res_table(l_records).exp_category);
675: gms_error_pkg.gms_output('Revenue Category :'||Res_table(l_records).rev_category);
676: gms_error_pkg.gms_output('Non Labor resource Org Id :'||Res_table(l_records).nlr_org_id);
677: gms_error_pkg.gms_output('System Linkage :'||Res_table(l_records).sys_link);
678: gms_error_pkg.gms_output('Expenditure Date :'||Res_table(l_records).exp_date);
671: gms_error_pkg.gms_output('Org_Id :'||Res_table(l_records).org_id);
672: gms_error_pkg.gms_output('Expenditure_type :'||Res_table(l_records).expenditure_type);
673: gms_error_pkg.gms_output('Non Labor resource :'||Res_table(l_records).nlr);
674: gms_error_pkg.gms_output('Expenditure Category :'||Res_table(l_records).exp_category);
675: gms_error_pkg.gms_output('Revenue Category :'||Res_table(l_records).rev_category);
676: gms_error_pkg.gms_output('Non Labor resource Org Id :'||Res_table(l_records).nlr_org_id);
677: gms_error_pkg.gms_output('System Linkage :'||Res_table(l_records).sys_link);
678: gms_error_pkg.gms_output('Expenditure Date :'||Res_table(l_records).exp_date);
679: gms_error_pkg.gms_output('Budget Version :'||Res_table(l_records).bvid);
672: gms_error_pkg.gms_output('Expenditure_type :'||Res_table(l_records).expenditure_type);
673: gms_error_pkg.gms_output('Non Labor resource :'||Res_table(l_records).nlr);
674: gms_error_pkg.gms_output('Expenditure Category :'||Res_table(l_records).exp_category);
675: gms_error_pkg.gms_output('Revenue Category :'||Res_table(l_records).rev_category);
676: gms_error_pkg.gms_output('Non Labor resource Org Id :'||Res_table(l_records).nlr_org_id);
677: gms_error_pkg.gms_output('System Linkage :'||Res_table(l_records).sys_link);
678: gms_error_pkg.gms_output('Expenditure Date :'||Res_table(l_records).exp_date);
679: gms_error_pkg.gms_output('Budget Version :'||Res_table(l_records).bvid);
680: gms_error_pkg.gms_output('Budgeted Task :'||Res_table(l_records).bud_task);
673: gms_error_pkg.gms_output('Non Labor resource :'||Res_table(l_records).nlr);
674: gms_error_pkg.gms_output('Expenditure Category :'||Res_table(l_records).exp_category);
675: gms_error_pkg.gms_output('Revenue Category :'||Res_table(l_records).rev_category);
676: gms_error_pkg.gms_output('Non Labor resource Org Id :'||Res_table(l_records).nlr_org_id);
677: gms_error_pkg.gms_output('System Linkage :'||Res_table(l_records).sys_link);
678: gms_error_pkg.gms_output('Expenditure Date :'||Res_table(l_records).exp_date);
679: gms_error_pkg.gms_output('Budget Version :'||Res_table(l_records).bvid);
680: gms_error_pkg.gms_output('Budgeted Task :'||Res_table(l_records).bud_task);
681: gms_error_pkg.gms_output('Categorization Code :'||Res_table(l_records).cat_code);
674: gms_error_pkg.gms_output('Expenditure Category :'||Res_table(l_records).exp_category);
675: gms_error_pkg.gms_output('Revenue Category :'||Res_table(l_records).rev_category);
676: gms_error_pkg.gms_output('Non Labor resource Org Id :'||Res_table(l_records).nlr_org_id);
677: gms_error_pkg.gms_output('System Linkage :'||Res_table(l_records).sys_link);
678: gms_error_pkg.gms_output('Expenditure Date :'||Res_table(l_records).exp_date);
679: gms_error_pkg.gms_output('Budget Version :'||Res_table(l_records).bvid);
680: gms_error_pkg.gms_output('Budgeted Task :'||Res_table(l_records).bud_task);
681: gms_error_pkg.gms_output('Categorization Code :'||Res_table(l_records).cat_code);
682: gms_error_pkg.gms_output('Time Phase code :'||Res_table(l_records).tp_code);
675: gms_error_pkg.gms_output('Revenue Category :'||Res_table(l_records).rev_category);
676: gms_error_pkg.gms_output('Non Labor resource Org Id :'||Res_table(l_records).nlr_org_id);
677: gms_error_pkg.gms_output('System Linkage :'||Res_table(l_records).sys_link);
678: gms_error_pkg.gms_output('Expenditure Date :'||Res_table(l_records).exp_date);
679: gms_error_pkg.gms_output('Budget Version :'||Res_table(l_records).bvid);
680: gms_error_pkg.gms_output('Budgeted Task :'||Res_table(l_records).bud_task);
681: gms_error_pkg.gms_output('Categorization Code :'||Res_table(l_records).cat_code);
682: gms_error_pkg.gms_output('Time Phase code :'||Res_table(l_records).tp_code);
683: gms_error_pkg.gms_output('--------------------------------------------------');
676: gms_error_pkg.gms_output('Non Labor resource Org Id :'||Res_table(l_records).nlr_org_id);
677: gms_error_pkg.gms_output('System Linkage :'||Res_table(l_records).sys_link);
678: gms_error_pkg.gms_output('Expenditure Date :'||Res_table(l_records).exp_date);
679: gms_error_pkg.gms_output('Budget Version :'||Res_table(l_records).bvid);
680: gms_error_pkg.gms_output('Budgeted Task :'||Res_table(l_records).bud_task);
681: gms_error_pkg.gms_output('Categorization Code :'||Res_table(l_records).cat_code);
682: gms_error_pkg.gms_output('Time Phase code :'||Res_table(l_records).tp_code);
683: gms_error_pkg.gms_output('--------------------------------------------------');
684: end loop;
677: gms_error_pkg.gms_output('System Linkage :'||Res_table(l_records).sys_link);
678: gms_error_pkg.gms_output('Expenditure Date :'||Res_table(l_records).exp_date);
679: gms_error_pkg.gms_output('Budget Version :'||Res_table(l_records).bvid);
680: gms_error_pkg.gms_output('Budgeted Task :'||Res_table(l_records).bud_task);
681: gms_error_pkg.gms_output('Categorization Code :'||Res_table(l_records).cat_code);
682: gms_error_pkg.gms_output('Time Phase code :'||Res_table(l_records).tp_code);
683: gms_error_pkg.gms_output('--------------------------------------------------');
684: end loop;
685:
678: gms_error_pkg.gms_output('Expenditure Date :'||Res_table(l_records).exp_date);
679: gms_error_pkg.gms_output('Budget Version :'||Res_table(l_records).bvid);
680: gms_error_pkg.gms_output('Budgeted Task :'||Res_table(l_records).bud_task);
681: gms_error_pkg.gms_output('Categorization Code :'||Res_table(l_records).cat_code);
682: gms_error_pkg.gms_output('Time Phase code :'||Res_table(l_records).tp_code);
683: gms_error_pkg.gms_output('--------------------------------------------------');
684: end loop;
685:
686: gms_error_pkg.gms_output('---- End Report ----');
679: gms_error_pkg.gms_output('Budget Version :'||Res_table(l_records).bvid);
680: gms_error_pkg.gms_output('Budgeted Task :'||Res_table(l_records).bud_task);
681: gms_error_pkg.gms_output('Categorization Code :'||Res_table(l_records).cat_code);
682: gms_error_pkg.gms_output('Time Phase code :'||Res_table(l_records).tp_code);
683: gms_error_pkg.gms_output('--------------------------------------------------');
684: end loop;
685:
686: gms_error_pkg.gms_output('---- End Report ----');
687:
682: gms_error_pkg.gms_output('Time Phase code :'||Res_table(l_records).tp_code);
683: gms_error_pkg.gms_output('--------------------------------------------------');
684: end loop;
685:
686: gms_error_pkg.gms_output('---- End Report ----');
687:
688: End;
689:
690: --------------------------------------------------------------------
1061: If x_budget_version_id is null then
1062:
1063: GOTO NO_PROCESS1;
1064: IF L_DEBUG = 'Y' THEN
1065: gms_error_pkg.gms_debug('No processing','C');
1066: END IF;
1067:
1068: End if;
1069:
1067:
1068: End if;
1069:
1070: IF L_DEBUG = 'Y' THEN
1071: gms_error_pkg.gms_debug('Project_id, Award_id, Budget_version_id:'||l_project_id_tbl(i)||','||l_award_id_tbl(i)||','||x_budget_version_id,'C');
1072: END IF;
1073:
1074: -- 3. Initialize revenue records
1075:
1101: -- Will call main exception
1102: End;
1103:
1104: IF L_DEBUG = 'Y' THEN
1105: gms_error_pkg.gms_debug('Amount_type,Boundary_code:'|| x_amount_type||','||x_boundary_code,'C');
1106: END IF;
1107:
1108: -- 5. Get Resource List Id and Categorization Code
1109:
1158: /*for rev_gen in gms_rev
1159: loop */ /* commented for the bug 5481465 */
1160:
1161: IF L_DEBUG = 'Y' THEN
1162: gms_error_pkg.gms_debug('Expenditure_item_id,Adl_line_Num:'||l_ei_id_tbl(i)||','||l_adl_ln_num_id_tbl(i),'C');
1163: gms_error_pkg.gms_debug('Amount,Table:'||l_amount_tbl(i)||','||l_fr_tab_tbl(i),'C');
1164: END IF;
1165:
1166: x_stage :='Get Set of Books Id';
1159: loop */ /* commented for the bug 5481465 */
1160:
1161: IF L_DEBUG = 'Y' THEN
1162: gms_error_pkg.gms_debug('Expenditure_item_id,Adl_line_Num:'||l_ei_id_tbl(i)||','||l_adl_ln_num_id_tbl(i),'C');
1163: gms_error_pkg.gms_debug('Amount,Table:'||l_amount_tbl(i)||','||l_fr_tab_tbl(i),'C');
1164: END IF;
1165:
1166: x_stage :='Get Set of Books Id';
1167: -- x_set_of_books_id := p_sob_id; /* Commented for bug 9134876*/
1212:
1213: End if; --if x_categorization_code = .....
1214:
1215: IF L_DEBUG = 'Y' THEN
1216: gms_error_pkg.gms_debug('RLMI :'||x_resource_list_member_id,'C');
1217: END IF;
1218:
1219: if x_resource_list_member_id is null then
1220:
1264:
1265: IF (SQL%NOTFOUND) THEN
1266:
1267: IF L_DEBUG = 'Y' THEN
1268: gms_error_pkg.gms_debug('No Balance Line Updated','C');
1269: END IF;
1270:
1271: -- 4d. Calculate Start and End date.
1272:
1400: ,l_amount_tbl(i) --rev_gen.amount
1401: );
1402:
1403: IF L_DEBUG = 'Y' THEN
1404: gms_error_pkg.gms_debug('After Balance Line Insert','C');
1405: END IF;
1406: end if;
1407:
1408: x_stage:='Updating revenue records';
1471: <
1472: NULL;
1473: exception
1474: when others then
1475: gms_error_pkg.gms_message('GMS_UNEXPECTED_ERROR',
1476: 'SQLCODE',
1477: SQLCODE,
1478: 'SQLERRM',
1479: SQLERRM,
1490: -- MAIN BEGIN STARTS HERE ---
1491:
1492: BEGIN
1493:
1494: gms_error_pkg.set_debug_context; -- Added for Bug: 2510024
1495:
1496: -- Initialize error tables
1497: upd_error_table.delete;
1498: upd_reason_table.delete;
1503: x_status_code := 'A';
1504: end if;
1505:
1506: IF L_DEBUG = 'Y' THEN
1507: gms_error_pkg.gms_debug('---------- Budget Balance Process Starts ----','C');
1508:
1509: gms_error_pkg.gms_debug('Baselining for Project_ID :'||x_project_id,'C');
1510: gms_error_pkg.gms_debug('Baselining for Award_ID :'||x_award_id,'C');
1511:
1505:
1506: IF L_DEBUG = 'Y' THEN
1507: gms_error_pkg.gms_debug('---------- Budget Balance Process Starts ----','C');
1508:
1509: gms_error_pkg.gms_debug('Baselining for Project_ID :'||x_project_id,'C');
1510: gms_error_pkg.gms_debug('Baselining for Award_ID :'||x_award_id,'C');
1511:
1512: END IF;
1513:
1506: IF L_DEBUG = 'Y' THEN
1507: gms_error_pkg.gms_debug('---------- Budget Balance Process Starts ----','C');
1508:
1509: gms_error_pkg.gms_debug('Baselining for Project_ID :'||x_project_id,'C');
1510: gms_error_pkg.gms_debug('Baselining for Award_ID :'||x_award_id,'C');
1511:
1512: END IF;
1513:
1514: --Bug 4732065 : Shifted the code to fetch set of books id as part of Main cursors
1521: FND_PROFILE.GET('GMS_PURGE_FUNDS_CHECK_RESULTS', l_offset_days);
1522:
1523: IF l_offset_days IS NULL THEN
1524: IF L_DEBUG = 'Y' THEN
1525: gms_error_pkg.gms_debug('Profile GMS_PURGE_FUNDS_CHECK_RESULTS cannot have NULL value','C');
1526: gms_error_pkg.gms_debug('Defaulting the value of GMS_PURGE_FUNDS_CHECK_RESULTS profile to 3','C');
1527: END IF;
1528: l_offset_days :=3 ;
1529: ELSIF (l_offset_days < 1 ) THEN
1522:
1523: IF l_offset_days IS NULL THEN
1524: IF L_DEBUG = 'Y' THEN
1525: gms_error_pkg.gms_debug('Profile GMS_PURGE_FUNDS_CHECK_RESULTS cannot have NULL value','C');
1526: gms_error_pkg.gms_debug('Defaulting the value of GMS_PURGE_FUNDS_CHECK_RESULTS profile to 3','C');
1527: END IF;
1528: l_offset_days :=3 ;
1529: ELSIF (l_offset_days < 1 ) THEN
1530: IF L_DEBUG = 'Y' THEN
1527: END IF;
1528: l_offset_days :=3 ;
1529: ELSIF (l_offset_days < 1 ) THEN
1530: IF L_DEBUG = 'Y' THEN
1531: gms_error_pkg.gms_debug('Profile GMS_PURGE_FUNDS_CHECK_RESULTS cannot have value '||l_offset_days||' which is less than 1','C');
1532: gms_error_pkg.gms_debug('Defaulting the value of GMS_PURGE_FUNDS_CHECK_RESULTS profile to 3','C');
1533: END IF;
1534: l_offset_days :=3 ;
1535:
1528: l_offset_days :=3 ;
1529: ELSIF (l_offset_days < 1 ) THEN
1530: IF L_DEBUG = 'Y' THEN
1531: gms_error_pkg.gms_debug('Profile GMS_PURGE_FUNDS_CHECK_RESULTS cannot have value '||l_offset_days||' which is less than 1','C');
1532: gms_error_pkg.gms_debug('Defaulting the value of GMS_PURGE_FUNDS_CHECK_RESULTS profile to 3','C');
1533: END IF;
1534: l_offset_days :=3 ;
1535:
1536: END IF;
1537:
1538: Exception
1539: When value_error then
1540: IF L_DEBUG = 'Y' THEN
1541: gms_error_pkg.gms_debug('Invalid character type value is assigned to Profile GMS_PURGE_FUNDS_CHECK_RESULTS',
1542: 'C');
1543: gms_error_pkg.gms_debug('Defaulting the value of GMS_PURGE_FUNDS_CHECK_RESULTS profile to 3','C');
1544: END IF;
1545: l_offset_days :=3;
1539: When value_error then
1540: IF L_DEBUG = 'Y' THEN
1541: gms_error_pkg.gms_debug('Invalid character type value is assigned to Profile GMS_PURGE_FUNDS_CHECK_RESULTS',
1542: 'C');
1543: gms_error_pkg.gms_debug('Defaulting the value of GMS_PURGE_FUNDS_CHECK_RESULTS profile to 3','C');
1544: END IF;
1545: l_offset_days :=3;
1546: END;
1547:
1556:
1557: ---------------------------------------------------------------------------------- +
1558: x_stage := '100'; -- Delete old records from gms_bc_packets
1559: IF L_DEBUG = 'Y' THEN
1560: gms_error_pkg.gms_debug('Deleting old records from GMS','C');
1561: END IF;
1562:
1563: -- Bug 2155790 : Removed the trunc function and replaced 3 with l_offset_days
1564: delete from gms_bc_packets
1575:
1576: ---------------------------------------------------------------------------------- +
1577: x_stage := '200'; -- Delete from gms_bc_packet_arrival_order
1578: IF L_DEBUG = 'Y' THEN
1579: gms_error_pkg.gms_debug('Deleting records from arrival order table','C');
1580: END IF;
1581:
1582: DELETE gms_bc_packet_arrival_order ao
1583: WHERE NOT EXISTS (
1590:
1591: ---------------------------------------------------------------------------------- +
1592: x_stage := '250'; -- delete transactions left in pending state
1593: IF L_DEBUG = 'Y' THEN
1594: gms_error_pkg.gms_debug('Deleting transactions left in pending state','C');
1595: END IF;
1596:
1597: gms_funds_control_pkg.delete_pending_txns(retcode,errbuf);
1598: -- Note: Above mentioned procedure will not handle exception , so if there is any error
1612: -- Bug 4053891 Ends
1613:
1614: x_stage := '300'; -- Before loop of gms_bc_packet
1615: IF L_DEBUG = 'Y' THEN
1616: gms_error_pkg.gms_debug('Start Loop for Updation','C');
1617: gms_error_pkg.gms_debug('----------------------------------------------','C');
1618: END IF;
1619:
1620: FOR rec_gms_packets IN c_gms_packets(x_status_code) --Added parameter to fix bug 2138376
1613:
1614: x_stage := '300'; -- Before loop of gms_bc_packet
1615: IF L_DEBUG = 'Y' THEN
1616: gms_error_pkg.gms_debug('Start Loop for Updation','C');
1617: gms_error_pkg.gms_debug('----------------------------------------------','C');
1618: END IF;
1619:
1620: FOR rec_gms_packets IN c_gms_packets(x_status_code) --Added parameter to fix bug 2138376
1621: LOOP
1633: -- * Update gms_bc_packets
1634: ---------------------------------------------------------------------------------- +
1635: x_stage := '325';
1636: IF L_DEBUG = 'Y' THEN
1637: gms_error_pkg.gms_debug('Check if burden to be posted','C');
1638: END IF;
1639:
1640: If x_mode <> 'B' then
1641: If (x_loop_counter = 100 or
1654: If x_plsql_count > 0 then
1655:
1656: x_stage := '350';
1657: IF L_DEBUG = 'Y' THEN
1658: gms_error_pkg.gms_debug('Posting burden for bvid:'||x_old_budget_version_id,'C');
1659: END IF;
1660:
1661: POST_BURDEN_AMOUNTS(x_plsql_count,Tab_Award_exp_burden,x_err_code);
1662:
1662:
1663: If x_err_code = 'E' then
1664:
1665: IF L_DEBUG = 'Y' THEN
1666: gms_error_pkg.gms_debug('Error Code after posting burden(E->Failure):'||x_err_code,'C');
1667: END IF;
1668:
1669: ROLLBACK to SAVEPOINT A;
1670: If Tab_Award_exp_burden.exists(1) then
1674:
1675: End If;
1676:
1677: IF L_DEBUG = 'Y' THEN
1678: gms_error_pkg.gms_debug('Burden posted for bvid:'||x_old_budget_version_id,'C');
1679: END IF;
1680:
1681: End If; --If x_plsql_count > 0 then
1682:
1700: x_loop_counter := x_loop_counter + 1;
1701:
1702: x_stage := '360';
1703: IF L_DEBUG = 'Y' THEN
1704: gms_error_pkg.gms_debug('Recording burden','C');
1705: END IF;
1706:
1707: -- Record Burden amounts
1708: If ((rec_gms_packets.burden_adjustment_flag = 'N' and
1729: Tab_Award_exp_burden,
1730: x_err_code);
1731: If x_err_code = 'E' then
1732: IF L_DEBUG = 'Y' THEN
1733: gms_error_pkg.gms_debug('Burden recording failed for bvid,award_id,expenditure type,doc_type:'||
1734: rec_gms_packets.budget_version_id||','||rec_gms_packets.award_id||
1735: ','||rec_gms_packets.expenditure_type||','||
1736: rec_gms_packets.document_type,'C');
1737: END IF;
1746:
1747:
1748: x_stage := '400'; -- Update GMS_BALANCES record
1749: IF L_DEBUG = 'Y' THEN
1750: gms_error_pkg.gms_debug('----------------------------------------------','C');
1751: gms_error_pkg.gms_debug('Expenditure --> '||to_char(rec_gms_packets.document_header_id),'C');
1752: gms_error_pkg.gms_debug('Adl --> '||to_char(rec_gms_packets.document_distribution_id),'C');
1753: gms_error_pkg.gms_debug('Award --> '||to_char(rec_gms_packets.award_id),'C');
1754: gms_error_pkg.gms_debug('Project --> '||to_char(rec_gms_packets.project_id),'C');
1747:
1748: x_stage := '400'; -- Update GMS_BALANCES record
1749: IF L_DEBUG = 'Y' THEN
1750: gms_error_pkg.gms_debug('----------------------------------------------','C');
1751: gms_error_pkg.gms_debug('Expenditure --> '||to_char(rec_gms_packets.document_header_id),'C');
1752: gms_error_pkg.gms_debug('Adl --> '||to_char(rec_gms_packets.document_distribution_id),'C');
1753: gms_error_pkg.gms_debug('Award --> '||to_char(rec_gms_packets.award_id),'C');
1754: gms_error_pkg.gms_debug('Project --> '||to_char(rec_gms_packets.project_id),'C');
1755: gms_error_pkg.gms_debug('Task --> '||to_char(rec_gms_packets.task_id),'C');
1748: x_stage := '400'; -- Update GMS_BALANCES record
1749: IF L_DEBUG = 'Y' THEN
1750: gms_error_pkg.gms_debug('----------------------------------------------','C');
1751: gms_error_pkg.gms_debug('Expenditure --> '||to_char(rec_gms_packets.document_header_id),'C');
1752: gms_error_pkg.gms_debug('Adl --> '||to_char(rec_gms_packets.document_distribution_id),'C');
1753: gms_error_pkg.gms_debug('Award --> '||to_char(rec_gms_packets.award_id),'C');
1754: gms_error_pkg.gms_debug('Project --> '||to_char(rec_gms_packets.project_id),'C');
1755: gms_error_pkg.gms_debug('Task --> '||to_char(rec_gms_packets.task_id),'C');
1756: gms_error_pkg.gms_debug('Budget Version --> '||to_char(rec_gms_packets.budget_version_id),'C');
1749: IF L_DEBUG = 'Y' THEN
1750: gms_error_pkg.gms_debug('----------------------------------------------','C');
1751: gms_error_pkg.gms_debug('Expenditure --> '||to_char(rec_gms_packets.document_header_id),'C');
1752: gms_error_pkg.gms_debug('Adl --> '||to_char(rec_gms_packets.document_distribution_id),'C');
1753: gms_error_pkg.gms_debug('Award --> '||to_char(rec_gms_packets.award_id),'C');
1754: gms_error_pkg.gms_debug('Project --> '||to_char(rec_gms_packets.project_id),'C');
1755: gms_error_pkg.gms_debug('Task --> '||to_char(rec_gms_packets.task_id),'C');
1756: gms_error_pkg.gms_debug('Budget Version --> '||to_char(rec_gms_packets.budget_version_id),'C');
1757: gms_error_pkg.gms_debug('Document --> '||rec_gms_packets.document_type,'C');
1750: gms_error_pkg.gms_debug('----------------------------------------------','C');
1751: gms_error_pkg.gms_debug('Expenditure --> '||to_char(rec_gms_packets.document_header_id),'C');
1752: gms_error_pkg.gms_debug('Adl --> '||to_char(rec_gms_packets.document_distribution_id),'C');
1753: gms_error_pkg.gms_debug('Award --> '||to_char(rec_gms_packets.award_id),'C');
1754: gms_error_pkg.gms_debug('Project --> '||to_char(rec_gms_packets.project_id),'C');
1755: gms_error_pkg.gms_debug('Task --> '||to_char(rec_gms_packets.task_id),'C');
1756: gms_error_pkg.gms_debug('Budget Version --> '||to_char(rec_gms_packets.budget_version_id),'C');
1757: gms_error_pkg.gms_debug('Document --> '||rec_gms_packets.document_type,'C');
1758: END IF;
1751: gms_error_pkg.gms_debug('Expenditure --> '||to_char(rec_gms_packets.document_header_id),'C');
1752: gms_error_pkg.gms_debug('Adl --> '||to_char(rec_gms_packets.document_distribution_id),'C');
1753: gms_error_pkg.gms_debug('Award --> '||to_char(rec_gms_packets.award_id),'C');
1754: gms_error_pkg.gms_debug('Project --> '||to_char(rec_gms_packets.project_id),'C');
1755: gms_error_pkg.gms_debug('Task --> '||to_char(rec_gms_packets.task_id),'C');
1756: gms_error_pkg.gms_debug('Budget Version --> '||to_char(rec_gms_packets.budget_version_id),'C');
1757: gms_error_pkg.gms_debug('Document --> '||rec_gms_packets.document_type,'C');
1758: END IF;
1759:
1752: gms_error_pkg.gms_debug('Adl --> '||to_char(rec_gms_packets.document_distribution_id),'C');
1753: gms_error_pkg.gms_debug('Award --> '||to_char(rec_gms_packets.award_id),'C');
1754: gms_error_pkg.gms_debug('Project --> '||to_char(rec_gms_packets.project_id),'C');
1755: gms_error_pkg.gms_debug('Task --> '||to_char(rec_gms_packets.task_id),'C');
1756: gms_error_pkg.gms_debug('Budget Version --> '||to_char(rec_gms_packets.budget_version_id),'C');
1757: gms_error_pkg.gms_debug('Document --> '||rec_gms_packets.document_type,'C');
1758: END IF;
1759:
1760:
1753: gms_error_pkg.gms_debug('Award --> '||to_char(rec_gms_packets.award_id),'C');
1754: gms_error_pkg.gms_debug('Project --> '||to_char(rec_gms_packets.project_id),'C');
1755: gms_error_pkg.gms_debug('Task --> '||to_char(rec_gms_packets.task_id),'C');
1756: gms_error_pkg.gms_debug('Budget Version --> '||to_char(rec_gms_packets.budget_version_id),'C');
1757: gms_error_pkg.gms_debug('Document --> '||rec_gms_packets.document_type,'C');
1758: END IF;
1759:
1760:
1761: /* Bug 5956576: Base Bug 5956576 - Changes start */
2033:
2034: EXCEPTION
2035: When others then
2036: IF L_DEBUG = 'Y' THEN
2037: gms_error_pkg.gms_debug('Stage:'||x_stage||';'||substr(sqlerrm,1,255),'C');
2038: END IF;
2039: If x_mode <> 'B' then
2040: ROLLBACK TO SAVEPOINT A;
2041: -- If Sweeper then rollback and continue
2085: -- Moved Revenue posting to after actuals ...bug 3487431
2086:
2087: -- Call update_revenue_balance.
2088: IF L_DEBUG = 'Y' THEN
2089: gms_error_pkg.gms_debug('Calling Revenue Updation','C');
2090: gms_error_pkg.gms_debug('Mode passed for revenue updation '||x_mode,'C');
2091: END IF;
2092:
2093: -- Bug 2138376 : Modify the following code
2086:
2087: -- Call update_revenue_balance.
2088: IF L_DEBUG = 'Y' THEN
2089: gms_error_pkg.gms_debug('Calling Revenue Updation','C');
2090: gms_error_pkg.gms_debug('Mode passed for revenue updation '||x_mode,'C');
2091: END IF;
2092:
2093: -- Bug 2138376 : Modify the following code
2094: -- If called from Baselining process consider records with status 'B' else
2130:
2131: end if;
2132:
2133: IF L_DEBUG = 'Y' THEN
2134: gms_error_pkg.gms_debug('Revenue Updation Completed','C');
2135: END IF;
2136:
2137: -- ...bug 3487431 end.
2138: