How Zudello Calculates Line Totals
Accurate line-level calculations form the basis for correct document header totals. Zudello automatically calculates several key fields on each transaction line based on the input values and the document's tax settings.
Input Fields:
The calculations primarily rely on these fields, which are often extracted or entered manually:
quantity: Number of units.unit_price: Price per unit.total: Total amount for the line (may or may not include tax initially).tax_rate: The linked Tax Rate record (e.g., 10% GST).tax_included(Header Level): A toggle indicating if thetotalvalues on the document lines include tax (TRUE) or exclude tax (FALSE).
Calculated Fields:
Zudello automatically calculates and stores these values:
-
Line Tax Amount (
tax_amount): The tax portion for the line.- If
tax_includedisTRUE: Tax is backed out:tax_amount = total - (total * 100 / (100 + tax_rate.rate)) - If
tax_includedisFALSE: Tax is added:tax_amount = total * tax_rate.rate / 100 - Defaults to
0iftax_rateis missing.
- If
-
Line Total Exclusive (
total_exclusive): The line total before tax.- If
tax_includedisTRUE:total_exclusive = total - tax_amount - If
tax_includedisFALSE:total_exclusive = total
- If
-
Line Unit Price Exclusive (
unit_price_exclusive): The unit price before tax.- Zudello attempts to determine if the entered
unit_pricewas inclusive or exclusive based on whether(unit_price * quantity)matches the calculatedtotal_exclusive(iftax_includedis TRUE) or thetotal(iftax_includedis FALSE). - If determined exclusive:
unit_price_exclusive = unit_price - If determined inclusive:
unit_price_exclusive = unit_price - (tax_amount / quantity)
- Zudello attempts to determine if the entered
-
Line Total (
total) - Recalculation: Ifquantityandunit_priceare present, Zudello often recalculates the linetotalasquantity * unit_price. The interpretation of whether this recalculated total includes tax depends on thetax_includedflag.
Key Factor:
- The
tax_includedtoggle setting is critical. Ensuring it correctly reflects the source document format is essential for accuratetax_amountandtotal_exclusivecalculations at the line level, which then roll up to the header totals.
Understanding these calculations helps troubleshoot discrepancies between Zudello figures and the source document.
See also: Understanding How Line Totals/Taxes are Calculated (How-To) See also: Troubleshooting Tax Calculation Errors