Repository navigation
[Settings]: Admin panel — assign Invoice Groups to companies #231
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 admin Panel I want to be able to assign Invoice Groups to multiple companies
Specific
In the Admin panel (/admin), the CompanyResource table view gains a bulk action called "Assign Invoice Group". When one or more companies are selected and the action is triggered, a modal opens with a searchable select of all Numbering records. On confirmation, the selected Numbering is attached to every selected company via a company_numbering pivot table.
Measurable
- Selecting 2+ companies and triggering the bulk action opens a modal with a Numbering select.
- After confirmation, a
company_numberingrow exists for each selected company. - A Filament success notification confirms how many companies were updated.
Achievable
- Create migration
add_company_numbering_pivot_table—Modules/Core/Database/Migrations/ - Add
numberings()BelongsToMany onCompanymodel —Modules/Core/Models/Company.php - Add
companies()BelongsToMany onNumberingmodel —Modules/Core/Models/Numbering.php - Create
AssignInvoiceGroupBulkActionFilament bulk action class —Modules/Core/Filament/Admin/Resources/Companies/Tables/Actions/AssignInvoiceGroupBulkAction.php - Register the bulk action on
CompanyResourcetable —Modules/Core/Filament/Admin/Resources/Companies/Tables/CompanyTable.php
Relevant
Invoice Groups (Numberings) define the sequential numbering scheme for invoices, quotes, and other documents. Assigning a shared numbering scheme to multiple companies at once is essential when onboarding a batch of new tenants that follow the same document format.
Time-bound
Sprint 6.
Arrange · Act · Assert
// Modules/Core/Tests/Feature/Admin/CompanyInvoiceGroupBulkActionTest.php
#[Test]
public function it_assigns_invoice_group_to_multiple_companies(): void
{
/* Arrange */
$companies = Company::factory()->count(2)->create();
$numbering = Numbering::factory()->create();
$ids = $companies->pluck('id')->all();
/* Act */
Livewire::actingAs($this->superAdmin())
->test(ListCompanies::class)
->callBulkAction('assignInvoiceGroup', $ids, ['numbering_id' => $numbering->id])
->assertHasNoErrors();
/* Assert */
foreach ($companies as $company) {
$this->assertDatabaseHas('company_numbering', [
'company_id' => $company->id,
'numbering_id' => $numbering->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!
nielsdrost7 commentedon Jan 2, 2026
@coderabbitai make pull-request with AAA test Scenario's: Arrange, Act, Assert. And also make sure you test edge cases
coderabbitai commentedon Jan 2, 2026
Rate Limit Exceeded
@nielsdrost7 have exceeded the limit for the number of chat messages per hour. Please wait 1 minutes and 3 seconds before sending another message.
[-]As an Admin, in the admin Panel I want to be able to assign Invoice Groups to multiple companies[/-][+][Settings]: Admin panel — assign Invoice Groups to companies[/+]nielsdrost7 commentedon Jul 24, 2026
SMART Plan — Admin Bulk Action: Assign Invoice Groups (Numbering) to Companies
Scope
In the Admin panel (
/admin), add a bulk action toCompanyResourcelist that assignsNumbering(Invoice Group) records to multiple companies at once viacompany_numberingpivot.Implementation
Migration: Create
add_company_numbering_pivot_table→Modules/Core/Database/Migrations/company_numbering(company_id, numbering_id)Model relationships:
Company::numberings()→ BelongsToManyNumbering::companies()→ BelongsToManyBulk action class: Create
Modules/Core/Filament/Admin/Resources/Companies/Actions/AssignInvoiceGroupBulkAction.phpRegister: In
Modules/Core/Filament/Admin/Resources/CompaniesResource.php, add to table:Test
company_numberingrows created for each companyProcessed by IP2 batch refine workflow
assign Invoice Groups to companies. Closes InvoicePlane#231