alfasix / alfakit-invoices
Invoices, quotes, credit notes and receipts for AlfaKit panels: exact integer money in any currency, inclusive, exclusive and compound taxes, atomic per-tenant numbering, live server-side totals, payments, overdue tracking, a branded print-ready document with a pluggable PDF renderer and a signed cu
Requires
- php: ^8.4
- ext-intl: *
- alfasix/alfakit: ^0.1|@dev
- brick/math: ^0.11|^0.12|^0.13|^0.14|^0.15|^0.16|^0.17|^0.18|^0.19|^0.20|^1.0
Requires (Dev)
None
Suggests
- alfasix/alfakit-billing: A "Pay now" button on the customer invoice page through your billing provider.
- barryvdh/laravel-dompdf: Render invoices as PDF files with Dompdf (used automatically when installed).
- dompdf/dompdf: Render invoices as PDF files with Dompdf (used automatically when installed).
- spatie/laravel-pdf: Render invoices as PDF files with headless Chrome, best for right-to-left scripts (used automatically when installed).
Provides
None
Conflicts
None
Replaces
None
README
by Alfa Six
This is a read-only split of the AlfaKit monorepo. Please open issues and pull requests there.
Invoices, quotes, credit notes and receipts for AlfaKit panels. Features:
- Exact integer money in any currency (JPY, BHD and the rest).
- Inclusive, exclusive and compound taxes, rounded per line or on the total.
- Atomic numbering per type and tenant (
INV-{YYYY}-{SEQ:5}). - Totals recomputed on the server as you edit.
- Payments, overdue tracking and receivables widgets.
- A branded, right-to-left-ready document with a pluggable PDF renderer.
- A signed customer link with an optional "Pay now" hook.
Installation
composer require alfasix/alfakit-invoices php artisan vendor:publish --tag=alfakit-invoices-migrations php artisan migrate
Without a PDF library, documents are print-ready HTML files. Install spatie/laravel-pdf or barryvdh/laravel-dompdf to get PDF files; the plugin picks the installed one.
Register
use AlfaSix\AlfakitInvoices\InvoicesPlugin; $panel->plugin( InvoicesPlugin::make() ->authorize(fn (User $user): bool => $user->can_bill) ->customers(fn (?Team $tenant) => Customer::query()->whereBelongsTo($tenant), titleAttribute: 'company') ->seller(['name' => 'Acme W.L.L.', 'tax_id' => 'VAT-123']), );
$invoice = Invoice::createWithItems(['billable' => $customer, 'currency' => 'BHD'], [ ['description' => 'Design', 'quantity' => '10', 'unit_price' => 25000, 'tax_ids' => [$vat->id]], ]); $invoice->markAsSent(); $invoice->recordPayment(100000, method: 'bank_transfer');
php artisan alfakit-invoices:mark-overdue runs daily through the scheduler.
Read the full documentation at alfakit.dev/docs/plugins/invoices.
License
MIT. See LICENSE.md.