schenke-io / laravel-invoice
Currency and Invoices in Laravel
Installs: 56
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/schenke-io/laravel-invoice
Requires
- php: ^8.3
- archtechx/enums: ^v1.1
- endroid/qr-code: ^6.0
- illuminate/contracts: ^12.0
- illuminate/http: ^12.0
- illuminate/routing: ^12.0
- illuminate/support: ^12.0
- illuminate/validation: ^12.0
- livewire/livewire: ^3.0
- smhg/sepa-qr-data: ^3.0
- spatie/laravel-data: ^4.0
- spatie/laravel-package-tools: ^1.0
Requires (Dev)
- laravel/pint: ^1.24
- pestphp/pest: ^3.8
- phpstan/phpstan-phpunit: ^1.0
- schenke-io/packaging-tools: ^0.0
README
Laravel Invoice
Handling of:
- Currency
- Invoice
Currency
Public methods of Currency
| method | summary |
|---|---|
| fromAny | static constructor from any value |
| fromFloat | static constructor from a float value |
| fromCents | static constructor from cents |
| vatFromGross | VAT amount from the gross price, given a VAT rate. |
| vatFromNet | Calculate the VAT amount from the net price, given a VAT rate. |
| fromGrossToNet | convert a gross value to a net value using VAT |
| fromNetToGross | Convert a net value to a gross value using VAT |
| toFloat | exports to float |
| str | exports to formatted currency string |
| plus | adds two objects |
| minus | subtracts two objects |
| times | multiplies the object by a factor |
| toLivewire | exports to Livewire format |
| fromLivewire | static constructor from Livewire format |
| isEmpty | Check if the object is empty (zero) |
InvoiceNumericData
Public methods of InvoiceNumericData
| method | summary |
|---|---|
| addWeight | take the weight in grams and add it to the total weight |
| addLine | cent based calculation to avoid numeric glitches |
| vats | formats the VAT values in a readable format |
| payMe | show pay me information |
| isEmpty | the total is zero |
| invoiceViewData | data for blade templates |
Custom invoice
To build a custom invoice you first generate a class which
extends LineViewBase and implements InvoiceLineView.
This class should define the column-alignment.
Then you start a new instance of InvoiceViewData and fill its public data.