Question

I need two currencies displayed on invoices, in a very basic way: $total should be displayed in default currency, followed by currency calculated using current exchange rate stored in tblcurrencies table, but I'm having trouble getting this to work.

So this line in invoicepdf.tpl and should look something like:

<td align="center">'.$total.' (€'. number_format($total/$exrate, 2, '.', '').')</td>

where $exrate is current exchange rate pulled from the database and stored in a variable. Probably something similar should be in viewinvoice.tpl.

Of course, there might be a smarter way to do this.

Was it helpful?

Solution

As it is seen here, no currency variable is available : http://docs.whmcs.com/PDF_Invoice_Customisation

So what you need to do is simply make a database call within viewinvoice.tpl and get the currency variable.

Other and simpler way is to use whmcs built-in functions described here(Formatting Currency seciton): http://docs.whmcs.com/Useful_Functions_for_Devs

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top