fixed payment report vat calc

This commit is contained in:
Ali 2025-07-22 13:24:43 +04:00
parent 79083c9b23
commit 9016cf1086
1 changed files with 6 additions and 6 deletions

View File

@ -109,18 +109,18 @@ def get_data(filters):
pe.party_type,
pe.party,
pe.party_name,
pe.paid_amount,
pe.paid_amount - COALESCE(SUM(CASE
WHEN stc.account_head = '521.3 - ƏDV' OR acc.account_number = '521.3'
THEN stc.tax_amount
ELSE 0
END), 0) as paid_amount,
pe.received_amount,
COALESCE(SUM(CASE
WHEN stc.account_head = '521.3 - ƏDV' OR acc.account_number = '521.3'
THEN stc.tax_amount
ELSE 0
END), 0) as vat_amount,
pe.received_amount + COALESCE(SUM(CASE
WHEN stc.account_head = '521.3 - ƏDV' OR acc.account_number = '521.3'
THEN stc.tax_amount
ELSE 0
END), 0) as grand_total,
pe.paid_amount as grand_total,
pe.mode_of_payment,
pe.reference_no,
pe.reference_date