mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-04-02 14:24:27 -04:00
The report had calculation inconsistencies where: 1. Per-line totals (subtotal + tax) didn't equal the total column 2. Column totals didn't match the sum of individual rows Root cause: subtotal, tax, and total were calculated independently using different formulas and rounding at different stages, leading to cumulative rounding errors. Fix: - Use item_tax_amount from database as the source of truth for tax - Derive subtotal from sale_amount (handling both tax_included and tax_not_included modes correctly) - Calculate total = subtotal + tax consistently for each line - Override getSummaryData() to sum values from getData() rows, ensuring summary totals match the sum of displayed rows Fixes #4112