17: -- P_ORG NUMBER Yes Org Id
18: -- P_FUNC_CURR VARCHAR2 Yes Functional currency code
19: --
20: --
21: g1_debug_mode varchar2(1) := NVL(FND_PROFILE.value('PA_DEBUG_MODE'), 'N');
22:
23: PROCEDURE Init (
24: P_LAST_UPDATE_LOGIN NUMBER,
25: P_REQUEST_ID NUMBER,
71: G_LAST_UPDATED_BY := P_LAST_UPDATED_BY;
72: G_CREATED_BY := P_CREATED_BY;
73: G_DEBUG_MODE := P_DEBUG_MODE;
74:
75: pa_debug.init_err_stack ('Intercompany Invoice');
76: pa_debug.set_process(
77: x_process => 'PLSQL',
78: x_debug_mode => p_debug_mode);
79:
72: G_CREATED_BY := P_CREATED_BY;
73: G_DEBUG_MODE := P_DEBUG_MODE;
74:
75: pa_debug.init_err_stack ('Intercompany Invoice');
76: pa_debug.set_process(
77: x_process => 'PLSQL',
78: x_debug_mode => p_debug_mode);
79:
80: pa_debug.G_Err_Stage := 'Initializing IC Invoice';
76: pa_debug.set_process(
77: x_process => 'PLSQL',
78: x_debug_mode => p_debug_mode);
79:
80: pa_debug.G_Err_Stage := 'Initializing IC Invoice';
81:
82: IF g1_debug_mode = 'Y' THEN
83: pa_ic_inv_utils.log_message('Init: ' || pa_debug.G_Err_Stage);
84: END IF;
79:
80: pa_debug.G_Err_Stage := 'Initializing IC Invoice';
81:
82: IF g1_debug_mode = 'Y' THEN
83: pa_ic_inv_utils.log_message('Init: ' || pa_debug.G_Err_Stage);
84: END IF;
85:
86: -- Initialize global variables for MRC
87:
153: */
154:
155: -- Get the highest invoice number for the project
156:
157: pa_debug.g_err_stage := ' In Get_Next_Draft_Inv_Num ';
158: IF g1_debug_mode = 'Y' THEN
159: pa_ic_inv_utils.log_message('Get_Next_Draft_Inv_Num: ' || pa_debug.g_err_stage);
160: pa_ic_inv_utils.log_message('Get_Next_Draft_Inv_Num: ' || 'opening cursor c_new_invoice_num');
161: END IF;
155: -- Get the highest invoice number for the project
156:
157: pa_debug.g_err_stage := ' In Get_Next_Draft_Inv_Num ';
158: IF g1_debug_mode = 'Y' THEN
159: pa_ic_inv_utils.log_message('Get_Next_Draft_Inv_Num: ' || pa_debug.g_err_stage);
160: pa_ic_inv_utils.log_message('Get_Next_Draft_Inv_Num: ' || 'opening cursor c_new_invoice_num');
161: END IF;
162:
163: Open c_new_invoice_num;
282: l_program_id := pa_ic_inv_utils.g_program_id;
283: l_program_application_id := pa_ic_inv_utils.g_program_application_id;
284: l_request_id := pa_ic_inv_utils.g_request_id;
285:
286: pa_debug.g_err_stage := ' In Update_SPF ';
287: IF g1_debug_mode = 'Y' THEN
288: pa_ic_inv_utils.log_message('Update_SPF: ' || pa_debug.g_err_stage);
289: END IF;
290:
284: l_request_id := pa_ic_inv_utils.g_request_id;
285:
286: pa_debug.g_err_stage := ' In Update_SPF ';
287: IF g1_debug_mode = 'Y' THEN
288: pa_ic_inv_utils.log_message('Update_SPF: ' || pa_debug.g_err_stage);
289: END IF;
290:
291: SELECT SUM(amount)
292: INTO l_total_billed_amount
373: /*End of fix for Bug 7433201*/
374: pa_ic_inv_utils.log_message('Done Deleting invoice');
375: ELSE
376: /* Fix for bug 7034356 ends here */
377: pa_debug.g_err_stage := ' In Mark Inv Error ';
378: IF g1_debug_mode = 'Y' THEN
379: pa_ic_inv_utils.log_message('Mark_Inv_Error: ' || pa_debug.g_err_stage);
380: END IF;
381:
375: ELSE
376: /* Fix for bug 7034356 ends here */
377: pa_debug.g_err_stage := ' In Mark Inv Error ';
378: IF g1_debug_mode = 'Y' THEN
379: pa_ic_inv_utils.log_message('Mark_Inv_Error: ' || pa_debug.g_err_stage);
380: END IF;
381:
382: begin
383: select meaning
420: );
421:
422: IF g1_debug_mode = 'Y' THEN
423: pa_ic_inv_utils.log_message('Rows Inserted in pa_distribution_warnings = '||SQL%rowcount);
424: pa_debug.g_err_stage := ' Done Mark Inv Error ';
425: pa_ic_inv_utils.log_message('Mark_Inv_Error: ' || pa_debug.g_err_stage);
426: END IF;
427: END IF; /* Added for bug 7034356*/
428: EXCEPTION
421:
422: IF g1_debug_mode = 'Y' THEN
423: pa_ic_inv_utils.log_message('Rows Inserted in pa_distribution_warnings = '||SQL%rowcount);
424: pa_debug.g_err_stage := ' Done Mark Inv Error ';
425: pa_ic_inv_utils.log_message('Mark_Inv_Error: ' || pa_debug.g_err_stage);
426: END IF;
427: END IF; /* Added for bug 7034356*/
428: EXCEPTION
429: when OTHERS then
482: l_program_id := pa_ic_inv_utils.g_program_id;
483: l_program_application_id := pa_ic_inv_utils.g_program_application_id;
484: l_request_id := pa_ic_inv_utils.g_request_id;
485:
486: pa_debug.g_err_stage := ' In mark_ei_as_billed ';
487: IF g1_debug_mode = 'Y' THEN
488: pa_ic_inv_utils.log_message('Mark_EI_as_Billed: ' || pa_debug.g_err_stage);
489: END IF;
490:
484: l_request_id := pa_ic_inv_utils.g_request_id;
485:
486: pa_debug.g_err_stage := ' In mark_ei_as_billed ';
487: IF g1_debug_mode = 'Y' THEN
488: pa_ic_inv_utils.log_message('Mark_EI_as_Billed: ' || pa_debug.g_err_stage);
489: END IF;
490:
491: FOR c_rec in c_inv_detail
492: loop
544: lock_name VARCHAR2(50);
545: BEGIN
546: lock_name := 'IC-'||P_PROJECT_ID;
547:
548: lock_status := pa_debug.acquire_user_lock(lock_name,6,FALSE,0);
549:
550: return(lock_status);
551:
552: END Set_User_Lock;
567: lock_name VARCHAR2(50);
568: BEGIN
569: lock_name := 'IC-'||P_PROJECT_ID;
570:
571: lock_status := pa_debug.release_user_lock(lock_name);
572:
573: return(lock_status);
574: END Release_User_Lock;
575: --
671: begin
672:
673: -- Update pa_draft_invoices with creation date so that the
674: -- trigger on this table is fired and creates MRC rows
675: pa_debug.g_err_stage := ' In Update_DI_for_MRC ';
676: IF g1_debug_mode = 'Y' THEN
677: pa_ic_inv_utils.log_message('Update_DI_for_MRC: ' || pa_debug.g_err_stage);
678: END IF;
679:
673: -- Update pa_draft_invoices with creation date so that the
674: -- trigger on this table is fired and creates MRC rows
675: pa_debug.g_err_stage := ' In Update_DI_for_MRC ';
676: IF g1_debug_mode = 'Y' THEN
677: pa_ic_inv_utils.log_message('Update_DI_for_MRC: ' || pa_debug.g_err_stage);
678: END IF;
679:
680: update pa_draft_invoices
681: set creation_date = creation_date
786: END Get_active_sites;
787:
788: PROCEDURE log_message (p_log_msg IN VARCHAR2) IS
789: BEGIN
790: pa_debug.write_file ('LOG',to_char(sysdate, 'DD-MON-YYYY HH:MI:SS ')||p_log_msg);
791: NULL;
792: END log_message;
793:
794: end PA_IC_INV_UTILS;