Формы налоговой отчетности Азербайджана для JeyERP
Go to file
Ali 9d485c7ad4 feat(formulas): batch report resolution in a taxes_az-owned runtime
Selecting a period on a declaration fired one HTTP request per report reference
— 217 on a VAT return — and each one re-executed an entire Script Report just to
read a single column. Those 217 requests only ever ran 4 distinct reports: 120 of
VAT's 127 report fields read different columns out of the same report with the
same filters.

run_reports_batch groups the references by (report, filters) and executes each
report once, slicing every requested column out of the one result. The extraction
rule (take the report's total row, else sum every row) is ported verbatim — it
decides the figures that end up on a filed tax return.

The runtime lives here rather than in formula_editor because that app is a
design-time tool that gets removed from production machines; generated scripts no
longer reference it at all.

Errors are now surfaced instead of swallowed. A failed report used to yield 0 for
every field that asked for it, so a user without report permission got a
plausible-looking, fully-zeroed declaration and no hint anything was wrong.
Failing reports now contribute no values, the affected formulas are skipped rather
than zeroed, and the user is told which report failed and why.

Also fixes a Frappe core bug that threw on every declaration: Frappe writes the
active tab's fieldname into the URL hash, the URL API percent-encodes our
Azerbaijani fieldnames, and form.js then feeds that hash to jQuery as a CSS
selector.

Land tax and Property tax pointed js_parent_subtab at a parent tab that does not
exist in those doctypes, so their Əlavə tabs never nested.

VAT, one period change: 217 HTTP requests -> 1, 236 refresh_field -> 11, 4.5s -> 1.5s.
Verified identical output across all 426 formulas and all 337 report fields.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-13 12:28:43 +00:00
taxes_az feat(formulas): batch report resolution in a taxes_az-owned runtime 2026-07-13 12:28:43 +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