From fe8d0161484e19cb1f3d2f1c8d349f761a284f92 Mon Sep 17 00:00:00 2001 From: Ali <010109ali@gmail.com> Date: Mon, 8 Jun 2026 12:44:51 +0000 Subject: [PATCH] feat(tax-article): extend tax_article coverage to new VAT-turnover groups MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Payment Entry: add the two new Əlavə 3 groups (ƏDV tutulan dövriyyə / ƏDV tutulan əməliyyat sayılmayan dövriyyə) to the tax_article link filter - Sales Invoice: allow tax articles on ƏDV 18% lines, filtered to "ƏDV tutulan dövriyyə barədə məlumat" (301.x). ƏDV daxil 18% stays excluded (its prefix doesn't match "ƏDV 18%"). Co-Authored-By: Claude Opus 4.8 (1M context) --- .../payment_entry_tax_article.json | 2 +- jey_erp/public/js/sales_invoice_tax_articles.js | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/jey_erp/jey_erp/doctype/payment_entry_tax_article/payment_entry_tax_article.json b/jey_erp/jey_erp/doctype/payment_entry_tax_article/payment_entry_tax_article.json index 429260c..12161ae 100644 --- a/jey_erp/jey_erp/doctype/payment_entry_tax_article/payment_entry_tax_article.json +++ b/jey_erp/jey_erp/doctype/payment_entry_tax_article/payment_entry_tax_article.json @@ -13,7 +13,7 @@ "fieldtype": "Link", "in_list_view": 1, "label": "Tax Article", - "link_filters": "[[\"Tax Article\",\"parent_tax_article\",\"in\",[\"ƏDV-yə 0% dərəcə ilə tutulan əməliyyatlar\",\"ƏDV-dən azad olunan əməliyyatlar\"]]]", + "link_filters": "[[\"Tax Article\",\"parent_tax_article\",\"in\",[\"ƏDV-yə 0% dərəcə ilə tutulan əməliyyatlar\",\"ƏDV-dən azad olunan əməliyyatlar\",\"ƏDV tutulan dövriyyə barədə məlumat\",\"ƏDV tutulan əməliyyat sayılmayan dövriyyə barədə məlumat\"]]]", "options": "Tax Article", "reqd": 1 } diff --git a/jey_erp/public/js/sales_invoice_tax_articles.js b/jey_erp/public/js/sales_invoice_tax_articles.js index eeadacd..865a343 100644 --- a/jey_erp/public/js/sales_invoice_tax_articles.js +++ b/jey_erp/public/js/sales_invoice_tax_articles.js @@ -5,8 +5,9 @@ // `custom_item_tax_articles`, linked to each item row by `custom_si_row_key`. // // The article list is filtered to the parent group matching the line's tax template -// (ƏDV 0% -> 0% group, ƏDV-dən azadolma -> exempt group); the dialog only opens for -// those templates. +// (ƏDV 0% -> 0% group, ƏDV-dən azadolma -> exempt group, ƏDV 18% -> taxable-turnover +// group); the dialog only opens for those templates. Note: ƏDV daxil 18% (VAT +// included) is intentionally excluded — it gets no tax articles. const DIALOG_CLASS = "tax-articles-dialog"; const CHILD_DOCTYPE = "Sales Invoice Tax Article"; @@ -14,11 +15,15 @@ const DISPLAY_FIELD = "custom_tax_articles_display"; const GROUP_ZERO = "ƏDV-yə 0% dərəcə ilə tutulan əməliyyatlar"; const GROUP_EXEMPT = "ƏDV-dən azad olunan əməliyyatlar"; +const GROUP_TAXABLE_18 = "ƏDV tutulan dövriyyə barədə məlumat"; function tax_article_group_for(template) { const t = (template || "").trim(); if (t.indexOf("ƏDV 0%") === 0) return GROUP_ZERO; if (t.indexOf("ƏDV-dən azadolma") === 0) return GROUP_EXEMPT; + // "ƏDV 18%" (VAT on top) only — "ƏDV daxil 18%" does NOT match this prefix, + // so the VAT-included variant deliberately gets no tax articles. + if (t.indexOf("ƏDV 18%") === 0) return GROUP_TAXABLE_18; return null; } @@ -126,7 +131,7 @@ function open_tax_article_dialog(frm, cdn) { if (!group) { frappe.show_alert({ message: __( - "Tax articles apply only to ƏDV 0% / ƏDV-dən azadolma lines. Set the item's Tax Template first." + "Tax articles apply only to ƏDV 0% / ƏDV-dən azadolma / ƏDV 18% lines. Set the item's Tax Template first." ), indicator: "orange", });