#1573·aureuserp

New companies are not provisioned with accounting data and setup reports false success

Author: fmoedCreated Sep 21, 2026Updated Sep 23, 2026
Labelsbug

✅ Prerequisites

  • I have searched for existing issues and confirm this bug has not already been reported.

AureusERP Version(s) Affected

d7d4718 — 2026-09-17

Issue Description

The default company created during installation, MyCompany (ID 1), has the initial accounting setup.

However, a second company created from the admin interface (ID 2) is created without the required accounting data. Opening the product creation page then throws a MissingSettings error. The Setup Accounting action also displays a success notification, but the setup is still missing after refreshing the page.

This is related to, but distinct from, #1501. Issue #1501 concerns country/currency selection during initial installation; this issue concerns accounting provisioning for companies created later.

⚙️ Preconditions

  • OS: Windows Server 2019 Standard
  • PHP: 8.4.12
  • Database: MySQL 8.4.3
  • Company 1: MyCompany, created automatically during installation
  • Company 2: created later from the admin interface
  • Company 1 has the initial accounting setup
  • Company 2 has no or incomplete accounting journals and company-specific accounting settings

Steps to Reproduce

  1. Install and start AureusERP.

  2. Confirm that MyCompany is created with ID 1.

  3. Create a second company from the admin interface.

  4. Switch to the newly created company, ID 2.

  5. Open:

    /admin/inventory/products/products/create

  6. Observe the MissingSettings error.

  7. Open:

    /admin/accounting/settings/manage-default-accounts

  8. Click Setup Accounting.

  9. Refresh the page.

❌ Actual Behavior

  • Product creation throws a 500 error because DefaultAccountSettings is missing.
  • The accounting setup action shows a success notification.
  • After refreshing, the company is still not set up.
  • Company 2 has no expected accounting journals or default account settings.

✅ Expected Behavior

  • A newly created company should have the required accounting setup, or show a clear setup error.
  • Product creation should not throw a 500 error when accounting is not configured.
  • The setup action should show success only when the setup was actually completed.

Database Observation

The database comparison showed:

  • Company 1 (MyCompany) has accounting journals and settings.
  • Company 2 has zero or incomplete accounting journals and settings.
  • settings.general.default_company_id may resolve to Company 2, the same company being configured.

Changing the setting to Company 1 and running the setup service for Company 2 allows Company 1 to be used as the template. This is only a diagnostic workaround, not a solution.

Possible Cause

AccountingSetupService::templateCompanyId() can resolve the target company as its own template. When the template ID equals the target company ID, setUp() returns false without explaining the reason, while the UI still displays a success notification.

Some pages also use the accounting setup gate, while AccountProductSchema loads DefaultAccountSettings directly and throws MissingSettings.

Relevant Code

  • plugins/webkul/accounts/src/Services/AccountingSetupService.php
  • plugins/webkul/accounting/src/Filament/Concerns/GatesAccountingSetup.php
  • plugins/webkul/accounts/src/Filament/Resources/ProductResource/Schemas/AccountProductSchema.php:127

Error Log

Tried loading settings 'Webkul\Account\Settings\DefaultAccountSettings', and the following properties were missing: currency_exchange_journal_id, income_currency_exchange_account_id, expense_currency_exchange_account_id, account_discount_expense_allocation_id, account_discount_income_allocation_id, account_journal_suspense_account_id, transfer_account_id, account_journal_payment_debit_account_id, account_journal_payment_credit_account_id, income_account_id, expense_account_id