Repository navigation
[Settings]: Company panel — assign Tax Rates #242
Copy link
Copy link
Closed
Labels
refinedRefined with SMART plan / test suggestionsRefined with SMART plan / test suggestions
Milestone
Description
SMART Plan — As an Admin, in the company Panel I want to be able to assign Tax Rates to that single company
Specific
Within the Company panel (/{tenant}) — either on the TaxRate resource list page or the Settings page — add a mechanism for the customer_admin to associate specific TaxRate records with their company. The association is stored via a company_tax_rate pivot table and causes those tax rates to appear in the invoice item tax rate dropdowns for that company only.
Measurable
- The company panel exposes a way to attach/detach tax rates (e.g. a
CheckboxList, toggle column, or dedicated assign action). - After associating a tax rate, it appears in the invoice item's tax rate select for that company.
- Tax rates not associated with the company do not appear in the invoice item dropdown.
- Only
customer_adminand elevated roles can manage associations.
Achievable
- Create migration
add_company_tax_rate_pivot_tableif not created by issue [Settings]: Admin panel — assign Tax Rates to companies #233 —Modules/Core/Database/Migrations/ - Add
taxRates()BelongsToMany onCompany—Modules/Core/Models/Company.php - Add
companies()BelongsToMany onTaxRate—Modules/Core/Models/TaxRate.php - Add an "Assign to Company" toggle action on the company panel's
TaxRateResourcetable —Modules/Core/Filament/Company/Resources/TaxRates/TaxRateResource.php - Update the invoice item form's
TaxRateselect to queryFilament::getTenant()->taxRates()instead of all tax rates —Modules/Invoices/Filament/Company/Resources/Invoices/Schemas/InvoiceItemSchema.php
Relevant
Tax rates must be configured per company to comply with local tax legislation. Restricting the tax rate dropdown on invoice items to only the rates the company has set up prevents accidental application of the wrong rate across different jurisdictions.
Time-bound
Sprint 6.
Arrange · Act · Assert
// Modules/Core/Tests/Feature/Company/CompanyTaxRateAssignmentTest.php
#[Test]
public function it_associates_tax_rate_with_company_and_makes_it_available_on_invoice_items(): void
{
/* Arrange */
$taxRate = TaxRate::factory()->create(['company_id' => null]); // global tax rate
$this->company->taxRates()->attach($taxRate->id);
/* Act */
$response = $this->testLivewire(CreateInvoice::class);
/* Assert */
$response->assertSuccessful();
// The tax rate select options for invoice items should include the associated rate.
$response->assertSee($taxRate->name);
}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 I want to be able to assign Tax Rates to that single company[/-][+][Settings]: Company panel — assign Tax Rates[/+]nielsdrost7 commentedon Jul 24, 2026
SMART Plan — Company panel — assign Tax Rates
Specific
Within the Company panel Settings page, add a multi-select field or table to assign available Tax Rates to the company. Stores the relationship (pivot or scoped select) so the company can only use tax rates assigned to it when creating invoices/quotes.
Measurable
Achievable
Company::taxRates()as a BelongsToMany if not already present.Relevant
Different companies use different tax jurisdictions. Assigning rates per company keeps the UI clean and prevents wrong tax application.
Time-bound
Sprint 6.
nielsdrost7 commentedon Jul 24, 2026
Already satisfied —
CompanySettings.php's Taxes tab hasSelect::make(Setting::KEY_DEFAULT_INVOICE_TAX_RATE_ID)andSelect::make(Setting::KEY_DEFAULT_QUOTE_TAX_RATE_ID), both scoped toTaxRate::query()->where('company_id', $this->getCompanyId()), persisted viaSetting::saveForCompany(). SinceTaxRateis already strictly one-per-company owned (viaBelongsToCompany), every company's tax rates already only ever appear in that company's own dropdowns — there's no separate 'assignment' step needed beyond picking the default(s), which this already does. Added a targeted test proving both the scoping and persistence for both defaults:CompanySettingsTest::it_offers_and_persists_default_tax_rates_scoped_to_the_companyonfeature/235-243-company-settings-cluster.test(InvoicePlane#240,InvoicePlane#242): prove default numbering/tax-…