Download the PHP package behappy/invoice-plugin without Composer
On this page you can find all versions of the php package behappy/invoice-plugin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download behappy/invoice-plugin
More information about behappy/invoice-plugin
Files in behappy/invoice-plugin
Package invoice-plugin
Short Description A plugin to generate invoices in Sylius
License MIT
Informations about the package invoice-plugin
sylius-invoice
A Plugin for Sylius to generate invoices
Installation-procedure
Informations
This plugin use Knp Snappy Bundle. Please refer to it's documentation for wkhtmltopdf installation (https://github.com/KnpLabs/snappy)
Enable the plugin
Enable those plugins in AppKernel
Generate database
Simply launch
You might have tables referring to BeHappySyliusCompanyDataPlugin if you did not enabled it before requiring this plugin
Optional : generate invoices
In order to have invoices for previously placed orders, you can run this command :
This command will generate invoices for all orders in state FULFILLED with no invoices attached
That's it !
From now on, each and every time an order is fulfilled, the event listener will create a new invoice and copy (if needed) company data information into a separate table to make them static.
A new block is also displayed in admin under the shipment section of orders that have an invoice linked.
In the account section for your customers, a link is also displayed for every invoice linked to their orders.
Configuration
Invoice number
By default, invoices will be generated with a 12 digits number filled with 0 (str_pad(12, '0', STR_PAD_LEFT))
You can redefine this length definition by overriding this :
Now every invoice will be 14 digits long.
In a near future, this plugin will use a number generator that you'll be free to override according to your needs.
Events
During the invoice creation, 2 events are fired with the order as argument.
You can subscribe to those events and do whatever you need
Override
In order to override the pdf template file, you simply have to create the following file : app/Resources/BeHappySyliusInvoicePlugin/views/Invoice/pdf.html.twig
Thanks
This plugin is partially inspired by BitBagCommerce/SyliusInvoicingPlugin (https://github.com/BitBagCommerce/SyliusInvoicingPlugin).
Feel free to contribute
You can also ask your questions at the mail address in the composer.json mentioning this package.
Other
You can also check our other packages (including Sylius plugins) at https://github.com/BeHappyCommunication
All versions of invoice-plugin with dependencies
sylius/sylius Version ^1.1
knplabs/knp-snappy-bundle Version ^1.5
behappy/company-data-plugin Version ^1.0.1