Replaces the free-text description in Landed Cost Taxes and Charges with a
service-item link, drives expense_account from a new Item.default_landed_cost_account,
adds an in-form "Get Items from Vendor Invoices" button, and validates totals
against vendor invoices on submit. Also fixes ERPNext's no-op items_remove
(its `this.trigger` call hits a non-existent method) so applicable_charges
recalculate correctly when rows are deleted from items or taxes.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Mirrors the salary-component pattern for two more pieces of master data:
- sync_leave_types(): full upsert from default_data/leave_types.json.
Creates missing, updates existing, deletes those no longer in JSON.
Leave Type has no `disabled` field, so when a deletion fails due to
linked Leave Allocation/Application records, the sync logs and skips
(vs. marking disabled like Salary Component does).
- sync_company_defaults(): for every Company, resolves each account_number
in default_data/company_defaults.json to the company-scoped Account
name and sets the corresponding Company field. Non-destructive: if
the company has no account with that number, the field is left as-is.
Both hooked into after_migrate_combined after sync_salary_components,
since Leave Type's earning_component references a Salary Component.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds sync_salary_components() — full upsert from default_data JSON:
creates missing components, updates existing ones (formula, condition,
flags, accounts), and deletes those no longer in the JSON. If a
component cannot be deleted due to linked records, it is marked
disabled instead. Idempotent and safe to re-run.
Hooked into after_migrate_combined so every "bench migrate" picks up
the latest formulas — single source of truth is the JSON file.
Replaced default_data/salary_components.json with the current
production export (14 components, formulas use the f(base) + g(LE)
pattern for separate ƏH/MK accounting).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replace per-field delete+create loop (which forced ALTER TABLE on all 222
custom fields every migrate) with idempotent bulk update that only writes
when a field's definition actually changed. Saves with ignore_version=True
to bypass the Frappe Version diff bug that crashes on certain int values.
Also remove the top-level create_custom_fields() call so the function only
runs from after_migrate, not on every module import.
Optional JEY_ERP_FORCE_RECREATE_FIELDS=1 env var preserves the old
delete+create path for development.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds six new collapsible sections at the very end of the Tax Policy
tab on Company form, each with an HTML field for a reference-data
table rendered by invoice_az/client/company.js:
- E-Taxes Objects
- Cash Registers
- POS Terminals
- Bank Accounts
- Obligation Pacts
- Presented Certificates
Tax Closing Wizards moved to the bottom (insert_after changed from
accounting_method to presented_certificates_list_html) so wizards
sit under the new sections.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds a Tax Free tab to Salary Slip with 4 nested sub-tabs (Vergi, MDSS,
İşsizlik sığorta, İcbari Tibbi Sığorta) rendered via the custom_subtabs
app. Each sub-tab has a Göstəricilər (Link to Tax Free Indicator, filtered
by group) and an Amount (Currency) field arranged in two columns.
Introduces a new Tax Free Indicator tree DocType mirroring the tax_article
pattern from taxes_az, seeded via fixtures with 74 indicators scraped from
the e-taxes.gov.az unified declaration (32 Vergi + 30 MDSS + 5 İşsizlik
+ 7 İcbari Tibbi Sığorta) grouped under 4 roots.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add rename_default_groups.py that uses frappe.rename_doc to rename
standard ERPNext groups (Products -> Məhsullar, etc.) instead of
modifying ERPNext source files directly. Runs on after_migrate.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Removed account_tree_custom.js which caused console errors due to
accessing undefined treeview fields. Export functionality is already
available via account_list.js.
Added CSS fix for Chart of Accounts tree view where account balances
were visually shifted down by one row due to float:right on balance-area.
Fix uses flexbox on tree nodes instead.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Export: company_export.py exports all Link-to-Account fields as account_name
- Import: create_default_company_accounts() resolves account names to full accounts in new company, applied via setup_wizard_complete
- JS: Export Defaults button in Company list view downloads company_defaults.json
- default_data/company_defaults.json: initial defaults
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Fields added as Small Text (TEXT in MySQL) to bypass tabEmployee's 65535-byte
row size limit. Added two pre_model_sync patches to fix row format and add
columns directly before Frappe schema sync runs.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds a Select field 'Absence Reason' visible only when status is Absent,
with 12 predefined Azerbaijani-language absence reason options.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Rewrote won/lost checkbox logic with clean code approach
- Removed complex HTML synchronization in favor of native Frappe checkboxes
- Added CSS to display checkboxes inline (side by side) instead of stacked
- Implemented automatic enforcement: one checkbox must always be selected
- Added client-side validation that auto-corrects invalid states
- Added server-side validation for gambling companies only
- Removed old column break and section break fields
- Fields now only validate for gambling company main activities
Changes:
- custom_fields.py: Simplified won/lost field definitions, removed HTML field
- sales_invoice_vat.js: Clean logic + CSS for inline display + auto-selection
- sales_invoice.py: Server validation with auto-correction
- hooks.py: Added validate_won_lost_fields hook
- patches: Added cleanup patches for old fields
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>