DBA Data[Home] [Help]

PACKAGE BODY: APPS.JAI_FA_MA_TRIGGER_PKG

Source


1 PACKAGE BODY JAI_FA_MA_TRIGGER_PKG AS
2 /* $Header: jai_fa_ma_t.plb 120.1 2007/07/05 12:45:46 brathod ship $ */
3 
4 /*  REM +======================================================================+
5   REM NAME          ARI_T1
6   REM
7   REM DESCRIPTION   Called from trigger JAI_FA_MA_ARIUD_T1
8   REM
9   REM NOTES         Refers to old trigger JAI_FA_MA_ARI_T1
10   REM
11   REM +======================================================================+
12 
13   ------------------------------------------------------------------------------------------------------------
14   CHANGE HISTORY
15   ------------------------------------------------------------------------------------------------------------
16   1.  09/05/2007   brathod, Bug#5763527 - File Version 120.1
17                    Forward Ported 11i Bug 5763527
18   ------------------------------------------------------------------------------------------------------------
19 
20   */
21  PROCEDURE ARI_T1 ( pr_old t_rec%type , pr_new t_rec%type , pv_action varchar2 , pv_return_code out nocopy varchar2 , pv_return_message out nocopy varchar2 ) IS
22    /* cursor c_ap_invoice_distributions_all
23   (p_invoice_id number, p_distribution_line_number  number) is
24     select  line_type_lookup_code,
25             po_distribution_id,
26             rcv_transaction_id,
27             set_of_books_id
28     from    ap_invoice_distributions_all
29     where   invoice_id = p_invoice_id
30     and     distribution_line_number = p_distribution_line_number;*/
31   /*
32   || rchandan for bug#4454657 commented the above and added the following cursor
33   */
34   cursor c_ap_invoice_lines_all
35   (p_invoice_id number, p_line_number  number) is
36     select  line_type_lookup_code,
37             po_distribution_id,
38             rcv_transaction_id,
39             set_of_books_id
40     from    ap_invoice_lines_all /*rchandan for bug#4428980*/
41     where   invoice_id = p_invoice_id
42     and     line_number = p_line_number;
43 
44   cursor c_gl_sets_of_books(p_set_of_books_id number) is
45     select  currency_code
46     from    gl_sets_of_books
47     where   set_of_books_id = p_set_of_books_id;
48 
49   cursor c_rcv_transactions(p_transaction_id number) is
50     select  shipment_line_id,
51             vendor_id
52     from    rcv_transactions
53     where   transaction_id = p_transaction_id;
54 
55   /* Added by LGOPALSA. Bug 4210102.
56    * Added CVD and Customs Education Cess */
57 
58   cursor  c_ja_in_receipt_tax_lines(p_shipment_line_id number, p_po_vendor_id number) is
59     select  count(1)
60     from    JAI_RCV_LINE_TAXES
61     where   shipment_line_id = p_shipment_line_id
62     and     nvl(tax_amount, 0) <> 0
63     and
64             (
65               (upper(tax_type) in
66            ( jai_constants.tax_type_cvd, /*--'CVD', 'CUSTOMS', Ramananda for removal of SQL LITERALs */
67             jai_constants.tax_type_customs,
68                   jai_constants.tax_type_customs_edu_cess,
69                   jai_constants.tax_type_cvd_Edu_cess))
70                               /* BOE Tax */
71               or
72               (upper(tax_type) not in --('TDS', 'MODVAT RECOVERY') /* Third party tax */
73         (
74                jai_constants.tax_type_tds,
75          jai_constants.tax_type_modvat_recovery
76          )
77               and  vendor_id > 0
78               and  vendor_id <> p_po_vendor_id
79               )
80             );
81 
82   cursor c_ja_in_fa_mass_additions(p_parent_request_id  number) is
83     select  count(1)
84     from    JAI_FA_MASS_ADDITIONS
85     where   create_batch_id = p_parent_request_id
86     and     process_flag <> 'Y';
87 
88 
89   r_ap_invoice_lines_all        c_ap_invoice_lines_all%rowtype;   /*rchandan for bug#4454657*/
90   r_rcv_transactions                    c_rcv_transactions%rowtype;
91   r_ja_in_receipt_tax_lines             c_ja_in_receipt_tax_lines%rowtype;
92   r_gl_sets_of_books                    c_gl_sets_of_books%rowtype;
93   ln_boe_3p_count                       number:=0;
94   lb_result                             boolean;
95   ln_req_id                             number;
96   ln_first_record                       number := 0;
97 
98 
99   BEGIN
100     pv_return_code := jai_constants.successful ;
101     /*------------------------------------------------------------------------------
102     Filename: ja_in_fa_mass_additions_boe3p_trg.sql
103 
104     CHANGE HISTORY:
105 
106     S.No    dd/mm/yyyy      Author and Details
107     ----    -------         ------------------
108     1       22/07/2004      Aparajita. Version # 115.0. Created for ER#3575112.
109 
110                 Enhancement is done for bringing over the third party
111                 and the BOE taxes attahed to a receipt to fixed asset
112                 cost whenever the payable invoice against the receipt
113                 is processed by the mass additions create program.
114 
115                 BOE and third party taxes do not flow into the invoice
116                 that is created against the receipt. Third party taxes
117                 become one or more 3rd party invoices where as BOE is
118                 matched against the BOE invoice already raised.
119 
120                 This trigger is populating data into the localization
121                 fa mass additions table for invoices being processed
122                 by base. Data in this table is further processed by
123                 localization concurrent 'India Local Mass Additions'
124                 to populate data on to the fa mass additions table
125                 with references to PO/ Receipt and payable invoice.
126 
127     2.   29/11/2004  ssumaith - bug# 4037690  - File version 115.1
128                        Check whether india localization is being used was done using a INR check in every trigger.
129                        This check has now been moved into a new package and calls made to this package from this trigger
130                        If the function jai_cmn_utils_pkg.check_jai_exists returns true it means INR is the set of books currency ,
131                        Hence if this function returns FALSE , control should return.
132 
133     3.   12/Mar/05   Bug 4210102. Added by LGOPALSA  - Version 115.2
134                      (1) Added CVD and Customs education Cess
135          (2) Added check file syntax in dbdrv command
136 
137     4.   08-Jun-2005   This Object is Modified to refer to New DB Entity names in place of Old
138                        DB Entity as required for CASE COMPLAINCE.  Version 116.1
139 
140     5. 10-Jun-2005    File Version: 116.2
141                           Removal of SQL LITERALs is done
142 
143     6.  24-Jun-2005    rchandan for bug#4454657,File Version: 116.3
144                        Modified the object as a part of AP LINES Impact Uptake
145                  A column invoice_line_number ie added to jai_fa_mass_additions.
146                  The ap_invoice_lines_all is used instead of ap_invoice_distributions_all while querying wherever applicable.
147 
148     Future Dependencies For the release Of this Object:-
149     (Please add a row in the section below only if your bug introduces a dependency due to spec change/ A new call to a object/
150     A datamodel change )
151     -------------------------------------------------------------------------------------------------------------------------------------------------------------------------
152     Current Version    Current Bug    Dependent           Files                Version   Author   Date          Remarks
153     Of File                           On Bug/Patchset    Dependent On
154 
155     ja_in_fa_mass_additions_boe3p_trg.sql
156     ------------------------------------------------------------------------------------------------------------------------------------------------------------------------
157     115.1              4037690        IN60105D2          ja_in_util_pkg_s.sql  115.0     ssumaith 29-Nov-2004  Call to this function.
158                                                          ja_in_util_pkg_s.sql  115.0     ssumaith
159 
160     115.2              4210102        IN60106 +                                          LGOPALSA 12-Mar-2005  Added cess implementation
161                                       4146708
162 
163     -----------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
164 
165 
166       /* check if invoice is against a receipt */
167       open c_ap_invoice_lines_all
168       (pr_new.invoice_id, pr_new.invoice_line_number);
169       fetch c_ap_invoice_lines_all into r_ap_invoice_lines_all;
170       close c_ap_invoice_lines_all;
171 
172       --If jai_cmn_utils_pkg.check_jai_exists(P_CALLING_OBJECT => 'JAI_FA_MA_ARI_T1', P_SET_OF_BOOKS_ID => r_ap_invoice_lines_all.set_of_books_id) = false then
173       --   return;
174       --end if;
175 
176       /*The following code has been commented and added the above code instead - ssumaith - bug# 4037690*/
177 
178      /* open  c_gl_sets_of_books(r_ap_invoice_distributions_all.set_of_books_id);
179       fetch c_gl_sets_of_books into r_gl_sets_of_books;
180       close c_gl_sets_of_books;
181     */
182       /* check if functional currency is INR, if not there is no need to process further */
183 
184      /*
185       if nvl(r_gl_sets_of_books.currency_code, 'XXX') <> 'INR' then
186         return;
187       end if;
188      */
189 
190       if  r_ap_invoice_lines_all.line_type_lookup_code not in  ('ITEM', 'ACCRUAL')  then
191         /* the invoice distribution line being processed is not an item line.*/
192         /* no need to check for existance of receipt taxes against it.*/
193         return;
194       end if;
195 
196      if  r_ap_invoice_lines_all.po_distribution_id is null or
197           r_ap_invoice_lines_all.rcv_transaction_id is null then
198         /* PO and/or Receipt references does not exist, no need to process */
199         return;
200       end if;
201 
202       open c_rcv_transactions(r_ap_invoice_lines_all.rcv_transaction_id);
203       fetch c_rcv_transactions into r_rcv_transactions;
204       close c_rcv_transactions;
205 
206       /*  All validations are over at this point, now check if BOE or third party tax exists */
207       open c_ja_in_receipt_tax_lines(r_rcv_transactions.shipment_line_id, r_rcv_transactions.vendor_id);
208       fetch c_ja_in_receipt_tax_lines into ln_boe_3p_count;
209       close c_ja_in_receipt_tax_lines;
210 
211       if ln_boe_3p_count <=  0 then
212         /* BOE or third party type of taxes do not exist for the item line */
213         return;
214       end if;
215 
216       insert into JAI_FA_MASS_ADDITIONS
217       (
218       mass_addition_id,
219       invoice_id,
220       distribution_line_number,
221       invoice_line_number,   /*rchandan for bug#4454657*/
222       process_flag,
223       book_type_code,
224       date_placed_in_service,
225       create_batch_date,
226       invoice_number,
227       invoice_date,
228       vendor_number,
229       po_number,
230       DEPRECIATE_STATUS,
231       asset_type,
232       accounting_date,
233       payables_code_combination_id,
234       created_by,
235       creation_date,
236       last_update_login,
237       last_update_date,
238       last_updated_by,
239       create_batch_id
240       )
241       values
242       (
243       pr_new.mass_addition_id,
244       pr_new.invoice_id,
245       pr_new.ap_distribution_line_number,
246       pr_new.invoice_line_number,
247       'N',
248       pr_new.book_type_code,
249       pr_new.date_placed_in_service,
250       pr_new.create_batch_date,
251       pr_new.invoice_number,
252       pr_new.invoice_date,
253       pr_new.vendor_number,
254       pr_new.po_number,
255       pr_new.depreciate_flag,
256       pr_new.asset_type,
257       pr_new.accounting_date,
258       pr_new.payables_code_combination_id,
259       pr_new.created_by,
260       pr_new.creation_date,
261       pr_new.last_update_login,
262       pr_new.last_update_date,
263       pr_new.last_updated_by,
264       pr_new.create_batch_id
265       );
266 
267       open c_ja_in_fa_mass_additions(pr_new.create_batch_id);
268       fetch c_ja_in_fa_mass_additions into ln_first_record;
269       close c_ja_in_fa_mass_additions;
270 
271       if nvl(ln_first_record, 0) > 1 then
272         /* Not the firstrecord to be inserted by the trigger for the batch
273            No need to invoke the concurrent */
274         return;
275       end if;
276 
277       lb_result := Fnd_Request.set_mode(TRUE);
278       ln_req_id := Fnd_Request.submit_request
279       ('JA',
280       'JAINMACR',
281       'India - Mass Additions Create',
282       '',
283       false,
284        pr_new.create_batch_id
285       );
286     /* Added an exception block by Ramananda for bug#4570303 */
287    EXCEPTION
288      WHEN OTHERS THEN
289        Pv_return_code     :=  jai_constants.unexpected_error;
290        Pv_return_message  := 'Encountered an error in JAI_FA_MA_TRIGGER_PKG.ARI_T1 '  || substr(sqlerrm,1,1900);
291   END ARI_T1 ;
292 
293   /*
294   REM +======================================================================+
295   REM NAME          BRI_T1
296   REM
297   REM DESCRIPTION   Called from trigger JAI_FA_MA_BRIUD_T1
298   REM
299   REM NOTES         Refers to old trigger JAI_FA_MA_BRI_T2
300   REM
301   REM +======================================================================+
302   */
303   PROCEDURE BRI_T1 ( pr_old t_rec%type , pr_new in out t_rec%type , pv_action varchar2 , pv_return_code out nocopy varchar2 , pv_return_message out nocopy varchar2 ) IS
304     v_modvat_per                NUMBER;
305     v_mod_per_diff              NUMBER;
306 
307     /*CURSOR c_get_line_info IS
308     SELECT A.invoice_id,
309            A.rcv_transaction_id,
310            A.distribution_line_number,
311            A.line_type_lookup_code,
312            A.amount
313       FROM JAI_CMN_FA_INV_DIST_ALL A, ap_invoice_distributions_all B
314      WHERE A.line_type_lookup_code    NOT like 'ITEM'
315        AND B.invoice_id = pr_new.invoice_id
316    AND A.INVOICE_ID = B.INVOICE_ID
317        AND A.distribution_line_number = B.distribution_line_number
318        AND B.distribution_line_number = pr_new.ap_distribution_line_number;*/
319 
320   /*
321   || rchandan for bug#4454657 commented the aboce cursor and following cursor has been added by rchandan for ap lines change
322   */
323   CURSOR c_get_line_info IS
324     SELECT A.rcv_transaction_id
325       FROM jai_ap_match_inv_taxes A, ap_invoice_lines_all B  /*  rchandan for bug#4454657 JAI_CMN_FA_INV_DIST_ALL is obsolete and so replaced by JAI_AP_MATCH_INV_TAXES */
326      WHERE A.line_type_lookup_code    NOT like 'ITEM'
327        AND B.invoice_id = pr_new.invoice_id
328        AND A.INVOICE_ID = B.INVOICE_ID
329        AND A.invoice_line_number = B.line_number
330        AND B.line_number = pr_new.invoice_line_number;
331 
332 
333   CURSOR c_get_ship_head_id(p_rcv_transaction_id NUMBER) is
334     SELECT shipment_header_id,
335            shipment_line_id
336       FROM rcv_transactions
337      WHERE transaction_id = p_rcv_transaction_id;
338 
339 
340   CURSOR item_mod_cur(c_shipment_line_id number) IS
341     SELECT jmsi.modvat_flag
342       FROM JAI_INV_ITM_SETUPS jmsi,
343            rcv_shipment_lines rsl
344      WHERE rsl.shipment_line_id = c_shipment_line_id
345        AND jmsi.organization_id = rsl.to_organization_id
346        AND jmsi.inventory_item_id = rsl.item_id;
347 
348 
349   CURSOR dist_tax_cur IS
350     SELECT b.mod_cr_percentage,
351            a.tax_id
352           ,a.parent_invoice_distribution_id   -- 5763527
353           ,a.line_no                          -- 5763527
354       FROM JAI_AP_MATCH_INV_TAXES a,
355            JAI_CMN_TAXES_ALL b
356      WHERE a.invoice_id = pr_new.invoice_id
357        AND a.invoice_line_number = pr_new.invoice_line_number   /*rchandan for bug#4454657*/
358        AND a.tax_id = b.tax_id;
359 
360 
361   CURSOR c_get_receipt_details(p_ship_head_id NUMBER) IS
362     SELECT receipt_num,
363            shipment_header_id
364       FROM rcv_shipment_headers
365      WHERE shipment_header_id =p_ship_head_id;
366 
367 
368   CURSOR c_get_modvat_details(p_ship_head_id NUMBER,p_ship_line_id NUMBER) IS
369     SELECT mfg_trading
370       FROM JAI_RCV_LINES
371      WHERE shipment_header_id = p_ship_head_id
372        AND shipment_line_id = p_ship_line_id;
373 
374 
375   CURSOR c_get_rcp_tax_details(c_ship_line_id NUMBER, c_tax_id number) IS
376     SELECT tax_amount,
377            modvat_flag
378       FROM JAI_RCV_LINE_TAXES
379      WHERE shipment_line_id = c_ship_line_id
380        AND tax_id = c_tax_id;
381 
382 
383   CURSOR c_set_of_books is
384   SELECT set_of_Books_id
385   FROM   ap_invoices_all
386   WHERE  invoice_id = pr_new.invoice_id; /*rchandan for bug#4454657*/
387 
388   c_get_line_info_rec          c_get_line_info%ROWTYPE ;
389   c_get_ship_head_id_rec       c_get_ship_head_id%ROWTYPE;
390   c_get_modvat_details_rec     c_get_modvat_details%ROWTYPE;
391   c_get_receipt_details_rec    c_get_receipt_details%ROWTYPE;
392   c_get_rcp_tax_details_rec    c_get_rcp_tax_details%ROWTYPE;
393   dist_tax_rec                 dist_tax_cur % rowtype;
394   item_mod_rec                 item_mod_cur % rowtype;
395   ln_set_of_books_id           gl_sets_of_books.set_of_books_id%type;
396 
397   --
398   -- Begin 5763527
399   --
400   ln_cnt  number;
401   cursor c_get_tax_line_cnt (cp_tax_id              JAI_AP_MATCH_INV_TAXES.tax_id%type
402                             ,cp_parent_inv_dist_id  JAI_AP_MATCH_INV_TAXES.parent_invoice_distribution_id%type
403                             ,cp_tax_line_num        JAI_AP_MATCH_INV_TAXES.line_no%type
404                             )
405   is
406     select count(1)
407     from   JAI_AP_MATCH_INV_TAXES a
408     where  a.invoice_id = pr_new.invoice_id
409     and    a.parent_invoice_distribution_id = cp_parent_inv_dist_id
410     and    a.tax_id = cp_tax_id
411     and    a.line_no = cp_tax_line_num ;
412   --
413   -- End 5763527
414   --
415 
416 
417   BEGIN
418     pv_return_code := jai_constants.successful ;
419    /*------------------------------------------------------------------------------------------
420  FILENAME: ja_in_fa_mass_add_trg1.sql
421 
422  CHANGE HISTORY:
423 
424 S.No      Date          Author and Details
425 
426 1.  2002/06/07        RPK: For BUG#2391562
427 
428                 1.For updating the date format of the column attribute1 of the table
429                         fa_mass_addtions_b for the assets added thru the ADI tool.The assets will
430                         be interfaced from the legacy system to the fa_mass_additions table
431                         thru ADI or any other data migration tool.The date format of the columns will
432                         be maintained same as that of the valueset for the report
433                         'India Income fixed assets schedule' ie 'DD-MON-RRRR'.Now,the user will be
434                         able to query the assets added through ADI.
435 
436 2.  30/03/2004         Aparajita for bug#3448803. Version#619.1
437                        Removed the when condition for checking the context = 'India B Of Assets' as this
438                        context is not used at the time of inserting records into FA_MASS_ADDITIONS. The process
439                        here is mass additions create and the dff is not used at that point.
440 
441                        There was no need to put extra condtion as the cursor dist_tax_cur would return null for
442                        non localization record and the control would return from here.
443 
444 3.    29-nov-2004  ssumaith - bug# 4037690  - File version 115.1
445                    Check whether india localization is being used was done using a INR check in every trigger.
446                    This check has now been moved into a new package and calls made to this package from this trigger
447                    If the function jai_cmn_utils_pkg.check_jai_exists returns true it means INR is the set of books currency ,
448                    Hence if this function returns FALSE , control should return.
449 
450 4.   08-Jun-2005   This Object is Modified to refer to New DB Entity names in place of Old
451                    DB Entity as required for CASE COMPLAINCE.  Version 116.1
452 
453 5. 13-Jun-2005    File Version: 116.2
454                   Ramananda for bug#4428980. Removal of SQL LITERALs is done
455 
456 6.  24-Jun-2005    rchandan for bug#4454657,File Version: 116.3
457                    Modified the object as a part of AP LINES Impact Uptake
458              A column invoice_line_number ie added to jai_fa_mass_additions.
459              The ap_invoice_lines_all is used instead of ap_invoice_distributions_all while querying wherever applicable.
460 
461 
462 Future Dependencies For the release Of this Object:-
463 (Please add a row in the section below only if your bug introduces a dependency due to spec change/ A new call to a object/
464 A datamodel change )
465 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------
466 Current Version    Current Bug    Dependent           Files                Version   Author   Date          Remarks
467 Of File                           On Bug/Patchset    Dependent On
468 
469 ja_in_fa_mass_add_trg1.sql
470 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------
471 115.1              4037690        IN60105D2          ja_in_util_pkg_s.sql  115.0     ssumaith 29-Nov-2004  Call to this function.
472                                                      ja_in_util_pkg_s.sql  115.0     ssumaith
473 
474 -----------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
475 
476 /* pr_new.Attribute1 := TO_CHAR(TO_DATE(pr_new.Attribute1, 'DD/MM/YYYY'),'DD-MON-RRRR'); */
477 
478   OPEN dist_tax_cur;
479   FETCH dist_tax_cur INTO dist_tax_rec;
480   CLOSE dist_tax_cur;
481 
482   IF dist_tax_rec.tax_id IS NULL  THEN
483       RETURN;
484   END IF;
485 
486   --
487   -- Brathod, 5763527
488   --
489   if dist_tax_rec.mod_cr_percentage > 0 and dist_tax_rec.mod_cr_percentage < 100 then
490     ln_cnt := 0;
491     open  c_get_tax_line_cnt (dist_tax_rec.tax_id, dist_tax_rec.parent_invoice_distribution_id, dist_tax_rec.line_no);
492     fetch c_get_tax_line_cnt into ln_cnt;
493     close c_get_tax_line_cnt ;
494 
495     if ln_cnt > 1 then
496     --
497     --  For a partially recoverable tax line two split already exists hence no need to do further processing
498     --  for the legacy lines (lines which exists for uptaking the projects) only one line will exists and
499     --  apportionment is required
500     --
501       return;
502     end if;
503   end if;
504   --
505   -- End 5763527
506   --
507 
508 
509 
510   /*The following code has added - ssumaith - bug# 4037690*/
511 
512   open  c_set_of_books;
513   fetch c_set_of_books into ln_set_of_books_id;
514   close c_set_of_books;
515 
516   --If jai_cmn_utils_pkg.check_jai_exists(P_CALLING_OBJECT => 'JA_IN_FA_MASS_ADD_TRG1', P_SET_OF_BOOKS_ID => ln_set_of_books_id) = false then
517   --  return;
518   --end if;
519 
520   /* ends here*/
521 
522   OPEN c_get_line_info;
523   FETCH c_get_line_info INTO c_get_line_info_rec;
524   CLOSE c_get_line_info;
525 
526   OPEN c_get_SHIP_head_id(c_get_line_info_rec.rcv_transaction_id);
527   FETCH c_get_ship_head_id INTO c_get_ship_head_id_rec;
528   CLOSE c_get_ship_head_id;
529 
530   OPEN c_get_modvat_details(c_get_ship_head_id_rec.shipment_header_id, c_get_ship_head_id_rec.shipment_line_id);
531   FETCH c_get_modvat_details INTO c_get_modvat_details_rec;
532   CLOSE c_get_modvat_details;
533 
534   OPEN c_get_receipt_details(c_get_ship_head_id_rec.shipment_header_id);
535   FETCH c_get_receipt_details INTO c_get_receipt_details_rec;
536   CLOSE c_get_receipt_details;
537 
538   OPEN item_mod_cur(c_get_ship_head_id_rec.shipment_line_id);
539   FETCH item_mod_cur INTO item_mod_rec;
540   CLOSE item_mod_cur;
541 
542   OPEN c_get_rcp_tax_details(c_get_ship_head_id_rec.shipment_line_id, dist_tax_rec.tax_id);
543   FETCH c_get_rcp_tax_details INTO c_get_rcp_tax_details_rec;
544   CLOSE c_get_rcp_tax_details;
545 
546 
547 
548 --   IF NVL(item_mod_rec.modvat_flag, 'N') = 'Y' AND
549    --   NVL(c_get_modvat_details_rec.mfg_trading_flag, '#') = 'YN' AND
550     IF  NVL(c_get_rcp_tax_details_rec.modvat_flag, 'N') = 'Y'
551   THEN
552 
553     v_modvat_per := dist_tax_rec.mod_cr_percentage;
554 
555     IF nvl(v_modvat_per, 0) > 0 THEN
556        v_mod_per_diff := 100 - nvl(v_modvat_per, 0);
557        pr_new.Fixed_Assets_Cost := pr_new.Fixed_Assets_Cost * v_mod_per_diff / 100;
558 
559        pr_new.payables_cost := pr_new.payables_cost * v_mod_per_diff / 100;
560     END IF;
561   END IF;
562     /* Added an exception block by Ramananda for bug#4570303 */
563    EXCEPTION
564      WHEN OTHERS THEN
565        Pv_return_code     :=  jai_constants.unexpected_error;
566        Pv_return_message  := 'Encountered an error in JAI_FA_MA_TRIGGER_PKG.BRI_T1 '  || substr(sqlerrm,1,1900);
567   END BRI_T1 ;
568 
569 END JAI_FA_MA_TRIGGER_PKG ;