koko20212021 Posted April 25, 2021 Share Posted April 25, 2021 48 minutes ago, Kian said: The real issue is that you must: Keep track of historical currency exchange rates Include the currency rate in use at the time the invoice was issued If you don't do that amounts on invoice fluctuate. Moreover your accountant needs to manually retreive the currency rate from invoice date or transaction date. It takes time. IMO you should look for something like follows (top-right corner). Once you have currency rates, you can display all currencies you want safe from fluctuating exchange rates. This is a good idea. I am now .. partially solved my issue alone. What I did was to leave just 1 Default currency - Eur and I applyed on invoices tpl a simple formula : <td class="total-row text-center">{($total|replace:'€':''|replace:'EUR':'' * 4.9)|string_format:"%.2f"} RON</td> The best solution as u say, would be the use the national bank rate: https://www.bnr.ro/nbrfxrates.xml Not sure if there would be any solution, like to grab this line or data "<Rate currency="EUR">4.9257</Rate>" and have this as refference / history . I am not a programmer to do this 0 Quote Link to comment Share on other sites More sharing options...
koko20212021 Posted April 25, 2021 Share Posted April 25, 2021 I have found a way it seems to basicly grab daily rate from our National Bank and solve the history of currency, this is a small php script that does this: https://www.curs-valutar-bnr.ro/preluare-curs-valutar-bnr-script-php My question is how would I call this rate into my formula: <td class="total-row text-center">{($total|replace:'€':''|replace:'EUR':'' * 4.9)|string_format:"%.2f"} RON</td> 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted April 25, 2021 Share Posted April 25, 2021 Save currency rates in a custom table of WHMCS database so that you have one rate for each YYYY-MM-DD. Once done, use invoice date to get the right rate to use in your formula. 0 Quote Link to comment Share on other sites More sharing options...
koko20212021 Posted April 26, 2021 Share Posted April 26, 2021 I have found this script : http://www.heliosdesign.ro/resurse/php/preluare-curs-valutar.htm It seems it creating 2 tables in mysql - Curs ( rate ) & Valuta ( currency ) His sourse it seems not functional: https://www.bnr.ro/ro/info/curs_ext.asp i will try : https://www.bnr.ro/nbrfxrates.xml Not sure how will call these entries in my formula but will see :)) 0 Quote Link to comment Share on other sites More sharing options...
redsky Posted November 15, 2021 Share Posted November 15, 2021 On 26.04.2021 at 8:46, koko20212021 said: Am găsit acest script: http://www.heliosdesign.ro/resurse/php/preluare-curs-valutar.htm Se pare că creează 2 tabele în mysql - Curs (rata) și Valuta (valută) Sursa lui pare să nu funcționeze: https://www.bnr.ro/ro/info/curs_ext.asp Voi încerca : https://www.bnr.ro/nbrfxrates.xml Nu sunt sigur cum voi apela aceste intrări în formula mea, dar voi vedea :)) hello, did you manage to implement https://www.bnr.ro/nbrfxrates.xml in the invoice? if so you can tell me that you have been torturing me for some time and when I put the script it makes my page white 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.