1 PACKAGE BODY JAI_AR_GLDIST_TRIGGER_PKG AS
2 /* $Header: jai_ar_gldist_t.plb 120.0 2005/11/10 13:35:16 brathod noship $ */
3 /*
4 REM +======================================================================+
5 REM NAME BRI_T1
6 REM
7 REM DESCRIPTION Called from trigger JAI_AR_GLDIST_BRIUD_T1
8 REM
9 REM NOTES
10 REM
11 REM +======================================================================+
12 */
13 PROCEDURE BRI_T1 ( pr_old t_rec%type ,
14 pr_new t_rec%type ,
15 pv_action varchar2 ,
16 pv_return_code out nocopy varchar2 ,
17 pv_return_message out nocopy varchar2
18 ) IS
19 /********************************************************************************************************************************
20 Created By : brathod
21
22 Created Date: 11-Nov-2005
23
24 Bug : 4727534
25
26 Purpose : Stop the Ar Posting To GL (General Ledger Transfer Program) from posting if data for the invoice exists in JAI_AR_TRX_INS_LINES_T.
27 indicating that user did not/forgot to run the India Local Concurrent Program.
28 Here data is being posted from ra_cust_trx_line_gl_dist_all to gl_interface.
29
30 ********************************************************************************************************************************/
31
32 /*
33 || Should stop all invoices from posting because
34 || data still lies in ja_in_temp_line_insert
35 || This includes both Imported and Manual tramsactions
36 */
37 CURSOR cur_get_temp_row
38 IS
39 SELECT
40 1
41 FROM
42 JAI_AR_TRX_INS_LINES_T
43 WHERE
44 customer_trx_id = pr_new.customer_trx_id
45 AND error_flag <> 'D'; /* Modified by Ramananda for removal of SQL LITERALs */
46
47 ln_exists NUMBER;
48
49 BEGIN
50 pv_return_code := jai_constants.successful ;
51 OPEN cur_get_temp_row;
52 FETCH cur_get_temp_row INTO ln_exists;
53 IF cur_get_temp_row%FOUND THEN
54 /*
55 ||Data found in JAI_AR_TRX_INS_LINES_T , India Local concurrent has not been run for this invoice.
56 ||Stop the posting to gl_interface
57 */
58 CLOSE cur_get_temp_row;
59 /* raise_application_error (-20131,'IL Taxes found in JAI_AR_TRX_INS_LINES_T table. Please run the India Local Concurrent Program and then post the record into GL');*/
60 pv_return_code := jai_constants.expected_error ;
61 pv_return_message := 'IL Taxes found in JAI_AR_TRX_INS_LINES_T table. Please run the India Local Concurrent Program and then post the record into GL' ;
62 return ;
63 END IF ;
64 CLOSE cur_get_temp_row;
65 /* Added an exception block by Ramananda for bug#4570303 */
66 EXCEPTION
67 WHEN OTHERS THEN
68 Pv_return_code := jai_constants.unexpected_error;
69 Pv_return_message := 'Encountered an error in JAI_AR_GLDIST_TRIGGER_PKG.BRI_T1 ' || substr(sqlerrm,1,1900);
70 END BRI_T1 ;
71
72 END JAI_AR_GLDIST_TRIGGER_PKG ;