Skip to main content
Version: Current

Understanding how line totals/taxes are calculated

Accurate line-level calculations are fundamental for correct document totals and financial processing. Zudello automatically calculates various line totals and tax amounts based on user input and document settings. This guide explains the logic behind these calculations.

Best practices

  • Ensure quantity and unit price fields are entered accurately.
  • Apply the correct tax rate to each line item.
  • Verify the header-level Are the line totals inclusive of tax? toggle (tax included) is set correctly based on the source document.
  • Review calculated line total and tax amount against the original document.

Core line fields

The primary fields involved in line calculations are:

  • Quantity
    • The number of units. Defaults to 1 if empty during calculation.
  • Unit price
    • The price per unit.
  • Total
    • The total amount for the line (Quantity * Unit Price, potentially including tax).
  • Tax rate
    • The linked Tax Rate record containing the percentage rate (e.g., 10% GST).
  • Tax included
    • A header-level boolean field indicating if the total values on the document lines inherently include tax (TRUE) or exclude tax (FALSE).

Calculated line fields

Zudello automatically calculates the following fields based on the core fields and the tax included setting:

  1. Line Tax Amount (tax amount):

    • This represents the tax portion applicable to the line total.
    • If tax included is TRUE:
      • tax amount = total - (total * 100 / (100 + tax rate.rate))
      • (Calculates the tax amount by finding the exclusive amount first)
    • If tax included is FALSE:
      • tax amount = total * tax rate.rate / 100
      • (Calculates tax directly on the exclusive total)
    • If tax rate is not set (null), tax amount defaults to 0.
  2. Line Total Exclusive (total exclusive):

    • This represents the line total before tax.
    • If tax included is TRUE:
      • total exclusive = total - tax amount
      • (Calculated using the tax amount derived above)
    • If tax included is FALSE:
      • total exclusive = total
      • (The line total already excludes tax)
    • If total or calculated tax amount is null, total exclusive is set to null.
  3. Line Unit Price Exclusive (unit price exclusive):

    • This represents the unit price before tax. Zudello attempts to determine if the entered unit price was inclusive or exclusive.
    • Determination Logic:
      • If tax included is TRUE: It checks if (unit price * quantity) equals total exclusive. If true, the entered unit price was exclusive. Otherwise, it assumes the entered unit price was inclusive.
      • If tax included is FALSE: It checks if (unit price * quantity) equals total. If true, the entered unit price was exclusive. Otherwise, it assumes the entered unit price was inclusive.
    • Calculation:
      • If determined to be exclusive: unit price exclusive = unit price
      • If determined to be inclusive: unit price exclusive = unit price - (tax amount / quantity)
      • (Calculates the exclusive unit price by removing the per-unit tax amount)
  4. Line Total (total) - Auto-calculation:

    • While often extracted or entered manually, the line total can also be auto-calculated if quantity and unit price are present.
    • total = quantity * unit price
    • Note: This basic calculation happens early. The subsequent tax amount and total exclusive calculations rely on this total and the tax included flag. If the tax included flag is TRUE, this auto-calculated total is assumed to include tax.

Key considerations

  • Tax included flag: The accuracy of all tax-related calculations hinges on the correct setting of the header-level tax included toggle.
  • Order of Operations: Zudello performs these calculations in a specific sequence during the enrichment process or when a document is saved. Changes to quantity, unit price, total, or tax rate will trigger recalculations.
  • Manual Overrides: Users can often manually edit the total and sometimes tax amount fields. Subsequent automatic recalculations might occur if other related fields (like tax rate) are changed later.
  • Rounding: Minor discrepancies can occur due to rounding, especially when dealing with inclusive amounts or complex tax rates.

Troubleshooting line totals

  • Incorrect tax amount: Verify the tax rate and the tax included setting.
  • Incorrect total exclusive: Verify the line total, tax rate, and the tax included setting.
  • Incorrect unit price exclusive: Verify unit price, quantity, tax rate, and the tax included setting. Check if the system correctly determined whether the entered unit price was inclusive or exclusive.

Need help?

Contact your organisation administrator or Zudello support if you encounter persistent issues with line total or tax calculations.