load_company_bank_accounts now makes every non-closed e-taxes bank
record usable inside ERPNext, not just a read-only E-Taxes Bank Account
cache row:
- Bank (global, one per unique bankName) — idempotent insert.
- GL Account under parent "223 Bank hesablaşma hesabları", named
"<CUR> <IBAN>", account_type=Bank, account_currency from e-taxes.
Parent discovered by account_number=223 with a name-prefix fallback.
- Bank Account linking Bank + GL Account + Company, is_company_account=1,
iban + bank_account_no = the AZ IBAN.
Closed accounts (status=C) are left at cache-row only; no native
records are created for them.
After the loop, unused AZ CoA placeholder accounts (names like
"AZN AZXXXXXXXXXXXXXXXXXXXXXXXXXX" under the bank group) are deleted
so the chart isn't cluttered with unmatched templates. Per-record
failures go to the "E-Taxes Bank Native Materialize" error log and
don't abort the overall load.
Adds a "Data Loading" dialog on Company form that pulls 6 types of
taxpayer reference data from E-Taxes into dedicated doctypes, plus
in-form summary tables inside the Tax Policy tab.
New DocTypes (all with company link, Accounts User read-only,
System Manager full CRUD):
- E-Taxes Object (taxpayer registered locations)
- E-Taxes Cash Register (kassa aparatları with object FK)
- E-Taxes POS Terminal (with auto-derived object from registration number)
- E-Taxes Bank Account
- E-Taxes Obligation Pact (sazişlər / oil fields)
- E-Taxes Presented Certificate (with sazis_code FK to Obligation Pact)
Backend (invoice_az/company_api.py):
- 6 per-doctype loaders + shared _auth_headers / _etaxes_request helpers
implementing CLAUDE.md §10 401-retry-once pattern
- Cash Register / POS Terminal loaders walk the hasMore pagination
- load_company_data_bulk enqueues a background job that runs selected
loaders sequentially and streams progress over Socket.IO
(company_data_loading_progress / _complete events)
- get_company_reference_list exposes first N rows per doctype for the
Tax Policy tab tables
Frontend (invoice_az/client/company.js):
- Full ETaxes auth module inlined (CLAUDE.md §2) so ASAN Imza re-auth
works from Company form without relying on other forms' state
- "Data Loading" button opens a dialog of checkboxes (DATA_LOADERS
declarative array) — one bulk call, one floating show_progress bar
- Six reference tables rendered inside Tax Policy tab sections,
pattern copied from e-taxes_settings (card-section + Refresh +
"View All" only when total > rows)
CLAUDE.md:
- Rewrote §3 backend template with 401 retry + explicit commit
- Added §10–§16: 401 auto-refresh, two response shapes,
db.commit() standard, log title convention, frontend unauthorized
handling, field naming for reference vs fixture doctypes,
Socket.IO background job pattern
hooks.py:
- Register client/company.js under doctype_js["Company"]
.gitignore:
- Exclude *.har (may contain Bearer tokens / PII)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
vat_18_percent_with_amount stores the total INCLUDING VAT (e.g. 118),
but the e-taxes API vat18 field expects just the tax amount (e.g. 18).
Also calculates net cost/pricePerUnit for VAT-inclusive pricing (ƏDV daxil 18%).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Checkbox values (load_items, load_units, load_customers, load_suppliers)
were collected in the dialog but never passed through the loading pipeline,
causing all data types to always be created regardless of user selection.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove invoice_az.bundle.js (not needed, app uses doctype_js)
- Remove OPTIMIZATION_SUMMARY.md (outdated)
- Remove claude.md (replaced by CLAUDE.md)
The patches.txt file is sufficient to make the app recognizable by Frappe.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Fixed two critical issues preventing app installation:
1. Removed non-existent e_taxes_parties_list.js from hooks.py
2. Added missing patches.txt file (required for Frappe app detection)
3. Added minimal bundle.js file to satisfy build system
Without patches.txt, the app was not recognized as a valid Frappe app,
causing esbuild to fail with "paths[0] must be of type string" error.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>