jai_om_tax

download jai_om_tax

If you can't read please download the document

description

India Localization Query

Transcript of jai_om_tax

REM +======================================================================+REM | Copyright (c) 1996, 2014 Oracle Corporation Redwood Shores, California, USA|REM | All rights reserved. |REM +======================================================================+REM NAMEREM +======================================================================+REMREM +======================================================================+REM DESCRIPTIONREMREM NOTESREMREM HISTORYREM Bug 5243532 Added by Lakshmi Gopalsami REM Removed the cursor set_of_books_cur and implemented REM caching logic for getting SOB.REM +======================================================================+REM dbdrv: sql ~PROD ~PATH ~FILE none none none sqlplus &phase=plb checkfile(120.14.12010000.36=120.26.12020000.17):~PROD:~PATH:~FILESET VERIFY OFFWHENEVER SQLERROR EXIT FAILURE ROLLBACK;WHENEVER OSERROR EXIT FAILURE ROLLBACK;CREATE OR REPLACE PACKAGE BODY jai_om_tax_pkg AS/* $Header: jai_om_tax.plb 120.26.12020000.17 2014/01/29 05:29:03 mmurtuza ship $ *//*------------------------------------------------------------------------------------------ FILENAME:1 08-Aug-2005 Ramananda for Bug#4540783. File Version 120.2 In Procedure recalculate_excise_taxes: Added a new parameter - p_vat_assess_value and value for the same as ln_vat_assessable_value while calling procedure jai_om_tax_pkg.recalculate_oe_taxes2.25-Aug-2006 Bug 5490479, Added by aiyer, File version 120.5 Issue:- Org_id parameter in all MOAC related Concurrent programs is getting derived from the profile org_id As this parameter is hidden hence not visible to users and so users cannot choose any other org_id from the security profile. Fix:- 1. The Multi_org_category field for all MOAC related concurrent programs should be set to 'S' (indicating single org reports). This would enable the SRS Operating Unit field. User would then be able to select operating unit values related to the security profile. 2. Remove the default value for the parameter p_org_id and make it Required false, Display false. This would ensure that null value gets passed to the called procedures/ reports. 3. Change the called procedures/reports. Remove the use of p_org_id and instead derive the org_id using the function mo_global.get_current_org_id This change has been made many procedures and reports. The procedure recalculate_excise_taxes has been changed for the same.01/11/2006 SACSETHI for bug 5228046, File version 120.6 Forward porting the change in 11i bug 5365523 (Additional CVD Enhancement). This bug has datamodel and spec changes.16/04/2007 KUNKUMAR for bug 5989740 file version 115.11.6107.2 of file ja_in_calc_taxes_ato_p.sql; forward porting to R1217/04/2007 bduvarag for the Bug#5989740, file version 120.8 Forward porting the changes done in 11i bug#590743620/05/2007 KUNKUMAR for bugno 5604375, file version 120.9 Issue:Interface Trip Stop concurrent was running into a warning when the shipped qty field was updated to less than the original ordered qty given during creation of sales order. Fix: The value of an un-initialized variable was being accessed. Made the appropriate assignment.15/06/2007 bduvarag for the bug#6072461, Forward porting of 11i bug#51830316/18/2007 ssawant for bug 6134057 row_count Changed to rec.lno in calculate_ato_taxes procedure. 12/10/2007 Kevin Cheng Update the logic for inclusive tax calculation05-Mar-08 Jia Li Added clause logic for bug# 6846048 Issue: When unit selling price is changed because of discounts, inclusive taxes are getting added to the tax amount in the JAI_OM_OE_SO_LINES table. So at ship confirm time, comparing the tax amount in the lines table with the sum of exclusive taxes in the taxes table was not matching and hence the trigger was returning an error. Fix: Ensuring that only exclusive taxes are added to the tax amount in the jai_om_oe_so_lines table. 22-Oct-2008 CSahoo - bug#4918667, File Version 120.14.12010000.2 Issue :- In case of retrobilling functionality, there was a divide by zero error which is caused. The parameter p_line_quantity is being used as a denominator, and in case it is zero it was causing a zero divide error. Resolution :- made the change that in case the p_line_quantity is zero , the tax amt is also zero. March 01. 2010 Bug 9382657 Base Tax Amount is not calculated correctly. Calculated by multiplying the line amount with effective rate of the precedences base_tax_amt_tab(I) := ln_exclusive_price*base_tax_amt_tab(I) + base_tax_amount_nr_tab(I)31-Mar-2010 Bug 9327049 Issue - Could not create receipt for RMA for some transactions. Cause - Problematic code in procedure calculate_ato_taxes. The pl sql array tax_rate_zero_tab is not not populated for RMA, but is being used for comparison in tax calculation. This raises a No Data Found error. Fix - Added logic to populate the tax_rate_zero_tab array in case of RMA also.07-May-2010 Bug 9674771 Issue - Interface trip stop errors out for partial shipment. Cause - Similar to that of bug 9327049. Here, the base_tax_amount_nr_tab table is not initialized for zero rate taxes. Fix - Added code to initialize the pl sql table for zero rate tax lines also.20 Feb2012 mmurtuza for bug13473763 Description: WRONG TAX CALCULATION ON SALES ORDER WHEN TAXES APPLIED THROUGH ITEM CATEGORY. Fix: Modified the procedure calculate_ato_taxes to perform calculation of inclusive and exclsuive taxes. (Ported from ja_in_calc_prec_taxes procedure)28-Aug-2012 mmurtuza for bug 14031594 Description: TAXES CALCULATION RESULT IS WRONG FOR IL RMA WHEN THERE IS ADHOC TAX INVOLVED. Fix: Added code in calculate_ato_taxes procedure to calcualte tax for RMA when tax type is adhoc.06-Aug-2013 mmurtuza for bug 17254045 Description: LEGACY RMA SHOWING TAX AMOUNT AS 0, AFTER APPLY TAX GETTING CALCULATED PROP Fix: Added logic to obtain confirm date ------------------------------------------------------------------------------------------*/PROCEDURE calculate_ato_taxes( transaction_name VARCHAR2, P_tax_category_id NUMBER, p_header_id NUMBER, p_line_id NUMBER, p_assessable_value NUMBER default 0, p_tax_amount IN OUT NOCOPY NUMBER, p_currency_conv_factor NUMBER, p_inventory_item_id NUMBER, p_line_quantity NUMBER, p_quantity NUMBER, p_uom_code VARCHAR2, p_vendor_id NUMBER, p_currency VARCHAR2, p_creation_date DATE, p_created_by NUMBER, p_last_update_date DATE, p_last_updated_by NUMBER, p_last_update_login NUMBER, p_vat_assessable_Value NUMBER DEFAULT 0, p_vat_reversal_price NUMBER DEFAULT 0 /*Bug#6072461, bduvarag*/ --,pn_gst_assessable_Value NUMBER DEFAULT 0 -- Added by zhiwei for bug10043656 GST enhancement 2010/09/14 /*Commented by mmurtuza for removing GST Changes*/ , p_warehouse_id NUMBER DEFAULT 0 -- Added by mmurtuza for bug 16804271) IS TYPE num_tab IS TABLE OF number INDEX BY BINARY_INTEGER; TYPE tax_amt_num_tab IS TABLE OF number INDEX BY BINARY_INTEGER; -- Add by Kevin Cheng for inclusive tax Dec 10, 2007 ---------------------------------------------------- TYPE CHAR_TAB IS TABLE OF VARCHAR2(30) INDEX BY BINARY_INTEGER; -- Changed size to 30 by mmurtuza for bug 16804271 lt_adhoc_tax_tab CHAR_TAB; lt_inclu_tax_tab CHAR_TAB; lt_tax_rate_tab NUM_TAB; lt_tax_rate_per_rupee NUM_TAB; lt_cumul_tax_rate_per_rupee NUM_TAB; lt_tax_target_tab NUM_TAB; lt_tax_amt_rate_tax_tab TAX_AMT_NUM_TAB; lt_tax_amt_non_rate_tab TAX_AMT_NUM_TAB; lt_func_tax_amt_tab TAX_AMT_NUM_TAB; lv_uom_code VARCHAR2(10) := 'EA'; lv_register_code VARCHAR2(20); ln_inventory_item_id NUMBER; ln_exclusive_price NUMBER; ln_total_non_rate_tax NUMBER := 0; ln_total_inclusive_factor NUMBER; ln_bsln_amt_nr NUMBER :=0; ln_tax_amt_nr NUMBER(38,10) := 0; ln_func_tax_amt NUMBER(38,10) := 0; ln_vamt_nr NUMBER(38,10) := 0; ln_excise_jb NUMBER; ln_total_tax_per_rupee NUMBER; ln_assessable_value NUMBER; ln_vat_assessable_value NUMBER; ln_vat_reversal_price NUMBER; -- ln_gst_assessable_value NUMBER; -- Added by zhiwei for GST 2010/09/14 /*Commented by mmurtuza for removing GST Changes*/ ---------------------------------------------------- p1 num_tab; p2 num_tab; p3 num_tab; p4 num_tab; p5 num_tab;-- Date 01/11/2006 Bug 5228046 added by SACSETHI ( added column from Precedence 6 to 10 ) -- START BUG 5228046 p6 num_tab; p7 num_tab; p8 num_tab; p9 num_tab; p10 num_tab;-- END BUG 5228046 tax_rate_tab num_tab; /* || Aiyer for bug#4691616. Added tax_rate_zero_tab table ------------------------------------------------------------- tax_rate(i) tax_rate_tab(i) tax_rate_zero_tab(i) ------------------------------------------------------------- NULL 0 0 0 0 -9999 n (non-zero and not null) n n ------------------------------------------------------------- */ tax_rate_zero_tab num_tab; tax_type_tab num_tab; qty_rate_tab NUM_TAB; /*By mmurtuza for Bug 14358278*/ tax_amt_tab tax_amt_num_tab; base_tax_amt_tab tax_amt_num_tab; base_tax_amount_nr_tab tax_amt_num_tab; /*Bug 9382657*/ end_date_tab num_tab; rounding_factor_tab num_tab; bsln_amt number; -- := p_tax_amount; --Ramananda for File.Sql.35 v_conversion_rate number := 0; v_currency_conv_factor number; -- := p_currency_conv_factor; --Ramananda for File.Sql.35 v_tax_amt number := 0; vamt number :=0; v_amt number; row_count number := 0; counter number; max_iter number := 10; v_rma_ctr Number; -- variable added by sriram - bug # 2740443 ln_amount NUMBER; --mmurtuza for bug 13473763 --Comment out by Kevin Cheng for inclusive tax Dec 10, 2007 /*CURSOR tax_cur(p_header_id NUMBER, p_line_id NUMBER) IS SELECT c.tax_line_no lno, c.tax_id, c.tax_rate, c.qty_rate, c.uom uom_code, c.func_tax_amount, c.base_tax_amount, c.precedence_1 p_1, c.precedence_2 p_2, c.precedence_3 p_3,c.precedence_4 p_4, c.precedence_5 p_5, c.precedence_6 p_6, c.precedence_7 p_7, c.precedence_8 p_8,c.precedence_9 p_9, c.precedence_10 p_10, -- Date 01/11/2006 Bug 5228046 added by SACSETHI ( added column from Precedence 6 to 10 ) c.tax_amount, d.tax_type, d.end_date valid_date, d.rounding_factor, DECODE(rgm_tax_types.regime_Code,jai_constants.vat_regime, 4, \* added by ssumaith - bug# 4245053*\ decode(upper(d.tax_type), 'EXCISE', 1, 'ADDL. EXCISE', 1, 'OTHER EXCISE', 1, 'CVD', 1, 'TDS', 2, 'EXCISE_EDUCATION_CESS', 1, 'CVD_EDUCATION_CESS', 1, 'SH_EXCISE_EDUCATION_CESS' ,1,--Added by kundan kumar for bug#5907436 'SH_CVD_EDUCATION_CESS' , 1, --Added by kundan kumar for bug#5907436 'VAT REVERSAL', 5,\*Bug#6072461, bduvarag*\ 0 ) ) tax_type_val, d.adhoc_flag FROM JAI_OM_OE_SO_TAXES c , JAI_CMN_TAXES_ALL d , jai_regime_tax_types_v rgm_tax_types \* added by ssumaith - bug# 4245053*\ WHERE c.line_id = p_line_id AND c.header_id = p_header_id AND c.tax_id = d.tax_id AND rgm_tax_types.tax_type (+) = d.tax_type \* added by ssumaith - bug# 4245053*\ ORDER BY c.tax_line_no;*/ --Add by Kevin Cheng for inclusive tax Dec 10, 2007 CURSOR tax_cur( p_header_id NUMBER , p_line_id NUMBER ) IS SELECT c.tax_line_no lno , c.tax_category_id , c.tax_id , c.tax_rate , c.qty_rate , c.uom uom_code , c.func_tax_amount , c.base_tax_amount , c.precedence_1 p_1 , c.precedence_2 p_2 , c.precedence_3 p_3 , c.precedence_4 p_4 , c.precedence_5 p_5 , c.precedence_6 p_6 , c.precedence_7 p_7 , c.precedence_8 p_8 , c.precedence_9 p_9 , c.precedence_10 p_10 -- Date 01/11/2006 Bug 5228046 added by SACSETHI ( added column from Precedence 6 to 10 ) , c.tax_amount , d.tax_type , d.end_date valid_date , nvl(d.rounding_factor,0) rounding_factor , DECODE( rgm_tax_types.regime_Code , jai_constants.vat_regime ,4 /* added by ssumaith - bug# 4245053*/ --, jai_constants.cgst_regime ,7 --Added by zhiwei for bug10043656 GST enhancement 2010/09/14 /*Commented by mmurtuza for removing GST Changes*/ --, jai_constants.sgst_regime ,7 --Added by zhiwei for bug10043656 GST enhancement 2010/09/14 /*Commented by mmurtuza for removing GST Changes*/ , decode( upper(d.tax_type) , 'EXCISE' ,1 , 'ADDL. EXCISE' ,1 , 'OTHER EXCISE' ,1 , jai_constants.tax_type_cvd ,1 , jai_constants.tax_type_tds ,2 , jai_constants.tax_type_exc_edu_cess ,6 , jai_constants.tax_type_cvd_edu_cess ,6 , jai_constants.tax_type_sh_exc_edu_cess ,6 , jai_constants.tax_type_sh_cvd_edu_cess ,6 , 'VAT REVERSAL' ,5/*Bug#6072461, bduvarag*/ , 0 ) ) tax_type_val , d.adhoc_flag , d.vendor_id , d.mod_cr_percentage , d.inclusive_tax_flag FROM Jai_Om_Oe_So_Taxes c , Jai_Cmn_Taxes_All d , Jai_Regime_Tax_Types_V rgm_tax_types /* added by ssumaith - bug# 4245053*/ WHERE c.line_id = p_line_id AND c.header_id = p_header_id AND c.tax_id = d.tax_id AND rgm_tax_types.tax_type(+) = d.tax_type /* added by ssumaith - bug# 4245053*/ ORDER BY c.tax_line_no; -- following cursor added by sriram - bug # 2740443 CURSOR c_rma_info (v_header_id Number , v_line_id Number) is Select 1 from JAI_OM_OE_RMA_LINES where rma_header_id = v_header_id and rma_line_id = v_line_id; --Comment out by Kevin Cheng for inclusive tax Dec 10, 2007 /*CURSOR c_rma_tax_cur(p_line_id NUMBER) IS SELECT c.tax_line_no lno, c.tax_id, c.tax_rate, c.qty_rate, c.uom uom_code, c.func_tax_amount, c.base_tax_amount, c.precedence_1 p_1, c.precedence_2 p_2, c.precedence_3 p_3,c.precedence_4 p_4, c.precedence_5 p_5, c.precedence_6 p_6, c.precedence_7 p_7, c.precedence_8 p_8,c.precedence_9 p_9, c.precedence_10 p_10, -- Date 01/11/2006 Bug 5228046 added by SACSETHI ( added column from Precedence 6 to 10 ) c.tax_amount, d.tax_type, d.end_date valid_date, d.rounding_factor, DECODE(rgm_tax_types.regime_Code,jai_constants.vat_regime, 4, \* added by ssumaith - bug# 4245053*\ decode(upper(d.tax_type),'EXCISE', 1, 'ADDL. EXCISE', 1, 'OTHER EXCISE', 1, 'CVD',1, 'TDS', 2, 0 ) ) tax_type_val, d.adhoc_flag FROM JAI_OM_OE_RMA_TAXES c, JAI_CMN_TAXES_ALL d , jai_regime_tax_types_v rgm_tax_types \* added by ssumaith - bug# 4245053*\ WHERE c.rma_line_id = p_line_id AND c.tax_id = d.tax_id AND rgm_tax_types.tax_type(+) = d.tax_type \* added by ssumaith - bug# 4245053*\ ORDER BY c.tax_line_no;*/ -- Add by Kevin Cheng for inclusive tax Dec 10, 2007 CURSOR c_rma_tax_cur( p_line_id NUMBER ) IS SELECT c.tax_line_no lno , c.tax_id , c.tax_rate , c.qty_rate , c.uom uom_code , c.func_tax_amount , c.base_tax_amount , c.precedence_1 p_1 , c.precedence_2 p_2 , c.precedence_3 p_3 , c.precedence_4 p_4 , c.precedence_5 p_5 , c.precedence_6 p_6 , c.precedence_7 p_7 , c.precedence_8 p_8 , c.precedence_9 p_9 , c.precedence_10 p_10 -- Date 01/11/2006 Bug 5228046 added by SACSETHI ( added column from Precedence 6 to 10 ) , c.tax_amount , d.tax_type , d.end_date valid_date , nvl(d.rounding_factor,0) rounding_factor , DECODE( rgm_tax_types.regime_Code , jai_constants.vat_regime, 4 /* added by ssumaith - bug# 4245053*/ --, jai_constants.cgst_regime ,7 --Added by zhiwei for bug10043656 GST enhancement 2010/09/14 /*Commented by mmurtuza for removing GST Changes*/ --, jai_constants.sgst_regime ,7 --Added by zhiwei for bug10043656 GST enhancement 2010/09/14 /*Commented by mmurtuza for removing GST Changes*/ , decode( upper(d.tax_type) , 'EXCISE' ,1 , 'ADDL. EXCISE' ,1 , 'OTHER EXCISE' ,1 , jai_constants.tax_type_cvd ,1 , jai_constants.tax_type_tds ,2 , jai_constants.tax_type_exc_edu_cess ,6 , jai_constants.tax_type_cvd_edu_cess ,6 , jai_constants.tax_type_sh_exc_edu_cess ,6 , jai_constants.tax_type_sh_cvd_edu_cess ,6 , 'VAT REVERSAL' ,5/*Bug#6072461, bduvarag*/ , 0 ) ) tax_type_val , d.adhoc_flag , d.vendor_id , d.mod_cr_percentage , d.inclusive_tax_flag FROM Jai_Om_Oe_Rma_Taxes c , Jai_Cmn_Taxes_All d , Jai_Regime_Tax_Types_V rgm_tax_types /* added by ssumaith - bug# 4245053*/ WHERE c.rma_line_id = p_line_id AND c.tax_id = d.tax_id AND rgm_tax_types.tax_type(+) = d.tax_type /* added by ssumaith - bug# 4245053*/ ORDER BY c.tax_line_no; -- Start of bug 3590208 /***************** Code modified by aiyer for the bug 3590208 Check whether the excise exemptions exist at the order line level. *****************/ CURSOR c_excise_exemption IS SELECT '1' FROM JAI_OM_OE_SO_LINES jsl WHERE jsl.excise_exempt_type IS NOT NULL AND jsl.line_id = p_line_id ; lv_excise_exemption_exists VARCHAR2(1); -- End of bug 3590208 lv_object_name CONSTANT VARCHAR2 (61) := 'jai_om_tax_pkg.calculate_ato_taxes'; /* Start Additions by mmurtuza for bug 14031594*/ CURSOR get_adhoc_flag(pn_tax_id NUMBER) IS SELECT adhoc_flag FROM jai_cmn_taxes_all WHERE tax_id = pn_tax_id; lv_adhoc_flag VARCHAR2(1); /* End Additions by mmurtuza for bug 14031594*/ /*Start additions by mmurtuza for bug 14559561*/ CURSOR c_get_vat_exempt_flag(cp_line_id number) IS select vat_exemption_flag from jai_om_oe_so_lines where line_id = cp_line_id; lv_vat_exemption_flag char(1) := 'N'; cursor c_get_base_line_id(cp_line_id oe_order_lines_all.line_id%type) is /*select wdd.source_line_id from wsh_delivery_details wdd, jai_om_oe_rma_lines joorl where wdd.delivery_detail_id = joorl.delivery_detail_id and joorl.rma_line_id = cp_line_id;*//*Changed cursor definition by mmurtuza for bug 17015322*/select jowla.order_line_id, jowla.organization_id, jowla.location_id, jowla.order_header_id from jai_om_wsh_lines_all jowla, jai_om_oe_rma_lines joorl where jowla.delivery_detail_id = joorl.delivery_detail_id and joorl.rma_line_id = cp_line_id; lv_reference_Line_id oe_order_lines_all.Reference_Line_id%type; cursor c_excise_exemption_rma(cp_line_id number) IS select excise_exempt_type from jai_om_oe_so_lines where excise_exempt_type IS NOT NULL AND line_id = cp_line_id; /*End additions by mmurtuza for bug 14559561*/ /*By mmurtuza for bug 16804271 - Start*/ cursor c_check_Vat_type_Tax_exists (cp_tax_type VARCHAR2) IS SELECT 1 FROM jai_regime_tax_types_v WHERE regime_code = jai_constants.vat_regime AND tax_type = cp_tax_type;/* Additions by nkodakan for bug 17831734 starts */ CURSOR get_tax_uom_code(p_header_id NUMBER, p_line_id NUMBER, p_tax_line_no number) IS SELECT jcta.uom_code, joost.tax_line_no FROM jai_cmn_taxes_all jcta, jai_om_oe_so_taxes joost WHERE jcta.tax_id = joost.tax_id AND joost.header_id = p_header_id AND joost.line_id = p_line_id AND joost.tax_line_no = p_tax_line_no;/* Additions by nkodakan for bug 17831734 ends */ v_excise_return_days JAI_CMN_INVENTORY_ORGS.excise_return_days % TYPE; v_sales_return_days JAI_CMN_INVENTORY_ORGS.sales_return_days % TYPE; v_vat_return_days JAI_CMN_INVENTORY_ORGS.vat_return_days % TYPE; v_excise_flag VARCHAR2(1); v_sales_flag VARCHAR2(1); v_vat_flag VARCHAR2(1); v_date_ordered DATE; v_date_confirmed DATE; pv_allow_sales_flag VARCHAR2(1); pv_allow_excise_flag VARCHAR2(1); lv_check_vat_type_exists VARCHAR2(1); tax_type_name CHAR_TAB; /*By mmurtuza for bug 16804271 - End*/ v_tax_uom_code VARCHAR2(3); /* by nkodakan for bug 17831734 */ v_tax_line_no NUMBER; /*Added below cursor and variables by mmurtuza for bug 17015322*/ cursor cur_get_order_type(p_src_header_id NUMBER) IS SELECT order_type_id from oe_order_headers_all where header_id = p_src_header_id; v_order_type_id NUMBER; v_asst_register_id NUMBER; v_register_code VARCHAR2(30); v_organization_id NUMBER;V_location_id NUMBER;v_source_header_id NUMBER; BEGIN jai_cmn_utils_pkg.write_fnd_log_msg('JAI_OM_TAX_PKG.CALCULATE_ATO_TAXES','481 begin of CALCULATE_ATO_TAXES procedure ');/*------------------------------------------------------------------------------------------ FILENAME: calculate_ato_taxes_P.sqlCHANGE HISTORY:S.No Date Author and Details1. 2001/11/09 Anuradha Parthasarathy Parameter p_quantity added To handle Adhoc Types of Taxes.2. 2002/01/03 Anuradha Parthasarathy parameter p_quantity used in place of p_line_quantity for correct calculation of taxes for which the tax_rate is null.3. 2003/01/18 Sriram Bug # 2740443 File Version 615.1 When RMA was done without reference and mofifiers attached to them, taxes were not getting recalculated. Hence wrote code to get the same done by adding 2 cursors and checking if the current header id and line id combination refers to a sales order or rma order . if it corresponds to an rma order , update the JAI_OM_OE_RMA_TAXES table .4. 26-Feb-2004 Aiyer For the Bug #3590208 File Version 619.1 Issue:- Excise Duty Recalculation happens for excise exempted tax lines if the order line quantity is changed. Fix:- Code has been added to set the tax_rate, tax_amount and base_tax_amount to 0 when the Order Line has Excise exemptions and tax is of "Excise" type. The cursor c_excise_exemption has been added for the purpose. Dependency Due to this code :- None5. 09-Aug-2004 Aiyer - Bug #3802074 File Version 115.2 Issue:- Uom based taxes do not get calculated correctly if the qty or price is changed. Reason:- -------- Previous to this fix the uom currency uom conversion would happen only when the transaction uom code and the tax level uom code where in the same uom class. This was not required. This was happening because the UOM calculation was previously happening only for cases of exact match between transaction uom and setup UOM. Fix:- ---- Removed the uom_class_cur for loop which used to check for the same uom class match condition. Now the uom conversion happens at all time. Now if an exact match is not found then the conversion rate between the two uom's is determined and tax amounts are calculated for defaultation. Dependency Due to This Bug:- ---------------------------- The refresh in the India Localization sales order form was not happening properly leading to taxes getting set incorrectly when the tax apply button is clicked (in JAINEORD) post updation of qty in Base apps form. To resolve this the locator logic was removed from the triggers ja_in_oe_order_lines_aiu_trg and ja_in_oe_order_lines_au_trg and a new trigger was created (ja_in_om_locator_aiu_trg). Some fix was also done in JAINEORD.fmb for the same. Hence all these objects should be displatched along with this object, due to functional dependency As this fix is also being taken in the current Due to this the tax was not getting bug6. 2005/03/10 ssumaith - bug# 4245053 - File version 115.3 Taxes under the vat regime needs to be calculated based on the vat assessable value setup done. In the vendor additional information screen and supplier additional information screen, a place has been given to capture the vat assessable value. This needs to be used for the calculation of the taxes registered under vat regime. This change has been done by using the view jai_regime_tax_types_v - and outer joining it with the JAI_CMN_TAXES_ALL table based on the tax type column. A parameter p_vat_assessable_Value NUMBER DEFAULT 0 has been added to the procedure. Dependency due to this bug - Huge This patch should always be accompanied by the VAT consolidated patch - 42450897. 08-Jun-2005 Version 116.3 jai_om_tax -Object is Modified to refer to New DB Entity names in place of Old DB Entity Names as required for CASE COMPLAINCE.8. 13-Jun-2005 File Version: 116.4 Ramananda for bug#4428980. Removal of SQL LITERALs is done9. 01-Jun-2006 Aiyer for bug# 4691616. File Version 120.3 Issue:- UOM based taxes do not get calculated correctly. Solution:- Fwd ported the fix for the bug 4729742. Changed the files JAINTAX1.pld, jai_cmn_tax_dflt.plb and jai_om_tax.plb. 10. 10-Dec-007 Kevin Cheng Update the logic for inclusive tax calculation 11. 05-Mar-08 Jia Li Added clause logic for bug# 6846048 Issue: When unit selling price is changed because of discounts, inclusive taxes are getting added to the tax amount in the JAI_OM_OE_SO_LINES table. So at ship confirm time, comparing the tax amount in the lines table with the sum of exclusive taxes in the taxes table was not matching and hence the trigger was returning an error. Fix: Ensuring that only exclusive taxes are added to the tax amount in the jai_om_oe_so_lines table.12 22-sep-2010 vkaranam for bug#10114559 Issue: TAXES ARE NOT CALCULATED AUTOMATICALLY ON A SPLIT ORDER Reason: Cess and shecess taxe are caluclated as 0. This is due to the base_tax_amt before the tax claculation was 0 due to the rounding function. Fix: -- removed round function for base_tax_amount calculation in calculate_ato_taxes procedure. 13. 12-Jun-2012 mmurtuza for bug 14140327 Issue: EXCISE DUTY IS WRONGLY CALCULATING FOR ISO ORDERS when line is splitted Description: Added condition while calcualting ln_vamt_nr. If ln_bsln_amt_nr = 0, only then p_tax_amount is added 14. 31-Jul-2012 mmurtuza for bug 14358278 Issue: RATE PER QUANTITY TAX AMT POPULATED AS ZERO IN SALES ORDER LOCALIZED SCREEN. Fix: Added a block in calculate_ato_taxes to check if tax_amount for that particular tax is defined or not and assigned the value of tax_amount * qunatity to tax_amt_tab(i) 15. 27-Sep-2012 mmurtuza for bug 14559561 Issue: RMA COPIED ORDER IS INCORRECTLY CALCULATING TAXES Fix: Added cursors c_get_vat_exempt_flag, c_get_base_line_id, c_excise_exemption_rma to check if the base ordre of RMA is excise / vat exempted. Also added code to ensure that vat taxes remain zero for vat exempted sales order even if sales order is updated 16. 28-feb-2013 mmurtuza for bug 16389308 Issue: TAXES ARE NOT GETTING APPLIED PROPERLY WHEN THE SALE ORDER LINE IS SPLITTED Fix: Moved the code to calcualte adhoc taxes in the bgining of procedure arther than calcaulting at the end. 17. 24-May-2013 mmurtuza for bug 16804271 issue: TAX GETTING CALCULATED AFTER 180 DAYS ALSO IN RMA ORDERS Fix: Added parameter p_warehouse_id in PROCEDURE calculate_ato_taxes. Checked for excise / vat return days logic and made teh tax amount as zero. 18. 2-Dec-2013 nkodakan for bug 17831734 Issue : TAXES ARE CALCULATED BASED ON SO UOM INSTEAD OF PRIMARY UOM CONVERSION CLASS DEF Fix : Added a cursor get_tax_uom_code to fetch the uom_code from jai_cmn_taxes_all and if tax uom is not equal to transaction uom then multiply with the proper conversion rate.19. 29-Jan-2014 mmurtuza for bug 17015322 Issue: BOND REGISTER SHOULD NOT BE UPDATED ON RMA OF EXPORT INVOICE.Fix: Added code to make the excise taxes zero in RMA incase the reference order is attached to bond registerFuture Dependencies For the release Of this Object:-(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/A datamodel change )----------------------------------------------------------------------------------------------------------------------------------------------------Current Version Current Bug Dependent Files Version Author Date RemarksOf File On Bug/Patchset Dependent Oncalculate_ato_taxes_p.sql----------------------------------------------------------------------------------------------------------------------------------------------------115.2 3802074 IN60105D2 ja_in_om_locator_aiu_trg.sql 115.1 Aiyer 26-oct-2004 Functional Dependency jai_cmn_utils_pkg.ja_in_set_locator 115.0 ja_in_oe_order_lines_aiu_trg 115.5 ja_in_oe_order_lines_aiu_trg 115.5 JAINEORD.fmb 115.3 calculate_ato_taxes_p.sql 115.2 Aiyer115.3 4245053 IN60106 + ssumaith Service Tax and VAT Infrastructure are created 4146708 + based on the bugs - 4146708 and 4545089 respectively. 4245089*************************************************************************************************************************************************************/ bsln_amt := p_tax_amount; --Ramananda for File.Sql.35 v_currency_conv_factor := p_currency_conv_factor; --Ramananda for File.Sql.35Open c_rma_info(p_header_id,p_line_id);Fetch c_rma_info into v_rma_ctr;close c_rma_info;jai_cmn_utils_pkg.write_fnd_log_msg('JAI_OM_TAX_PKG.JA_IN_RG23I_BALANCE','635 p_header_id '||p_header_id||', p_line_id '||p_line_id||', v_rma_ctr '||v_rma_ctr);-- Start of bug 3590208/*****************Code modified by aiyer for the bug 3590208*****************/OPEN c_excise_exemption;FETCH c_excise_exemption INTO lv_excise_exemption_exists;jai_cmn_utils_pkg.write_fnd_log_msg('JAI_OM_TAX_PKG.JA_IN_RG23I_BALANCE','643 lv_excise_exemption_exists '||lv_excise_exemption_exists||', v_rma_ctr '||v_rma_ctr);-- End of bug 3590208IF NVL(v_rma_ctr,0) = 0 then -- added by sriram - bug # 2740443 abc FOR rec in tax_cur(p_header_id, p_line_id) LOOP p1(rec.lno) := nvl(rec.p_1,-1); p2(rec.lno) := nvl(rec.p_2,-1); p3(rec.lno) := nvl(rec.p_3,-1); p4(rec.lno) := nvl(rec.p_4,-1); p5(rec.lno) := nvl(rec.p_5,-1);-- Date 01/11/2006 Bug 5228046 added by SACSETHI ( added column from Precedence 6 to 10 ) -- START BUG 5228046 p6(rec.lno) := nvl(rec.p_6,-1); p7(rec.lno) := nvl(rec.p_7,-1); p8(rec.lno) := nvl(rec.p_8,-1);/*Added by kunkumar,for bugno5604375,deleted second assignment of p7 */ p9(rec.lno) := nvl(rec.p_9,-1); p10(rec.lno) := nvl(rec.p_10,-1);-- END BUG 5228046jai_cmn_utils_pkg.write_fnd_log_msg('JAI_OM_TAX_PKG.JA_IN_RG23I_BALANCE','666 rec.adhoc_flag '||rec.adhoc_flag||', rec.tax_rate '||rec.tax_rate);lt_adhoc_tax_tab(rec.lno) := nvl(rec.adhoc_flag, 'N'); -- by mmurtuza for bug 16389308 tax_rate_tab(rec.lno) := nvl(rec.tax_rate,0); /* || The following code added by aiyer for the bug 4691616 || Purpose: || rec.tax_rate = 0 means that tax_rate for such a tax line is actually zero (i.e it is not a replacement of null value) || So, when rec.tax_rate = 0, tax_rate_zero_tab is populated with -9999 to identify that this tax_line actually has tax_rate = 0 || To calculate the BASE_TAX_AMOUNT of the taxes whose tax_rate is zero */ IF rec.tax_rate is null THEN /* ||Indicates qty based taxes */ tax_rate_zero_tab(rec.lno) := 0; /*row_count Changed to rec.lno by ssawant for bug 6134057*/ ELSIF rec.tax_rate = 0 THEN /* ||Indicates 0% tax rate becasue a tax can have a rate as 0%. */ tax_rate_zero_tab(rec.lno) := -9999; /*row_count Changed to rec.lno by ssawant for bug 6134057*/ ELSE tax_rate_zero_tab(rec.lno) := rec.tax_rate; /*row_count Changed to rec.lno by ssawant for bug 6134057*/ END IF; tax_type_tab(rec.lno) := rec.tax_type_val; /*row_count Changed to rec.lno by ssawant for bug 6134057*/ /*End of bug 4691616 */ tax_type_name(rec.lno) :=rec.tax_type; -- by mmurtuza for bug 16804271 jai_cmn_utils_pkg.write_fnd_log_msg('JAI_OM_TAX_PKG.JA_IN_RG23I_BALANCE','699 rec.tax_type '||rec.tax_type); tax_type_tab(rec.lno) := rec.tax_type_val; qty_rate_tab(rec.lno) := rec.qty_rate; /*By mmurtuza for Bug 14358278*/ jai_cmn_utils_pkg.write_fnd_log_msg('JAI_OM_TAX_PKG.JA_IN_RG23I_BALANCE','704 rec.tax_type_val '||rec.tax_type_val||', rec.qty_rate '||rec.qty_rate); tax_amt_tab(rec.lno) := 0; base_tax_amt_tab(rec.lno) := 0; rounding_factor_tab(rec.lno) := NVL(rec.rounding_factor, 0); -- Add by Kevin Cheng for inclusive tax Dec 10, 2007 ---------------------------------------------------- lt_tax_rate_per_rupee(rec.lno) := NVL(rec.tax_rate,0)/100; ln_total_tax_per_rupee := 0; lt_inclu_tax_tab(rec.lno) := NVL(rec.inclusive_tax_flag,'N'); lt_tax_amt_rate_tax_tab(rec.lno) := 0; lt_tax_amt_non_rate_tab(rec.lno) := 0; -- tax inclusive ---------------------------------------------------- IF tax_rate_tab(rec.lno) = 0 THEN -- Start of bug 3802074 /* Code added by aiyer for the bug 3802074. Removed the uom_class_cur for loop, as it used to check that the uom conversion should happen only when the transaction uom code and the tax uom code are in the same uom class. This was not required. Now the code check whether an exact match exists between the transaction uom and the setup uom. IF an exact match is found then the conversion rate is equal to 1 else the conversion rate between the two uom's would be determined and tax amounts, base_tax_amounts are calculated for defaultation. */ inv_convert.inv_um_conversion( p_uom_code, rec.uom_code, p_inventory_item_id, v_conversion_rate); IF nvl(v_conversion_rate, 0) '||p_org_id);/*End of bug 5490479 */p_start_order := pn_start_order;p_end_order := pn_end_order ;p_order_type_id := pn_order_type_id;p_ship_from_org_id := pn_ship_from_org_id;/* End of Bug# 4400993 */-- added by cbabu for Bug#2496481, startv_last_update_date := SYSDATE;v_last_updated_by := FND_GLOBAL.USER_ID;v_last_update_login := FND_GLOBAL.LOGIN_ID;-- added by cbabu for Bug#2496481, endFND_FILE.PUT_LINE(FND_FILE.LOG,' Sl. No., Order Number, Header_id , line_id, line_number' ||', ship_to_site_use_id, inventory_item_id, line_quantity, uom_code' ||',warehouse_id, Line_Category_Code, reference_line_id, item_type_code' ||',original_line_reference, unit_selling_price, operating_id, org_id' ||',SOLD_TO_ORG_ID, hsdi, price_list_id, ORDER_CATEGORY_CODE, ORIG_SYS_DOCUMENT_REF' ||',TRANSACTIONAL_CURR_CODE, conversion_type_code, conversion_rate' ||',CONVERSION_RATE_DATE, ORDERED_DATE');FOR rec IN line_details1( p_start_order, p_end_order,p_ship_from_org_id, p_org_id, p_order_type_id) LOOP ------------------------------------------------------------------------ FND_FILE.PUT_LINE(FND_FILE.LOG,ii||', ' || rec.order_number||', '||rec.header_id|| ', '||rec.line_id|| ', '||rec.line_number||', '||rec.SHIP_FROM_ORG_ID ||', '||rec.inventory_item_id|| ', '||rec.ordered_quantity||', '||rec.order_quantity_uom|| ', '||rec.SHIP_FROM_ORG_ID ||', '||rec.Line_Category_Code||', '||rec.reference_line_id|| ', '||rec.item_type_code ||', '||rec.ORIG_SYS_LINE_REF||', '||rec.unit_selling_price||', '||rec.org_id ||', '||rec.org_id1|| ', '||rec.SOLD_TO_ORG_ID||', '||rec.hsdi ||', '||rec.price_list_id||', '||rec.ORDER_CATEGORY_CODE|| ', '||rec.ORIG_SYS_DOCUMENT_REF||', '||rec.TRANSACTIONAL_CURR_CODE ||', '||rec.conversion_type_code||', '||rec.conversion_rate||', '||rec.CONVERSION_RATE_DATE||', '||rec.ORDERED_DATE); ------------------------------------------------------------------------ OPEN get_shipped_line(rec.line_id,rec.header_id); FETCH get_shipped_line INTO v_check_line; CLOSE get_shipped_line; jai_cmn_utils_pkg.write_fnd_log_msg('JAI_OM_TAX_PKG.RECALCULATE_EXCISE_TAXES','4321 rec.line_id '||rec.line_id||', rec.header_id' ||rec.header_id||', v_check_line '||v_check_line); IF v_check_line IS NULL THEN --- zzz v_header_id := rec.header_id; v_line_id := rec.line_id; v_line_number := rec.line_number; v_shipment_number := rec.shipment_number; v_ship_to_site_use_id := rec.SHIP_TO_ORG_ID; v_inventory_item_id := rec.inventory_item_id; v_line_quantity := rec.ordered_quantity; v_uom_code := rec.order_quantity_uom; v_warehouse_id := rec.SHIP_FROM_ORG_ID; jai_cmn_utils_pkg.write_fnd_log_msg('JAI_OM_TAX_PKG.RECALCULATE_EXCISE_TAXES','4335 v_header_id '||rec.header_id||', v_line_id '||rec.line_id|| ', v_line_number '||rec.line_number|| ', v_shipment_number '||rec.shipment_number|| ', v_ship_to_site_use_id '||rec.SHIP_TO_ORG_ID|| ', v_inventory_item_id '||rec.inventory_item_id|| ', v_line_quantity '||rec.ordered_quantity|| ', v_line_quantity '||rec.ordered_quantity|| ', v_uom_code '||rec.order_quantity_uom|| ', v_warehouse_id '||rec.SHIP_FROM_ORG_ID); /* commented for cbabu for Bug#2496481 v_creation_date := rec.creation_date; v_created_by := rec.created_by; v_last_update_date := rec.last_update_date; v_last_updated_by := rec.last_updated_by; v_last_update_login := rec.last_update_login; v_original_system_line_ref := rec.ORIG_SYS_LINE_REF; v_original_line_reference := rec.ORIG_SYS_LINE_REF; v_split_from_line_id := null; v_source_document_id := null; v_source_document_line_id := null; */ v_source_document_type_id := rec.source_document_type_id; v_Line_Category_Code := rec.Line_Category_Code; v_reference_line_id := rec.reference_line_id; v_item_type_code := rec.item_type_code; v_unit_selling_price := rec.unit_selling_price; v_operating_id := rec.org_id; v_old_assessable_value := rec.assessable_value; v_line_amount := nvl(v_line_quantity,0) * nvl(v_unit_selling_price,0); jai_cmn_utils_pkg.write_fnd_log_msg('JAI_OM_TAX_PKG.RECALCULATE_EXCISE_TAXES','4367 v_line_amount '||v_line_amount); FND_FILE.PUT_LINE(FND_FILE.LOG,ii|| ', 1 v_line_amount = ' ||v_line_amount) ; v_org_id := rec.org_id1; v_customer_id := rec.sold_to_org_id; /* commented for cbabu for Bug#2496481 v_source_header_id := rec.hsdi; */ v_order_number := rec.order_number; v_price_list_id := rec.price_list_id; v_order_category := rec.order_category_code; v_original_system_reference := rec.orig_sys_document_ref; v_currency_code := rec.transactional_curr_code; v_conv_type_code := rec.conversion_type_code; v_conv_rate := rec.conversion_rate; v_conv_date := rec.conversion_rate_date; v_date_ordered := rec.ordered_date; IF v_conv_date IS NULL THEN v_conv_date := v_date_ordered; END IF; jai_cmn_utils_pkg.write_fnd_log_msg('JAI_OM_TAX_PKG.RECALCULATE_EXCISE_TAXES','4392 v_date_ordered '||v_date_ordered); Open Get_Order_Source_Type(v_source_document_type_id); Fetch Get_Order_Source_Type Into v_order_source_type; Close Get_Order_Source_Type; jai_cmn_utils_pkg.write_fnd_log_msg('JAI_OM_TAX_PKG.RECALCULATE_EXCISE_TAXES','4397 v_source_document_type_id '||v_source_document_type_id|| ', v_order_source_type '||v_order_source_type); jai_cmn_utils_pkg.write_fnd_log_msg('JAI_OM_TAX_PKG.RECALCULATE_EXCISE_TAXES','4400 v_item_type_code '||v_item_type_code|| ', v_reference_line_id '||v_reference_line_id|| ', v_order_category '||v_order_category|| ', v_order_source_type '||v_order_source_type|| ', v_line_category_code '||v_line_category_code); IF v_item_type_code = 'STANDARD' AND (v_reference_line_id IS NOT NULL or v_order_category = 'RETURN') -- AND nvl(v_source_document_type_id,0) != 2 AND UPPER(v_order_source_type) 'COPY' THEN --- aaa -- if execution enters here, it means it is a return order which need not be considered for recalculation --return; null; FND_FILE.PUT_LINE(FND_FILE.LOG,ii||', 2 , returning v_item_type_code = '||v_item_type_code||', v_order_category = '||v_order_category||', v_reference_line_id = '||v_reference_line_id); ELSIF v_line_category_code in ('ORDER') THEN --- aaa, compute assessable value /* Bug 5243532. Added by Lakshmi Gopalsami * Removed the cursor set_of_books_cur and implemented using caching logic. */ l_func_curr_det := jai_plsql_cache_pkg.return_sob_curr (p_org_id => v_warehouse_id ); v_set_of_books_id := l_func_curr_det.ledger_id; v_converted_rate := jai_cmn_utils_pkg.currency_conversion (v_set_of_books_id , v_currency_code, v_conv_date , v_conv_type_code, v_conv_rate); OPEN address_cur(v_ship_to_site_use_id); FETCH address_cur INTO v_address_id; CLOSE address_cur; jai_cmn_utils_pkg.write_fnd_log_msg('JAI_OM_TAX_PKG.RECALCULATE_EXCISE_TAXES','4428 v_ship_to_site_use_id '||v_ship_to_site_use_id||', v_address_id '||v_address_id); FND_FILE.PUT_LINE(FND_FILE.LOG,ii||' 3 v_address_id = '||v_address_id||', 121 v_customer_id = '||v_customer_id); -- Fetch Assessable Price List Value for the -- given Customer and Location Combination -- OPEN Get_Assessable_Value_Cur(v_customer_id, v_address_id, v_inventory_item_id, v_uom_code, v_date_ordered); /* Modified by Ramananda for removal of SQL LITERALs :bug#4428980 --added to_char*/ OPEN Get_Assessable_Value_Cur(v_customer_id, v_address_id, to_char(v_inventory_item_id), v_uom_code, v_assessable_value_date); -- cbabu for Bug#2496494 FETCH Get_Assessable_Value_Cur INTO v_assessable_value, v_price_list_uom_code; CLOSE Get_Assessable_Value_Cur; jai_cmn_utils_pkg.write_fnd_log_msg('JAI_OM_TAX_PKG.RECALCULATE_EXCISE_TAXES','4438 v_customer_id '||v_customer_id||', v_address_id '||v_address_id|| ', v_inventory_item_id '||v_inventory_item_id||', v_uom_code '||v_uom_code|| ', v_assessable_value_date '||v_assessable_value_date|| ', v_assessable_value '||v_assessable_value|| ', v_price_list_uom_code '||v_price_list_uom_code); IF v_assessable_value IS NULL THEN --5 -- Fetch Assessable Price List Value for the -- given Customer and NULL LOCATION Combination -- OPEN Get_Assessable_Value_Cur(v_customer_id, 0, v_inventory_item_id, v_uom_code, v_date_ordered); /* Modified by Ramananda for removal of SQL LITERALs :bug#4428980 --added to_char*/ OPEN Get_Assessable_Value_Cur(v_customer_id, 0, to_char(v_inventory_item_id), v_uom_code, v_assessable_value_date); -- cbabu for Bug#2496494 FETCH Get_Assessable_Value_Cur INTO v_assessable_value, v_price_list_uom_code; CLOSE Get_Assessable_Value_Cur; jai_cmn_utils_pkg.write_fnd_log_msg('JAI_OM_TAX_PKG.RECALCULATE_EXCISE_TAXES','4452 v_assessable_value '||v_assessable_value||', v_price_list_uom_code '||v_price_list_uom_code); FND_FILE.PUT_LINE(FND_FILE.LOG,ii||' 4 v_assessable_value = '||v_assessable_value); END IF; --5 FND_FILE.PUT_LINE(FND_FILE.LOG,ii||' 5 , v_assessable_value = '||v_assessable_value||', v_price_list_uom_code = '||v_price_list_uom_code); IF NVL(v_assessable_value,0) > 0 THEN --6 -- If still the Assessable Value is available IF v_price_list_uom_code IS NOT NULL THEN --7 FND_FILE.PUT_LINE(FND_FILE.LOG,ii||' 6 , v_uom_code = '||v_uom_code||', v_inventory_item_id = '||v_inventory_item_id||', v_conversion_rate = '||v_conversion_rate); INV_CONVERT.inv_um_conversion(v_uom_code, v_price_list_uom_code, v_inventory_item_id, v_conversion_rate); IF nvl(v_conversion_rate, 0) v_ship_to_site_use_id , p_inventory_item_id => v_inventory_item_id , p_uom_code => v_uom_code , p_default_price => v_unit_selling_price , p_ass_value_date => v_date_ordered , p_party_type => 'C' ); ln_vat_assessable_value := nvl(ln_vat_assessable_value,0) * v_line_quantity; jai_cmn_utils_pkg.write_fnd_log_msg('JAI_OM_TAX_PKG.RECALCULATE_EXCISE_TAXES','4538 ln_vat_assessable_value '||ln_vat_assessable_value||', v_line_quantity '||v_line_quantity); /* End OF Bug# 4400993 */ --Added by zhiwei for bug10043656 GST enhancement 2010/09/14 begin --------------------------------------------------- /*Start Commenting by mmurtuza for removing GST Changes*/ /*ln_gst_assessable_value := JAI_GST_GENERAL_PKG.GET_GST_ASSESSABLE_VALUE ( p_party_id => v_customer_id , p_party_site_id => v_ship_to_site_use_id , p_inventory_item_id => v_inventory_item_id , p_uom_code => v_uom_code , p_default_price => v_unit_selling_price , p_ass_value_date => v_date_ordered , p_party_type => 'C' ); ln_gst_assessable_value := nvl(ln_gst_assessable_value,0) * v_line_quantity;*/ /*End Commenting by mmurtuza for removing GST Changes*/ --------------------------------------------------- --Added by zhiwei for bug10043656 GST enhancement 2010/09/14 end jai_om_tax_pkg.recalculate_oe_taxes ( v_header_id, v_line_id, v_assessable_amount, ln_vat_assessable_value , /* Added by Brathod for Bug# 4400993, Ramananda for Bug#4540783 */ v_line_tax_amount, v_inventory_item_id, v_line_quantity, v_uom_code, v_converted_rate, v_last_update_date, v_last_updated_by, v_last_update_login --,ln_gst_assessable_value --Added by zhiwei for bug10043656 GST enhancement 2010/09/14 /*Commented by mmurtuza for removing GST Changes*/ ); -- added by cbabu for Bug#2496481, end UPDATE JAI_OM_OE_SO_LINES SET assessable_value = v_assessable_value, tax_amount = nvl(v_line_tax_amount,0), line_amount = v_line_amount, line_tot_amount = v_line_amount + nvl(v_line_tax_amount,0), last_update_date = v_last_update_date, last_updated_by = v_last_updated_by, last_update_login = v_last_update_login WHERE line_id = v_line_id and header_id = v_header_id; jai_cmn_utils_pkg.write_fnd_log_msg('JAI_OM_TAX_PKG.RECALCULATE_EXCISE_TAXES','4588 UPDATE JAI_OM_OE_SO_LINES v_assessable_value '||v_assessable_value||', v_line_tax_amount '||v_line_tax_amount|| ', v_line_id '||v_line_id||', v_header_id '||v_header_id); END IF; ---bbb END IF; ---aaa FND_FILE.PUT_LINE(FND_FILE.LOG,ii||' 14'); ------------------------------------------------------------------------ v_original_system_reference := null; v_customer_id := null; v_address_id := null; v_price_list_id := null; v_org_id := null; v_order_number := null; v_conv_type_code := null; v_conv_rate := null; v_conv_date := null; v_conv_factor := null; v_set_of_books_id := null; v_tax_category_id := null; v_order_category := null; v_line_amount := 0; /* commented by cbabu for Bug#2496481 v_source_header_id := null; v_source_order_category := null; v_source_id := null; */ v_assessable_value := null; v_assessable_amount := null; v_price_list_uom_code := null; v_converted_rate := null; v_date_ordered := null; v_ordered_date := null; v_line_tax_amount := 0; v_conversion_rate := 0; v_currency_code := null; v_order_source_type := null; v_source_document_type_id := null; v_org_id := null; v_customer_id := null; v_order_number := null; v_price_list_id := null; v_order_category := null; v_original_system_reference := null; v_currency_code := null; v_conv_type_code := null; v_conv_rate := null; v_conv_date := null; v_date_ordered := null; ------------------------------------------------------------------------ END IF; --- zzz v_check_line := null; ii := ii + 1;END LOOP;COMMIT;FND_FILE.PUT_LINE(FND_FILE.LOG,'END of the procedure JA_IN_ASSESSABLE_PRICE_CHANGE');EXCEPTION WHEN OTHERS THEN jai_cmn_utils_pkg.write_fnd_log_msg('JAI_OM_TAX_PKG.RECALCULATE_EXCISE_TAXES','4650 Exception occured in RECALCULATE_EXCISE_TAXES procedure sqlcode '||sqlcode||', sqlerrm '||sqlerrm); FND_MESSAGE.SET_NAME ('JA','JAI_EXCEPTION_OCCURED'); FND_MESSAGE.SET_TOKEN ('JAI_PROCESS_MSG',lv_object_name ||'.Err:'||sqlerrm); app_exception.raise_exception;END recalculate_excise_taxes;END jai_om_tax_pkg;/COMMIT;EXIT;