Download the PHP package 2lenet/invoice-bundle without Composer
On this page you can find all versions of the php package 2lenet/invoice-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download 2lenet/invoice-bundle
More information about 2lenet/invoice-bundle
Files in 2lenet/invoice-bundle
Package invoice-bundle
Short Description Invoice Bundle
License MIT
Homepage https://github.com/2lenet/InvoiceBundle
Informations about the package invoice-bundle
InvoiceBundle v2
This bundle is useful to manage invoice in your project.
Installation
To install the bundle:
Configuration
To configure the bundle, in the doctrine service configuration file ("config/packages/doctrine.yaml"), you have to define which entity will get the role of customer.
For exemple, if you want to use your User
entity, you will add this block at the end of file :
Then, when the bundle expect a CustomerInterface you can pass an user. Once this listener is configured, Doctrine will know how to replace the customer interface. And that's the same for the Product entity.
To get more info about relationships with abstract classes and interfaces, you can check official Symfony Documentation here
Do not forget to implement methods on your entity using bundle traits and add your custom needs.
PDF Parameter
Use PdfGenerator
To export invoice in PDF, you have to define paramater in the file "config/packages/lle_invoice.yaml". For example, you can define parameter like that :
logo: Path of image to put on Invoice header
The other fields concern the company who made fixtures.
Usage
In this bundle, there are several services : InvoiceManager, InvoiceLineManager, InvoiceExporter, InvoicePDF. You can use all of them with Dependency Injection. You can use EasyAdmin or EasyAdminPlus to manage this entity.
Invoice Manager
InvoiceManager is a service that let you generate a draft invoice or validate an invoice.
Generate a draft invoice
A draft invoice is an invoice with pre-filled fields.
Example:
But if you want to get more pre-filled fields, you can pass an entity that implements CustomerInterface :
Validate an invoice
If you want to validate an invoice, you can use the InvoiceManager. Validate an Invoice set the invoice number, puts current date and set status to "Validate".
Example:
Then, you can persist your entity or do whatever you want.
Invoice Exporter
You can export one or more invoice in csv format.
Example:
You can choose the filename with: export([$invoice1, $invoice2], 'invoice_export.csv');
All versions of invoice-bundle with dependencies
symfony/orm-pack Version *
symfony/framework-bundle Version ^6.0
symfony/validator Version ^6.0
symfony/form Version ^6.0
cocur/slugify Version ^4.0
gedmo/doctrine-extensions Version ^2.4|^3
twig/twig Version ^3.4