40:
41:
42:
43: --Local Package Body Definition
44: P_Insert_tab PA_INVOICE_DETAIL_PKG.inv_rec_tab;
45: P_Delete_tab PA_INVOICE_DETAIL_PKG.inv_rec_tab;
46: P_Update_tab PA_INVOICE_DETAIL_PKG.inv_rec_tab;
47:
48: --EI Table for marking status as IC Processed.
41:
42:
43: --Local Package Body Definition
44: P_Insert_tab PA_INVOICE_DETAIL_PKG.inv_rec_tab;
45: P_Delete_tab PA_INVOICE_DETAIL_PKG.inv_rec_tab;
46: P_Update_tab PA_INVOICE_DETAIL_PKG.inv_rec_tab;
47:
48: --EI Table for marking status as IC Processed.
49: P_Ei_table PA_PLSQL_DATATYPES.IdTabTyp;
42:
43: --Local Package Body Definition
44: P_Insert_tab PA_INVOICE_DETAIL_PKG.inv_rec_tab;
45: P_Delete_tab PA_INVOICE_DETAIL_PKG.inv_rec_tab;
46: P_Update_tab PA_INVOICE_DETAIL_PKG.inv_rec_tab;
47:
48: --EI Table for marking status as IC Processed.
49: P_Ei_table PA_PLSQL_DATATYPES.IdTabTyp;
50: I_Ei_count number;
120: PROCEDURE init
121: IS
122: BEGIN
123: PA_IC_INV_UTILS.log_message('Initializing Package Global variable......');
124: PA_INVOICE_DETAIL_PKG.G_Ins_count := 0;
125: PA_INVOICE_DETAIL_PKG.G_Del_count := 0;
126: PA_INVOICE_DETAIL_PKG.G_Upd_count := 0;
127: I_EI_count := 0;
128: PA_CC_BL_PROCESS.g_dcnt := 0;
121: IS
122: BEGIN
123: PA_IC_INV_UTILS.log_message('Initializing Package Global variable......');
124: PA_INVOICE_DETAIL_PKG.G_Ins_count := 0;
125: PA_INVOICE_DETAIL_PKG.G_Del_count := 0;
126: PA_INVOICE_DETAIL_PKG.G_Upd_count := 0;
127: I_EI_count := 0;
128: PA_CC_BL_PROCESS.g_dcnt := 0;
129: PA_CC_BL_PROCESS.g_ucnt := 0;
122: BEGIN
123: PA_IC_INV_UTILS.log_message('Initializing Package Global variable......');
124: PA_INVOICE_DETAIL_PKG.G_Ins_count := 0;
125: PA_INVOICE_DETAIL_PKG.G_Del_count := 0;
126: PA_INVOICE_DETAIL_PKG.G_Upd_count := 0;
127: I_EI_count := 0;
128: PA_CC_BL_PROCESS.g_dcnt := 0;
129: PA_CC_BL_PROCESS.g_ucnt := 0;
130: PA_CC_BL_PROCESS.g_icnt := 0;
697: IF g1_debug_mode = 'Y' THEN
698: PA_IC_INV_UTILS.log_message('Enter pa_invoice_detail_process.insert_row ...');
699: END IF;
700: --Increase the Insert counter
701: PA_INVOICE_DETAIL_PKG.G_Ins_count := PA_INVOICE_DETAIL_PKG.G_Ins_count + 1;
702: --Assign Invoice detail Id from sequence
703: p_inv_rec.DRAFT_INVOICE_DETAIL_ID := get_nextval;
704: --Add record to insert buffer
705: P_Insert_tab(PA_INVOICE_DETAIL_PKG.G_Ins_count) := p_inv_rec;
701: PA_INVOICE_DETAIL_PKG.G_Ins_count := PA_INVOICE_DETAIL_PKG.G_Ins_count + 1;
702: --Assign Invoice detail Id from sequence
703: p_inv_rec.DRAFT_INVOICE_DETAIL_ID := get_nextval;
704: --Add record to insert buffer
705: P_Insert_tab(PA_INVOICE_DETAIL_PKG.G_Ins_count) := p_inv_rec;
706:
707: END insert_row;
708:
709: --Procedure to add record in delete buffer
714: IF g1_debug_mode = 'Y' THEN
715: PA_IC_INV_UTILS.log_message('Enter pa_invoice_detail_process.delete_row ...');
716: END IF;
717: --Increase the Delete counter
718: PA_INVOICE_DETAIL_PKG.G_Del_count := PA_INVOICE_DETAIL_PKG.G_Del_count + 1;
719: --Add record to delete buffer
720: P_Delete_tab(PA_INVOICE_DETAIL_PKG.G_Del_count) := p_inv_rec;
721:
722: END delete_row;
716: END IF;
717: --Increase the Delete counter
718: PA_INVOICE_DETAIL_PKG.G_Del_count := PA_INVOICE_DETAIL_PKG.G_Del_count + 1;
719: --Add record to delete buffer
720: P_Delete_tab(PA_INVOICE_DETAIL_PKG.G_Del_count) := p_inv_rec;
721:
722: END delete_row;
723:
724: --Procedure to add record in update buffer
730: IF g1_debug_mode = 'Y' THEN
731: PA_IC_INV_UTILS.log_message('Enter pa_invoice_detail_process.update_row ...');
732: END IF;
733: --Increase the Update counter
734: PA_INVOICE_DETAIL_PKG.G_Upd_count := PA_INVOICE_DETAIL_PKG.G_Upd_count + 1;
735: --Add record to update buffer
736: P_Update_tab(PA_INVOICE_DETAIL_PKG.G_Upd_count) := p_inv_rec;
737: I_MRC_REQD_FLAG(PA_INVOICE_DETAIL_PKG.G_Upd_count) := p_mrc_required;
738:
732: END IF;
733: --Increase the Update counter
734: PA_INVOICE_DETAIL_PKG.G_Upd_count := PA_INVOICE_DETAIL_PKG.G_Upd_count + 1;
735: --Add record to update buffer
736: P_Update_tab(PA_INVOICE_DETAIL_PKG.G_Upd_count) := p_inv_rec;
737: I_MRC_REQD_FLAG(PA_INVOICE_DETAIL_PKG.G_Upd_count) := p_mrc_required;
738:
739: END update_row;
740:
733: --Increase the Update counter
734: PA_INVOICE_DETAIL_PKG.G_Upd_count := PA_INVOICE_DETAIL_PKG.G_Upd_count + 1;
735: --Add record to update buffer
736: P_Update_tab(PA_INVOICE_DETAIL_PKG.G_Upd_count) := p_inv_rec;
737: I_MRC_REQD_FLAG(PA_INVOICE_DETAIL_PKG.G_Upd_count) := p_mrc_required;
738:
739: END update_row;
740:
741: -- Procedure to Update EI status as IC Processed.
1157: IF g1_debug_mode = 'Y' THEN
1158: PA_IC_INV_UTILS.log_message('Enter pa_invoice_detail_process.apply_db_changes...');
1159: END IF;
1160: /* Apply Pending Delete/Update/Insert in PA_DRAFT_INVOICE Details */
1161: PA_INVOICE_DETAIL_PKG.delete_rows(P_Delete_tab);
1162: PA_INVOICE_DETAIL_PKG.update_rows(P_Update_tab,I_MRC_REQD_FLAG);
1163: PA_INVOICE_DETAIL_PKG.insert_rows(P_Insert_tab);
1164:
1165: /* Apply pending changes for PA_EXPENDITURE_ITEMS */
1158: PA_IC_INV_UTILS.log_message('Enter pa_invoice_detail_process.apply_db_changes...');
1159: END IF;
1160: /* Apply Pending Delete/Update/Insert in PA_DRAFT_INVOICE Details */
1161: PA_INVOICE_DETAIL_PKG.delete_rows(P_Delete_tab);
1162: PA_INVOICE_DETAIL_PKG.update_rows(P_Update_tab,I_MRC_REQD_FLAG);
1163: PA_INVOICE_DETAIL_PKG.insert_rows(P_Insert_tab);
1164:
1165: /* Apply pending changes for PA_EXPENDITURE_ITEMS */
1166: update_ei;
1159: END IF;
1160: /* Apply Pending Delete/Update/Insert in PA_DRAFT_INVOICE Details */
1161: PA_INVOICE_DETAIL_PKG.delete_rows(P_Delete_tab);
1162: PA_INVOICE_DETAIL_PKG.update_rows(P_Update_tab,I_MRC_REQD_FLAG);
1163: PA_INVOICE_DETAIL_PKG.insert_rows(P_Insert_tab);
1164:
1165: /* Apply pending changes for PA_EXPENDITURE_ITEMS */
1166: update_ei;
1167: update_rejection_reason( P_Error_code, P_Exp_Id, P_no_of_records );
2489:
2490: -- Apply all pending insert changes in Bulk
2491: PROCEDURE apply_ins_changes IS
2492: BEGIN
2493: PA_INVOICE_DETAIL_PKG.insert_rows(P_Insert_tab);
2494:
2495: if (PA_CC_BL_PROCESS.g_icnt > 0 )
2496: then
2497: PA_CC_BL_PROCESS.mass_insert;