Technical Documentation: Tax-Related Features
Automatic VAT Code Selection for EC Sales
Legacy Script
Workflow Action Script: LOC: ecSalesTaxcodeSuiteAPP V2
Workflow: Localization Nordics TXN BeforeSubmit
Unreleased new version: User Event Script: Localization Nordics Tran On Submit
Design Flow
Runs on before submit
NetSuite License checking
Get the localization settings record
For OneWorld accounts, the corresponding loc settings for the transaction subsidiary
For non-OneWorld accounts, the active loc settings record with the smallest internal id (created the earliest)
Note: Subsidiary field is not mandatory in the Localization Settings record
If no loc settings found, exit script
Check if the feature is enabled through the field EC TAX CODE CHANGE ENABLED (custrecord_sta_fin_ectaxcodechange). If unchecked, exit script.
Get the following field values from the loc settings record:
EC DUMMY TAX CODE (custrecord_sta_fin_ecdummy_taxcodeid)
EC GOODS TAX CODE (custrecord_sta_fin_ecgoods_taxcodeid)
EC SERVICES TAX CODE (custrecord_sta_fin_ecservice_taxcodeid)
Get the Item VAT Type of Nature (custom field in the Item record) for all of the Items in the Item sublist and store them in an array.
Loop through the Item sublist. If the line’s Tax Code ID = EC DUMMY TAX CODE:
If the Item VAT Type of Nature of the current Item = Goods, set the current line’s Tax Code to the EC GOODS TAX CODE
If the Item VAT Type of Nature of the current Item = Service, set the current line’s Tax Code to the EC SERVICES TAX CODE
Updating VAT Declaration Fields
Legacy Script
Workflow Action Script: LOC: VAT Declaration 1: BeforeSubmit
Workflow: Localization Nordics TXN BeforeSubmit
Unreleased new version: User Event Script: Localization Nordics Tran On Submit
Design Flow
Runs on before submit
NetSuite License checking
Build an array of Tax Code details
Perform a search of all tax codes where VAT Category code (custrecord_sta_vat_type_code) is not empty
For OneWorld accounts, additional filter for Subsidiary
Get the following fields for each Tax Code in the search results and store them:
Tax Internal ID (internalid)
VAT Category code (custrecord_sta_vat_type_code)
VAT Category (custrecord_sta_select_vat_category)
VAT Exemption code (custrecord_sta_vatexempt_code)
VAT Exemption Reason (custrecord_sta_vatex_reason)
Loop through the sublists: Item, Billable Expenses, and Billable Time. For each line:
Set the following column fields to the values retrieved from the Tax Code record (retrieved in #3)
Line : VAT Category code (custcol_sta_vat_type_code) = Tax Code : VAT Category code (custrecord_sta_vat_type_code)
Line : VAT Category desc. (custcol_sta_vat_type_description) = Tax Code : VAT Category (custrecord_sta_select_vat_category)
Line : VAT Exemption Code (custcol_sta_vatex_code) = Tax Code : VAT Exemption code (custrecord_sta_vatexempt_code)
Line : VAT Exemption Reason (custcol_sta_vatex_reason) = Tax Code : VAT Exemption Reason (custrecord_sta_vatex_reason)
Invoicing: Detailed VAT Summary
Legacy Script
Workflow Action Script: LOC: Create Invoice Reference Number v2
Workflow: Localization Nordics TXN AfterSubmit
Unreleased new version: User Event Script: Localization Nordics Tran On Submit
Design Flow
Runs on before submit
NetSuite License checking
Get the localization settings record
For OneWorld accounts, the corresponding loc settings for the transaction subsidiary
For non-OneWorld accounts, the active loc settings record with the smallest internal id (created the earliest)
Note: Subsidiary field is not mandatory in the Localization Settings record
If no loc settings found, exit script
Check if the feature is enabled through the field VAT DETAILED SUMMARY (custrecord_sta_locset_vat_summary). If unchecked, exit script.
Get all the Tax Codes assigned in the lines of the sublists: Item, Billable Expenses, and Billable Time
Get the following fields for each Tax Code and store them:
Tax Internal ID (internalid)
Tax Rate (rate)
VAT Category code (custrecord_sta_vat_type_code)
VAT Category (custrecord_sta_select_vat_category)
VAT Exemption code (custrecord_sta_vatexempt_code)
Group all the lines from the Item, Billable Expenses, and Billable Time sublists according to Tax Code
For each Tax Code, get the summation of the Amount and Tax Amount of all the lines using that Tax Code
Add the Shipping Cost and Shipping Tax Amount to the grouped lines
Add the Handling Cost and Handling Tax Amount to the grouped lines
Sort the Tax Code grouped lines by descending Tax Rate
Get the first 4 Tax Codes and set the corresponding fields in the eInvoice (FIN) subtab of the Invoice (ex. Tax Rate 1, Tax Rate 2, Tax Rate 3, Tax Rate 4)
Invoicing: Invoice Layout
Legacy Template
Nordic Countries Invoice PDF/HTML Template
Design Flow
References the VAT Summary fields populated from the Invoicing: Detailed VAT Summary feature