This is a small 'hack' which will add the statement "This supply is subject to the reverse charge." to the bottom of PDF invoices if the customer is in an EC state and there is no tax applied to the invoice (i.e. the tax is reverse charged).
This is required for EC invoices and something that WHMCS doesn't do out of the box. Its not very elegant, but it does work. As we are UK Based, the United Kingdom is isn't in the country array, so if you are based in Germany, add UK and remove Germany. Customize as you will.
Simply add this to the bottom of invoicepdf.tpl:
function wordsExist(&$string, $words) {
foreach($words as &$word) {
if(stripos($string, $word) !== false) {
return true;
}
}
return false;
}
$reverse_charge = $clientsdetails["country"];
# Show reverse charge text if country matches array AND there is no tax rate
if( wordsExist($reverse_charge, array('Austria','Belgium','Bulgaria','Croatia','Cyprus','Czech Republic','Denmark','Estonia','Finland','France','Germany','Greece','Hungary','Ireland','Italy','Latvia','Lithuania','Luxembourg','Malta','Netherlands','Poland','Portugal','Romania','Slovakia','Slovenia','Spain','Sweden')) && !$taxrate )
{
$pdf->SetFont('freesans','',14);
$pdf->Ln(10);
$pdf->Cell(180,4," This supply is subject to the reverse charge.",'','','C');
}
Hope this helps.