Articles in this section

Handle Canadian taxes using a NetSuite script

Problem: When you perform separate tax reporting for GST and PST in the NetSuite Canadian edition, orders may import with the correct total, but the Auto-Billing (Invoice) flow in the integration app does not mark the invoice as paid in full. This occurs because the Canadian tax amount on the invoice is not calculated correctly, despite the original order showing the correct total.

Reason: The integration app does not natively support Canadian tax structures. As a result, the tax information imported from the eCommerce platform is not fully compatible with NetSuite’s Canadian tax handling during invoicing, causing a mismatch between the order total and the invoice tax calculation.

To address this limitation, we have developed a NetSuite user event script that adjusts Canadian tax behavior.

This script overrides the tax behavior so that Canadian taxes are calculated correctly, and invoices are fully paid when the Auto-Billing flow runs.

Workaround: Deploy a NetSuite script that:

  • Overrides tax behavior for Canadian transactions.
  • Ensures Canadian taxes are applied correctly on invoices created by the Auto-Billing (Invoice) flow.

Important: This workaround uses a custom NetSuite script. Deploying and configuring this script can impact transaction behavior and tax reporting. Involve your NetSuite administrator, NetSuite partner, or internal NetSuite point of contact.

Deploy script in NetSuite 

Steps to deploy the script in NetSuite

  1. In NetSuite, go to:

    Customization > Scripting > Scripts > New 

  2. Create a new script record:

    1. Name: Provide a name of your choice (for example, Celigo Canada Tax Override).
    2. ID: Provide an internal ID of your choice (for example, _celigo_cad_tax_override).
    3. Script Type: Select the script type appropriate for the provided file (typically User Event).
    4. Upload/attach the script file.
    5. After Submit Function: Provide the function name as “afterSubmit”.
    6. Click Save.
  3. You must update certain parameters inside the script so it aligns with your specific NetSuite and eCommerce configuration.

    1. On the script record, click Edit.
    2. Update the following values using NetSuite internal IDs:

      • genericCanadaTaxId
      • Magento Store ID
    3. Click Save.

      Cad_tax1.png
  4. Deploy the script:

    1. On the script record, click Deploy Script.
    2. Configure the deployment settings:

      • Applies to: Sales Order
      • Deployed: True
      • Status: Released
      • Event Type: Create
      • Log Level: Error
      • Execute as Role: Administrator
    3. Go to Audience > Roles and select Select All.

      Cad_2.png
    4. Click Save.

      Note

      You must deploy the script for every NetSuite transaction type where the tax override should apply (for example, Sales Order, Cash Sale created by the integration app).

  5. Test the behavior:

    1. In the integration app, run the Sales Order/Auto-billing flow on a sample Canadian order.
    2. Confirm that the Canadian taxes are calculated correctly and the invoice is marked as fully paid.