Taxes and Charges

Every invoice ERPNext creates passes through a Taxes and Charges table before it posts. That table is where tax is calculated, freight is allocated, discounts are applied, and the final payable or receivable amount is determined. Understanding how that table works — and the three template types that populate it — is prerequisite knowledge for anyone configuring or auditing transactions in ERPNext.

ERPNext represents each taxing authority as a separate GL account and models tax as a line item in the Taxes and Charges table rather than as a field on the invoice. This approach is not unique to ERPNext; it reflects a design pattern common to most ERP systems built in the 1990s and 2000s. The practical consequence is that every jurisdiction a company collects or remits tax to requires its own account, its own template row, and its own maintenance when rates change. The system works well for businesses with straightforward, stable tax obligations. It becomes burdensome as nexus complexity grows.

How Templates Work

All three template types — Purchase Taxes and Charges, Sales Taxes and Charges, and Item Tax — share the same row structure. Each row specifies a GL account, a calculation method (fixed amount, percentage of the invoice total, or compounded on a prior row), whether to add or deduct, and whether the result should affect inventory valuation, the invoice total, or both. The valuation flag is the most consequential decision in the row: a charge marked as affecting valuation is capitalized into the cost of the received items and flows through Cost of Goods Sold when those items are sold; a charge marked as total-only is expensed immediately against its account head regardless of inventory movement. An account used in any template row must have its Account Type set to "Tax" in the Chart of Accounts.

Any template can be marked as the default for its transaction type, which causes ERPNext to apply it automatically without user selection. For most businesses, one default Purchase template and one default Sales template cover the majority of transactions, and Tax Rules handle exceptions.

Purchase Taxes and Charges Template

The Purchase Taxes and Charges Template is the right tool for charges that arrive with or after a purchase and need to be recorded at the document level rather than as item costs. Tax, freight, customs duties, bank processing fees, and volume discounts all belong here. The critical design question for each row is whether the charge should be capitalized into inventory or expensed: freight on raw materials for a manufacturer typically should be; a credit card processing fee typically should not be.

Use the Purchase template when the adjustment applies to the purchase as a whole rather than to a specific item. If the freight rate varies by item weight or the discount applies only to certain product lines, those adjustments belong on the item lines instead. Early payment discounts do not belong in the template at all — their applicability depends on the payment date, which is not known at invoice time, and a template row applies unconditionally.

Multiple Adjustments on One Purchase

Chelsea Fruit Company receives a $1,000 invoice for raw materials. The supplier charges $50 freight, the company pays by credit card at a 3% processing fee, and the order qualifies for a 2% volume discount.

Template configuration:

AccountTypeAdd/DeductRateAmountConditionAffects Valuation
Freight and ForwardingTotalAdd050Yes
Bank ChargesNet TotalAdd30No
Purchase DiscountsNet TotalDeduct20total > 500No

Freight is marked Valuation so its cost distributes across the received items. Bank charges and the discount are Total only; they affect the payable but not the inventory value.

Purchase Receipt:

AccountStock LedgerDebitCredit
Raw Materials+100 @ $10.50$1,050.00
Stock Received But Not Billed$1,050.00

Purchase Invoice:

AccountStock LedgerDebitCredit
Stock Received But Not Billed$1,050.00
Bank Charges$30.00
Purchase Discounts$20.00
Accounts Payable$1,060.00

When to Use the Item Line vs. the Taxes and Charges Table

The Taxes and Charges table handles adjustments that apply to the transaction as a whole or that need to be calculated as a percentage of the invoice total. Item lines handle quantities and unit costs. The decision affects both where the amount posts and whether it is distributed across individual items or treated as a single charge.

Yes

No

Yes

No

Yes

No

Yes - becomes part of item cost

No - expense separately

Charge or Adjustment

Is it tied to a specific item
or quantity?

Item line

Is it a percentage of
the invoice total?

Taxes and Charges table
Type: On Net Total

Is it a fixed amount?

Should it affect
inventory valuation?

Taxes and Charges table
Type: On Previous Row

