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 cacd7d3..b15bdec 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 @@ -290,21 +290,20 @@ function vc_recompute(frm) { // 3s after the fill settles it runs the recompute ONCE, so roll-ups / passthrough // (e.g. 301.1 = Σ children, turnover ← appendices) fill in from the report data. // User edits (outside fill mode) are debounced. --- -var vc_fill_mode = false, vc_fill_timer = null, vc_calc_timer = null, vc_frm = null; +var vc_fill_mode = false, vc_fill_timer = null, vc_frm = null; function vc_mark_fill(frm) { if (frm) vc_frm = frm; vc_fill_mode = true; if (vc_fill_timer) clearTimeout(vc_fill_timer); vc_fill_timer = setTimeout(function () { vc_fill_mode = false; - if (vc_frm) vc_recompute(vc_frm); // one recompute after the report-fill settles - }, 3000); + if (vc_frm) vc_recompute(vc_frm); // one recompute after the report-fill burst settles + }, 400); } function vc_onchange(frm) { vc_frm = frm; - if (vc_fill_mode) { vc_mark_fill(frm); return; } // during fill: extend window, no per-write recompute - if (vc_calc_timer) clearTimeout(vc_calc_timer); - vc_calc_timer = setTimeout(function () { vc_recompute(frm); }, 300); // debounce user edits + if (vc_fill_mode) { vc_mark_fill(frm); return; } // during report-fill: don't recompute per write (would freeze) + vc_recompute(frm); // user edit: recompute instantly } // period change (dövr picker writes ay/il) starts the fill window