문제

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.

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top