Taxes and Charges table
Type: Actual, Affects Valuation

Taxes and Charges table
Type: Actual, Total only

Purchase-Side Tax

Purchase tax comes in two varieties: tax the supplier collects and remits (VAT, GST, sales tax in some jurisdictions) and tax the company self-assesses (use tax in the United States). Both use the same template mechanics. The accounting decision is whether the tax should be capitalized into inventory cost or expensed immediately.

Purchase tax takes two forms: tax the supplier collects and remits (VAT, GST, sales tax in some jurisdictions) and tax the company self-assesses (use tax in the United States). The template mechanics are identical for both. The accounting decision is whether to capitalize the tax into inventory cost or expense it immediately. Capitalizing is more accurate for manufacturing contexts where the tax is unrecoverable and should flow through Cost of Goods Sold at the time of sale. Expensing immediately is simpler and is how most US companies treat purchase-side sales tax. Either approach is defensible; the requirement is consistency across similar transactions.

Supplier-collected VAT at 20% on a $1,000 purchase, expensed separately:

AccountStock LedgerDebitCredit
Raw Materials+100 @ $10.00$1,000.00
Input VAT$200.00
Accounts Payable$1,200.00

The same purchase with VAT capitalized into inventory cost:

AccountStock LedgerDebitCredit
Raw Materials+100 @ $12.00$1,200.00
Accounts Payable$1,200.00

Self-assessed use tax at 6% on a $1,000 interstate purchase, expensed immediately:

AccountStock LedgerDebitCredit
Raw Materials+100 @ $10.00$1,000.00
Use Tax Expense$60.00
Use Tax Payable$60.00
Accounts Payable$1,000.00

Sales Taxes and Charges Template

The Sales Taxes and Charges Template applies to Sales Orders and Sales Invoices. It differs from the Purchase template in two ways. First, it adds a calculation type of On Item Quantity, which multiplies the rate by units sold rather than by a monetary amount; this is the correct configuration for per-unit excise taxes, bottle deposits, and similar charges where the taxable base is quantity rather than value. Second, it supports a tax-inclusive pricing flag that causes ERPNext to back-calculate the net amount from a tax-included price rather than adding tax on top, which is the correct behavior for markets where prices are quoted inclusive of VAT.

Sales tax collected and remitted does not affect inventory valuation; it is always a liability. The Sales template is therefore simpler than the Purchase template on the valuation question. The design decision to make is whether a given charge — a delivery fee, a fuel surcharge, a restocking charge on returns — should appear as a separate line on the customer's invoice or be built into item pricing. Charges that vary by order and that customers expect to see itemized belong in the template; charges that are standard and invisible to the customer belong in the item price.

Sales tax on a $500 invoice at 8%:

AccountStock LedgerDebitCredit
Accounts Receivable$540.00
Sales Revenue$500.00
Sales Tax Payable$40.00

Item Tax Template

The Purchase and Sales Taxes and Charges Templates apply a single rate to every item on a transaction. An Item Tax Template overrides that rate for a specific item or Item Group. It is the mechanism for reduced rates, zero rates, and exemptions: most items on an invoice are taxed at the standard rate, but fresh produce in one state is exempt, or a medical device qualifies for a reduced rate.

The override only fires if the same tax account head appears in both the document-level template and the Item Tax Template. ERPNext matches on account head and substitutes the item-level rate for that item's row. Item Tax Templates support a Valid From date, which allows rate changes to be staged in advance; for Purchase Invoices, the Supplier Invoice Date governs which template version applies rather than the Posting Date. Templates can be assigned at the Item Group level and cascade to member items unless a specific item has its own assignment.

Do not use the same Sales or Purchase Taxes and Charges Template in both a Tax Rule and an Item Tax Template on the same transaction. ERPNext cannot reconcile the two sources and the resulting rates will be incorrect. Use distinct template names even when the rates are the same.

Tax Category

