How Price-Includes-Tax and GST Calculations Work
Source: invoice.rb:1168-end, invoice_item.rb:263-282
- Two calculation modes: price_includes_tax (GST is reverse-calculated from the inclusive amount) vs price_excludes_tax (GST is added on top)
- For price-includes-tax: GST = amount - (amount / (1 + tax_rate))
- For price-excludes-tax: GST = amount * tax_rate
- For multi-tax groups, all tax rates in the group are summed before applying
- Labor items with labor_gst_free flag get reduced rates
- GST rounding precision differs by integration: 2 decimal places for Xero/QuickBooks-connected companies, 4 decimal places otherwise
- Freight tax calculation also varies based on the price_includes_tax setting
- GST is forced to zero for GST-free products, tax-free customers, and internal invoices
Support scenarios
- "My GST seems wrong" -> check the price_includes_tax setting; switching between modes changes how GST is derived from the same unit price
- "GST is slightly different from what I calculated" -> Xero/QuickBooks companies round GST to 2 decimal places; non-integrated companies keep 4 decimal places
- "Why is there no tax on this line item?" -> the product is GST-free, the customer is tax-free, or it is an internal invoice