Download the PHP package fsuuaas/finvoice without Composer
On this page you can find all versions of the php package fsuuaas/finvoice. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package finvoice
PDF Invoice
This is a streamlined fork of pdf-invoicr.
Changes:
- PHP 7.0 Support
- PSR-4 compatible
- Available as composer package
- Dependencies are coming via composer
Introduction
PHP Invoice is a simple object oriented PHP class to generate beautifully designed invoices, quotes or orders with just a few lines of code. Brand it with your own logo and theme color, add unlimited items and total rows with automatic paging. You can deliver the PDF ouput in the user's browser, save on the server or force a file download. PHP Invoice is fully customizable and can be integrated into any well known CMS.
Multi-languages & Currencies
PHP Invoice has built in translations in English, Dutch, French, German, Spanish and Italian (you can easily add your own if needed) and you can set the currency needed per document.
Additional Titles, Paragraphs And Badges
Extra content (titles and multi-line paragraphs) can be added to the bottom of the document. You might use it for payment or shipping information or any other content needed.
Installation
Examples
There are 3 examples included in the examples/
folder of this repo:
- simple.php
- example1.php
- example2.php
- change_timezone.php
Create A New Invoice
Make sure that the default php date timezone is set before using the class.
In this simple example we are generating an invoice with custom logo and theme color. It will contain 2 products and a box on the bottom with VAT and total price. Then we add a "Paid" badge right before the output.
Documentation
Create Instances
Parameter | Type | Accepts | Note |
---|---|---|---|
size | string | A4 (default) Letter Legal |
Set your document size |
currency | string | any string (e.g. "$", "£", "€") | Set the currency that you want to use |
language | string | en (default), nl, fr, de, es, it | A language that exists in the inc/languages folder |
Number Formatting
How do you want to show your numbers?
Parameter | Type | Accepts | Note |
---|---|---|---|
decimalpoint | string | Commonly used is '.' or ',' | What string to use for decimal point |
seperator | string | Commonly used is '.' or ',' | What string to use for thousands separator |
Color
Set a custom color to personalize your invoices.
Add Logo
Parameter | Type | Accepts | Note |
---|---|---|---|
image | string | Local path or remote url of the image | Preferably a good quality transparant png image |
maxwidth (optional) | int | The width (in mm) of the bounding box where the image will be fitted in | |
maxheight (optional) | int | The height (in mm) of the bounding box where the image will be fitted in |
Document Title
Invoice Number
Date
Due Date
Issuer Information
Set your company details.
Client Information
Flip Flop
Switch the horizontal positions of your company information and the client information. By default, your company details are on the left.
Adding Items
Add a new product or service row to your document below the company and client information. PHP Invoice has automatic paging so there is absolutely no limit.
name {string} A string with the
product or service name. description {string} A string with the description with multi-line support.
Use either
or \n to add a line-break. amount {decimal} An integer with the amount of this item.
vat {string} or {decimal} Pass a string (e.g. "21%", or any other text you may like) or a decimal if
you want to show an amount instead (e.g. 124.30) price {decimal} A decimal for the unit price.
discount {string}, {decimal} or {boolean}Optional Pass a string (e.g. "10%", or any other text you
may like) or a decimal if you want to show an amount instead (e.g. 50.00) If you do not want to give
discount just enter the boolean false in this field. Note: the final output will not show a discount
column when all of the products haven't set a discount. total {decimal} A decimal for the total
product or service price.
Adding Totals
Add a row below the products and services for calculations and totals. You can add unlimited rows.
name {string} A string for the display name of the total field. value {decimal} A decimal for the value. background {boolean}Optional Set to true to set the theme color as background color of the row.
Adding A Badge
Adds a badge to your invoice below the products and services. You can use this for example to display that the invoice has been payed.
badge {string} A string with the text of the badge.
It is possible to set the color of the badge as the second parameter:
CSS color names ('red', 'cyan', 'fuchsia', etc) are NOT supported
Add Title
You can add titles and paragraphs to display information on the bottom part of your document such as payment details or shipping information.
title {string} A string with the title to display in the badge.
Add Paragraph
You can add titles and paragraphs to display information on the bottom part of your document such as payment details or shipping information.
Paragraph {string} A string with the paragraph text with
multi-line support. Use either
or \n to add a line-break.
Footer
A small text you want to display on the bottom left corner of the document.
note {string} A string with the information you want to display in the footer.
Rendering The Invoice
name {string} A string with the name of your invoice.
Example: 'invoice.pdf'
output {string} Choose how you want the invoice to be delivered to the user. The following options are available: I (Send the file inline to the browser) D (Send to the browser and force a file download with the name given by name) F (Save to a local file. Make sure to set pass the path in the name parameter) S (Return the document as a string)