[IP-248]: General — Company Branding (logo, colors, fonts) - #704
Merged
Conversation
CodeRabbit flagged that the invoice PDF renders font-family via raw inline CSS with no @font-face registration, so Dompdf silently falls back for fonts outside its core/DejaVu substitution table. Addresses review feedback on InvoicePlane#704. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Checklist
Checklist
Description
Adds company branding — primary color, accent color, font family, and font size — to the General tab of the Company Settings page, and wires those settings (plus the existing invoice logo upload) into actual invoice PDF/preview rendering.
Settings (
Modules/Core/Filament/Company/Pages/CompanySettings.php,Modules/Core/Models/Setting.php):Setting::KEY_PRIMARY_COLOR,KEY_ACCENT_COLOR,KEY_FONT_FAMILY,KEY_FONT_SIZEconstants.ColorPickerfields for primary/accent color, aSelectfor font family (Inter, Roboto, Arial, Helvetica, Georgia, Times New Roman), and a numericTextInputfor font size, all in a new "Company Branding" section of the General tab.Setting::saveForCompany/getForCompanymechanism.Setting::KEY_INVOICE_LOGO, shipped in [IP-247]: company-scoped Settings page (Invoices/Quotes/Taxes/Email/System/Dashboard) #686) rather than adding a duplicate logo field.PDF rendering (
Modules/Invoices/Services/InvoiceService.php,Modules/Invoices/resources/views/pdf/invoice.blade.php):InvoiceService::renderHtml()now resolves aresolveBranding()helper that reads the four settings above plus the invoice logo, per-company, and passes them into the PDF/preview Blade view.#1f2937/#6b7280/ DejaVu Sans / 12px, no logo) when a company hasn't set any branding, so existing invoices render unchanged.Out of scope: Quote PDFs — there is currently no quote PDF generation pipeline in the codebase at all (only a dead legacy template referencing a nonexistent model shape), so branding there would mean building that pipeline from scratch. Left as a separate follow-up.
Related Issue(s)
Fixes #248
Motivation and Context
Issue #248 ("Company Branding: logo, colors, fonts") was partially covered by #686, which explicitly called out that only the invoice-logo upload was implemented and general branding (colors, fonts) — plus actually applying it to invoice PDFs — was still outstanding. This PR closes that remaining gap end-to-end: settings capture and rendering.
Issue Type
Screenshots