A Tax Category is a label assigned to a Customer, Supplier, Address, or Item. Its presence on a transaction triggers Tax Rules that would not otherwise apply. Tax Categories exist to classify parties and addresses into groups that share the same tax treatment without requiring a dedicated Tax Rule per party.

The lookup order when ERPNext resolves a Tax Category for a transaction is:

  1. The billing or shipping address on the transaction (which takes precedence is configurable in Accounts Settings under "Determine Address Tax Category From")
  2. The Customer or Supplier master, as a fallback if the address has no Tax Category

The resolved Tax Category is displayed on the transaction and can be overridden manually. Once set, it activates any Tax Rule that references that category, which in turn loads the appropriate Taxes and Charges Template.

Common uses: classifying government entities, nonprofits, or resellers who purchase tax-exempt; distinguishing domestic from export customers; grouping customers in a specific state or territory who share a distinct tax template.

Tax Rules and Nexus Determination

Tax Rules automate template selection. Without them, users must manually choose the correct Taxes and Charges Template on every transaction. With them, ERPNext evaluates the transaction's party, address, items, Tax Category, and date, finds the matching rule, and populates the template automatically.

When a transaction is saved, ERPNext evaluates all active Tax Rules against it. A rule can match on any combination of party, party group, billing or shipping address fields, item, item group, tax category, and date range. The more conditions a rule specifies, the more specific it is. When multiple rules match the same transaction, the one with the lowest Priority number wins. A rule with no condition set on a given field matches anything for that field, so a rule that only specifies a country will fire for every transaction with a shipping address in that country, regardless of customer or item.

This resolution order has practical consequences for rule design. A general rule covering a state should have a higher Priority number than a specific rule covering a county within that state. If the county rule matches, it wins; if it does not, the state rule fires as a fallback. A rule covering a specific tax-exempt customer should have a lower Priority number than the general state rule, so the exemption takes precedence. Getting this wrong produces silently incorrect tax amounts with no error message.

Chelsea Fruit Company ships produce to customers in three states, each with different sales tax rates, and sells to several government customers who are fully exempt. The rule set might look like this, ordered from lowest to highest Priority number:

  1. Government exempt customers (Tax Category: Government, template: No Tax) — fires first when the customer carries that category, regardless of state
  2. State A rule (shipping address state = State A, template: State A Sales Tax)
  3. State B rule (shipping address state = State B, template: State B Sales Tax)
  4. State C rule (shipping address state = State C, template: State C Sales Tax)

A government customer in State A matches both rule 1 and rule 2. Rule 1 wins. A commercial customer in State B matches only rule 3. A commercial customer in a state with no rule matches nothing and no template is applied, which is the correct outcome if the company has no nexus there.

When Tax Rules Are Not Enough

ERPNext's Tax Rule system requires someone to configure and maintain a rule for every jurisdiction where the company has nexus. In the United States alone, there are over 11,000 taxing jurisdictions (states, counties, cities, and special districts), each with its own rates, exemptions, and product classifications. A wholesale fruit company selling across state lines encounters economic nexus thresholds that can change annually, product-level exemptions that vary by state (fresh produce may be exempt in one state and taxable in another), and rate changes that require updating templates before they take effect.

Third-party tax compliance services, of which TaxJar and Avalara are the two most widely deployed, solve this by maintaining the rate database, handling nexus tracking, and filing returns. ERPNext has community-built integrations for both. The integration replaces the Tax Rule and Taxes and Charges Template calculation with a real-time API call: the service receives the transaction details and returns the correct tax amount for the jurisdiction, which populates the Taxes and Charges row.

The decision between ERPNext's native system and a third-party service is a cost-of-compliance question. For businesses with simple, stable tax obligations (one or two states, standard-rated products, predictable volumes) the native system is sufficient and the maintenance burden is manageable. For businesses selling across many jurisdictions, dealing with product-level exemptions, or approaching nexus thresholds in new states, the cost of maintaining ERPNext's tax configuration accurately will exceed the cost of the integration service, and the risk of misconfiguration is material.

Please contact us for corrections, additions, questions, or to request a topic.

© 2026 AgriTheory. All Rights Reserved.