Enabling surcharge tax calculations in the Aurora starter store

You can enable surcharge tax calculations in the Aurora starter store using the calculation framework.

Procedure

  1. Load surcharge tax configuration data into the HCL Commerce database.

    Perform one of the following steps.

    Either:
    • Use the Data Load utility to load the data. For more information, see Sample: Loading surcharge tax calculation data.
    • Or, run the following SQL statements to configure the calculation framework:
      
      insert into taxcgry (taxcgry_id,taxtype_id,storeent_id,name,calculationseq,displayseq,displayusage,markfordelete) 
      values (#taxcgry_id,-9,#storeent_id,'Surcharge Tax',0.0,0.0,0,0)
      
      insert into calcode (calcode_id,code,calusage_id,storeent_id,groupby,published,sequence,calmethod_id,calmethod_id_app,calmethod_id_qfy,displaylevel,flags,precedence) 
      values (#calcode_id,'Surcharge Tax',-9,#storeent_id,0,1,2.0,-93,-94,-92,0,0,0.0)
      
      insert into calrule (calrule_id,calcode_id,taxcgry_id,sequence,combination,calmethod_id,calmethod_id_qfy,flags,identifier) 
      values (#calrule_id,#calcode_id,#taxcgry_id,0.0,2,-97,-96,1,1)
      
      insert into calscale (calscale_id,storeent_id,calusage_id,calmethod_id,code) 
      values (#calscale_id,#storeent_id,-9,-99,'Preloaded Surcharge Tax Scale')
      
      insert into calrange (calrange_id,calscale_id,calmethod_id,rangestart,cumulative,markfordelete) 
      values (#calrange_id,#calscale_id,-59,0.00000,0,0)
      
      insert into calrlookup (calrlookup_id,calrange_id,value)
      values (#calrlookup_id,#calrange_id,5.00000)
      
      insert into crulescale (calscale_id,calrule_id) 
      values (#calscale_id,#calrule_id)
      
      insert into taxjcrule (calrule_id,taxjcrule_id,ffmcenter_id,jurstgroup_id,precedence) 
      values (#calrule_id,#taxjcrule_id,#ffmcenter_id,#jurstgroup_id,0.0)
      
      insert into catencalcd (store_id, catencalcd_id, trading_id, catentry_id, calcode_id) 
      values(#store_id,#catencalcd_id,NULL,NULL,#calcode_id);
      
      insert into stencalusg (storeent_id,calusage_id,actcc_calmethod_id,actrc_calmethod_id,calmethod_id_app,calmethod_id_sum,usageflags,calmethod_id_ini,sequence ) 
      values (-1,-9,-91,-95,-242,-243,1,-241,5.1)
      
  2. Update the storefront to use the surcharge tax calculation usage.
    1. Go to the following directory:
      1. AuroraStorefrontAssetStore
        • crs-web/WebContent/AuroraStorefrontAssetStore/javascript/CheckoutArea
      2. AuroraB2BStorefrontAssetStore
        • crs-web/WebContent/AuroraB2BStorefrontAssetStore/javascript/CheckoutArea
    2. Open the following files for editing:
      • ShipmodeSelectionExt.js
      • CheckoutHelper.js
    3. Find all occurrences of the calculationUsage array parameter and append -9 to the list of available values.
    Note: This update only adds surcharge tax into the tax amount during an order's check out flow from the store's home page. If you need to use surcharge calculations in other scenarios, you must update the corresponding storefront assets to suit your business needs.