Exclude cancelled transaction

This commit is contained in:
Abdul Aziz Amrullah 2026-06-10 09:52:37 +07:00
parent 1245444819
commit eda9896548

View File

@ -102,6 +102,8 @@ class PosExportBcWizard(models.TransientModel):
# To get the total amount tendered before change, we sum only the positive payments. # To get the total amount tendered before change, we sum only the positive payments.
# The change/return is typically stored in order.amount_return # The change/return is typically stored in order.amount_return
paid = sum(p.amount for p in order.payment_ids if p.amount > 0) paid = sum(p.amount for p in order.payment_ids if p.amount > 0)
if paid == 0:
continue
pax = order.customer_count if 'customer_count' in order._fields else 1 pax = order.customer_count if 'customer_count' in order._fields else 1
return_amt = order.amount_return if 'amount_return' in order._fields else (paid - charge if paid > charge else 0) return_amt = order.amount_return if 'amount_return' in order._fields else (paid - charge if paid > charge else 0)