1: PACKAGE BODY PSA_AP_BC_PVT AS
2: --$Header: psavapbb.pls 120.82.12020000.2 2012/08/28 14:55:10 sasukuma ship $
3:
4: g_state_level NUMBER := FND_LOG.LEVEL_STATEMENT;
5: g_proc_level NUMBER := FND_LOG.LEVEL_PROCEDURE;
6: g_event_level NUMBER := FND_LOG.LEVEL_EVENT;
7: g_excep_level NUMBER := FND_LOG.LEVEL_EXCEPTION;
8: g_error_level NUMBER := FND_LOG.LEVEL_ERROR;
9: g_unexp_level NUMBER := FND_LOG.LEVEL_UNEXPECTED;
10: g_full_path CONSTANT VARCHAR2(50) :='psa.plsql.psavapbb.psa_ap_bc_pvt';
11: /*=============================================================================
12: |Private Procedure Specifications
13: *===========================================================================*/
14: FUNCTION get_event_security_context
96: l_security_context xla_events_pub_pkg.t_security;
97: l_return_status VARCHAR2(1);
98:
99: BEGIN
100: fnd_file.put_line(fnd_file.log ,'>> PSA_AP_BC_PVT.Delete_EVENTS');
101: l_api_name := g_full_path||'.Delete_Events';
102: -- Update the calling sequence --
103: l_curr_calling_sequence := 'PSA_AP_BC_PVT.'||l_debug_loc||'<-'||p_calling_sequence;
104: x_return_status := Fnd_Api.G_Ret_Sts_Success;
99: BEGIN
100: fnd_file.put_line(fnd_file.log ,'>> PSA_AP_BC_PVT.Delete_EVENTS');
101: l_api_name := g_full_path||'.Delete_Events';
102: -- Update the calling sequence --
103: l_curr_calling_sequence := 'PSA_AP_BC_PVT.'||l_debug_loc||'<-'||p_calling_sequence;
104: x_return_status := Fnd_Api.G_Ret_Sts_Success;
105: IF Fnd_Api.To_Boolean(p_init_msg_list) THEN
106: Fnd_Msg_Pub.Initialize;
107: END IF;
171:
172: END LOOP;
173: END IF;
174: fnd_file.put_line(fnd_file.log ,'Count of BC events deleted:' || l_event_count);
175: fnd_file.put_line(fnd_file.log ,'<< PSA_AP_BC_PVT.Delete_EVENTS');
176: /*
177: --IF Federal is installed, call to fv_utility to
178: --delete Federal orphan events, if any
179: IF fv_install.enabled THEN
187: p_status => l_return_status
188: );
189: IF l_return_status <> 'S' THEN
190: psa_utils.debug_other_string(g_error_level,l_api_name,
191: ' PSA_AP_BC_PVT.CREATE_EVENT Failed after calling fv_utility.delete_fv_bc_orphan!');
192: x_return_status := Fnd_Api.G_Ret_Sts_Error;
193: END IF;
194: END IF;
195: */
457: FROM ap_self_assessed_tax_dist_all aps
458: WHERE aps.bc_event_id = xe.event_id)
459: ORDER BY xe.event_id;
460: BEGIN
461: fnd_file.put_line(fnd_file.log ,'>> PSA_AP_BC_PVT.Delete_Processed_Orphan_Events');
462: p_return_status := Fnd_Api.G_Ret_Sts_Success;
463: IF Fnd_Api.To_Boolean(p_init_msg_list) THEN
464: Fnd_Msg_Pub.Initialize;
465: END IF;
585: fnd_file.put_line(fnd_file.log ,'--------- ----------------- ------------------- ----------------------- -------------');
586: fnd_file.put_line(fnd_file.log ,'Events deleted successfully: ' || l_success_count);
587: fnd_file.put_line(fnd_file.log ,'Events could not be deleted: ' || l_fail_count);
588: psa_utils.debug_other_string(g_state_level,l_path_name, 'END of procedure delete_processed_orphan_events ' );
589: fnd_file.put_line(fnd_file.log ,'<< PSA_AP_BC_PVT.delete_processed_orphan_events');
590:
591: EXCEPTION
592: WHEN OTHERS THEN
593: p_return_status := Fnd_Api.G_Ret_Sts_Error;
783:
784: BEGIN
785: l_api_name := g_full_path||'.Create_events';
786: -- Update the calling sequence --
787: l_curr_calling_sequence := 'PSA_AP_BC_PVT.'||l_debug_loc|| '<-'||p_calling_sequence;
788:
789: x_return_status := Fnd_Api.G_Ret_Sts_Success;
790: IF Fnd_Api.To_Boolean(p_init_msg_list) THEN
791: Fnd_Msg_Pub.Initialize;
1171: WHERE aid1.invoice_id = aid2.invoice_id
1172: AND isprepaydist( aid2.invoice_distribution_id,aid2.invoice_id,aid2.line_type_lookup_code)='N');
1173:
1174: x_return_status := Fnd_Api.G_Ret_Sts_Error;
1175: psa_utils.debug_other_string(g_error_level,l_api_name, ' PSA_AP_BC_PVT.CREATE_EVENT Failed ');
1176: psa_utils.debug_other_string(g_error_level,l_api_name, 'ERROR: Wrong BC event stamped on distributions for invoice id: ' || p_tab_fc_dist(1).invoice_id );
1177: fnd_message.set_name('PSA','PSA_AP_BC_STAMPING_ERROR');
1178: fnd_message.set_token('INVOICE_ID',p_tab_fc_dist(1).invoice_id);
1179: psa_bc_xla_pvt.psa_xla_error ('PSA_AP_BC_STAMPING_ERROR');
1240: Fnd_Msg_Pub.Initialize;
1241: END IF;
1242:
1243: -- Update the calling sequence --
1244: l_curr_calling_sequence := 'PSA_AP_BC_PVT.'||l_debug_loc|| '<-'||p_calling_sequence;
1245:
1246: FOR i IN p_tab_fc_dist.FIRST..p_tab_fc_dist.LAST LOOP
1247: IF (p_tab_fc_dist(i).distribution_type = 'PREPAY') THEN
1248:
1494: BEGIN
1495:
1496: l_api_name := g_full_path || '.Process_Fundschk_Failure_Code';
1497: -- Update the calling sequence --
1498: l_curr_calling_sequence := 'PSA_AP_BC_PVT.'||l_debug_loc|| '<-'||p_calling_sequence;
1499:
1500: -----------------------------------------------------------
1501: -- Retrieve the failure result_code from gl fundschecker --
1502: -----------------------------------------------------------
2207: BEGIN
2208: l_api_name := g_full_path || '.Get_PO_Reversed_Encumb_Amount';
2209: l_unencumbered_amount := 0;
2210:
2211: l_calling_sequence := 'PSA_AP_BC_PVT.Get_PO_Reversed_Encumb_Amount -> '
2212: ||substr(p_calling_sequence,1,100);
2213:
2214: psa_utils.debug_other_string(g_state_level,l_api_name,'Calling Sequence : ' || l_calling_sequence );
2215: psa_utils.debug_other_string(g_state_level,l_api_name,'PO Distribution Id : ' || P_Po_Distribution_Id );
2322: END isprepaydist;
2323: -------------------------------------------------------------
2324: BEGIN
2325: init;
2326: END PSA_AP_BC_PVT;