The e-invoice module for WHMCS enables you to create invoices in WHMCS. The ZUGFeRD format is used here, which combines the human-readable PDF file with the machine-readable XML file.
System requirements
- Running WHMCS installation in version 8.9 – 8.11
- PHP 7.4, 8.1 or 8.2
- IonCube Loader 13
- FTP access for uploading module files and customizing template files
Installation
- Upload the module files that you have downloaded from the Plambee.de customer area to the web space of your WHMCS installation.
- In WHMCS, go to Configuration > System Settings -> Addon Modules and activate the E-Invoice module
- Make the settings and save them. You will find an explanation of the individual settings in the next section of this Wiki article
- Open the invoicepdf.tpl file of the WHMCS client template you are using and insert the following code in the first line (after <?php )
require(ROOTDIR.'/modules/addons/e_invoice/invoice.php');
Explanation of the module settings
The module currently offers the following settings and input options.
- Licensekey: Please enter the license key for your license here. You can find the license key in the customer area of Plambee.de
- Cache PDF Invoice on the Webspace: The module offers the option of saving PDF invoices once they have been created on your web space. This means that the invoices are no longer generated on-the-fly by WHMCS, but the already saved version is delivered each time the PDF invoice is called up. This means that the customer receives an unchanged PDF invoice, even if you change the layout or product name, for example, or you or the customer move.
- Cache After Payment: With this option you can set that PDF invoices are only cached once they have been paid. Before this, the invoice is generated on-the-fly by WHMCS each time it is called up.
- Cache Path: If you activate the module’s cache function, you must specify the absolute path to the directory in which the module should store the files here. Within this directory, the module will store the invoices in subfolders for the year and months. The directory should be located outside your web directory so that the invoices cannot be accessed from outside. The directory must be readable and writable.
- Customfield for buyer reference: If you would like to give the customer the option of storing a buyer reference for their account, for example for the routing ID, please create a client custom field as described below and then select it here using the drop-down option. This reference will then be used for all e-invoices for this account
- Seller Contact Name: Please enter the name of the contact person for billing questions here
- Seller Contact Address: Please enter the address of the contact person for billing questions here
- Seller Contact Postcode: Please enter the postal code of the contact person for billing questions here
- Seller Contact City: Please enter the city of the contact person for billing questions here
- Seller Contact Country: Please enter the country in 2-character format (e.g. DE for Germany or AT for Austria) of the contact person for billing questions here
- Seller Contact E-Mail: Please enter the e-mail address of the contact person for billing questions here
- Seller Contact phone number: Please enter the phone number of the contact person for billing questions here
It is necessary to enter your contact details, otherwise a valid e-bill cannot be created.
Creation of client custom fields
If you want to store the so-called Buyer Reference for the customer, for example in the form of the lead ID, you can do this via Client Custom Fields. To do this, please proceed as follows:
- Log in to your WHMCS admin area
- In the admin area, click on Configuration > System Settings > Custom Field
- Now scroll down until you come to the creation of a new custom field
- In the Field Name line, you can enter a name of your choice
- If you would like to create a custom field for the Buye Reference, please select Text Box here, if you would like to create a custom field for the invoice format, please select Drop-Down
- In the Description field, please enter a description of the field so that the customer knows what kind of setting it is
- Do not enter anything in the Select Options field.
- Once you have made all the entries, you can save the field and return to the module settings and assign the client custom field you have just created to the relevant function.
Notes
Template updates
Adjustments to the TPL files may be overwritten during a template update, so please remember to make the adjustments again when updating your template, otherwise no e-invoices can be created.
Payment by bank transfer
When paying by bank transfer and using the WHMCS Bank Transfer Gateway, the payment information must be formatted in the following format (in a new line in each case) so that the module can read the bank details correctly and store them in the e-invoice.
Payee: Max Mustermann
Name of the bank: Musterbank
IBAN: DE1234567890
BIC: XXXXXXX
The separation between the line name, such as payee, and the name is made by a : (colon)
Payment by SEPA direct debit
When using the SEPA Direct Debit payment method in combination with the SEPA Direct Debit module from Plambee.de, the customer must already have a valid mandate when the invoice is issued, otherwise no valid e-bill can be created.
PDF Batch Export
If the PDF batch function is used in WHMCS, no files are cached and no XML data is written to the PDF invoice, as the PDF file created is a large collective file and not individual files.