diff --git a/taxes_az/taxes_az/doctype/vat_allocation/vat_allocation.js b/taxes_az/taxes_az/doctype/vat_allocation/vat_allocation.js index 35dc667..0e1c5bc 100644 --- a/taxes_az/taxes_az/doctype/vat_allocation/vat_allocation.js +++ b/taxes_az/taxes_az/doctype/vat_allocation/vat_allocation.js @@ -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; } diff --git a/taxes_az/taxes_az/doctype/vat_allocation/vat_allocation.py b/taxes_az/taxes_az/doctype/vat_allocation/vat_allocation.py index a9ce403..35b6d6b 100644 --- a/taxes_az/taxes_az/doctype/vat_allocation/vat_allocation.py +++ b/taxes_az/taxes_az/doctype/vat_allocation/vat_allocation.py @@ -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