India Localization Query

Embed Size (px)

DESCRIPTION

India Localization

Citation preview

REM +======================================================================+REM | Copyright (c) 1996 Oracle Corporation Redwood Shores, California, USA|REM | All rights reserved. |REM +======================================================================+REM NAME JAI_JAR_TL_TRIGGER_PKGREMREM DESCRIPTION PackageREMREM NOTESREMREM HISTORYREM Bug 4938350. Added by Lakshmi GopalsamiREM Fixed performance issue - SQL id - 14828911REM (1) Removed the sub-query andREM replaced with oe_transaction_types_tl inREM cursor register_code_cur1.REM (2) Removed the parameter p_order_number from the cursor.REMREM Bug 5243532 Added by Lakshmi GopalsamiREM Removed the reference to cursor set_of_books_cur andREM implemented caching logic for getting SOBREM +======================================================================+REM dbdrv: sql ~PROD ~PATH ~FILE none none none sqlplus &phase=plb+1 checkfile(120.22.12010000.18=120.39):~PROD:~PATH:~FILESET VERIFY OFFWHENEVER SQLERROR EXIT FAILURE ROLLBACK;WHENEVER OSERROR EXIT FAILURE ROLLBACK;CREATE OR REPLACE PACKAGE BODY JAI_JAR_TL_TRIGGER_PKG AS/* $Header: jai_jar_tl_t.plb 120.44.12020000.6 2013/04/25 07:21:53 mmurtuza ship $ */ --Added by Wenqiong for Bug 14253668 Begin ---------------------------------------------------------------------------- FUNCTION get_ar_trx_type(pn_customer_trx_line_id IN NUMBER) RETURN VARCHAR2 ISPRAGMA AUTONOMOUS_TRANSACTION; CURSOR check_trx_type IS SELECT trx_types.type FROM ra_customer_trx_lines_all trxl , ra_customer_trx_all trx , ra_cust_trx_types_all trx_types WHERE trxl.customer_trx_id = trx.customer_trx_id AND trx_types.cust_trx_type_id = trx.cust_trx_type_id AND trxl.customer_trx_line_id = pn_customer_trx_line_id; lv_trx_type ra_cust_trx_types_all.type%TYPE; BEGIN OPEN check_trx_type; FETCH check_trx_type INTO lv_trx_type; CLOSE check_trx_type; RETURN lv_trx_type; END get_ar_trx_type; ---------------------------------------------------------------------------- --Added by Wenqiong for Bug 14253668 End/* REM +======================================================================+ REM NAME ARI_T1 REM REM DESCRIPTION Called from trigger JAI_JAR_TL_ARIUD_T1 REM REM NOTES Refers to old trigger JAI_JAR_TL_ARI_T1 REM REM +======================================================================+*/ 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 v_line_no NUMBER := 0; v_books_id NUMBER := 1; v_salesrep_id NUMBER; v_line_type VARCHAR2(30); v_vat_tax NUMBER; v_ccid NUMBER; v_cust_trx_line_id RA_CUSTOMER_TRX_LINES_ALL.customer_trx_line_id%TYPE; /* commented by rallamse bug#4479131 PADDR Elimination v_paddr v$session.paddr%TYPE; */ v_customer_trx_line_id NUMBER; -- := pr_new.customer_trx_line_id; --Ramananda for File.Sql.35 v_customer_trx_id NUMBER; -- := pr_new.customer_trx_id; --Ramananda for File.Sql.35 v_created_from VARCHAR2(30); c_from_currency_code VARCHAR2(15); c_conversion_type VARCHAR2(30); c_conversion_date DATE; c_conversion_rate NUMBER := 0; v_converted_rate NUMBER := 1; req_id NUMBER; result BOOLEAN; v_organization_id NUMBER ; v_location_id NUMBER ; v_batch_source_id NUMBER ; v_register_code VARCHAR2(50); v_order_number ra_customer_trx_all.interface_header_attribute1%type; /*for bug 14089006. Earlier size was varchar2(30)*/ v_order_type ra_customer_trx_all.interface_header_attribute2%type; v_org_id NUMBER(15); -- added by sriram because the orgid value is not going into temp_lines_insert table v_tax_exists NUMBER :=0; --added by mmurtuza for bug 13042890 --v_ORDER_PRICE_EXCISE_INCLUSIVE JAI_CMN_INVENTORY_ORGS.ORDER_PRICE_EXCISE_INCLUSIVE%type; ---- Deleted by Jia Li for Tax inclusive Computations on 2007/11/22, TD18 ln_inv_curr_precision NUMBER; /* added by CSahoo - bug# 5364120*/ --commented by kunkumar for bug#6066813 lv_intf_hdr_ctx ra_customer_trx_all.interface_header_context%type; /* bug# 6012570 (5876390) */ /*Bug 11821537 - Fetch the effective date on which Service Tax needs to accounted in accrual basis instead of cash - Start*/ ld_st_accrual_date DATE; ld_trx_date DATE;--Commented by Chong.Lei for POT code port begin/* CURSOR c_get_st_accrual_date (p_regime_id NUMBER) IS SELECT to_date(attribute_value, 'DD/MM/YYYY') FROM jai_rgm_registrations WHERE regime_id = p_regime_id AND attribute_code = 'EFF_DATE_ST_PT' AND attribute_type_code = 'OTHERS' AND registration_type = 'OTHERS'; CURSOR c_get_trx_date IS SELECT trx_date FROM ra_customer_trx_all WHERE customer_trx_id = v_customer_trx_id; */--Commented by Chong.Lei for POT code port end--Added by Chong.Lei for POT code port begin------------------------------------------------------------------------------------------------------------------- /*Bug 12805386 - Fetch Effective Date of Point of Taxation only if Organization Type is either 'INDIVIDUALS' or 'PARTNERSHIP FIRM' or 'PROPRIETARY FIRM' and if the Service Type is one mentioned in Rule 7 of Point of Taxation Rules 2011 i.e 105-p, 105-q, 105-s, 105-t, 105-u, 105-za, 105-zzzzm*/ CURSOR c_get_st_accrual_date(p_regime_id NUMBER, p_organization_id NUMBER, p_location_id NUMBER) IS select to_date(attribute_value, 'DD/MM/YYYY') from JAI_RGM_ORG_REGNS_V where regime_id = p_regime_id and organization_id = p_organization_id and location_id = p_location_id AND attribute_code = 'EFF_DATE_ST_PT' AND attribute_type_code = 'OTHERS' AND registration_type = 'OTHERS' AND (NOT EXISTS (select '1' from JAI_RGM_ORG_REGNS_V where regime_id = p_regime_id and attribute_code IN 'INV_ORG_CLASSIFICATION' and attribute_value 'ORGANIZATION' and organization_id = p_organization_id and location_id = p_location_id) OR NOT EXISTS (select '1' from JAI_RGM_ORG_REGNS_V where regime_id = p_regime_id and attribute_code IN 'SERVICE TYPE' and attribute_value 'OTHER' and organization_id = p_organization_id and location_id = p_location_id) ); CURSOR c_get_trx_date IS SELECT gl_date --Xiao for POT changes, reg bug#12533434 FROM ra_cust_trx_line_gl_dist_all WHERE customer_trx_id = v_customer_trx_id AND customer_trx_line_id = v_customer_trx_line_id AND account_class = 'REV';--Xiao for POT changes, reg bug#12533434---------------------------------------------------------------------------------------------------------------------Added by Chong.Lei for POT code port end /*Bug 11821537 - End*/ /* added by CSahoo - bug# 5364120*/ CURSOR c_inv_curr_precision(cp_currency_code varchar2) IS SELECT NVL(minimum_accountable_unit,NVL(precision,2)) curr_precision FROM fnd_currencies WHERE currency_code = cp_currency_code; CURSOR tax_type_cur IS SELECT a.tax_id taxid , a.tax_rate , a.uom uom , a.tax_amount tax_amt , b.tax_type t_type , a.customer_trx_line_id line_id , a.tax_line_no tax_line_no -- added by sriram - 10/4/2003 - bug # 2769439 FROM JAI_AR_TRX_TAX_LINES a , JAI_CMN_TAXES_ALL b WHERE link_to_cust_trx_line_id = v_customer_trx_line_id AND a.tax_id = b.tax_id and nvl(b.reverse_charge_flag,'N') = 'N' --Added by Qiong for reverse charge bug#16001407 /*Bug 11936630 - Inclusive taxes are not interfaced in GL if Order contains only Inclusive Taxes*/ --AND NVL(b.inclusive_tax_flag,'N') = 'N' --Added by Jia Li for Tax inclusive Computations on 2007/11/22, TD11 ORDER BY 1; /* Bug 4535701. Added by Lakshmi gopalsami * Commented the following cursor as part of PADDR elimiation CURSOR PADDR_CUR IS SELECT A.paddr FROM JAI_CMN_LOCATORS_T A , v$session s WHERE A.PADDR = s.paddr AND s.audsid = USERENV('SESSIONID'); */ CURSOR HEADER_INFO_CUR IS SELECT set_of_books_id, primary_salesrep_id, org_id , invoice_currency_code, exchange_rate_type, exchange_date, exchange_rate --commented by kunkumar for Bug#6066813 ,interface_header_context /* 6012570 (5876390) */ FROM RA_CUSTOMER_TRX_ALL WHERE customer_trx_id = v_customer_trx_id; --Commented for bug#4468353 /* CURSOR VAT_TAX_CUR(cp_tax_code AR_VAT_TAX_ALL.tax_code%type) IS SELECT MAX(vat_tax_id) FROM AR_VAT_TAX_ALL WHERE tax_code = cp_tax_code ; */ /* Added by Ramananda for bug#4468353 , start */ CURSOR ORG_CUR IS SELECT ORG_ID FROM RA_CUSTOMER_TRX_ALL WHERE CUSTOMER_TRX_ID = pr_new.customer_trx_id; lv_tax_regime_code zx_rates_b.tax_regime_code%type ; ln_party_tax_profile_id zx_party_tax_profile.party_tax_profile_id%type ; ln_tax_rate_id zx_rates_b.tax_rate_id%type ; /* Added by Ramananda for bug#4468353 , end */ CURSOR TAX_CCID_CUR(p_tax_id IN NUMBER) IS SELECT tax_account_id FROM JAI_CMN_TAXES_ALL B WHERE B.tax_id = p_tax_id ; CURSOR CREATED_FROM_CUR IS SELECT created_from, interface_header_attribute1,interface_header_attribute2 FROM ra_customer_trx_all WHERE customer_trx_id = v_customer_trx_id; CURSOR SO_AR_HDR_INFO IS SELECT organization_id, location_id, batch_source_id /*uncommented for bug#8775345*/ -- SELECT batch_source_id FROM JAI_AR_TRXS WHERE Customer_Trx_ID = v_customer_trx_id; --cursor added for bug 8775345 CURSOR get_batch_src_id IS SELECT batch_source_id FROM JAI_AR_TRXS WHERE Customer_Trx_ID = v_customer_trx_id; --start additions for bug#7661892 Cursor c_get_orgn is select warehouse_id,interface_line_attribute6 from ra_interfacE_lines_all where interfacE_line_context= 'ORDER ENTRY' and line_type='LINE' and interface_line_id=v_customer_trx_line_id; --added for bug#9151886 CURSOR c_get_orgn_project IS SELECT a.organization_id, a.location_id FROM jai_pa_draft_invoices a, ra_interface_lines_all b, pa_projects_all c WHERE b.interface_line_context = 'PROJECTS INVOICES' AND b.line_type = 'LINE' AND b.interface_line_attribute1 = c.segment1 AND c.project_id = a.project_id AND a.draft_invoice_num = b.interface_line_attribute2 AND interface_line_id=v_customer_trx_line_id; Cursor c_get_loc(cp_order_line_id varchar2)isselect location_id from jai_om_wsh_lines_all where order_line_id=cp_order_line_id; ln_order_line_id varchar2(30); --end additions for bug#7661892 CURSOR register_code_cur(p_org_id IN NUMBER, p_loc_id IN NUMBER, p_batch_source_id IN NUMBER) IS SELECT register_code FROM JAI_OM_OE_BOND_REG_HDRS WHERE organization_id = p_org_id AND location_id = p_loc_id AND register_id IN (SELECT register_id FROM JAI_OM_OE_BOND_REG_DTLS WHERE order_type_id = p_batch_source_id AND order_flag = 'N'); /* Bug 4938350. Added by Lakshmi Gopalsami Removed the sub-query and added oe_transaction_types_tl Removed parameter p_order_number */ CURSOR register_code_cur1(p_organization_id NUMBER, p_location_id NUMBER, p_order_type varchar2) IS SELECT A.register_code FROM JAI_OM_OE_BOND_REG_HDRS A, JAI_OM_OE_BOND_REG_DTLS b, oe_transaction_types_tl ott WHERE A.organization_id = p_organization_id AND A.location_id = p_location_id AND A.register_id = b.register_id AND b.order_flag = 'Y' AND b.order_type_id = ott.transaction_type_id AND ott.NAME = p_order_type; /* Bug 5243532. Added by Lakshmi Gopalsami * Removed cursor set_of_books_cur and c_opr_set_of_books_id * and implemented caching logic. */ CURSOR trx_num(v_cust_trx_id NUMBER) IS SELECT trx_number FROM ra_customer_trx_all WHERE customer_trx_id = v_cust_trx_id; -- following cursor added by sriram -3266982 -- Deleted by Jia Li for Tax inclusive Computations on 2007/11/22 Begin -- TD18-changed Trading AR Invoice ------------------------------------------------------------------------- /* cursor c_ORDER_PRICE_EXCISE_INCLUSIVE(p_organization_id number,p_location_id number) is select ORDER_PRICE_EXCISE_INCLUSIVE from JAI_CMN_INVENTORY_ORGS where organization_id = p_organization_id and location_id = p_location_id; */ ------------------------------------------------------------------------- -- Deleted by Jia Li for Tax inclusive Computations on 2007/11/22 End CURSOR cur_chk_rgm ( cp_tax_type JAI_CMN_TAXES_ALL.TAX_TYPE%TYPE ) IS SELECT regime_id , regime_code FROM jai_regime_tax_types_v jrttv WHERE upper(jrttv.tax_type) = upper(cp_tax_type); ln_regime_code JAI_RGM_DEFINITIONS.REGIME_CODE%TYPE; lv_attr_value JAI_RGM_REGISTRATIONS.ATTRIBUTE_VALUE%TYPE; -- Start of bug 4089440 ln_regime_id JAI_RGM_DEFINITIONS.REGIME_ID%TYPE ; lv_error_flag VARCHAR2(2) ; lv_error_message VARCHAR2(4000) ; -- End of bug 4089440 v_err_mesg VARCHAR2(250) ; v_trx_num ra_customer_trx_all.trx_number%TYPE ; /* Bug 5243532. Added by Lakshmi Gopalsami * Defined variable for implementing caching logic */ l_func_curr_det jai_plsql_cache_pkg.func_curr_details; --Added by Bo Li for Bug 9705313 Begin ---------------------------------------------------------------------------- CURSOR check_rma_credit_cur(-- pn_order_number NUMBER /*Commented order number parameter by mmurtuza for bug 14846750*/ pn_order_line_id NUMBER) IS SELECT count(1) FROM OE_ORDER_HEADERS_ALL oh, OE_ORDER_LINES_ALL ol, OE_TRANSACTION_TYPES_TL ot, oe_workflow_assignments owf WHERE oh.header_id = ol.header_id AND oh.order_type_id = ot.transaction_type_id AND oh.order_type_id = owf.order_type_id AND ol.line_type_id = owf.line_type_id -- AND oh.order_number = pn_order_number /*Commented order number condition by mmurtuza for bug 14846750*/ AND ot.language = userenv('LANG') AND ol.line_id = pn_order_line_id AND owf.process_name IN ('R_RMA_CREDIT_APP_HDR_INV', 'R_RMA_CREDIT_WO_SHIP_APPROVE', 'R_RMA_CREDIT_WO_SHIP_HDR_INV', 'R_RMA_FOR_CREDIT_WO_SHIPMENT', 'R_RMA_FOR_OTA_CREDIT'); CURSOR check_shippable_item_cur(pn_order_line_id NUMBER) IS SELECT COUNT(1) FROM MTL_SYSTEM_ITEMS msi, JAI_OM_OE_RMA_LINES l WHERE msi.inventory_item_id = pr_new.inventory_item_id AND msi.inventory_item_id = l.inventory_item_id AND l.rma_line_id = pn_order_line_id AND msi.shippable_item_flag = 'N' ; ln_rma_flag NUMBER; ln_nonship_rma_flag NUMBER; ---------------------------------------------------------------------------- --Added by Bo Li for Bug 9705313 End -- Added by zhiwei for GST get ccid by regime setup BUG#10233402 20101027 BEGIN ------------------------------------------------------------------ lv_enable_gst_flag VARCHAR2(1); CURSOR get_gst_organization_location(cn_customer_trx_id IN NUMBER)--v_customer_trx_line_id IS SELECT ORGANIZATION_ID,LOCATION_ID FROM JAI_AR_TRXS WHERE CUSTOMER_TRX_ID = cn_customer_trx_id; lv_log VARCHAR2(1000); x number; CURSOR GET_COUNT(cn_customer_trx_line_id IN NUMBER)is SELECT COUNT(1) FROM JAI_AR_TRX_TAX_LINES WHERE link_to_cust_trx_line_id = cn_customer_trx_line_id ; ln_tax_type_code varchar2(50); ------------------------------------------------------------------ -- Added by zhiwei for GST get ccid by regime setup BUG#10233402 20101027 END lv_trx_type ra_cust_trx_types_all.type%TYPE; --Added by Wenqiong for Bug 14253668 BEGIN pv_return_code := jai_constants.successful ; /*------------------------------------------------------------------------------------------ FILENAME: JA_IN_APPS_AR_LINES_INSERT_TRG.sql CHANGE HISTORY:S.No Date Author and Details1. 10-Jun-01 Jagdish / Subbu To populate Tax_rate column in RA_CUSTOMER_TRX_LINES_ALL table as receipts with discounts doesn't get saved.2. 2001/06/22 Anuradha Parthasarathy Commented and Added code for better performance.3. 2002/03/22 RPK added the column error_flag to the table 'JAI_AR_TRX_INS_LINES_T' added the cursor trx_num to get the invoice num.4 2002/04/22 RPK BUG#2334972. Code modified to allow the taxes to be inserted into the table JAI_AR_TRX_INS_LINES_T.When an order line is having 2 tax amounts one with a positive value and the other with a negative value(eg:100 and -100) then these lines were not getting transferred to AR Tables and the same is required to be transferred to have the proper accounting of the GL/AR.For this, the when_clause of this trigger is commented to facilitate the execution of this code.This is required to facilitate the functionality of having discounts in the OM/AR tax flow.5. 2002/05/04 Added the If Condition to ensure that the concurrent request to. AR Tax and Freight Defaultation gets invoked only for manual invoices6. 2002/05/06 Added the Source Column in the insert statement of Ja-In_temp_lines_insert table.8. 2003/04/07 SSUMAITH.Bug # 2779967 column Org id was not inserted in the JAI_AR_TRX_INS_LINES_T table. This needs to be inserted in the table , because when processing the records using the 'India Local Concurrent' only records that belong to the orgid of the current responsiblity needs to be picked up.9. 2003/04/10 SSUMAITH - Bug # 2769439 Also inserting the tax line number in the JAI_AR_TRX_INS_LINES_T table. This is necessary for creating links between OM and AR.10. 2003/11/20 SSUMAITH - Bug # 3266982 File Version 617.1 The cursor which fetches order number was still pointing to So_headers_all table. This caused the query to fetch no records, causing the code not to execute based on register types. This bug introduces dependency . Because as part of this bug , a new column ORDER_PRICE_EXCISE_INCLUSIVE is added into the table - ja_in_hr_organzization_units. If the flag value of ORDER_PRICE_EXCISE_INCLUSIVE becomes 'Y' then the excise tax will go as zero else , the normal excise value will go to the base apps. Also , a join between oe_order_headers_all and oe_transaction_types_tl has been added. Without this join, if the same sales order number is associated to multiple order types, there is scope for the wrong order number to be chosen and comparison done on that basis. With this join condition, the value in the ra_customer_trx_all.interface_header_attribute2 is compared to the 'Name' field in the oe_transaction_types_tl.11. 2005/27/01 aiyer - Bug # 4089440 File Version 115.1 Issue:- In case of service invoices having service/service_education type of taxes the code combination id should be picked up from regime tax setup. This is being done as a part of the service tax enhancement Solution:- The check that, for service type of taxes ccid should be picked up from regime tax setup has been impletemented. Called the procedure jai_ar_rgm_processing_pkg.get_regime_info is being called for regime setup validation. Aslo called the function jai_cmn_rgm_recording_pkg.get_account to get the ccid in such cases. Dependency introduced as a part of this bug:- This file should be released on top of Bug 4146708.12. 01-Mar-2005 aiyer - Bug # 4212816 File Version 115.2 Issue:- In case of invoices having any of the taxes setup for VAT REGIME, the code combination should get picked up from the VAT Regime setup. This is being done as a part of the VAT enhancement Solution:- The check that, for taxes belonging to the VAT regime, ccid should be picked up from VAT regime setup has been impletemented. The account info is fetched using the function jai_cmn_rgm_recording_pkg.get_account. Dependency introduced as a part of this bug:- This file should be released on top of Bug 4245089. Datamodel changes for VAT13. 02-Apr-2005 aiyer - Bug # 4279702 File Version 115.3 Issue:- VAT regime code does not get reinitialized for any tax type which does not fall in the VAT / Service TAx regime Solution:- Changed the triggers ja_in_apps_lines_insert_trg and ja_in_apps_ar_lines_update_trg to reinitialize the regime codes every time processing happens for a tax type. Dependency introduced as a part of this bug:- This file should be released on top of Bug 4245089.14 08-Jun-2005 This Object is Modified to refer to New DB Entity names in place of Old DB Entity as required for CASE COMPLAINCE. Version 116.115. 13-Jun-2005 File Version: 116.2 Ramananda for bug#4428980. Removal of SQL LITERALs is done16 06-Jul-2005 rallamse for bug# PADDR Elimination 1. Commented use of v_paddr and cursor PADDR_CUR17 04-Aug-2005 Bug4535701. Added by Lakshmi Gopalsami Version 120.2 Commented the cursor which is used for PADDR18 25-Jan-2007 CSahoo for Bug#5631784, File Version 120.3 Forward Porting of BUG#4742259 Accounting information popluated for TCS regime19 14-FEB-2007 CSahoo - bug# 5364120 - file version 120.4 Forward Porting Of 11i BUG 5346489. The transaction amounts are rounded based on the currency precision of the invoice currency code when the insert id done in the JAI_AR_TRX_INS_LINES_T. Added the cursor c_inv_curr_precision. Dependency due to this bug :- None19. 15-Feb-2007 CSahoo Bug# 5390583, File Version 120.5 Forward Porting of 11i Bug 5357400 When taxes are added manually to the ar invoice from the transactions localised screen and the batch source is set to bond register, the excise taxes are going to base AR. This should not go. Fix : The code to take care of this was in a trading loop and would never reach there. Modified the code appropriately.20 24/04/2007 cbabu for bug#6012570 (5876390), File Version 120.7 (115.14 ) FP: For project billing bond register functionality is not required hence added a check to see if the invoice is created by projects then bond register related logic should not be executed.21 25/05/2007 sacsethi for bug 6072461 file version 120.11 Problem - MANUAL AR TRANSACTION GIVES PROBLEM WITH VAT TAXES when we creating transactions in receivalbles , at that time at time of saving , it was giving error , vat setup is not defined but vat setup was defined Solution - At time of get account of vat , we were passing wrong value of organzation id and location id . 22. 31/05/2007 csahoo for bug#6081806, File version 120.13 added the sh cess types. 23. 14/06/2007 sacsethi for bug 6072461 for file version - 120.15 This bug is used to fp 11i bug 5183031 for vat reveresal Problem - Vat Reversal Enhancement not forward ported Solution - Changes has been done to make it compatible for vat reversal functioanlity also.24 06-jan-2009 vkaranam for bug# 7661892 Issue: Auto Invoice is landing into error if the Order having the delivery from different warehouses Fix: Changed the query logic to get the organization ,location details.25 08-sep-2009 vkaranam for bug#8775345 Issue: Manual AR invoice is giving an error "Organization Cannot be Null". Fix: Changed the query logic to get the organization ,location details.26. 26-Nov-2009 CSahoo for bug#9151886 Issue: AUTO INVOICE IMPORT ERROR Fix: Added the code to fetch the organization_id and location_id for project invoices.27 11-May-2010 Bug 9705313 Added by Bo Li For nonshippable RMA flow Generate the account for the nonshippable item Tax28 29-Oct-2010 abezgam for bug10176878Issue: When attempting to run Autoinvoice, the following error occurs. 'Invalid Code combination ,please check the Service Tax - Tax Accounting Setup ' Fix: Added an if condition to check if the location_id going into ' jai_ar_rgm_processing_pkg.get_regime_info' is null. If the location_id null, it is fetched using the SO_AR_HDR_INFO cursor. 29 04-Mar-2011 Enhancement 11821537 Description: Notification # 18/2011 proposes change in Point of Taxation for Service Tax. Service Tax Liability arises on creation of Invoice and not on Receipt of Payment from Customer i.e. Accounting changes to Accrual basis from Cash Basis Fix: Service Tax Libility Account will be hit directly instead of Interim Liablity as there will be no set off during Receipt/CM Application. 30 12-Apr-2011 Bug 11936630 Description: Data was inserted into JAI_AR_TRX_INS_LINES_T via tax_type_cur only if there was an Exclusive Tax Line. Hence for Order Imported AR Invoice with only Inclusive Taxes accounting was not happening. Fix: Data to be inserted into JAI_AR_TRX_INS_LINES_T irrespective of Tax Types. 31 18-May-2011 Xiao for POT changes, reg bug#12533434. Issue: Compare transaction date with POT date. fixed: Compare Accounting Date with POT date. Cursor c_get_trx_date is modified. --Added by Chong.Lei for POT code port32. 03-Oct-2011 mmurtuza for bug 13042890Issue: INDIA-AR TAX AND FREIGHT DEFAULTATION IS FIRING WHEN TRANSACTION RAISED IN BASE AR Transaction witout IOL TaxesFix: Added a variable v_tax_exists and Added condition in the trigger to check if taxes exists and the concurrent should fire only if taxes exists. 33. 28-Mar-2012 mmurtuza for bug 13649994Issue: AUTOINVOICE FAILING FOR VAT INVOICES INTERFACED FORM PROJECTSFix: Added if condition to skip the cursors check_rma_credit_cur and check_shippable_item_cur in procedure ARI_T1 if the invoices areimported from projects.34. 18-May-2012 mmurtuza for bug 14089006Issue: ERROR ENCOUNTERED IN TRANSACTION WORKBENCHFix: Mdofied the definition of variable v_order_number from varchar2(30) to ra_customer_trx_all.interface_header_attribute1%type35. 10-Dec-2012 mmurtuza for bug 14846750Issue: INDIA LOCALIZATION ERROR IN AUTO INVOICE IMPORT FOR SUPPLEMENTARY INVOICES.Fix: Removed parameter and condition of order_number in cursor check_rma_credit_cur==========================================================================================================================================================Future 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 Onja_in_apps_ar_lines_insert_trg.sql617.1 3266982 IN60105D1 617.1 ssumaith 03/12/2003115.1 4089440 IN60105D2 + Aiyer 27-Jan-2005 4146708 is the release bug for SERVICE/CESS 4146708 enhancement release115.2 4247989 IN60106 + 4146708 + 4245089 Aiyer 01-Mar-2005 4245089 is the Base bug for VAT. This has datamodel changes for VAT.24. 22/11/2007 Added by Jia Li for Tax inclusive Computations--------------------------------------------------------------------------------------------------------------------------------------------------------*/ v_customer_trx_line_id := pr_new.customer_trx_line_id; --Ramananda for File.Sql.35 v_customer_trx_id := pr_new.customer_trx_id; --Ramananda for File.Sql.35 --added the following block to capture the trx_number on 22-Mar-2002 OPEN trx_num(pr_new.Customer_trx_id); FETCH trx_num INTO v_trx_num; CLOSE trx_num;--end addition 22-Mar-2002 OPEN CREATED_FROM_CUR; FETCH CREATED_FROM_CUR INTO v_created_from , v_order_number, v_order_type; CLOSE CREATED_FROM_CUR; IF v_created_from IN ('ARXREC') THEN RETURN; END IF; /* Commented rallamse bug#4479131 PADDR Elimination OPEN PADDR_CUR; FETCH PADDR_CUR INTO v_paddr; CLOSE PADDR_CUR; */ OPEN HEADER_INFO_CUR; FETCH HEADER_INFO_CUR INTO v_books_id, v_salesrep_id,v_org_id , c_from_currency_code, c_conversion_type, c_conversion_date, c_conversion_rate, lv_intf_hdr_ctx; CLOSE HEADER_INFO_CUR; /* start additions by CSahoo - bug#5364120 */ IF c_from_currency_code IS NOT NULL THEN OPEN c_inv_Curr_precision(c_from_currency_code); FETCH c_inv_curr_precision INTO ln_inv_curr_precision; CLOSE c_inv_curr_precision; END IF; IF ln_inv_curr_precision is NULL THEN ln_inv_curr_precision := 0; END IF; /* end additions by CSahoo - bug#5364120 */ --Commented for bug#4468353 /* OPEN VAT_TAX_CUR('Localization'); FETCH VAT_TAX_CUR INTO v_vat_tax; CLOSE VAT_TAX_CUR; *//* Added by Ramananda for bug# due to ebtax uptake by AR, start */ OPEN ORG_CUR; FETCH ORG_CUR INTO V_ORG_ID; CLOSE ORG_CUR; OPEN jai_ar_trx_pkg.c_tax_regime_code_cur(V_ORG_ID); FETCH jai_ar_trx_pkg.c_tax_regime_code_cur INTO lv_tax_regime_code; CLOSE jai_ar_trx_pkg.c_tax_regime_code_cur ; OPEN jai_ar_trx_pkg.c_max_tax_rate_id_cur(lv_tax_regime_code); FETCH jai_ar_trx_pkg.c_max_tax_rate_id_cur INTO ln_tax_rate_id; CLOSE jai_ar_trx_pkg.c_max_tax_rate_id_cur ;/* Added by Ramananda for bug# due to ebtax uptake by AR, end */ IF v_books_id IS NULL THEN /* 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_org_id ); v_books_id := l_func_curr_det.ledger_id; END IF; v_converted_rate := jai_cmn_utils_pkg.currency_conversion (v_books_id ,c_from_currency_code , c_conversion_date ,c_conversion_type, c_conversion_rate); /* OPEN SO_AR_HDR_INFO ; --FETCH SO_AR_HDR_INFO INTO v_organization_id, v_location_id, v_batch_source_id; commented for bug#7661892 FETCH SO_AR_HDR_INFO INTO v_batch_source_id; CLOSE SO_AR_HDR_INFO ; *//*commented for bug#8775345*/ --start additions for bug#8775345 open get_batch_src_id; fetch get_batch_src_id into v_batch_source_id; close get_batch_src_id; --end additions for bug#8775345 --start additions for bug#7661892 open c_get_orgn; fetch c_get_orgn into v_organization_id,ln_order_line_id; close c_get_orgn; --start additions for bug#8775345 if v_organization_id is null then OPEN SO_AR_HDR_INFO ; FETCH SO_AR_HDR_INFO INTO v_organization_id, v_location_id, v_batch_source_id; CLOSE SO_AR_HDR_INFO ; end if; --end additions for bug#8775345 open c_get_loc(ln_order_line_id); fetch c_get_loc into v_location_id; close c_get_loc; --end additions for bug#7661892 /*Commented by kunkumar for Bug#6066813 Start, Bug 6012570 (5876390) */ if JAI_AR_RCTLA_TRIGGER_PKG.is_this_projects_context (lv_intf_hdr_ctx) then /* For project invoices, there is no bond register functionality, so no need to do any processing for bond registers If line context is not PROJECT INVOICE then continue the normal processing flow */ --null; --added for bug#9151886, start open c_get_orgn_project; fetch c_get_orgn_project into v_organization_id,v_location_id; close c_get_orgn_project; -- bug#9151886,end else -- End commented by kunkumar for bug#6066813 -- End 6012570 (5876390) */fnd_file.put_line(FND_FILE.LOG,'organization id is '|| v_organization_id); fnd_file.put_line(FND_FILE.LOG,'location id is '|| v_location_id);/*added by abezgam for bug10176878*Added the following to get the location_id incase it is Null*/--start additions for the bug10176878 if v_location_id is null then OPEN SO_AR_HDR_INFO ; FETCH SO_AR_HDR_INFO INTO v_organization_id, v_location_id, v_batch_source_id; CLOSE SO_AR_HDR_INFO ; end if;--end additions for the bug10176878 fnd_file.put_line(FND_FILE.LOG,'organization id is '|| v_organization_id); fnd_file.put_line(FND_FILE.LOG,'location id is '|| v_location_id); IF v_created_from = 'RAXTRX' THEN /* Bug 4938350. Added by Lakshmi Gopalsami Removed the parameter v_order_number */ OPEN register_code_cur1(v_organization_id, v_location_id,v_order_type); FETCH register_code_cur1 INTO v_register_code; CLOSE register_code_cur1; ELSIF v_created_from = 'ARXTWMAI' THEN OPEN register_code_cur(v_organization_id, v_location_id, v_batch_source_id); FETCH register_code_cur INTO v_register_code; CLOSE register_code_cur; END IF; -- Deleted by Jia Li for Tax inclusive Computations on 2007/11/22 Begin -- TD18-changed Trading AR Invoice ------------------------------------------------------------------------- /* open c_ORDER_PRICE_EXCISE_INCLUSIVE(v_organization_id, v_location_id); fetch c_ORDER_PRICE_EXCISE_INCLUSIVE into v_ORDER_PRICE_EXCISE_INCLUSIVE; close c_ORDER_PRICE_EXCISE_INCLUSIVE; */ ------------------------------------------------------------------------- -- Deleted by Jia Li for Tax inclusive Computations on 2007/11/22 End --commented by kunkumar for bug#6066813 end if;/* Bug 6012570 (5876390) */ BEGIN --19-MAR-2002 FOR TAX_TYPE_REC IN TAX_TYPE_CUR LOOP /* following if condition added by sriram - bug# 3266982*/ --Added by zhiwei for GST get ccid by regime setup BUG#10233402 20101027 BEGIN ---------------------------------------------------------------------- lv_enable_gst_flag := JAI_GST_GENERAL_PKG.IS_GST_ENABLED; OPEN get_gst_organization_location(v_customer_trx_id); FETCH get_gst_organization_location INTO v_organization_id,v_location_id; CLOSE get_gst_organization_location; IF tax_type_rec.t_type = 'Freight' THEN v_line_type := 'FREIGHT'; ELSE v_line_type := 'TAX'; END IF; ln_regime_id := null; ln_regime_code := null; OPEN cur_chk_rgm ( cp_tax_type => tax_type_rec.t_type); FETCH cur_chk_rgm INTO ln_regime_id,ln_regime_code ; CLOSE cur_chk_rgm ; IF nvl(lv_enable_gst_flag,'N') = 'Y' THEN v_ccid := JAI_GST_GENERAL_PKG.get_gst_accounting( pv_account_source => 'AR' , pv_trx_type => 'MANUAL' , pn_tax_regim_id => ln_regime_id , pv_tax_type_code => tax_type_rec.t_type , pn_tax_id => tax_type_rec.Taxid , pn_organization_id => v_organization_id , pn_location_id => v_location_id ) ; IF v_ccid IS NULL THEN /********************************************************************************************************** || Code Combination id has been returned as null from the function jai_rgm_trx_recording_pkg.get_account || This is an error condition and the current processing has to be stopped **********************************************************************************************************/ raise_application_error (-20130,'Invalid Code combination ,please check the GST Tax - Tax Accounting Setup' || tax_type_rec.t_type || '&&' || tax_type_rec.Taxid); END IF; lv_log := 'get ccid:' || v_ccid; ELSE ---------------------------------------------------------------------- --Added by zhiwei for GST get ccid by regime setup BUG#10233402 20101027 END -- IF nvl(v_ORDER_PRICE_EXCISE_INCLUSIVE,'N') = 'Y' then -- Deleted by Jia Li for Tax inclusive Computations on 2007/11/22 ,TD18/*commented for bug#10048317 as the functionality has been obsoleted as part of inclusive tax ER* IF NVL(v_register_code,'N') IN ('23D_EXPORT_WITHOUT_EXCISE','23D_EXPORT_EXCISE', '23D_DOMESTIC_EXCISE','23D_DOM_WITHOUT_EXCISE','BOND_REG') THEN -- jai_constants.tax_type_sh_exc_edu_cess,jai_constants.tax_type_sh_cvd_edu_cess added by csahoo for bug#6081806 IF Tax_Type_Rec.T_Type IN ('Excise','Addl. Excise','Other Excise','EXCISE_EDUCATION_CESS','CVD_EDUCATION_CESS',jai_constants.tax_type_sh_exc_edu_cess,jai_constants.tax_type_sh_cvd_edu_cess) THEN TAX_TYPE_REC.tax_amt := 0; END IF; END IF; */ -- END IF; -- Deleted by Jia Li for Tax inclusive Computations on 2007/11/22 ,TD18 /* Date 14-jun-2007 by sacsethi for bug 6072461 */ IF ( upper(Tax_Type_Rec.T_Type) = 'VAT REVERSAL' ) THEN TAX_TYPE_REC.tax_amt := 0; END IF; /* || added by CSahoo - bug# 5390583 In case of bond reg , the excise taxes should not go to base AR tables. */ IF NVL(v_register_code,'N') = 'BOND_REG' THEN -- jai_constants.tax_type_sh_exc_edu_cess,jai_constants.tax_type_sh_cvd_edu_cess added by csahoo for bug#6081806 IF upper(Tax_Type_Rec.T_Type) IN ('EXCISE','ADDL. EXCISE','OTHER EXCISE','EXCISE_EDUCATION_CESS','CVD_EDUCATION_CESS',jai_constants.tax_type_sh_exc_edu_cess,jai_constants.tax_type_sh_cvd_edu_cess) THEN TAX_TYPE_REC.tax_amt := 0; END IF; END IF; /* || Ends additions by CSahoo - bug# 5390583 */ IF tax_type_rec.t_type = 'Freight' THEN v_line_type := 'FREIGHT'; ELSE v_line_type := 'TAX'; END IF; /* || Code modified by aiyer for the bug 4279702. || Initializing the regime variables */ ln_regime_id := null; ln_regime_code := null; /* || Get the regime attached to a transaction tax type */ OPEN cur_chk_rgm ( cp_tax_type => tax_type_rec.t_type); FETCH cur_chk_rgm INTO ln_regime_id,ln_regime_code ; CLOSE cur_chk_rgm ; -- Start of bug 4089440 /* || The following code has been added by aiyer for the bug 4089440 || IF tax type is SERVICE or SERVICE-CESS then get the account info from regime setup || IF no setup is found then raise an error and stop the transaction. */ IF upper(tax_type_rec.t_type) = upper(jai_constants.tax_type_service) OR upper(tax_type_rec.t_type) = upper(jai_constants.tax_type_service_edu_cess) OR upper(tax_type_rec.t_type)= upper(jai_constants.tax_type_sh_service_edu_cess) --added by csahoo for bug#6081806 THEN -- Start of A1 /********************************************************************************************************** || Get the regime id and also validate the Regime/Regime Registratiom Setup Information ***********************************************************************************************************/ jai_ar_rgm_processing_pkg.get_regime_info ( p_regime_code => jai_constants.service_regime , p_tax_type_code => tax_type_rec.t_type , p_regime_id => ln_regime_id , p_error_flag => lv_error_flag , p_error_message => lv_error_message ); IF lv_error_flag jai_constants.successful THEN /* || Encountered an error from the call to jai_ar_rgm_processing_pkg.get_regime_info || Stop processing and thorw an error *//* raise_application_error (-20130,lv_error_message); */ pv_return_code := jai_constants.expected_error ; pv_return_message := lv_error_message ; return ; END IF ; /********************************************************************************************************** || Get Tax Account Info from the Regime Organization/Regime Registration setup **********************************************************************************************************/ /* || Get the code combination id from the Organization/Regime Registration setup || by calling the function jai_cmn_rgm_recording_pkg.get_account */ /*ER 11821537 - Service Tax must hit Liability instead of Interim Liability due to change in point of taxation to accural from cash*/-- OPEN c_get_st_accrual_date(ln_regime_id); --Comment by Chong.Lei for POT code port-- Added by Chong.Lei for POT code port begin /*Bug 12805386 - Added parameters Inventory Organization ID and Location ID*/ OPEN c_get_st_accrual_date(ln_regime_id, v_organization_id, v_location_id);-- Added by Chong.Lei for POT code port end FETCH c_get_st_accrual_date INTO ld_st_accrual_date; CLOSE c_get_st_accrual_date; OPEN c_get_trx_date; FETCH c_get_trx_date INTO ld_trx_date; CLOSE c_get_trx_date; --Added by Wenqiong for Bug 14253668 begin ------------------------------------------- lv_trx_type := get_ar_trx_type(v_customer_trx_line_id); ------------------------------------------- --Added by Wenqiong for Bug 14253668 end IF ld_trx_date >= ld_st_accrual_date THEN IF nvl(lv_trx_type,'#') jai_constants.ar_invoice_type_cm THEN--Added by Wenqiong for Bug 14253668 v_ccid := jai_cmn_rgm_recording_pkg.get_account ( p_regime_id => ln_regime_id , p_organization_type => jai_constants.service_tax_orgn_type , p_organization_id => v_organization_id , p_location_id => v_location_id , p_tax_type => tax_type_rec.t_type , p_account_name => jai_constants.liability ); --Added by Wenqiong for Bug 14253668 begin ELSIF nvl(lv_trx_type,'#') = jai_constants.ar_invoice_type_cm THEN v_ccid := jai_cmn_rgm_recording_pkg.get_account ( p_regime_id => ln_regime_id , p_organization_type => jai_constants.service_tax_orgn_type , p_organization_id => v_organization_id , p_location_id => v_location_id , p_tax_type => tax_type_rec.t_type , p_account_name => jai_constants.recovery ); END IF; --Added by Wenqiong for Bug 14253668 end ELSE IF nvl(lv_trx_type,'#') jai_constants.ar_invoice_type_cm THEN --Added by Wenqiong for Bug 14253668 v_ccid := jai_cmn_rgm_recording_pkg.get_account ( p_regime_id => ln_regime_id , p_organization_type => jai_constants.service_tax_orgn_type , p_organization_id => v_organization_id , p_location_id => v_location_id , p_tax_type => tax_type_rec.t_type , p_account_name => jai_constants.liability_interim ); --Added by Wenqiong for Bug 14253668 begin ELSIF nvl(lv_trx_type,'#') = jai_constants.ar_invoice_type_cm THEN v_ccid := jai_cmn_rgm_recording_pkg.get_account ( p_regime_id => ln_regime_id , p_organization_type => jai_constants.service_tax_orgn_type , p_organization_id => v_organization_id , p_location_id => v_location_id , p_tax_type => tax_type_rec.t_type , p_account_name => jai_constants.recovery_interim ); END IF; --Added by Wenqiong for Bug 14253668 end END IF; /*ER 11821537 - End*/ IF v_ccid IS NULL THEN /* || Code Combination id has been returned as null from the function jai_cmn_rgm_recording_pkg.get_account || This is an error condition and the current processing has to be stopped *//* raise_application_error (-20130,'Invalid Code combination ,please check the Service Tax - Tax Accounting Setup'); */ pv_return_code := jai_constants.expected_error ; pv_return_message := 'Invalid Code combination ,please check the Service Tax - Tax Accounting Setup' ; return ; END IF; /* || Start of bug 4212816 || Code modified by aiyer for the VAT Enhancement || Get the Tax accounting information from the vat regime setup when the taxes are as mentioned below taxes */ ELSIF UPPER(nvl(ln_regime_code,'####')) = jai_constants.vat_regime THEN /********************************************************************************************************* || Validate whether the item attached is vatable or not *********************************************************************************************************/ if pr_new.inventory_item_id is not null then /*ssumaith - bug#6104491 */ jai_inv_items_pkg.jai_get_attrib ( p_regime_code => ln_regime_code , p_organization_id => v_organization_id , p_inventory_item_id => pr_new.inventory_item_id , p_attribute_code => jai_constants.rgm_attr_item_applicable , p_attribute_value => lv_attr_value , p_process_flag => lv_error_flag , p_process_msg => lv_error_message ) ; IF lv_error_flag jai_constants.successful THEN /* || Encountered an error from the call to jai_ar_rgm_processing_pkg.get_regime_info || Stop processing and thorw an error *//* raise_application_error (-20130,lv_error_message); */ pv_return_code := jai_constants.expected_error ; pv_return_message := lv_error_message ; return ; /* app_exception.raise_exception( EXCEPTION_TYPE => 'APP', EXCEPTION_CODE => NULL , EXCEPTION_TEXT => lv_error_message ); */ END IF; end if; /*ssumaith - bug# 6104491 */ /********************************************************************************************************* || Raise an error if item is not vatable *********************************************************************************************************/ if pr_new.inventory_item_id is not null and nvl(lv_attr_value,'N') = 'N' THEN /* above if condition before the if added by ssumaith - bug# 6104491 */ /* || Item is not vatable . Stop processing and throw an error *//* raise_application_error (-20130,'ITEM not vatable'); */ pv_return_code := jai_constants.expected_error ; pv_return_message := 'ITEM not vatable' ; return ; /* DO not delete this code, enable this code while doing the messageing project app_exception.raise_exception( EXCEPTION_TYPE => 'APP', EXCEPTION_CODE => NULL , EXCEPTION_TEXT => 'Cannot attach VAT type of taxes to non vatable items.' ); */ END IF; /********************************************************************************************************* || Get the code combination id from the Organization/Regime Registration setup || by calling the function jai_cmn_rgm_recording_pkg.get_account *********************************************************************************************************/ -- 25/05/2007 by sacsethi for bug 6072461 -- Previously Organziation id was going wrong and location id was wrong --Added by Bo Li for Bug 9705313 Begin -----------------------------------------------------------------------if NOT (JAI_AR_RCTLA_TRIGGER_PKG.is_this_projects_context (lv_intf_hdr_ctx)) then --by mmurtuza for bug 13649994 /*OPEN check_rma_credit_cur(v_order_number,ln_order_line_id);*/ /*Commected and added below by mmurtuza for bug 14846750*/ OPEN check_rma_credit_cur(ln_order_line_id); FETCH check_rma_credit_cur INTO ln_rma_flag ; CLOSE check_rma_credit_cur; OPEN check_shippable_item_cur(ln_order_line_id); FETCH check_shippable_item_cur INTO ln_nonship_rma_flag ; CLOSE check_shippable_item_cur;end if; -- bug 13649994 IF ln_rma_flag > 0 OR ln_nonship_rma_flag > 0 THEN v_ccid := jai_cmn_rgm_recording_pkg.get_account ( p_regime_id => ln_regime_id , p_organization_type => jai_constants.orgn_type_io , p_organization_id => v_organization_id , p_location_id => v_location_id , p_tax_type => tax_type_rec.t_type , p_account_name => jai_constants.recovery ); ELSE ---------------------------------------------------------------------- --Added by Bo Li for Bug 9705313 End v_ccid := jai_cmn_rgm_recording_pkg.get_account ( p_regime_id => ln_regime_id , p_organization_type => jai_constants.orgn_type_io , p_organization_id => v_organization_id , p_location_id => v_location_id , p_tax_type => tax_type_rec.t_type , p_account_name => jai_constants.liability_interim ); End IF; -- Added by Bo Li for Bug 9705313 IF v_ccid IS NULL THEN /********************************************************************************************************** || Code Combination id has been returned as null from the function jai_cmn_rgm_recording_pkg.get_account || This is an error condition and the current processing has to be stopped **********************************************************************************************************//* raise_application_error (-20130,'Invalid Code combination ,please check the VAT Tax - Tax Accounting Setup'); */ pv_return_code := jai_constants.expected_error ; pv_return_message := 'Invalid Code combination ,please check the VAT Tax - Tax Accounting Setup ' ; return ; /* app_exception.raise_exception( EXCEPTION_TYPE => 'APP', EXCEPTION_CODE => NULL , EXCEPTION_TEXT => 'Invalid Code combination ,please check the VAT Tax - Tax Accounting Setup' ); */ END IF; /* || End of bug 4212816 */ /* Added by CSahoo for the TCS enhancements Bug# 5631784 */ ELSIF UPPER(nvl(ln_regime_code,'####')) = jai_constants.tcs_regime THEN -- Start of A1 /********************************************************************************************************* || Get the code combination id from the Organization/Regime Registration setup || by calling the function jai_rgm_trx_recording_pkg.get_account *********************************************************************************************************/ v_ccid := jai_cmn_rgm_recording_pkg.get_account ( p_regime_id => ln_regime_id , p_organization_type => jai_constants.orgn_type_io , p_organization_id => v_organization_id , p_location_id => v_location_id , p_tax_type => tax_type_rec.t_type , p_account_name => jai_constants.liability_interim ); IF v_ccid IS NULL THEN /********************************************************************************************************** || Code Combination id has been returned as null from the function jai_rgm_trx_recording_pkg.get_account || This is an error condition and the current processing has to be stopped **********************************************************************************************************/ raise_application_error (-20130,'Invalid Code combination ,please check the TCS Tax - Tax Accounting Setup'); END IF; /*End of bug 5631784 */ ELSE -- ELSE of A1 /* || As tax type is not SERVICE hence || get code combination from tax definition setup */ OPEN TAX_CCID_CUR(TAX_TYPE_REC.taxid); FETCH TAX_CCID_CUR INTO v_ccid; CLOSE TAX_CCID_CUR; END IF; --End if of A1 -- End of bug 4089440 IF TAX_TYPE_REC.t_type = 'TDS' THEN TAX_TYPE_REC.tax_amt := 0; END IF; END IF;--Added by zhiwei for GST get ccid by regime setup BUG#10233402 20101027 INSERT INTO JAI_AR_TRX_INS_LINES_T ( -- paddr, -- 6842749 extended_amount, customer_trx_line_id, customer_trx_id, set_of_books_id, link_to_cust_trx_line_id, line_type, uom_code, vat_tax_id, acctd_amount, amount, CODE_COMBINATION_ID, cust_trx_line_sales_rep_id, insert_update_flag, last_update_date, last_updated_by, creation_date, created_by, last_update_login, tax_rate, --Tax_rate column added by Jagdish/Subbu 10-Jun-01 error_flag ,--added on 22-Mar-2002 by RPK to store the error_flag.Initially it --will be NULL source, -- column added by sriram on 6th May 2002. org_id, -- Added by sriram bug # 2779967 line_number ) -- Added by sriram Bug # 2769439 VALUES ( -- NULL, /* Previously passing v_paddr. Replaced with NULL by rallamse bug#4448789 */ round( TAX_TYPE_REC.tax_amt, ln_inv_curr_precision ), /* rounding based on inv currency precision - bug# 5364120*/ TAX_TYPE_REC.LINE_ID, v_customer_trx_id, v_books_id, v_customer_trx_line_id, v_line_type, TAX_TYPE_REC.uom, ln_tax_rate_id, --v_vat_tax, /* Modified by Ramananda for bug#4468353 due to ebtax uptake by AR */ v_converted_rate * TAX_TYPE_REC.tax_amt, round(TAX_TYPE_REC.tax_amt, ln_inv_curr_precision ) , /* rounding based on inv currency precision - bug# 5364120*/ v_ccid, v_salesrep_id, 'U', pr_new.last_update_date, pr_new.last_updated_by, pr_new.creation_date, pr_new.created_by, pr_new.last_update_login, TAX_TYPE_REC.tax_rate, --Tax_rate column added by Jagdish/Subbu 10-Jun-01 'P', v_created_from, v_org_id , -- added by sriram bug # 2779967 tax_type_rec.tax_line_no ); -- added by sriram - bug # 2769439 --END; --19-MAR-2002v_tax_exists := 1; --added by mmurtuza for bug 13042890 END LOOP; EXCEPTION WHEN OTHERS THEN v_err_mesg := SQLERRM;/* RAISE_APPLICATION_ERROR(-20003,'error in processing the invoice ..' || v_trx_num || v_err_mesg); */ pv_return_code := jai_constants.expected_error ; pv_return_message := 'error in processing the invoice ..' || v_trx_num || v_err_mesg ; return ; --19-MAR-2002 END; -- the following if added by Sriram / Pavan on 06-May-2002 IF v_created_from = 'ARXTWMAI' AND v_tax_exists = 1 THEN --added condition of v_tax_exists by mmurtuza for bug 13042890 result := fnd_request.set_mode(TRUE); req_id := fnd_request.submit_request( 'JA', 'JAILINEGL', 'AR Tax and Freight Defaultation', SYSDATE, FALSE,v_customer_trx_id, v_customer_trx_line_id ); END IF; END ARI_T1 ; /* REM +======================================================================+ REM NAME ARU_T1 REM REM DESCRIPTION Called from trigger JAI_JAR_TL_ARIUD_T1 REM REM NOTES Refers to old trigger JAI_JAR_TL_ARU_T2 REM REM +======================================================================+ */PROCEDURE ARU_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 v_books_id NUMBER; v_salesrep_id NUMBER; v_line_type VARCHAR2(30); v_vat_tax NUMBER; v_ccid NUMBER; v_cust_trx_line_id RA_CUSTOMER_TRX_LINES_ALL.customer_trx_line_id%TYPE; -- v_paddr v$session.paddr%TYPE; -- bug#6842749 v_counter NUMBER; v_customer_trx_id NUMBER; -- := pr_old.customer_trx_id; --rpokkula for File.Sql.35 c_from_currency_code VARCHAR2(15); c_conversion_type VARCHAR2(30); c_conversion_date DATE; c_conversion_rate NUMBER := 0; v_converted_rate NUMBER := 1; req_id NUMBER; result BOOLEAN; v_created_from VARCHAR2(30); v_insert_update_flag VARCHAR2(1) ; v_organization_id NUMBER ; v_location_id NUMBER ; v_batch_source_id NUMBER ; v_register_code VARCHAR2(50); -- added by sriram - bug # 2779967 v_org_id ra_customer_trx_all.org_id%type; /*Bug 8371741 - Start*/ v_line_amount NUMBER := 0; v_quantity NUMBER; v_trans_type VARCHAR2(30); v_line_tax_amount NUMBER := 0; l_tcs_line_num NUMBER := 0; l_tcs_sur_line_num NUMBER := 0; ln_tcs_regime_id JAI_RGM_DEFINITIONS.regime_id%type; l_org_id NUMBER; l_bill_to_customer_id NUMBER; l_bill_to_site_use_id NUMBER; ln_organization_id NUMBER; ln_trx_date DATE; ln_threshold_slab_id jai_ap_tds_thhold_slabs.threshold_slab_id%type; ln_threshold_tax_cat_id jai_ap_tds_thhold_taxes.tax_category_id%type; lv_process_flag VARCHAR2(2); lv_process_message VARCHAR2(1996); ln_tax_amount NUMBER; l_tot_tax_lines NUMBER; l_max_tax_line_no NUMBER; /*Bug 8371741 - End*/ /*Bug 11821537 - Fetch the effective date on which Service Tax needs to accounted in accrual basis instead of cash - Start*/ ld_st_accrual_date DATE; ld_trx_date DATE; v_tax_exists NUMBER :=0; --added by mmurtuza for bug 13042890--Commented by Chong.Lei for POT code port begin/* CURSOR c_get_st_accrual_date (p_regime_id NUMBER) IS SELECT to_date(attribute_value, 'DD/MM/YYYY') FROM jai_rgm_registrations WHERE regime_id = p_regime_id AND attribute_code = 'EFF_DATE_ST_PT' AND attribute_type_code = 'OTHERS' AND registration_type = 'OTHERS'; CURSOR c_get_trx_date IS SELECT trx_date FROM ra_customer_trx_all WHERE customer_trx_id = v_customer_trx_id;*/--Commented by Chong.Lei for POT code port end-- Added by Chong.Lei for POT code port begin--------------------------------------------------------------------------------------------------------- /*Bug 12805386 - Fetch Effective Date of Point of Taxation only if Organization Type is either 'INDIVIDUALS' or 'PARTNERSHIP FIRM' or 'PROPRIETARY FIRM' and if the Service Type is one mentioned in Rule 7 of Point of Taxation Rules 2011 i.e 105-p, 105-q, 105-s, 105-t, 105-u, 105-za, 105-zzzzm*/ CURSOR c_get_st_accrual_date(p_regime_id NUMBER, p_organization_id NUMBER, p_location_id NUMBER) IS select to_date(attribute_value, 'DD/MM/YYYY') from JAI_RGM_ORG_REGNS_V where regime_id = p_regime_id and organization_id = p_organization_id and location_id = p_location_id AND attribute_code = 'EFF_DATE_ST_PT' AND attribute_type_code = 'OTHERS' AND registration_type = 'OTHERS' AND (NOT EXISTS (select '1' from JAI_RGM_ORG_REGNS_V where regime_id = p_regime_id and attribute_code IN 'INV_ORG_CLASSIFICATION' and attribute_value 'ORGANIZATION' and organization_id = p_organization_id and location_id = p_location_id) OR NOT EXISTS (select '1' from JAI_RGM_ORG_REGNS_V where regime_id = p_regime_id and attribute_code IN 'SERVICE TYPE' and attribute_value 'OTHER' and organization_id = p_organization_id and location_id = p_location_id) ); CURSOR c_get_trx_date IS SELECT gl_date --Xiao for POT changes, reg bug#12533434 FROM ra_cust_trx_line_gl_dist_all WHERE customer_trx_id = v_customer_trx_id AND customer_trx_line_id = pr_new.customer_trx_line_id AND account_class = 'REV';--Xiao for POT changes, reg bug#12533434----------------------------------------------------------------------------------------------------------- Added by Chong.Lei for POT code port end /*Bug 11821537 - End*/ -- added by sriram - bug # 2779967 /*Bug 8371741 - Start*/ CURSOR GC_GET_REGIME_ID (CP_REGIME_CODE JAI_RGM_DEFINITIONS.REGIME_CODE%TYPE) IS SELECT REGIME_ID FROM JAI_RGM_DEFINITIONS WHERE REGIME_CODE = CP_REGIME_CODE; Cursor transaction_type_cur IS Select a.type From RA_CUST_TRX_TYPES_ALL a, RA_CUSTOMER_TRX_ALL b Where a.cust_trx_type_id = b.cust_trx_type_id And b.customer_trx_id = v_customer_trx_id And NVL(a.org_id,0) = NVL(b.org_id,0); CURSOR bind_cur IS SELECT RCTA.org_id, RCTA.bill_to_customer_id, NVL(RCTA.bill_to_site_use_id,0), RCTA.trx_date FROM RA_CUSTOMER_TRX_ALL RCTA WHERE RCTA.customer_trx_id = v_customer_trx_id; /*Bug 8371741 - End*/ /*Commented by kunkumar for bug#6066813 start Bug 6012570 (5876390) */ /*cursor c_get_hdr_ctx is select interface_header_context from ra_customer_trx_all where customer_trx_id = pr_new.customer_trx_id;*/ /*commented the above cursor and added the following for bug#5597146*/ /*commented the cursor c_get_hdr_ctx for bug#8310220 cursor c_get_hdr_ctx is select distinct interface_line_context from ra_customer_trx_lines_all where customer_trx_id = pr_new.customer_trx_id and customer_trx_line_id = pr_new.customer_trx_line_id --added for bug#5597146 and interface_line_context is not null and rownum = 1;*/ lv_intf_hdr_ctx ra_customer_trx_all.interface_header_context%type ; /* End commented by kunkumar for bug#6066813 */ /*end Bug 6012570 (5876390) */ -- Deleted by Jia Li for Tax inclusive Computations on 2007/11/22 Begin -- TD18-changed Trading AR Invoice ------------------------------------------------------------------------- /* v_ORDER_PRICE_EXCISE_INCLUSIVE JAI_CMN_INVENTORY_ORGS.ORDER_PRICE_EXCISE_INCLUSIVE%type; -- date 15/06/2007 sacsethi for bug 6131957-- date 15/06/2007 sacsethi for bug 6131957 cursor c_ORDER_PRICE_EXCISE_INCLUSIVE(p_organization_id number,p_location_id number) is select ORDER_PRICE_EXCISE_INCLUSIVE from JAI_CMN_INVENTORY_ORGS where organization_id = p_organization_id and location_id = p_location_id; */ ------------------------------------------------------------------------- -- Deleted by Jia Li for Tax inclusive Computations on 2007/11/22 End -- Added by zhiwei for GST get ccid by regime setup BUG#10233402 20101027 BEGIN ------------------------------------------------------------------ lv_enable_gst_flag VARCHAR2(1); CURSOR get_gst_organization_location(cn_customer_trx_id IN NUMBER)--v_customer_trx_line_id IS SELECT ORGANIZATION_ID,LOCATION_ID FROM JAI_AR_TRXS WHERE CUSTOMER_TRX_ID = cn_customer_trx_id; lv_log VARCHAR2(1000); x number; CURSOR GET_COUNT(cn_customer_trx_line_id IN NUMBER)is SELECT COUNT(1) FROM JAI_AR_TRX_TAX_LINES WHERE link_to_cust_trx_line_id = cn_customer_trx_line_id ; ------------------------------------------------------------------ -- Added by zhiwei for GST get ccid by regime setup BUG#10233402 20101027 END CURSOR tax_type_cur IS SELECT a.tax_id taxid , a.tax_rate , a.uom uom , a.tax_amount tax_amt , b.tax_type t_type , a.customer_trx_line_id line_id , a.tax_line_no tax_line_no FROM JAI_AR_TRX_TAX_LINES a , JAI_CMN_TAXES_ALL b WHERE link_to_cust_trx_line_id = pr_old.customer_trx_line_id and a.tax_id = b.tax_id and nvl(b.reverse_charge_flag,'N') = 'N' --Added by Qiong for reverse charge bug#16001407 /*Bug 12895321 - Inclusive taxes are not interfaced in GL if Order contains only Inclusive Taxes*/ --AND NVL(b.inclusive_tax_flag,'N') = 'N' --Added by Jia Li for Tax inclusive Computations on 2007/11/22 ORDER BY 1;-- bug#6842749/* CURSOR PADDR_CUR IS SELECT paddr FROM v$session WHERE audsid = USERENV('SESSIONID');*/ CURSOR BOOKS_TRX_CUR IS SELECT set_of_books_id, primary_salesrep_id, invoice_currency_code, exchange_rate_type, exchange_date, exchange_rate FROM JAI_AR_TRXS WHERE customer_trx_id = v_customer_trx_id; --Commented for bug#4468353 /* CURSOR VAT_TAX_CUR(cp_tax_code AR_VAT_TAX_ALL.tax_code%type) IS SELECT DISTINCT vat_tax_id FROM AR_VAT_TAX_ALL WHERE UPPER(tax_code) = cp_tax_code ; */ /* Added by Ramananda for bug#4468353 , start CURSOR ORG_CUR IS SELECT ORG_ID FROM RA_CUSTOMER_TRX_ALL WHERE CUSTOMER_TRX_ID = pr_new.customer_trx_id;*/ --commented the above org_cur cursor and added the following org_cur cursor for bug#5597146 CURSOR ORG_CUR IS SELECT ORG_ID FROM RA_CUST_TRX_LINE_GL_DIST_ALL WHERE CUSTOMER_TRX_ID = pr_new.customer_trx_id AND account_class ='REC' AND latest_rec_flag ='Y'; lv_tax_regime_code zx_rates_b.tax_regime_code%type ; ln_party_tax_profile_id zx_party_tax_profile.party_tax_profile_id%type ; ln_tax_rate_id zx_rates_b.tax_rate_id%type ; /* Added by Ramananda for bug#4468353 , end */ CURSOR TAX_CCID_CUR(p_tax_id IN NUMBER) IS SELECT tax_account_id FROM JAI_CMN_TAXES_ALL B WHERE B.tax_id = p_tax_id ; CURSOR GL_DATE_CUR IS SELECT gl_date FROM RA_CUST_TRX_LINE_GL_DIST_ALL WHERE CUSTOMER_TRX_LINE_ID = pr_old.customer_trx_line_id; CURSOR CREATED_FROM_CUR IS SELECT created_from FROM JAI_AR_TRXS -- table reference was previously RA_CUSTOMER_TRX_ALL - using JA_IN_RA_CUSTOMER_TRX instead - bug# 2728636 WHERE customer_trx_id = v_customer_trx_id; CURSOR Insert_Update_Cur(p_customer_trx_line_id IN NUMBER) IS SELECT INSERT_UPDATE_FLAG FROM JAI_AR_TRX_INS_LINES_T WHERE customer_trx_id = V_CUSTOMER_TRX_ID AND Customer_trx_line_id = p_customer_trx_line_id ORDER BY CUSTOMER_TRX_LINE_ID; CURSOR SO_AR_HDR_INFO IS SELECT organization_id, location_id, batch_source_id FROM JAI_AR_TRXS WHERE Customer_Trx_ID = v_customer_trx_id; CURSOR register_code_cur(p_org_id IN NUMBER, p_loc_id IN NUMBER, p_batch_source_id IN NUMBER) IS SELECT register_code FROM JAI_OM_OE_BOND_REG_HDRS WHERE organization_id = p_org_id AND location_id = p_loc_id AND register_id IN (SELECT register_id FROM JAI_OM_OE_BOND_REG_DTLS WHERE order_type_id = p_batch_source_id AND order_flag = 'N'); /* Bug 5243532. Added by Lakshmi Gopalsami * Removed cursor set_of_books_cur and c_opr_set_of_books_id * and implemented caching logic. */ CURSOR cur_chk_rgm ( cp_tax_type JAI_CMN_TAXES_ALL.TAX_TYPE%TYPE ) IS SELECT regime_id , regime_code FROM jai_regime_tax_types_v jrttv WHERE upper(jrttv.tax_type) = upper(cp_tax_type); ln_regime_code JAI_RGM_DEFINITIONS.REGIME_CODE%TYPE; lv_attr_value JAI_RGM_REGISTRATIONS.ATTRIBUTE_VALUE%TYPE; -- Start of bug 4089440 ln_regime_id JAI_RGM_DEFINITIONS.REGIME_ID%TYPE ; lv_error_flag VARCHAR2(2) ; lv_error_message VARCHAR2(4000) ; -- End of bug 4089440 /* Bug 5243532. Added by Lakshmi Gopalsami * Removed cursor set_of_books_cur * and implemented caching logic. */ l_func_curr_det jai_plsql_cache_pkg.func_curr_details; ln_inv_curr_precision NUMBER; /* added by CSahoo - bug# 5364120*/ CURSOR c_inv_curr_precision(cp_currency_code varchar2) IS SELECT NVL(minimum_accountable_unit,NVL(precision,2)) curr_precision FROM fnd_currencies WHERE currency_code = cp_currency_code; lv_trx_type ra_cust_trx_types_all.type%TYPE; --Added by Wenqiong for Bug 14253668 --added the function for bug#8310220 FUNCTION get_hdr_ctx (p_customer_trx_id IN NUMBER, p_customer_trx_line_id IN NUMBER) RETURN VARCHAR2 IS PRAGMA AUTONOMOUS_TRANSACTION; cursor c_get_hdr_ctx is select distinct interface_line_context from ra_customer_trx_lines_all where customer_trx_id = p_customer_trx_id and customer_trx_line_id = p_customer_trx_line_id --added for bug#5597146 and interface_line_context is not null and rownum = 1; lv_hdr_ctx ra_customer_trx_lines_all.INTERFACE_LINE_CONTEXT%type; BEGIN OPEN c_get_hdr_ctx; FETCH c_get_hdr_ctx into lv_hdr_ctx; CLOSE c_get_hdr_ctx; return lv_hdr_ctx; END get_hdr_ctx; BEGIN pv_return_code := jai_constants.successful ; /*------------------------------------------------------------------------------------------FILENAME: JA_IN_APPS_AR_LINES_UPDATE_TRG.sqlCHANGE HISTORY:S.No Date Author and Details1. 2001/04/09 Changed the Cases for Register Codes2. 2001/06/11 Jagdish Added tax_rate for Receipts Discounts Issue3. 2001/06/22 Anuradha Parthasarathy Code commented and added to improve performance.4. 2001/12/13 Anuradha Parthasarathy Code commented because if the updated tax amount is zero the tax lines need to be corrected in the Base Tables as well.5. 2002/05/09 Sriram Added the Source Column in the Column list in the insert statement This Column was added in the JAI_AR_TRX_INS_LINES_T table because the AR Tax and Freight Defaultation Concurrent - was split into 2 concurrents doing the same functionality - one being called from the AR side for manual invoice from this trigger and another from OM side which is scheduled to run on a periodid basis6. 2002/05/09 Sriram Added the if condition at the bottom of the trigger to conditionally call the concurrent only if is a manual invoice.7. 2003/01/02 Ssumaith Bug # 2728636 File Version 615.2 Reference to table RA_CUSTOMER_TRX_ALL was present in the cursor Created_from_cur Which was causing a mutating error and causing the transaction to error out with unhandled exception.This has been changed to point to JAI_AR_TRXS table instead which takes care of the issue.8. 2003/04/07 SSUMAITH.Bug # 2779967 column Org id was not inserted in the JAI_AR_TRX_INS_LINES_T table. This needs to be inserted in the table , because when processing the records using the 'India Local Concurrent' only records that belong to the orgid of the current responsiblity needs to be picked up.9. 2003/04/10 SSUMAITH - Bug # 2769439 Also inserting the tax line number in the JAI_AR_TRX_INS_LINES_T table. This is necessary for creating links between OM and AR.10. 2005/27/01 aiyer - Bug # 4089440 File Version 115.1 Issue:- In case of service invoices having service/service_education type of taxes the code combination id should be picked up from regime tax setup. This is being done as a part of the service tax enhancement Solution:- The check that, for service type of taxes ccid should be picked up from regime tax setup has been impletemented. Called the procedure jai_ar_rgm_processing_pkg.get_regime_info is being called for regime setup validation. Aslo called the function jai_cmn_rgm_recording_pkg.get_account to get the ccid in such cases. Dependency introduced as a part of this bug:- This file should be released on top of Bug 4146708.11. 01-Mar-2005 aiyer - Bug # 4212816 File Version 115.2 Issue:- In case of invoices having any of the taxes setup for VAT REGIME, the code combination should get picked up from the VAT Regime setup. This is being done as a part of the VAT enhancement Solution:- The check that, for taxes belonging to the VAT regime, ccid should be picked up from VAT regime setup has been impletemented. The account info is fetched using the function jai_cmn_rgm_recording_pkg.get_account. Dependency introduced as a part of this bug:- This file should be released on top of Bug 4245089. Datamodel changes for VAT12. 02-Apr-2005 aiyer - Bug # 4279702 File Version 115.3 Issue:- VAT regime code does not get reinitialized for any tax type which does not fall in the VAT / Service TAx regime Solution:- Changed the triggers ja_in_apps_ar_lines_insert_trg and ja_in_apps_ar_lines_update_trg to reinitialize the regime codes every time processing happens for a tax type. Dependency introduced as a part of this bug:- This file should be released on top of Bug 4245089.13. 08-Jun-2005 This Object is Modified to refer to New DB Entity names in place of Old DB Entity as required for CASE COMPLAINCE. Version 116.114. 13-Jun-2005 File Version: 116.2 Ramananda for bug#4428980. Removal of SQL LITERALs is done15. 25-Jan-2007 CSahoo for Bug#5631784, File Version 120.3 Forward Porting of BUG#4742259 Accounting information popluated for TCS regime15. 14-Feb-2007 CSahoo BUG#5364120, File Version - 120.4 Forward Porting of 11i BUG#5346489 The transaction amounts are rounded based on the currency precision of the invoice currency code when the insert is done in the JAI_AR_TRX_INS_LINES_T. Added the cursor c_inv_curr_precision. Dependency due to this bug :- None16. 15-Feb-2007 CSahoo Bug#5390583, File Version - 120.5 Forward Porting of 11i bug#5357400 When taxes are added manually to the ar invoice from the transactions localised screen and the batch source is set to bond register, the excise taxes are going to base AR. This should not go. Fix : The code to take care of this was in a trading loop and would never reach there.17. 05-APR-2007 bduvarag for bug#5671400,File version 120.6 Forward porting the changes done in 11i bug#4648231 Modified the code appropriately.18 24/04/2007 cbabu for bug#5876390, File Version 120.7 (115.17 ) FP: For project billing bond register functionality is not required hence added a check to see if the invoice is created by projects then bond register related logic should not be executed.19. 31/05/2007 CSahoo for bug#6081806, File Version 120.13 added the sh cess tax types.20. 14/06/2007 sacsethi for bug 6072461 for file version - 120.15 This bug is used to fp 11i bug 5183031 for vat reveresal Problem - Vat Reversal Enhancement not forward ported Solution - Changes has been done to make it compatible for vat reversal functioanlity also.21. 15/06/2007 sacsethi for bug 6131957 for file version - 120.16 R12RUP03-ST1: TRADING TAKES EXCISE PRICE INCLUSIVE EVEN WHEN FLAG IS UNCHECKED Variable v_order_price_excise_inclusive and cursor c_order_price_excise_inclusive is defined22. 10/07/2007 CSahoo for bug#5597146, FileVersion 120.17 modified the cursor ORG_CUR.23. 10/10/2007 CSahoo for bug#5597146, FileVersion 120.19 modified the cursor c_get_hdr_ctx to remove the mutating trigger error.24. 11/10/2007 CSahoo for bug#5597146, File Version 120.20 Added the following AND condition in the cursor c_get_hdr_ctx "and customer_trx_line_id = pr_new.customer_trx_line_id "25. 23/04/2009 CSahoo for bug#8310220, File Version 120.22.12010000.4,120.22.12010000.5 Commented the cursor c_get_hdr_ctx. added the function get_hdr_ctx26. 30-aug-2010 vkaranam for bug#10048317 Issue:EXCISE TAXES NOT TRANSFERRING FROM SALES ORDER TO RECEIVABLE for trading organization. issue is in jai_jar_tl_t.plb: IF NVL(v_register_code,'N') IN ('23D_EXPORT_WITHOUT_EXCISE','23D_EXPORT_EXCISE', '23D_DOMESTIC_EXCISE','23D_DOM_WITHOUT_EXCISE','BOND_REG') THEN --jai_constants.tax_type_sh_exc_edu_cess,jai_constants.tax_type_sh_cvd_edu_ces s added by csahoo for bug#6081806 IF Tax_Type_Rec.T_Type IN ('Excise','Addl. Excise','Other Excise','EXCISE_EDUCATION_CESS','CVD_EDUCATION_CESS',jai_constants.tax_type_sh _exc_edu_cess,jai_constants.tax_type_sh_cvd_edu_cess) THEN TAX_TYPE_REC.tax_amt := 0; END IF; END IF; Eventhough the order_price_excise_inclusive functionality was obsoleted the tax amount has been populated as "0" in jai_ar_trx_ins_lines_t. Hence the issue Fix: commeneted the code which will make the tax_type_rec.tax_amt to 0.27 04-Mar-2011 Enhancement 11821537 Description: Notification # 18/2011 proposes change in Point of Taxation for Service Tax. Service Tax Liability arises on creation of Invoice and not on Receipt of Payment from Customer i.e. Accounting changes to Accrual basis from Cash Basis Fix: Service Tax Libility Account will be hit directly instead of Interim Liablity as there will be no set off during Receipt/CM Application. 28. 10/02/2011 Added by Zhiwei for Open Interface ER bug#11683927. When update the AR transaction that are imported by Open Interface, procedure JAI_JAR_TL_TRIGGER_PKG.ARU_T1 will not be invoked, and the same logic is implemented in Open Interface Procedure.29 12-Apr-2011 Bug 11936630 Description: Data was inserted into JAI_AR_TRX_INS_LINES_T via tax_type_cur only if there was an Exclusive Tax Line. Hence for Order Imported AR Invoice with only Inclusive Taxes accounting was not happening. Fix: Data to be inserted into JAI_AR_TRX_INS_LINES_T irrespective of Tax Types. 29 18-May-2011 Xiao for POT changes, reg bug#12533434. Issue: Compare transaction date with POT date. fixed: Compare Accounting Date with POT date. Cursor c_get_trx_date is modified. --Added by Chong.Lei for POT code port30. 03-Oct-2011 mmurtuza for bug 13042890Issue: INDIA-AR TAX AND FREIGHT DEFAULTATION IS FIRING WHEN TRANSACTION RAISED IN BASE AR Transaction witout IOL TaxesFix: Added a variable v_tax_exists and Added condition in the trigger to check if taxes exists and the concurrent should fire only if taxes exists.31. 27-Dec-2011 mmurtuza for bug 13532483Issue: TAXES ARE NOT REFLECT IN THE AR DISTRIBUTIONS when sum of taxes is zeroFix: Commented the part of code which returns the control when the old and new tax amoutns are same.32. 30-Dec-2011 mmurtuza for bug 13532483Fix: reverted the cahnegs done for bug 1353248333. 27-Aug-2012 mmurtuza for bug 14525160Issue: TAXES ARE NOT REFLECT IN THE AR DISTRIBUTIONS when sum of taxes is zeroFix: Commented the part of code which returns the control when the old and new tax amoutns are same.33. 14-Feb-2013 mmurtuza for bug 16052256 Issue: UNABLE TO APPLY TCS TAXES ON AR INVOICESDescription: Added paramter p_called_from while calling jai_rgm_thhold_proc_pkg.get_threshold_slab_id34. 24-Apr-2013 mmurtuza for bug 16656728 issue: APP-JA-460633 ERROR ENCOUNTERED IN TRANSACTION WORKBENCH Fix: Commented the call to jai_cmn_tax_defaultation_pkg.ja_in_ca