Completing the Installation

Automatic Importer

Before reading this article make sure you completed the preliminary steps described here.

When you install Billing Extension, it will automatically try to read your existing configuration from WHMCS and EU VAT Addon (if in use). The settings of the latter override the default ones of WHMCS. The purpose of this feature is to ease the process of configuring Billing Extension. Below you can find a list of options that are set based on your existing configuration.
 
Invoices:
  • Invoices > Invoice Date on Payment. This value is taken directly from EU VAT Addon (Set Invoice Date on Payment)
  • Invoices > Number Format. Auto-tags are imported too
  • Invoices > Next ID
  • Invoices > Increm$ent
Proformas:
  • Proformas > Proforma Invoicing
  • Proformas > Number Format. Auto-tags are imported too
  • Proformas > Next ID. Latest ID in tblinvoices plus 1
Billing Preferences:
  • Billing Preferences > Snapshots. If WHMCS is set so store snapshots, Billing Extension imports existing data from mod_invoicedata
  • Billing Preferences > Reset Invoice. Enabled only if EU VAT Addon is set to reset invoice numbers annually
VIES:
  • VIES > VIES. Enabled when VAT Number validation is enabled in EU VAT Addon
  • VIES > VAT Custom Field. Billing Extension uses the same field used by EU VAT
  • VIES > VAT Exempt Status. Enabled when Tax Exempt is enabled in EU VAT Addon. Billing Extension also selects all European countries (home country is not included)
Localisation:
  • Localisation > Default Language. Based on the default language of WHMCS
Moreover the module creates the first Company Profile based on your current details (Company Name, Pay To Text, Country).

Customizations

Now that you have successfully installed Billing Extension, take your time to deepen your understanding of its features and options. All settings can be found in Addons > Billing Extension > Settings divided in multiple tabs:
  • Company Profile
  • Tax Rules
  • Late Fees
  • Settings
The content of the first 3 tabs is self-explanatory. In the last one, Settings, you find a huge amount of options that allows you to customize the module to match your specific needs. All options are complete with descriptions and when needed fully documented. If there's something unclear about a particular option, just click on the information icon. You'll be redirected on the relative article of our documentation.

Integration Code

Most parts of the integration with WHMCS are handled by Billing Extension automatically. However there few small changes that need to be performed manually by adding some snippets of code in templates/{YOUR_TEMPLATE}/invoicepdf.tpl. Open this file with a text editor and place the following code right after the php opening tag:

# Billing Extension - Integration Code
if(file_exists(ROOTDIR . '/modules/addons/BillingExtension/core/autoload.php'))
{
    require_once(ROOTDIR . '/modules/addons/BillingExtension/core/autoload.php');
    $hook = new BillingExtension\BillingExtension_Admin\Hook;
    $hook = $hook->Integration($tplvars, 'pdf');
    foreach($hook as $k=>$v) $$k = $v;
}


Now look for the following section:

$pdf->Image(ROOTDIR . '/assets/img/' . $logoFilename, 15, 25, 75);

Right after that, add the this line of code:

if ($companylogo) {
    $pdf->Image($companylogo, 15, 25, 75); # Billing Extension - Company Logo
}


Lastly copy this snippet right before # Notes section:

# Billing Extension - Footer Text
if ($footertext) {
    $pdf->Ln(5);
    $pdf->SetFont($pdfFont, '', 6);
    $pdf->Cell(170, 5, $footertext, '', '', 'C');
}


Once finished save changes and upload it into your WHMCS. Don't forget to deactivate EU VAT Addon if in use.