Tax Group

You can use the tax group record to combine several tax codes, even if the taxes are paid to different jurisdictions. For example, a tax group in the US might include a state tax, a city tax, and a transit tax. The advantage of using a tax group is that, when you create a sales invoice, you can apply one tax group to the transaction, instead of several separate tax codes.

In the UI, you go to this record by choosing Setup > Accounting > Tax Groups.

For help working with this record in the UI, see Tax Groups Overview.

The internal ID for this record is taxgroup.

See the SuiteScript Records Browser for the internal IDs of fields, search filters, and search columns associated with this record.

For information about scripting with this record in SuiteScript, see the following help topics:

Supported Script Types

The tax group record is scriptable in both client SuiteScript and Server SuiteScript.

All three user events are supported: beforeLoad, beforeSubmit, and afterSubmit.

Supported Functions

The tax group record is fully scriptable, which means that it can be created, updated, copied, deleted, and searched using SuiteScript.

For information about using the SuiteScript Records Browser, see Working with the SuiteScript Records Browser.

Code Samples

The following sample shows how to create a US tax group.

          var initValues = new Array();
initValues.nexuscountry = 'US';

var taxgroup = record.create({
    type: record.Type.TAX_GROUP,
    isDynamic: true,
    defaultValues: {
        'nexuscountry' : 'US'
    }
});
taxgroup.setValue({
    fieldId: 'itemid',
    value: 'Test US Tax Group'
});
taxgroup.setValue({
    fieldId: 'description',
    value: 'Tax group description'
});
taxgroup.selectNewLine({
    sublistId: 'taxitem'
});
taxgroup.setCurrentSublistValue({
    sublistId: 'taxitem',
    fieldId: 'taxname',
    value: '-1425'        // -1425 is ID of TX_BUFFALO Tax Code
});
taxgroup.commitLine({
    sublistId: 'taxitem'
});                 
recId = taxgroup.save(); 

        

The following code sample shows how to create a tax group for Canada.

          var newgroup = record.create({
    type: record.Type.TAX_GROUP,
    defaultValues: {
        'nexuscountry': 'CA'
    }
});
newgroup.setValue({
    fieldId: 'itemid',
    value: 'CA-T5'
});
newgroup.setValue({
    fieldId: 'piggyback',
    value: 'T'
});
newgroup.setValue({
    fieldId: 'taxitem1',
    value: 21           // Canadian tax code
});
newgroup.setValue({
    fieldId: 'taxitem2',
    value: 24           // Canadian tax code
});
newgroup.setValue({
    fieldId: 'subsidiary',
    value: 2            // Canadian subsidiary
});
newgroup.setValue({
    fieldId: 'state',
    value: 'AB'         // Canadian subsidiary
});
newgroup.setValue({
    fieldId: 'description',
    value: 'New Canada Tax Group'
});
var recID = newgroup.save(); 

        

Related Topics

General Notices