WHMCS invoicepdf.tpl and viewinvoice.tpl multiple currencies -


i need 2 currencies displayed on invoices, in basic way: $total should displayed in default currency, followed currency calculated using current exchange rate stored in tblcurrencies table, i'm having trouble getting work.

so line in invoicepdf.tpl , should like:

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

where $exrate current exchange rate pulled database , stored in variable. similar should in viewinvoice.tpl.

of course, there might smarter way this.

as seen here, no currency variable available : http://docs.whmcs.com/pdf_invoice_customisation

so need make database call within viewinvoice.tpl , currency variable.

other , simpler way use whmcs built-in functions described here(formatting currency seciton): http://docs.whmcs.com/useful_functions_for_devs


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

html - Unable to style the color of bullets in a list -

c# - must be a non-abstract type with a public parameterless constructor in redis -