Change currency from settings #671 (#672)

This commit is contained in:
Nabeel S
2020-04-26 11:55:20 -04:00
committed by GitHub
parent 03cfc648b0
commit 99f4f3b3d8
15 changed files with 63 additions and 29 deletions

View File

@@ -168,4 +168,16 @@ class FinanceService extends Service
'transactions' => $transactions,
];
}
/**
* Change the currencies on the journals and transactions to the current currency value
*/
public function changeJournalCurrencies(): void
{
$currency = setting('units.currency', 'USD');
$update = ['currency' => $currency];
Journal::query()->update($update);
JournalTransaction::query()->update($update);
}
}