Tax calculation types ​

The Type field on a row of a Sales Taxes and Charges Template or Purchase Taxes and Charges Template decides the base that ERPNext uses to calculate the row. The same Tax Rate of 5 can mean 5%, or 5 per unit, depending on the type.

Types ​

TypeFormulaTypical use
ActualThe amount that you enter in AmountA fixed shipping or documentation charge
On Net TotalNet Total × Tax Rate ÷ 100A standard percentage tax
On Previous Row AmountAmount of the referenced row × Tax Rate ÷ 100A surcharge on another tax
On Previous Row TotalTotal of the referenced row × Tax Rate ÷ 100A tax on the subtotal after an earlier row
On Item QuantityTotal item quantity × Tax RateA fixed charge per unit

Examples ​

The examples use a Net Total of 1,000.

Actual ​

A fixed shipping charge of 25: the row Amount is 25 and the running Total is 1,025. ERPNext ignores the Tax Rate for an Actual row.

On Net Total ​

A rate of 8: 1,000 × 8 ÷ 100 = 80. The running Total is 1,080.

On Previous Row Amount and On Previous Row Total ​

Row 1 is 8% On Net Total. Row 2 is 2% with Reference Row # 1:

Row 2 typeBase from row 1Row 2 amountGrand Total
On Previous Row AmountAmount: 801.601,081.60
On Previous Row TotalTotal: 1,08021.601,101.60

See Apply tax on another tax.

On Item Quantity ​

With 5 units in total and a Tax Rate of 2: 5 × 2 = 10. The rate is an amount per unit in the document currency, not a percentage. Check the units of measure and conversion factors of the items.

Amount and Total columns ​

ColumnMeaning
AmountThe tax or charge of this row alone
TotalThe running total of the document after this row
Net AmountThe base that the row used. For a previous-row type, the referenced row's Amount or Total.

On Previous Row Amount uses the Amount of the referenced row. On Previous Row Total uses its Total.

Rules for Reference Row ​

  • Reference Row # is shown and allowed only for On Previous Row Amount and On Previous Row Total.
  • The first row cannot use a previous-row type.
  • The reference must point to an earlier row.
  • Each row has one reference. To tax a combination of several rows, reference the row whose running Total contains them.
  • Reference Row # stores a row number. When you insert, delete, or move rows, check every reference again.

The type decides how the amount is calculated. Two other fields decide how the amount is used:

  • Is this Tax included in Basic Rate? takes the tax out of a tax-inclusive item rate instead of adding it. See Tax-inclusive pricing.
  • Consider Tax or Charge for (purchase rows only) decides whether the amount changes the supplier total, the stock valuation, or both. See Include tax in valuation or total.

Errors ​

MessageCauseFix
Can refer row only if the charge type is 'On Previous Row Amount' or 'Previous Row Total'A row of another type has a Reference Row #Clear the reference or change the type.
Cannot select charge type as 'On Previous Row Amount' or 'On Previous Row Total' for first rowThe first row uses a previous-row typeMove a base row above it.
Please specify a valid Row ID for row ... in table ...A previous-row type has no Reference Row #Enter the earlier row number.
Cannot refer row number greater than or equal to current row number for this Charge typeThe reference points to this row or a later rowPoint to an earlier row.