Repository navigation
[Settings]: Taxes — Default Tax Rate #263
Copy link
Copy link
Closed
Labels
refinedRefined with SMART plan / test suggestionsRefined with SMART plan / test suggestions
Milestone
Description
SMART Plan — Set default invoice tax rate in Taxes Settings
Specific
A Select field labelled "Default Invoice Tax Rate" in the Taxes tab of the Company Settings page. Options are populated from the company's own TaxRate records. Stores the selected TaxRate ID as a string under the key default_invoice_tax_rate_id, scoped to the current company. The stored ID is applied as the default tax rate when new invoice line items are created.
Measurable
- The field appears in the Taxes section of the Company Settings page
- Saving the form persists the value to the
settingstable with keydefault_invoice_tax_rate_idand company_id scope - The value is read back correctly on page reload
- New invoice items default to the tax rate whose ID matches the stored value
Achievable
- Create/extend
Modules/Core/Filament/Company/Pages/CompanySettings.php(Filament page with tabs) - Add a
Select::make('default_invoice_tax_rate_id')->label('Default Invoice Tax Rate')->options(fn() => TaxRate::forCompany()->pluck('name', 'id'))field to the Taxes tab section - Add
const DEFAULT_INVOICE_TAX_RATE_ID = 'default_invoice_tax_rate_id';toModules/Core/Models/Setting.phpconstants - Register the page in
CompanyPanelProvider
Relevant
Most companies apply the same tax rate to the majority of their invoices. Storing a company-level default eliminates repetitive selection on each invoice item and reduces errors from choosing the wrong tax rate.
Time-bound
Sprint 6.
Arrange · Act · Assert
// Modules/Core/Tests/Feature/CompanySettingsTest.php
#[Test]
public function it_saves_default_invoice_tax_rate_id_setting(): void
{
/* Arrange */
$taxRate = \Modules\Core\Models\TaxRate::factory()->for($this->company)->create();
$page = Livewire::actingAs($this->user)
->test(\Modules\Core\Filament\Company\Pages\CompanySettings::class);
/* Act */
$page->set('data.default_invoice_tax_rate_id', $taxRate->id)
->call('save');
/* Assert */
$page->assertSuccessful();
$this->assertDatabaseHas('settings', [
'company_id' => $this->company->id,
'key' => 'default_invoice_tax_rate_id',
'value' => (string) $taxRate->id,
]);
}Reacted by coderabbitai
Metadata
Metadata
Assignees
Labels
refinedRefined with SMART plan / test suggestionsRefined with SMART plan / test suggestions
Activity
coderabbitai commentedon Dec 28, 2025
📝 CodeRabbit Plan Mode
Generate an implementation plan and prompts that you can use with your favorite coding agent.
Examples
🔗 Similar Issues
Related Issues
👤 Suggested Assignees
🧪 Issue enrichment is currently in open beta.
You can configure auto-planning by selecting labels in the issue_enrichment configuration.
To disable automatic issue enrichment, add the following to your
.coderabbit.yaml:💬 Have feedback or questions? Drop into our discord!
[-]As an Admin in the Company Panel (Taxes tab) i want to be able to set the Default Invoice Tax Rate[/-][+][Settings]: Taxes — Default Tax Rate[/+]nielsdrost7 commentedon Jul 24, 2026
SMART Plan — Tax settings per-company: Default invoice tax rate
Solid plan with good test coverage. A couple of notes:
Infrastructure:
Modules/Core/Filament/Company/Pages/CompanySettings.phpdoesn't exist yet. This batch of 8 settings issues ([Settings]: Invoices — Client Portal & Public Links #259–266) will scaffold it. Group [Settings]: Taxes — Default Tax Rate #263–264 together under a single Taxes tab.Default application: Applied when new invoice items are created. You'll need an InvoiceItem factory callback or observer to read the company setting and pre-fill it — make sure it reads from the current company context.
UI consistency: Keep the Select wording parallel to [Settings]: Taxes — Tax Calculation Mode #264 ("Default Invoice Tax Rate"), so both settings are visually consistent in the Taxes tab. Add helptext: "New invoice line items will default to this rate unless overridden."
Null handling: Handle gracefully if the company has no TaxRates, or the stored ID is stale (deleted TaxRate). The Select query should filter to existing TaxRates only.
Ready to implement — straightforward, pairs well with #264.
nielsdrost7 commentedon Jul 24, 2026
Correction: an unmerged local branch,
settings-cluster-2026-07-19, already implements this via a newModules/Core/Filament/Company/Pages/CompanySettings.phppage (490 lines) +CompanySettingsTest.php, covering mail send method/from-address, default invoice/quote tax rates, quote PDF template/public/email templates, quote footer, quote validity days, invoice/quote PDF password + mark-as-sent toggles, and invoice default footer. The SMART Plan comment above was posted in error by an automated grooming pass that didn't check non-issue-numbered branch names. Please check that branch before implementing this from scratch — it may just need finishing/rebasing rather than a fresh implementation.