SMART Plan — Configure Invoice Numbering Format in Company Settings
refs #236
Specific
A Select field (and possibly TextInput for custom format) labelled "Invoice Numbering Scheme" in the Invoices tab of the Company Settings page (Modules/Core/Filament/Company/Pages/CompanySettings.php). Allows selection of an existing Numbering scheme or creation of a company-specific one. The selected numbering scheme is applied when generating new invoice numbers for this company.
Measurable
- The field appears in the Invoices section of the Company Settings page
- The field shows available
Numbering records filtered by type (NumberingType::INVOICE)
- Saving the form persists the selection to link the company to the chosen
Numbering record
- New invoices created for this company use the selected numbering scheme to generate invoice numbers
- Invoice numbers follow the configured format (e.g.,
INV-2026-001 based on format tokens)
Achievable
- Add a
Select::make('numbering_id')->relationship('numbering', 'name')->label('Invoice Numbering Scheme') field to the Invoices tab in CompanySettings.php
- Add
numbering() BelongsTo relationship to the Company model if not already present
- Filter the select to show only
Numbering records where type = NumberingType::INVOICE
- Add
Setting::KEY_NUMBERING_ID = 'numbering_id' constant to Modules/Core/Models/Setting.php
- Update invoice creation logic to use the company's selected numbering scheme
Relevant
The invoice numbering format feature (Modules/Core/Models/Numbering.php, NumberingService.php) already exists and handles format tokens ({{prefix}}, {{number}}, {{year}}, {{month}}, etc.), but there's no UI in the company settings to configure which numbering scheme each company uses. This bridges that gap, giving company admins control over their invoice numbering format.
Time-bound
Small to Medium — reuses existing Numbering model and relationship patterns. Primary work is adding the Filament form field and ensuring the selected scheme is applied during invoice creation.
Implementation Notes
Code references:
- Numbering model:
Modules/Core/Models/Numbering.php
- Numbering service:
Modules/Core/Services/NumberingService.php
- Numbering types enum:
Modules/Core/Enums/NumberingType.php
- Company settings page:
Modules/Core/Filament/Company/Pages/CompanySettings.php
- Company model:
Modules/Core/Models/Company.php
- Existing admin numbering UI:
Modules/Core/Filament/Admin/Resources/Numberings/
Related issues:
Test Plan
CompanySettingsTest: Save and reload company's selected numbering scheme
CompanySettingsTest: New invoice uses the selected company numbering scheme
CompanySettingsTest: Multi-tenancy — different companies can have different numbering schemes
SMART Plan — Configure Invoice Numbering Format in Company Settings
refs #236
Specific
A
Selectfield (and possiblyTextInputfor custom format) labelled "Invoice Numbering Scheme" in the Invoices tab of the Company Settings page (Modules/Core/Filament/Company/Pages/CompanySettings.php). Allows selection of an existingNumberingscheme or creation of a company-specific one. The selected numbering scheme is applied when generating new invoice numbers for this company.Measurable
Numberingrecords filtered by type (NumberingType::INVOICE)NumberingrecordINV-2026-001based on format tokens)Achievable
Select::make('numbering_id')->relationship('numbering', 'name')->label('Invoice Numbering Scheme')field to the Invoices tab inCompanySettings.phpnumbering()BelongsTo relationship to theCompanymodel if not already presentNumberingrecords wheretype = NumberingType::INVOICESetting::KEY_NUMBERING_ID = 'numbering_id'constant toModules/Core/Models/Setting.phpRelevant
The invoice numbering format feature (
Modules/Core/Models/Numbering.php,NumberingService.php) already exists and handles format tokens ({{prefix}},{{number}},{{year}},{{month}}, etc.), but there's no UI in the company settings to configure which numbering scheme each company uses. This bridges that gap, giving company admins control over their invoice numbering format.Time-bound
Small to Medium — reuses existing
Numberingmodel and relationship patterns. Primary work is adding the Filament form field and ensuring the selected scheme is applied during invoice creation.Implementation Notes
Code references:
Modules/Core/Models/Numbering.phpModules/Core/Services/NumberingService.phpModules/Core/Enums/NumberingType.phpModules/Core/Filament/Company/Pages/CompanySettings.phpModules/Core/Models/Company.phpModules/Core/Filament/Admin/Resources/Numberings/Related issues:
Test Plan
CompanySettingsTest: Save and reload company's selected numbering schemeCompanySettingsTest: New invoice uses the selected company numbering schemeCompanySettingsTest: Multi-tenancy — different companies can have different numbering schemes