InvoiceNinja - Update Currency Exchange Rates
-
I would like to be able to manually trigger the currency exchange rate updater from the CLI or by passing a url query parameter such as ?update-rates. I would also like to know how to change the scheduler for the currency exchange rate updater.
Currency Conversion (exchange rate updater) Docs
https://invoiceninja.github.io/en/self-host/#currency-conversionUpdater Job
https://github.com/invoiceninja/invoiceninja/blob/v5-stable/app/Jobs/Util/UpdateExchangeRates.phpThis job could be run via the laravel-job tool, if it was installed or installable.
https://github.com/mxl/laravel-jobUpdate Schedule
https://github.com/invoiceninja/invoiceninja/blob/a52e138a392c37df0ff05f40d7b37d0c7446647e/app/Console/Kernel.php#L73 -
@robi the issue is that the UpdateExchangeRates.php job is not built as a command as far as I can see. I tried to create a Laravel command for it but the secure file system prevents me from doing that. I would like it to exist as
php artisan ninja:update-ex
or the like. -
I am not sure what you are thinking of. I did a search.
This is what I get when I try to make a command in app/data:root@...:/app/data# php /app/code/artisan make:command What should the console command be named? ❯ ninja:update-ex In Filesystem.php line 190: file_put_contents(/app/code/app/Console/Commands/ninja:update-ex.php): Failed to open stream: Read-only file system
-
@spacetime The CLI commands require changes upstream. You should report it in their forum or discussion area. https://github.com/invoiceninja/invoiceninja/ or https://forum.invoiceninja.com/ . We only package the app, we cannot make changes or add features.
-
@girish understood. What about the scheduled exchange rate updater? It seems it is broken and does not automatically run on Cloudron. It is difficult to test since it only runs once per day. I have added the necessary API key to the .env file.
-
@spacetime You can just run
sudo -u www-data php /app/code/artisan schedule:run
in the web terminal. Does that not work ?