From d81eb4eee9c7d08cc251868cbad416df1a3c6aa3 Mon Sep 17 00:00:00 2001 From: Ali <010109ali@gmail.com> Date: Thu, 16 Jul 2026 11:56:12 +0000 Subject: [PATCH] =?UTF-8?q?fix(edv):=20compute=20319.1-4=20=C6=8FDV=20at?= =?UTF-8?q?=20per-row=20rates=20to=20match=20e-taxes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rows 319.1-319.4 (VAT refund on returned goods, Art. 165.5/165.6) have their ƏDV auto-computed on the e-taxes portal from the paid amount at distinct rates driven by the cash/non-cash cashback rules: 319.1 = 18%, 319.2 = 17.1%, 319.3 = 14.85%, 319.4 = 12.6% Parent 319 = Σ(319.1..319.4). Previously ours left the child ƏDV as manual input, so 319 summed to 0 unless the accountant typed each cell. Compute them in the controller and mark the cells read_only, mirroring the grey (computed) cells on the site. Verified headless: paid 100/500/200/300 -> 18/85.5/29.7/37.8, 319 = 171. --- .../declaration_of_value_added_tax.js | 5 +++++ .../declaration_of_value_added_tax_deqiqlesdirilen.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/taxes_az/taxes_az/doctype/declaration_of_value_added_tax/declaration_of_value_added_tax.js b/taxes_az/taxes_az/doctype/declaration_of_value_added_tax/declaration_of_value_added_tax.js index 794cf66..de4ac72 100644 --- a/taxes_az/taxes_az/doctype/declaration_of_value_added_tax/declaration_of_value_added_tax.js +++ b/taxes_az/taxes_az/doctype/declaration_of_value_added_tax/declaration_of_value_added_tax.js @@ -231,6 +231,11 @@ function vc_recompute(frm) { var gq = function (c, f) { var r = vc_row(frm, Q, c); return r ? vc_n(r[f]) : 0; }; var sq = function (c, f, val) { var r = vc_row(frm, Q, c); if (r) r[f] = vc_r2(val); }; sq("318", QVAT, gq("318", QPAID) * 18 / 100); + // 319.1-4 ƏDV = ödənilmiş məbləğ × dərəcə (fərqli — Art. 165.5/165.6 nağd/nağdsız qaytarma) + sq("319.1", QVAT, gq("319.1", QPAID) * 18 / 100); + sq("319.2", QVAT, gq("319.2", QPAID) * 17.1 / 100); + sq("319.3", QVAT, gq("319.3", QPAID) * 14.85 / 100); + sq("319.4", QVAT, gq("319.4", QPAID) * 12.6 / 100); sq("319", QVAT, gq("319.1", QVAT) + gq("319.2", QVAT) + gq("319.3", QVAT) + gq("319.4", QVAT)); frm.refresh_field(Q); diff --git a/taxes_az/taxes_az/doctype/declaration_of_value_added_tax_deqiqlesdirilen/declaration_of_value_added_tax_deqiqlesdirilen.json b/taxes_az/taxes_az/doctype/declaration_of_value_added_tax_deqiqlesdirilen/declaration_of_value_added_tax_deqiqlesdirilen.json index 3df5130..295f1f2 100644 --- a/taxes_az/taxes_az/doctype/declaration_of_value_added_tax_deqiqlesdirilen/declaration_of_value_added_tax_deqiqlesdirilen.json +++ b/taxes_az/taxes_az/doctype/declaration_of_value_added_tax_deqiqlesdirilen/declaration_of_value_added_tax_deqiqlesdirilen.json @@ -41,7 +41,7 @@ "in_list_view": 1, "label": "Əlavə dəyər vergisi məbləği", "read_only": 0, - "read_only_depends_on": "eval:[\"318\", \"319\"].indexOf((doc.göstəricilər||\"\").trim().split(/\\s+/)[0].replace(/\\.+$/,\"\")) >= 0" + "read_only_depends_on": "eval:[\"318\", \"319\", \"319.1\", \"319.2\", \"319.3\", \"319.4\"].indexOf((doc.göstəricilər||\"\").trim().split(/\\s+/)[0].replace(/\\.+$/,\"\")) >= 0" } ], "index_web_pages_for_search": 1,