fixed report vat allocation

This commit is contained in:
Ali 2026-02-09 19:28:08 +04:00
parent b2fd9bbe7b
commit b848bbd1d0
2 changed files with 2 additions and 4 deletions

View File

@ -168,7 +168,7 @@
"fieldname": "sales_invoice_previous_table", "fieldname": "sales_invoice_previous_table",
"fieldtype": "Table", "fieldtype": "Table",
"label": "Sales Invoice Previous Months", "label": "Sales Invoice Previous Months",
"options": "VAT allocation sales invoice" "options": "VAT allocation sales invoice previous months"
}, },
{ {
"fieldname": "column_break_lpuu", "fieldname": "column_break_lpuu",

View File

@ -91,9 +91,8 @@ def calculate_row_data(vat_allocation_name):
item_tax_template, item_tax_template,
SUM(amount) as total_amount, SUM(amount) as total_amount,
SUM(allocated_amount) as total_allocated SUM(allocated_amount) as total_allocated
FROM `tabVAT allocation sales invoice` FROM `tabVAT allocation sales invoice previous months`
WHERE parent = %(parent)s WHERE parent = %(parent)s
AND parentfield = 'sales_invoice_previous_table'
GROUP BY item_tax_template GROUP BY item_tax_template
""", {"parent": vat_allocation_name}, as_dict=1) """, {"parent": vat_allocation_name}, as_dict=1)
@ -104,7 +103,6 @@ def calculate_row_data(vat_allocation_name):
SUM(unallocated_amount) as total_unallocated SUM(unallocated_amount) as total_unallocated
FROM `tabVAT allocation sales invoice` FROM `tabVAT allocation sales invoice`
WHERE parent = %(parent)s WHERE parent = %(parent)s
AND parentfield = 'sales_invoice_table'
GROUP BY item_tax_template GROUP BY item_tax_template
""", {"parent": vat_allocation_name}, as_dict=1) """, {"parent": vat_allocation_name}, as_dict=1)