{
 "actions": [],
 "creation": "2026-04-01 12:00:00.000000",
 "doctype": "DocType",
 "engine": "InnoDB",
 "issingle": 1,
 "field_order": [
  "company_section",
  "company",
  "column_break_comp1",
  "auto_detect_on_save",
  "detection_status_html",
  "accounting_method_section",
  "accounting_method",
  "column_break_am1",
  "deferred_vat_sales_account",
  "deferred_vat_purchase_account",
  "column_break_am2",
  "deferred_revenue_account",
  "regime_section",
  "auto_detect_regime",
  "default_tax_regime",
  "column_break_reg1",
  "regime_explanation_html",
  "scan_section",
  "scan_existing_entries",
  "column_break_scan1",
  "force_create_if_exists",
  "column_break_scan2",
  "offer_correction_entry",
  "behavior_section",
  "auto_submit_entries",
  "column_break_beh1",
  "allow_reclosing",
  "column_break_beh2",
  "duplicate_check_scope",
  "pcv_section",
  "enable_period_closing",
  "column_break_pcv1",
  "closing_account",
  "declaration_section",
  "create_declaration_draft",
  "column_break_decl1",
  "auto_fill_declaration",
  "cost_center_section",
  "default_cost_center",
  "column_break_cc1",
  "cost_center_per_tax",
  "vat_section",
  "enable_vat",
  "vat_rate",
  "column_break_vat1",
  "vat_input_account",
  "vat_output_account",
  "column_break_vat2",
  "use_vat_allocation",
  "vat_data_source",
  "profit_tax_section",
  "enable_profit_tax",
  "profit_tax_rate",
  "column_break_pt1",
  "profit_tax_advance_method",
  "column_break_pt2",
  "profit_tax_previous_year_amount",
  "simplified_tax_section",
  "enable_simplified_tax",
  "simplified_tax_auto_rate",
  "column_break_st1",
  "default_simplified_rate",
  "column_break_st2",
  "simplified_tax_revenue_source",
  "property_tax_section",
  "enable_property_tax",
  "property_tax_rate",
  "column_break_prop1",
  "property_tax_threshold",
  "column_break_prop2",
  "property_tax_calc_method",
  "land_tax_section",
  "enable_land_tax",
  "column_break_lt1",
  "land_tax_source",
  "other_taxes_section",
  "enable_excise_tax",
  "enable_mining_tax",
  "column_break_ot1",
  "enable_road_tax",
  "payroll_section",
  "enable_payroll_collection",
  "column_break_pay1",
  "payroll_data_source",
  "tax_rates_section",
  "tax_rates",
  "account_mapping_section",
  "account_map"
 ],
 "fields": [
  {
   "fieldname": "company_section",
   "fieldtype": "Section Break",
   "label": "Company & Auto-Detection"
  },
  {
   "description": "Select the company for which these settings apply. All auto-detection (regime, accounts, rates) will use data from this company. If you have multiple companies, the wizard will let you override per-run.",
   "fieldname": "company",
   "fieldtype": "Link",
   "label": "Default Company",
   "options": "Company"
  },
  {
   "fieldname": "column_break_comp1",
   "fieldtype": "Column Break"
  },
  {
   "default": "1",
   "description": "When enabled, saving this form will automatically detect: tax regime, VAT payer status, OKVED code, available assets, employees, and set recommended values for all settings below. You can always override any auto-detected value manually.",
   "fieldname": "auto_detect_on_save",
   "fieldtype": "Check",
   "label": "Auto-detect parameters on Save"
  },
  {
   "fieldname": "detection_status_html",
   "fieldtype": "HTML",
   "label": "Detection Status"
  },
  {
   "fieldname": "accounting_method_section",
   "fieldtype": "Section Break",
   "label": "Accounting Method"
  },
  {
   "description": "Read from Company settings. Kassa metodu: revenue, expenses, and VAT obligations are recognized only when payment is received/made. Hesablama metodu: recognized at invoice date.\n\nPer AZ Tax Code: Micro and Small entrepreneurs can use Kassa metodu. Medium and Big must use Hesablama metodu.",
   "fieldname": "accounting_method",
   "fieldtype": "Select",
   "label": "Accounting Method",
   "options": "\nKassa metodu\nHesablama metodu",
   "read_only": 1
  },
  {
   "fieldname": "column_break_am1",
   "fieldtype": "Column Break"
  },
  {
   "depends_on": "eval:doc.accounting_method === 'Kassa metodu'",
   "description": "Account 245.1 — ƏDV gözləmədə (satış). Deferred output VAT — posted at Invoice, transferred to 521.3 at Payment.",
   "fieldname": "deferred_vat_sales_account",
   "fieldtype": "Link",
   "label": "Deferred VAT (Sales)",
   "options": "Account"
  },
  {
   "depends_on": "eval:doc.accounting_method === 'Kassa metodu'",
   "description": "Account 245.2 — ƏDV gözləmədə (alış). Deferred input VAT — posted at Invoice, transferred to 226 at Payment.",
   "fieldname": "deferred_vat_purchase_account",
   "fieldtype": "Link",
   "label": "Deferred VAT (Purchases)",
   "options": "Account"
  },
  {
   "fieldname": "column_break_am2",
   "fieldtype": "Column Break"
  },
  {
   "depends_on": "eval:doc.accounting_method === 'Kassa metodu'",
   "description": "Account 542 — Gələcək hesabat dövrünün gəlirləri. Deferred revenue — posted at Invoice, transferred to 601 at Payment.",
   "fieldname": "deferred_revenue_account",
   "fieldtype": "Link",
   "label": "Deferred Revenue (542)",
   "options": "Account"
  },
  {
   "fieldname": "regime_section",
   "fieldtype": "Section Break",
   "label": "Tax Regime"
  },
  {
   "default": "1",
   "description": "If ON: the tax regime is determined automatically from the company's VAT certificate and OKVED code. Companies with a VAT certificate → General regime. Companies without → Simplified. Special OKVED codes (construction, real estate) → Special regime. If OFF: the regime below is used as-is for every wizard run.",
   "fieldname": "auto_detect_regime",
   "fieldtype": "Check",
   "label": "Auto-detect Tax Regime"
  },
  {
   "default": "General (VAT + Profit)",
   "description": "This determines which taxes the wizard will calculate:\n\n• General (VAT + Profit) — VAT monthly + Profit Tax quarterly. Most common for medium/large businesses registered as VAT payers.\n• Simplified Tax — Quarterly simplified tax on revenue. For micro/small businesses NOT registered for VAT.\n• Special Regime — Construction, real estate, housing, cash withdrawals. Uses simplified tax with special declaration forms.\n\nIf 'Auto-detect' is ON above, this field shows the detected value but can still be changed.",
   "fieldname": "default_tax_regime",
   "fieldtype": "Select",
   "label": "Default Tax Regime",
   "options": "General (VAT + Profit)\nSimplified Tax\nSpecial Regime"
  },
  {
   "fieldname": "column_break_reg1",
   "fieldtype": "Column Break"
  },
  {
   "fieldname": "regime_explanation_html",
   "fieldtype": "HTML",
   "label": "Regime Explanation"
  },
  {
   "fieldname": "scan_section",
   "fieldtype": "Section Break",
   "label": "Smart Scan — Existing Entry Detection"
  },
  {
   "default": "1",
   "description": "If ON (recommended): before creating any journal entry, the wizard scans GL Entries to check if a matching entry already exists for the same tax type, accounts, and period.\n\nIf an existing entry is found:\n• The wizard marks it as 'Existing' (green) and shows the existing JE number and amount\n• No duplicate entry is created\n• If the calculated amount differs from the existing amount, a warning with the difference is shown\n\nThis is essential when tax entries come from external sources (e.g., e-taxes portal imports) or were created manually. The wizard automatically adapts — no configuration needed per period.",
   "fieldname": "scan_existing_entries",
   "fieldtype": "Check",
   "label": "Scan for Existing Entries"
  },
  {
   "fieldname": "column_break_scan1",
   "fieldtype": "Column Break"
  },
  {
   "default": "0",
   "depends_on": "scan_existing_entries",
   "description": "If ON: the wizard will create a new journal entry even if a matching one already exists. Use only if you intentionally need duplicate entries (very rare).\n\nIf OFF (default, safe): existing entries are respected and not duplicated.",
   "fieldname": "force_create_if_exists",
   "fieldtype": "Check",
   "label": "Force Create Even if Exists"
  },
  {
   "fieldname": "column_break_scan2",
   "fieldtype": "Column Break"
  },
  {
   "default": "1",
   "depends_on": "scan_existing_entries",
   "description": "If ON: when an existing entry is found but its amount differs from the wizard's calculation, the wizard will offer a correction entry for the difference.\n\nFor example: existing VAT entry = 1,296 AZN, wizard calculates 1,300 AZN → offers a correction entry of 4 AZN.\n\nThe correction entry is shown in Entry Preview with status 'Difference' (orange) and is optional — you can disable it per row.\n\nIf OFF: differences are only logged as warnings, no correction entries are offered.",
   "fieldname": "offer_correction_entry",
   "fieldtype": "Check",
   "label": "Offer Correction Entry for Differences"
  },
  {
   "fieldname": "behavior_section",
   "fieldtype": "Section Break",
   "label": "Journal Entry Behavior"
  },
  {
   "default": "0",
   "description": "If ON: journal entries created by the wizard will be immediately submitted (docstatus=1) and will affect account balances right away. Use this only if you trust the calculation and don't need manual review.\n\nIf OFF (recommended): entries are created as Draft. You can review each one in the Journal Entry list and submit manually or in bulk. This is safer — you can edit or delete drafts if something looks wrong.",
   "fieldname": "auto_submit_entries",
   "fieldtype": "Check",
   "label": "Auto-submit Journal Entries"
  },
  {
   "fieldname": "column_break_beh1",
   "fieldtype": "Column Break"
  },
  {
   "default": "0",
   "description": "Controls what happens when you run the wizard for a period that was already closed.\n\nIf OFF (default, safe): the wizard will refuse to run and show which previous wizard closed this period. This prevents accidental double-posting.\n\nIf ON: the wizard will cancel all journal entries from the previous run and create new ones. The old wizard document will be marked as superseded. Use this when you need to correct previously posted tax entries (e.g., after fixing invoices or asset values).",
   "fieldname": "allow_reclosing",
   "fieldtype": "Check",
   "label": "Allow Re-closing Periods"
  },
  {
   "fieldname": "column_break_beh2",
   "fieldtype": "Column Break"
  },
  {
   "default": "Same Company + Same Period",
   "depends_on": "eval:!doc.allow_reclosing",
   "description": "How the wizard checks for duplicate closings:\n\n• Same Company + Same Period — blocks if the exact same company and date range was already closed. Most restrictive.\n• Same Company + Overlapping Dates — blocks if any part of the period overlaps with a previous closing. Catches partial overlaps.\n\nOnly relevant when 'Allow Re-closing' is OFF.",
   "fieldname": "duplicate_check_scope",
   "fieldtype": "Select",
   "label": "Duplicate Check Scope",
   "options": "Same Company + Same Period\nSame Company + Overlapping Dates"
  },
  {
   "fieldname": "pcv_section",
   "fieldtype": "Section Break",
   "label": "Period Closing Voucher (P&L Close)"
  },
  {
   "default": "0",
   "description": "If ON: after creating tax journal entries, the wizard will also create a standard ERPNext Period Closing Voucher. This closes all Income and Expense accounts and transfers the net result to the Closing Account below.\n\nIf OFF (default): the wizard only creates tax accrual entries. You close P&L manually via Accounting → Period Closing Voucher. Recommended to keep OFF if your accountant closes periods separately.\n\nIMPORTANT: Period Closing Voucher is irreversible after submission. The wizard will create it in Draft if 'Auto-submit' is OFF.",
   "fieldname": "enable_period_closing",
   "fieldtype": "Check",
   "label": "Create Period Closing Voucher"
  },
  {
   "fieldname": "column_break_pcv1",
   "fieldtype": "Column Break"
  },
  {
   "depends_on": "enable_period_closing",
   "description": "The equity/liability account where net profit or loss will be transferred when P&L accounts are closed.\n\nStandard AZ Chart of Accounts:\n• 341 — Hesabat dövrünün xalis mənfəəti (Current period net profit)\n• 342 — Keçmiş illərin bölüşdürülməmiş mənfəəti (Retained earnings)\n\nThe account MUST be of type Liability or Equity, and in the same currency as the company.",
   "fieldname": "closing_account",
   "fieldtype": "Link",
   "label": "Closing Account",
   "options": "Account"
  },
  {
   "fieldname": "declaration_section",
   "fieldtype": "Section Break",
   "collapsible": 1,
   "collapsible_depends_on": "eval:!doc.create_declaration_draft",
   "label": "Declaration Integration (Future)"
  },
  {
   "default": "0",
   "description": "If ON: the wizard will create a draft of the corresponding tax declaration (e.g., Declaration of Value Added Tax, Income Tax Return) pre-filled with calculated values.\n\nIf OFF (default): only journal entries are created. Declarations are filed separately via Tax Declaration doctypes or the E-Taxes portal.\n\nNote: This feature is under development. Currently only VAT and Simplified Tax declarations are supported.",
   "fieldname": "create_declaration_draft",
   "fieldtype": "Check",
   "label": "Create Declaration Draft"
  },
  {
   "fieldname": "column_break_decl1",
   "fieldtype": "Column Break"
  },
  {
   "default": "0",
   "depends_on": "create_declaration_draft",
   "description": "If ON: declaration fields (VOEN, activity code, tax authority, etc.) will be auto-filled from Company data and calculated amounts.\n\nIf OFF: only the amounts section will be filled; header fields (VOEN, period, etc.) are left blank for manual entry.\n\nRequires 'Create Declaration Draft' to be enabled.",
   "fieldname": "auto_fill_declaration",
   "fieldtype": "Check",
   "label": "Auto-fill Declaration Header"
  },
  {
   "fieldname": "cost_center_section",
   "fieldtype": "Section Break",
   "collapsible": 1,
   "label": "Cost Center"
  },
  {
   "description": "All tax journal entries will use this cost center by default. If left blank, the company's default cost center is used.\n\nYou can override this per wizard run.",
   "fieldname": "default_cost_center",
   "fieldtype": "Link",
   "label": "Default Cost Center",
   "options": "Cost Center"
  },
  {
   "fieldname": "column_break_cc1",
   "fieldtype": "Column Break"
  },
  {
   "default": "0",
   "description": "If ON: each tax type can have its own cost center (configured in the Account Mapping table below). For example, VAT entries go to 'Sales' cost center, while property tax goes to 'Admin'.\n\nIf OFF (default): all tax entries use the single default cost center above.",
   "fieldname": "cost_center_per_tax",
   "fieldtype": "Check",
   "label": "Separate Cost Center per Tax Type"
  },
  {
   "fieldname": "vat_section",
   "fieldtype": "Section Break",
   "label": "VAT (Value Added Tax)",
   "depends_on": "eval:doc.default_tax_regime === 'General (VAT + Profit)'"
  },
  {
   "default": "1",
   "description": "Enable VAT calculation in the wizard. The wizard will calculate the difference between output VAT (collected from customers) and input VAT (paid to suppliers) for each month in the period.\n\nDisable this only if you handle VAT entries manually or via a separate process.",
   "fieldname": "enable_vat",
   "fieldtype": "Check",
   "label": "Enable VAT Calculation"
  },
  {
   "default": "18",
   "depends_on": "enable_vat",
   "description": "Standard VAT rate in Azərbaycan is 18% (Maddə 159 of the Tax Code). This is used for reference and reporting only — the actual VAT amounts are calculated from GL account balances, not by applying this rate.\n\nChange only if the government announces a new rate.",
   "fieldname": "vat_rate",
   "fieldtype": "Percent",
   "label": "VAT Rate (%)"
  },
  {
   "fieldname": "column_break_vat1",
   "fieldtype": "Column Break"
  },
  {
   "depends_on": "enable_vat",
   "description": "The asset account where input VAT (VAT paid to suppliers on purchases) is recorded.\n\nStandard AZ: Account 226 — ƏDV sub-uçot hesabı.\n\nThis account has a DEBIT balance. The wizard reads this balance to determine how much input VAT you can offset against output VAT.",
   "fieldname": "vat_input_account",
   "fieldtype": "Link",
   "label": "VAT Input Account",
   "options": "Account"
  },
  {
   "depends_on": "enable_vat",
   "description": "The liability account where output VAT (VAT collected from customers on sales) is recorded.\n\nStandard AZ: Account 521.3 — ƏDV.\n\nThis account has a CREDIT balance. The wizard reads this balance and offsets it against input VAT to determine the net VAT payable to the budget.",
   "fieldname": "vat_output_account",
   "fieldtype": "Link",
   "label": "VAT Output Account",
   "options": "Account"
  },
  {
   "fieldname": "column_break_vat2",
   "fieldtype": "Column Break"
  },
  {
   "default": "0",
   "depends_on": "enable_vat",
   "description": "If ON: after calculating VAT from GL balances, the wizard will compare the result with the VAT Allocation doctype (if you use it). Any discrepancy will be logged as a warning.\n\nIf OFF: VAT is calculated purely from GL account balances. This is simpler and works for most companies.\n\nEnable only if you actively use the VAT Allocation system in taxes_az for distributing input VAT across taxable/exempt operations.",
   "fieldname": "use_vat_allocation",
   "fieldtype": "Check",
   "label": "Cross-check with VAT Allocation"
  },
  {
   "default": "GL Account Balance",
   "depends_on": "enable_vat",
   "description": "How VAT amounts are determined:\n\n• GL Account Balance — reads debit/credit balances from VAT accounts (226 and 521.3) for each month. Simple, reliable, captures all transactions including manual adjustments.\n\n• Sales/Purchase Invoices — sums VAT from individual invoices. More granular but may miss manual journal entries or corrections.\n\nRecommended: GL Account Balance.",
   "fieldname": "vat_data_source",
   "fieldtype": "Select",
   "label": "VAT Data Source",
   "options": "GL Account Balance\nSales/Purchase Invoices"
  },
  {
   "fieldname": "profit_tax_section",
   "fieldtype": "Section Break",
   "label": "Profit Tax",
   "depends_on": "eval:doc.default_tax_regime === 'General (VAT + Profit)'"
  },
  {
   "default": "1",
   "description": "Enable profit tax calculation. The wizard will calculate quarterly advance payments based on the method selected below.\n\nPer AZ Tax Code: annual declaration is due by March 31 of the following year, but advance payments are due quarterly (by the 15th of the month after the quarter ends).\n\nDisable only if you handle profit tax entries manually.",
   "fieldname": "enable_profit_tax",
   "fieldtype": "Check",
   "label": "Enable Profit Tax Calculation"
  },
  {
   "default": "20",
   "depends_on": "enable_profit_tax",
   "description": "Corporate profit tax rate. Standard rate in Azərbaycan is 20% (Maddə 104 of the Tax Code).\n\nApplied to: Net Profit = Total Income − Total Expenses for the period.\n\nChange only if your company qualifies for a reduced rate (e.g., certain agricultural or IT activities may have incentives).",
   "fieldname": "profit_tax_rate",
   "fieldtype": "Percent",
   "label": "Profit Tax Rate (%)"
  },
  {
   "fieldname": "column_break_pt1",
   "fieldtype": "Column Break"
  },
  {
   "default": "Actual Quarterly Profit",
   "depends_on": "enable_profit_tax",
   "description": "How quarterly advance payments are calculated:\n\n• Actual Quarterly Profit — calculates 20% of the actual profit for the current quarter (Income − Expenses from P&L). More accurate, reflects current performance. Recommended for growing or seasonal businesses.\n\n• 1/4 of Previous Year Tax — takes the total profit tax from the previous year and divides by 4. Simpler, more predictable payments. Better for stable businesses. Requires 'Previous Year Tax Amount' to be filled in.\n\nBoth methods are accepted by the AZ tax authorities. The annual declaration reconciles any over/underpayment.",
   "fieldname": "profit_tax_advance_method",
   "fieldtype": "Select",
   "label": "Advance Payment Method",
   "options": "Actual Quarterly Profit\n1/4 of Previous Year Tax"
  },
  {
   "fieldname": "column_break_pt2",
   "fieldtype": "Column Break"
  },
  {
   "default": "0",
   "depends_on": "eval:doc.enable_profit_tax && doc.profit_tax_advance_method === '1/4 of Previous Year Tax'",
   "description": "Enter the total profit tax amount from the previous fiscal year. The wizard will divide this by 4 for each quarterly advance payment.\n\nYou can find this in last year's Income Tax Return (field: total calculated tax) or from the previous year's Tax Period Closing Wizard summary.\n\nLeave at 0 if using 'Actual Quarterly Profit' method.",
   "fieldname": "profit_tax_previous_year_amount",
   "fieldtype": "Currency",
   "label": "Previous Year Tax Amount",
   "precision": "2"
  },
  {
   "fieldname": "simplified_tax_section",
   "fieldtype": "Section Break",
   "label": "Simplified Tax",
   "depends_on": "eval:doc.default_tax_regime === 'Simplified Tax' || doc.default_tax_regime === 'Special Regime'"
  },
  {
   "default": "1",
   "description": "Enable simplified tax calculation. Applied quarterly to total revenue (not profit).\n\nPer AZ Tax Code (Maddə 218-227): simplified tax replaces VAT and profit tax for qualifying businesses. Declaration and payment are due by the 20th of the month after the quarter.\n\nDisable only if you handle simplified tax entries manually.",
   "fieldname": "enable_simplified_tax",
   "fieldtype": "Check",
   "label": "Enable Simplified Tax"
  },
  {
   "default": "1",
   "depends_on": "enable_simplified_tax",
   "description": "If ON: the wizard determines the simplified tax rate automatically based on the company's OKVED (activity code):\n\n• Trade activities in Baku → 2%\n• Catering (public food) → 8%\n• All other activities → 4%\n\nIf OFF: the 'Default Rate' below is used for all calculations regardless of activity type.",
   "fieldname": "simplified_tax_auto_rate",
   "fieldtype": "Check",
   "label": "Auto-detect Rate by OKVED"
  },
  {
   "fieldname": "column_break_st1",
   "fieldtype": "Column Break"
  },
  {
   "default": "4",
   "depends_on": "eval:doc.enable_simplified_tax && !doc.simplified_tax_auto_rate",
   "description": "The flat simplified tax rate applied to total revenue.\n\nStandard rates per AZ Tax Code (Maddə 220.1):\n• 2% — Retail/wholesale trade in Baku\n• 4% — Services, production, and other activities\n• 8% — Catering/public food services\n\nThis field is only used when 'Auto-detect by OKVED' is OFF.",
   "fieldname": "default_simplified_rate",
   "fieldtype": "Percent",
   "label": "Default Simplified Tax Rate (%)"
  },
  {
   "fieldname": "column_break_st2",
   "fieldtype": "Column Break"
  },
  {
   "default": "Total Income (P&L)",
   "depends_on": "enable_simplified_tax",
   "description": "What counts as 'revenue' for simplified tax calculation:\n\n• Total Income (P&L) — sums all Income-type accounts from the P&L for the quarter. Includes sales revenue, other operating income, etc. Most common.\n\n• Sales Revenue Only — only account 601 (Satış gəlirləri). Excludes other income like interest, rent, etc. Use if your other income is not subject to simplified tax.\n\n• Cash Receipts — revenue recognized when cash is received (cash-basis). For companies using cash-basis accounting.",
   "fieldname": "simplified_tax_revenue_source",
   "fieldtype": "Select",
   "label": "Revenue Source",
   "options": "Total Income (P&L)\nSales Revenue Only\nCash Receipts"
  },
  {
   "fieldname": "property_tax_section",
   "fieldtype": "Section Break",
   "label": "Property Tax"
  },
  {
   "default": "1",
   "description": "Enable property tax calculation on fixed assets. Calculated annually but paid in quarterly advances (1/4 each quarter).\n\nPer AZ Tax Code (Maddə 196-202): tax is levied on the average annual net book value of fixed assets (buildings, equipment, vehicles, etc.).\n\nDisable if the company has no fixed assets or all assets are tax-exempt under Maddə 199.4.",
   "fieldname": "enable_property_tax",
   "fieldtype": "Check",
   "label": "Enable Property Tax"
  },
  {
   "default": "1",
   "depends_on": "enable_property_tax",
   "description": "Property tax rate on the average annual residual value of fixed assets.\n\nStandard rate: 1% (Maddə 199 of the Tax Code).\n\nApplied to: (Value at start of year + Value at end of year) / 2.\n\nThis rate applies uniformly to all taxable asset types (buildings, equipment, vehicles, etc.).",
   "fieldname": "property_tax_rate",
   "fieldtype": "Percent",
   "label": "Property Tax Rate (%)"
  },
  {
   "fieldname": "column_break_prop1",
   "fieldtype": "Column Break"
  },
  {
   "default": "1000000",
   "depends_on": "enable_property_tax",
   "description": "Net book value threshold for property tax reporting. Per Maddə 199 of the AZ Tax Code, enterprises with average annual asset value exceeding this threshold may have additional reporting requirements.\n\nStandard value: 1,000,000 AZN.\n\nThe wizard will show a warning in the log if your company's net book value exceeds this threshold.",
   "fieldname": "property_tax_threshold",
   "fieldtype": "Currency",
   "label": "Reporting Threshold (AZN)",
   "precision": "2"
  },
  {
   "fieldname": "column_break_prop2",
   "fieldtype": "Column Break"
  },
  {
   "default": "Average Annual (Start + End) / 2",
   "depends_on": "enable_property_tax",
   "description": "How the taxable asset value is calculated:\n\n• Average Annual (Start + End) / 2 — standard method per Maddə 199. Takes the residual value at the start of the year and the end of the year, averages them. Used for companies operating the full year (Tam İl).\n\n• Pro-rata for New Companies — for companies established during the year (İl Ərzində). Formula: (Purchase value + Year-end value) / 24 × months of operation.\n\n• End of Period NBV — uses the net book value at the end of the closing period. Simpler but less accurate for annual tax.",
   "fieldname": "property_tax_calc_method",
   "fieldtype": "Select",
   "label": "Calculation Method",
   "options": "Average Annual (Start + End) / 2\nPro-rata for New Companies\nEnd of Period NBV"
  },
  {
   "fieldname": "land_tax_section",
   "fieldtype": "Section Break",
   "collapsible": 1,
   "label": "Land Tax"
  },
  {
   "default": "0",
   "description": "Enable land tax calculation. Uses existing calculation logic from Land Tax Declaration in taxes_az (cadastral scores, industrial land rates).\n\nPer AZ Tax Code (Maddə 206-212): land tax is calculated based on cadastral value and land purpose. Annual declaration, quarterly payments.\n\nEnable only if the company owns or uses land plots. The wizard will use rates from cadastral_points_data.json and industrial_land_data.json.",
   "fieldname": "enable_land_tax",
   "fieldtype": "Check",
   "label": "Enable Land Tax"
  },
  {
   "fieldname": "column_break_lt1",
   "fieldtype": "Column Break"
  },
  {
   "default": "Land Tax Declaration",
   "depends_on": "enable_land_tax",
   "description": "Where land tax amounts come from:\n\n• Land Tax Declaration — reads the calculated amount from an existing Land Tax Declaration document for the fiscal year. You must create and calculate the Land Tax Declaration first.\n\n• Manual Entry — you manually enter the annual land tax amount in the wizard. The wizard will divide by 4 for quarterly advances.\n\nRecommended: Land Tax Declaration (uses existing cadastral calculation logic).",
   "fieldname": "land_tax_source",
   "fieldtype": "Select",
   "label": "Data Source",
   "options": "Land Tax Declaration\nManual Entry"
  },
  {
   "fieldname": "other_taxes_section",
   "fieldtype": "Section Break",
   "collapsible": 1,
   "label": "Other Taxes (Optional)"
  },
  {
   "default": "0",
   "description": "Enable excise tax tracking. Relevant only for companies producing or importing excisable goods (alcohol, tobacco, fuel, vehicles).\n\nThe wizard will check if the company's OKVED code matches excise-related activities. If enabled but no excisable activities are found, it will be skipped with a note in the log.\n\nMonthly calculation and declaration.",
   "fieldname": "enable_excise_tax",
   "fieldtype": "Check",
   "label": "Enable Excise Tax"
  },
  {
   "default": "0",
   "description": "Enable mining tax tracking. Relevant only for companies extracting mineral resources (oil, gas, metals, stone, etc.).\n\nThe wizard will check if the company's OKVED code matches mining activities and if mining-related Item Groups exist. Monthly calculation.\n\nEnable only if the company has mining operations.",
   "fieldname": "enable_mining_tax",
   "fieldtype": "Check",
   "label": "Enable Mining Tax"
  },
  {
   "fieldname": "column_break_ot1",
   "fieldtype": "Column Break"
  },
  {
   "default": "0",
   "description": "Enable road tax tracking. Relevant for companies owning vehicles registered in Azərbaycan.\n\nThe wizard will check if the company has transportation assets. Annual calculation.\n\nEnable only if the company owns registered vehicles.",
   "fieldname": "enable_road_tax",
   "fieldtype": "Check",
   "label": "Enable Road Tax"
  },
  {
   "fieldname": "payroll_section",
   "fieldtype": "Section Break",
   "label": "Payroll Data Collection"
  },
  {
   "default": "1",
   "description": "If ON: the wizard collects payroll data (gross pay, NDFL, DSMF, unemployment insurance, medical insurance) from Salary Slips for the period. This data is shown in the summary report for reference.\n\nNOTE: The wizard does NOT create payroll-related journal entries — those are already created by the Payroll Entry process. The wizard only COLLECTS and DISPLAYS the totals.\n\nIf OFF: payroll data is not included in the wizard summary.",
   "fieldname": "enable_payroll_collection",
   "fieldtype": "Check",
   "label": "Collect Payroll Data"
  },
  {
   "fieldname": "column_break_pay1",
   "fieldtype": "Column Break"
  },
  {
   "default": "Salary Slips",
   "depends_on": "enable_payroll_collection",
   "description": "Where payroll totals are collected from:\n\n• Salary Slips — reads submitted Salary Slip documents for the period. Provides detailed breakdown by salary component (deductions, contributions).\n\n• GL Account Balances — reads balances from payroll-related accounts (522, 522.1-4, 533). Faster but less detailed.\n\n• Both (with cross-check) — reads from both sources and flags discrepancies. Most thorough but slowest.\n\nRecommended: Salary Slips.",
   "fieldname": "payroll_data_source",
   "fieldtype": "Select",
   "label": "Payroll Data Source",
   "options": "Salary Slips\nGL Account Balances\nBoth (with cross-check)"
  },
  {
   "fieldname": "tax_rates_section",
   "fieldtype": "Section Break",
   "label": "Tax Rates Reference Table",
   "description": "Reference table of all tax rates used by the wizard. Click 'Load Default Rates' to populate with standard AZ rates. You can modify rates here — changes affect all future wizard runs."
  },
  {
   "description": "Each row defines a tax type and its rate. These rates are used as reference for calculations and for taxes that use fixed rates (property, DSMF, unemployment insurance). VAT and profit tax have their own rate fields above for convenience.\n\nClick 'Load Default AZ Rates' button to populate with standard rates from the AZ Tax Code.",
   "fieldname": "tax_rates",
   "fieldtype": "Table",
   "label": "Tax Rates",
   "options": "Tax Rate Row"
  },
  {
   "fieldname": "account_mapping_section",
   "fieldtype": "Section Break",
   "label": "Account Mapping (Debit → Credit)",
   "description": "Maps each tax type to the accounts used for journal entries. Debit = Expense account, Credit = Liability account. Click 'Auto-detect Accounts' to find matching accounts from your Chart of Accounts."
  },
  {
   "description": "Each row maps a tax type to a pair of accounts:\n• Debit (Expense) — where the tax cost is recorded (e.g., 901 for profit tax expense)\n• Credit (Liability) — where the tax payable is recorded (e.g., 521.1 for profit tax liability)\n\nIf the company uses the standard AZ Chart of Accounts, click 'Auto-detect Accounts' to find the correct accounts automatically.",
   "fieldname": "account_map",
   "fieldtype": "Table",
   "label": "Account Mapping",
   "options": "Tax Closing Account Map"
  }
 ],
 "index_web_pages_for_search": 0,
 "links": [],
 "modified": "2026-04-01 14:00:00.000000",
 "modified_by": "Administrator",
 "module": "Taxes Az",
 "name": "Tax Period Closing Settings",
 "owner": "Administrator",
 "permissions": [
  {
   "create": 1,
   "email": 1,
   "print": 1,
   "read": 1,
   "role": "System Manager",
   "share": 1,
   "write": 1
  },
  {
   "create": 1,
   "email": 1,
   "print": 1,
   "read": 1,
   "role": "Accounts Manager",
   "share": 1,
   "write": 1
  }
 ],
 "sort_field": "creation",
 "sort_order": "DESC",
 "states": []
}