Vs Nu Posted October 19, 2023 Share Posted October 19, 2023 (edited) Hello, My Default currency was USD But as i was paying GST (From India) i need to update the currency in INR Format in GST portal. I had searched the community and got some luck about doing the exchange and displaying in the Invoice Page (View invoice page) but when ever the exchange rate updates it was also getting update on the view invoice page but i need it like the currency rate of that day should be stored for paid invoices and which should be change (for unpaid invoices only) I had used the hook below : <?php use Illuminate\Database\Capsule\Manager as Capsule; function hook_currency_exchange_rates($vars) { $exchangerate = Capsule::table('tblcurrencies') ->where('code', 'INR') ->get(); return array("exchangerate" => $exchangerate[0]->rate); } add_hook("ClientAreaPage", 1, "hook_currency_exchange_rates"); ?> in viewinvoice.tpl file i had used this Quote <tr> <td class="background-gray" colspan="9" align="right"><strong>Total Amount In Rupees (₹) :</strong></td> <td class="background-gray" align="left"><strong>₹{if $clientsdetails.currency eq "2"} {(($total->toNumeric())* $exchangerate)|string_format:"%.2f"} INR</strong>{/if} </td> </tr> Please can someone help me to store the value and display it on paid invoice Looking for your Support @brian! Edited October 19, 2023 by Vs Nu 0 Quote Link to comment Share on other sites More sharing options...
Remitur Posted October 20, 2023 Share Posted October 20, 2023 I suggest: create a new db table invoice_notes , with just to fields: invoiced and exchangerate in your hook, add a record to the table, inserting the required data and recover the data from the table when needed You can enrich the table with further notes and info to be displayed in the invoice (I use a similar way to add notes about VAT management) 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.