Download the PHP package imos/invoice without Composer
On this page you can find all versions of the php package imos/invoice. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package invoice
Invoice
imos Invoice is a library for creating and generating invoices.
Setup
This library relies on BCMath to do reliable calculations. Make sure bcmath.scale is set sufficiently high (it should at least be higher than the number of decimal places you will round to).
Install Twig and/or mPDF to use HtmlGenerator
or MpdfGenerator
.
Building an Invoice
LineItem
represents a line item on your invoice. It holds basic information for each position.
Invoice
represents an invoice. It can be set to use either net list prices or gross
list prices. Depending on type, it will calculate taxes either "backwards" or "forwards".
Line items are grouped by tax name and rate.
Placeholders
Text fields support the following placeholders, which are replaced with the corresponding values from the invoice:
{{totalNet}}
- Net total{{totalGross}}
- Gross total{{taxTotal}}
- Total tax{{totalNetAbs}}
Net total (absolute value){{totalGrossAbs}}
Gross total (absolute value){{taxTotalAbs}}
Total tax (absolute value){{customerNumber}}
{{invoiceNumber}}
{{invoiceDate}}
{{dueDate}}
{{billingPeriod}}
{{commission}}
Generating an Invoice
Generating an invoice is simple:
The generated invoice can be customized for your locale and/or business:
The HtmlGenerator
In addition to the translation features, you can add CSS directly to the generated document:
You can also write your own Twig template to use (see the current ones under
resources/html_templates/
for a starting point):
The MpdfGenerator
The MpdfGenerator
uses mPDF to generate a PDF invoice. In addition to the generate()
method,
MpdfGenerator can also return you the mPDF object directly.
A PDF file can be set as a template for the invoice. A template usually consists of two pages, one for the first page of the invoice (with a letterhead, for example) and one for subsequent pages. The last page of the template is repeated if the invoice becomes longer that the template. Page margins can be set using CSS.
All versions of invoice with dependencies
ext-bcmath Version *