fixed vat allocation total fields

This commit is contained in:
Ali 2026-02-06 15:22:38 +04:00
parent 1544253f99
commit 6741525a74
2 changed files with 10 additions and 10 deletions

View File

@ -1250,14 +1250,14 @@ function calculate_tax_template_totals(frm) {
let template = (si_row.item_tax_template || '').trim();
// Match by template name
if (template === 'ƏDV daxil 18%') {
// Match by template name prefix (template may have company suffix like "ƏDV 18% - js")
if (template.startsWith('ƏDV daxil 18%')) {
frm.doc.total_edv_daxil_18 += allocated;
} else if (template === 'ƏDV-dən azadolma') {
} else if (template.startsWith('ƏDV-dən azadolma')) {
frm.doc.total_edv_azadolma += allocated;
} else if (template === 'ƏDV 0%') {
} else if (template.startsWith('ƏDV 0%')) {
frm.doc.total_edv_0 += allocated;
} else if (template === 'ƏDV 18%') {
} else if (template.startsWith('ƏDV 18%')) {
frm.doc.total_edv_18 += allocated;
}

View File

@ -123,14 +123,14 @@ class VATallocation(Document):
template = (si_row.item_tax_template or '').strip()
# Match by template name
if template == 'ƏDV daxil 18%':
# Match by template name prefix (template may have company suffix like "ƏDV 18% - js")
if template.startswith('ƏDV daxil 18%'):
self.total_edv_daxil_18 = float(Decimal(str(self.total_edv_daxil_18 or 0)) + allocated)
elif template == 'ƏDV-dən azadolma':
elif template.startswith('ƏDV-dən azadolma'):
self.total_edv_azadolma = float(Decimal(str(self.total_edv_azadolma or 0)) + allocated)
elif template == 'ƏDV 0%':
elif template.startswith('ƏDV 0%'):
self.total_edv_0 = float(Decimal(str(self.total_edv_0 or 0)) + allocated)
elif template == 'ƏDV 18%':
elif template.startswith('ƏDV 18%'):
self.total_edv_18 = float(Decimal(str(self.total_edv_18 or 0)) + allocated)
# Add to total sum