d3m0n Posted December 23, 2020 Share Posted December 23, 2020 Hello Community members, i need to do some pdf invoice tweaking including different lines according to clients currency i have been playing around with invoicepdf.tpl but can't find a correct way yo output the "$clientsdetails.currency" . the task is pretty simple if the client currency is USD show this if Euro show that. can someone point me to the right direction ? thx in advance Merry Christmas and happy new year 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted December 24, 2020 Share Posted December 24, 2020 $clientsdetails.currency will return the id value from the tblcurrencies database table - so it's going to return a number rather than a specific currency code, e.g USD, GBP etc. now you could look that value up in the database, or if you know the ids of your currencies, then you can code based on the values instead of using GBP, USD directly... if you don't, then a quick way might be to use... $currencydata = getCurrency($userid); $currencycode = $currencydata["code"]; $currencycode should then contain the code, e.g GBP, USD etc and you should then be able to use that in your IF statements to decide what to do based on the client's currency. 1 Quote Link to comment Share on other sites More sharing options...
d3m0n Posted December 24, 2020 Author Share Posted December 24, 2020 thank you brian! once again save the day) happy holidays 42 minutes ago, brian! said: $clientsdetails.currency will return the id value from the tblcurrencies database table - so it's going to return a number rather than a specific currency code, e.g USD, GBP etc. now you could look that value up in the database, or if you know the ids of your currencies, then you can code based on the values instead of using GBP, USD directly... if you don't, then a quick way might be to use... $currencydata = getCurrency($userid); $currencycode = $currencydata["code"]; $currencycode should then contain the code, e.g GBP, USD etc and you should then be able to use that in your IF statements to decide what to do based on the client's currency. 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.