Bug #5587
openPOS Discount calculation incorrect for taxable & non-taxable products
Description
The current POS system applies discount on the final total after tax, which also reduces the tax value.
This is not the correct POS standard behavior, as discount should never reduce the tax amount.
✅ * * Correct POS Standard Logic (Expected)**
Calculate subtotal for each product line item (Price × Quantity)
Apply discount on each product subtotal before calculating tax
Separate discounted subtotals into:
Taxable subtotal (after discount)
Non-taxable subtotal (after discount)
Apply tax only on discounted taxable subtotal
Final Net Total = (discounted taxable subtotal + tax) + discounted non-taxable subtotal
*Actual Behavior (Current System – Incorrect)
Subtotal → Tax on taxable items → Subtotal+Tax → Discount applied on total
This causes the tax amount to be discounted, which is incorrect.*
Example using selected products
Product Price ($) Qty Taxable? Subtotal ($)
Cutter Tool 0.25 1 T 0.25
Mango Pickle 8.00 1 T 8.00
Shanku Chakram 42.00 1 NT 42.00
✅ Correct calculation:
Cutter Tool discounted subtotal = 0.25 × 50% = 0.125
Mango Pickle discounted subtotal = 8.00 × 50% = 4.00
Shanku Chakram discounted subtotal = 42.00 × 50% = 21.00
Taxable subtotal after discount = 0.125 + 4.00 = 4.125
Tax (7%) on taxable subtotal = 4.125 × 7% = 0.289 ≈ 0.29
Final Net Total = 4.125 + 0.29 + 21.00 = 25.415 → Rounded = $25.42
✔ Discount reduces subtotal only
✔ Tax remains accurate and not reduced
✔ Non-taxable product has 0 tax
Test Steps to Reproduce
Open POS screen
Add one taxable product (Cutter Tool, Mango Pickle etc.)
Add one non-taxable product
Verify subtotal is calculated correctly per product
Select Discount Type → 50%
Observe discount applying on entire net total including tax
Verify tax amount is reduced by 50% (❌ issue)
Verify calculation should match standard POS flow where tax is not reduced
Test Data
Cart subtotal before tax = 50.25
Total tax on taxable products = 0.58 (7%)
Final before discount = 50.83
Discount selected = 50%
Expected Result
Discount must apply on product subtotal before tax
Tax must calculate on discounted taxable subtotal only
Non-tax item tax = 0
Discount must NOT reduce tax
Actual Result
Tax amount is being discounted
Discount applied after tax on final total
Logic incorrect for POS standards
i will attach the images in our pos present calcualtion and chatgpt gives the some pos standard logic given by chatgpt
Our Pos Application present logic
Chatgpt gives the pos standard logic is 
Files
Subtasks
Related issues
Updated by Rubanraj c 5 days ago
- Status changed from New to In Progress
- Estimated time set to 2:00 h
Updated by Rubanraj c 4 days ago
- Status changed from In Progress to Resolved
- % Done changed from 0 to 100
Backend fixed for card and terminal pls assign frontend person for this