Repository navigation
[Settings]: Invoices — Invoice Template #255
Copy link
Copy link
Closed
Labels
refinedRefined with SMART plan / test suggestionsRefined with SMART plan / test suggestions
Milestone
Description
SMART Plan — Company Panel Invoice Template Settings
Specific
Seven per-company select fields and one textarea in the Invoices → Templates section of the Company Settings page, mapping PDF and email templates to specific invoice lifecycle states:
| Setting | Type | Purpose |
|---|---|---|
| Default PDF Template | Select (pdf_template) | Template used for standard invoice PDFs |
| Paid PDF Template | Select (pdf_template) | Template used when invoice status = Paid |
| Overdue PDF Template | Select (pdf_template) | Template used when invoice is overdue |
| Default Public Template | Select (public_template) | Guest-facing URL template |
| Default Email Template | Select (email_template) | Email body for standard invoice sends |
| Paid Email Template | Select (email_template) | Email body for payment confirmation |
| Overdue Email Template | Select (email_template) | Email body for overdue reminders |
| PDF Footer | Textarea | Static HTML/text appended to every invoice PDF |
Measurable
- All eight fields appear in the
Invoices → Templatestab ofCompanySettings - Each saves to
settingskeyed asinvoice_template_pdf_default,invoice_template_pdf_paid,invoice_template_pdf_overdue,invoice_template_public_default,invoice_template_email_default,invoice_template_email_paid,invoice_template_email_overdue,invoice_pdf_footer - The PDF and email pipeline reads the correct template key based on invoice status
Achievable
- Add eight fields to
CompanySettingsunder theInvoices > Templatestab - Populate template select options from
EmailTemplate::forCompany($company)->pluck('name', 'id') - In
InvoicePdfServiceandInvoiceEmailService, resolve the active template by checking the status-specific key, falling back to the_defaultkey
Relevant
Allows companies to apply different PDF layouts and email copy for different invoice states (new, paid, overdue) — necessary for professional billing workflows.
Time-bound
Sprint 6.
Arrange · Act · Assert
// Modules/Core/Tests/Feature/CompanySettingsTest.php
#[Test]
public function it_saves_invoice_template_settings(): void
{
/* Arrange */
$emailTemplate = EmailTemplate::factory()->for($this->company)->create();
$page = Livewire::actingAs($this->user)
->test(\Modules\Core\Filament\Company\Pages\CompanySettings::class);
/* Act */
$page->set('data.invoice_template_email_default', $emailTemplate->id)
->set('data.invoice_pdf_footer', 'Thank you for your business.')
->call('save');
/* Assert */
$page->assertSuccessful();
$this->assertDatabaseHas('settings', [
'company_id' => $this->company->id,
'key' => 'invoice_template_email_default',
'value' => (string) $emailTemplate->id,
]);
$this->assertDatabaseHas('settings', [
'company_id' => $this->company->id,
'key' => 'invoice_pdf_footer',
'value' => 'Thank you for your business.',
]);
}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
Possible Duplicates
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, in the Invoice Template Settings (Invoices Tab, Per Company!), I want to be able to set:[/-][+][Settings]: Invoices — Invoice Template[/+]nielsdrost7 commentedon Jul 24, 2026
SMART Plan — Invoices — Invoice Template
Specific
Within the Company panel Settings → Invoices tab, add select fields for email and PDF templates per invoice lifecycle state: sent, paid, overdue, and public link. Each selects from available EmailTemplate and PDF template records scoped to the company. Stored as settings rows scoped to the company.
Measurable
Achievable
Relevant
Different invoice states warrant different messaging. Companies want customized templates for new invoices, payment confirmations, and reminders.
Time-bound
Sprint 6.
nielsdrost7 commentedon Jul 24, 2026
Correction: this is already fully implemented on the unmerged branch
settings-cluster-2026-07-19— the Invoices → Invoice Templates section ofCompanySettings.phphasSetting::KEY_INVOICE_PDF_TEMPLATE,KEY_INVOICE_PAID_PDF_TEMPLATE,KEY_INVOICE_OVERDUE_PDF_TEMPLATE,KEY_INVOICE_PUBLIC_TEMPLATE,KEY_INVOICE_EMAIL_TEMPLATE,KEY_INVOICE_PAID_EMAIL_TEMPLATE, andKEY_INVOICE_OVERDUE_EMAIL_TEMPLATE— matching the seven fields described above. Please check that branch before implementing from scratch — it likely just needs finishing/rebasing and a PR opened, not a fresh implementation.