mdeinhardt Posted December 11, 2014 Share Posted December 11, 2014 We are from Germany and it is mandatory for us to show all prices including tax on websites. On invoices we have to list all prices excluding tax though and then add VAT and display the Total. So far, so good and very common I guess. But how do I do that in WHMCS? I have set all prices to be inclusive tax, otherwise they would displayed wrong in the client area. But now WHMCS only displays gross prices and using $item.amount in the invoice does the same. Is there a way to make WHMCS display net prices, especially in the invoice? Or am I simply overlooking something? How are others handling this? Thanks 0 Quote Link to comment Share on other sites More sharing options...
mdeinhardt Posted December 12, 2014 Author Share Posted December 12, 2014 I've been studying posts and documentation for hours now and know as much as before :-( So here's what I found/think: Tax rules in WHMC seem to be either inclusive or exclusive and I have found no way around that. German law requires prices on websites to be given including tax (not a new thing, always has been this way) German law requires prices in invoices to be shown excluding tax for each service/product and then add VAT. (see above) WHMCS can't do that, or can it? Any Germans here, who could shed some light on this? No other country in the world has this kind of requirement? 0 Quote Link to comment Share on other sites More sharing options...
mdeinhardt Posted December 19, 2014 Author Share Posted December 19, 2014 C'mon guys, surely there must be someone here who is using prices including tax but lists net prices on the invoice. Or are you using exlusive prices and show gross prices on the web? Could anyone tell me how they are doing it? 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted December 19, 2014 Share Posted December 19, 2014 Here in Italy we simply add a text like this one in the footer. In past I've seen that also big brands like Microsoft were using the same approach on their websites. Are you allowed to do the same? *all our prices are excluding VAT Anyway there's a solution. You could modify your tpl to display prices including VAT. It should be easy. 0 Quote Link to comment Share on other sites More sharing options...
mdeinhardt Posted December 19, 2014 Author Share Posted December 19, 2014 Hi Kian, thanks for taking the time to answer. Unfortunately we can't do that declaration bit, you know Germans, everything has to be following the rules very strictly ;-) Do you mean the invoicepdf.tpl? I would love to do that, but as I found out here http://forum.whmcs.com/showthread.php?22916-V4-Invoice-Template-Calculations-Stopped-Working&highlight=calculate+invoice I can't simply caclulate with the value, since $invoiceitems[amount] delivers a string. Any ideas around that? The other way around, i.e. using prices excluding VAT and then calculate the gross price for output on the web, would be good too, but I haven't yet found how to do that either :-( 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted December 19, 2014 Share Posted December 19, 2014 It's true but it's still possible to display the price excluding VAT plus 2 additional columns (if necessary) with tax rate and price including VAT for each item of the invoice. You just need to modify your invoice.tpl file and of course also viewinvoice.php for the printable version. 0 Quote Link to comment Share on other sites More sharing options...
mdeinhardt Posted December 19, 2014 Author Share Posted December 19, 2014 Ok, so I have missed resp. haven't found that yet then. Is there any comprehensive listing of the possible variables anywhere? The information under http://docs.whmcs.com/PDF_Invoice_Customisation is very meager, to say the least. And I have scoured the forum for hours, but have found no mention of this. Or do you happen to have the variable at hand? '.$item['amount'].' gives me the price as entered (in my case including tax). What would I use to display the price excluding VAT? Cheers 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted December 19, 2014 Share Posted December 19, 2014 Nah, as you said there are no available variables but you can "calculate" them since you know the price and tax rate. You just have to do some PHP math and TCPDF modifications. 0 Quote Link to comment Share on other sites More sharing options...
mdeinhardt Posted December 19, 2014 Author Share Posted December 19, 2014 That I know, but how? If '.$item['amount'].' gives me string, how do I do that? You might have guessed, I am not a programmer... 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted December 19, 2014 Share Posted December 19, 2014 Given that you can still get the amount 10.00 € even from a string like... I'm awesome, I'm special 10.00 yeah € bla bla There's also $item['rawamount']. It contains the raw value with no currency (e.g. 10.00). 0 Quote Link to comment Share on other sites More sharing options...
mdeinhardt Posted December 19, 2014 Author Share Posted December 19, 2014 I might have to ask a programmer to do this for me anyway, so he would know how to get the number from a string. Ah, great, so $item['rawamount'] is exactly what I was looking for. Where did you find that (just curious, since I a always trying to figure stuff out myself)? Thanks a million for our help, Kian. 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted December 19, 2014 Share Posted December 19, 2014 (edited) With this in invoicepdf.tpl echo "<pre>"; print_r($invoiceitems); echo "</pre>"; die(); $invoiceitems is the array that contains all items of invoice. Basically I'm printing all its content. The result is something like this: Array ( [0] => Array ( [id] => 125 [type] => Hosting [relid] => 89 [description] => Dedicated Server (28/11/2014 - 27/12/2014) Add Bulk Space 1gb, $1.95/mo.: 0 x +1gb space €5.00 EUR Add Bandwidth 1gb, $0.49/mo.: 0 x +1gb bandwidth €5.00 EUR Add Bulk Bandwidth 10gb, $3.25/mo., 10+% Discount!: 0 x +10gb bandwidth €5.00 EUR Add DS cPanel/WHM with Fully Managed Support, FREE (a $790/yr value!): Nei [rawamount] => 10.00 [amount] => €10.00 EUR [taxed] => 1 ) [1] => Array ( [id] => 191 [type] => [relid] => 0 [description] => Website Wordpress [rawamount] => 1000.00 [amount] => €1000.00 EUR [taxed] => 1 ) [2] => Array ( [id] => 192 [type] => [relid] => 0 [description] => Dedicated server setup [rawamount] => 159.00 [amount] => €159.00 EUR [taxed] => 1 ) ) Remember that you have to edit invoicepdf.tpl with TCPDF and also viewinvoice.tpl with Smarty so the following skills are required: PHP, Smarty, TCPDF and of course WHMCS. Anyway it's simple to achieve. Edited December 19, 2014 by Kian 0 Quote Link to comment Share on other sites More sharing options...
mdeinhardt Posted December 20, 2014 Author Share Posted December 20, 2014 Simple, eh? ;-) No actually that is awesome. You helped me on so many levels now, I know where to start and I know where to go. So thanks again for taking the time. And merry xmas Cheers, Michael 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.