ehuk Posted February 7, 2015 Share Posted February 7, 2015 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. 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted February 7, 2015 Share Posted February 7, 2015 may i can improve it just a little!! # Company Country [Modify it to match your country] $companyCountry = "United Kingdom"; # Client Country $clientCountry = $clientsdetails["country"]; # Reverse Charge Countries $reverseCountries = array('United Kingdom','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'); $deleteCompanyCountry = array_diff($reverseCountries, [$companyCountry]); $reverseCountries = array_values($deleteCompanyCountry); # Show reverse charge text if country matches array AND there is no tax rate if( in_array($clientCountry, $reverseCountries) && !$taxrate ){ $pdf->SetFont('freesans','',14); $pdf->Ln(10); $pdf->Cell(180,4," This supply is subject to the reverse charge.",'','','C'); } 0 Quote Link to comment Share on other sites More sharing options...
ehuk Posted February 9, 2015 Author Share Posted February 9, 2015 That is a lot more elegant 0 Quote Link to comment Share on other sites More sharing options...
michael24 Posted February 18, 2015 Share Posted February 18, 2015 Be careful with the text. In Germany it has to be "Steuerschuldnerschaft des Leistungsempfängers" and there may be some more countries with explicit legal regulation for this. You may want to have a look at the facts for the Council Directive 2010/45/EC / Explanatory notes Germans should google for "Steuervereinfachungsgesetz" 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.