Hostmag Posted May 2, 2016 Share Posted May 2, 2016 Hello I have next issue: I would like to have my default currency in EUR, but in invoie (both pdf and viewinvoice) I would like to display the price in secondary currency (for example USD). How can i edit the .tpl files so the clients see the other currency (not default) ? Thank you 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 3, 2016 Share Posted May 3, 2016 the problem with this is that, on one level, it's simple... but dig a little deeper and it becomes more complicated! so the opening step would be to get the exchange rate from the database - but that's simple enough to do using an action hook. http://forum.whmcs.com/showthread.php?112787-how-to-get-currency-exchange-rate&p=457891#post457891 with that value, you can then work out the total in your other currency - as it's simply... total in currency B = total in currency A * exchange rate the problem is that WHMCS doesn't archive exchange rates - it only stores the rate obtained from the last cron run... so on the day the invoice is generated, you could use the hook, tweak the templates to show the second currency and it would be correct. however, if the client logs into WHMCS the next day, week or month later, and views the invoice, the exchange rate will be different and so the secondary total will now be wrong. perhaps the only way around that would be to archive the exchange rates (or secondary totals) and then use the appropriate rate/total when viewing the invoice... or using an online API that can access historical rates and pulls the correct rate based on the invoice date. but those two last options would require an addon to be written - and i'm not aware of any existing addon that can do that. 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.