Jump to content

pdf invoice currencty


d3m0n

Recommended Posts

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

Link to comment
Share on other sites

$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.

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated