Формы налоговой отчетности Азербайджана для JeyERP
Go to file
Ali afd65ce302 fix(fno): run declaration calculations once per Dövr pick
Picking a period fired every recalculation twice. `frm.set_value()` schedules the
field's handlers asynchronously (frappe.model.set_value -> run_serially), so by
the time the first trigger ran, both `ay`/`rüb` and `il` were already set in
frm.doc — and each field's handler then did a full pass. In VAT that also meant
`populate_vat_tables` was called twice per pick.

Five declarations were affected, all of them via Formula_Editor_Script_* which
bind a handler to every field a formula depends on: Declaration of value added
tax, Declaration of mining tax, Road tax 2, Tax return withheld at source of
payment, Single declaration related to salaried and non-salaried work.

Those scripts are generated, so they can't be patched — the fix has to live in
the picker. Instead of two set_value() calls, write the fields directly, do what
set_value would have done (refresh_field, refresh_dependency, dirty) and fire the
handlers exactly once.

Firing only `il` is safe: for every affected declaration the period handler and
the `il` handler have byte-identical bodies once the trigger-field argument is
normalized (VAT 2750 lines each, single declaration 1202, mining tax 484, road
tax 2 128, tax withheld 4 — differing only in a comment), and
calculate_table_row_field() never reads its triggerField argument. A runtime
fallback triggers the period field instead when no `il` handler is bound.

Note this cannot be done with set_value("il", year) alone: frappe.model.set_value
skips both the trigger and dirty() when the value is unchanged, so changing only
the month within the same year would silently recalculate nothing.

Verified headless: one call per pick on both VAT (month) and Single declaration
(quarter), including a second pick within the same year.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-09 12:10:08 +00:00
taxes_az fix(fno): run declaration calculations once per Dövr pick 2026-07-09 12:10:08 +00:00
.gitignore feat(reports): tax articles via SI child-table join; drop Tax Article Items Report 2026-06-02 12:25:24 +00:00
CLAUDE.md perf(master-data): sync Item Groups via hash-diff instead of after_migrate loop 2026-05-20 15:30:03 +00:00
README.md chore: use native Azərbaycan spelling in user-facing strings 2026-05-14 10:57:14 +00:00
TECHNICAL_SPECIFICATION_PROPERTY_TAX_AUTOMATION.md Modifed property tax return 2025-12-11 17:26:57 +04:00
check_tax_articles.py fixed tax article report bugs 2026-02-06 14:59:12 +04:00
check_tax_articles_safe.py fixed tax article report bugs 2026-02-06 14:59:12 +04:00
convert-int-to-float.js added precision to all floats 2025-08-27 14:56:35 +04:00
fixtures.json Added test fixtures and edited hooks.py 2024-12-19 11:49:02 +00:00
float-change.js added precision to all floats 2025-08-27 14:56:35 +04:00
license.txt feat: Initialize App 2024-09-11 12:48:17 +00:00
n push from mvp 2026-07-09 11:02:04 +00:00
pyproject.toml chore: use native Azərbaycan spelling in user-facing strings 2026-05-14 10:57:14 +00:00

README.md

Taxes Az

Azərbaycan Taxes

License

unlicense