feat(tax-article): extend tax_article coverage to new VAT-turnover groups

- 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) <noreply@anthropic.com>
This commit is contained in:
Ali 2026-06-08 12:44:51 +00:00
parent e4e5746301
commit fe8d016148
2 changed files with 9 additions and 4 deletions

View File

@ -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
}

View File

@ -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",
});