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:
parent
e4e5746301
commit
fe8d016148
|
|
@ -13,7 +13,7 @@
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"label": "Tax Article",
|
"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",
|
"options": "Tax Article",
|
||||||
"reqd": 1
|
"reqd": 1
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,9 @@
|
||||||
// `custom_item_tax_articles`, linked to each item row by `custom_si_row_key`.
|
// `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
|
// 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
|
// (ƏDV 0% -> 0% group, ƏDV-dən azadolma -> exempt group, ƏDV 18% -> taxable-turnover
|
||||||
// those templates.
|
// 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 DIALOG_CLASS = "tax-articles-dialog";
|
||||||
const CHILD_DOCTYPE = "Sales Invoice Tax Article";
|
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_ZERO = "ƏDV-yə 0% dərəcə ilə tutulan əməliyyatlar";
|
||||||
const GROUP_EXEMPT = "ƏDV-dən azad olunan ə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) {
|
function tax_article_group_for(template) {
|
||||||
const t = (template || "").trim();
|
const t = (template || "").trim();
|
||||||
if (t.indexOf("ƏDV 0%") === 0) return GROUP_ZERO;
|
if (t.indexOf("ƏDV 0%") === 0) return GROUP_ZERO;
|
||||||
if (t.indexOf("ƏDV-dən azadolma") === 0) return GROUP_EXEMPT;
|
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;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -126,7 +131,7 @@ function open_tax_article_dialog(frm, cdn) {
|
||||||
if (!group) {
|
if (!group) {
|
||||||
frappe.show_alert({
|
frappe.show_alert({
|
||||||
message: __(
|
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",
|
indicator: "orange",
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue