@@ -63,11 +63,11 @@ class PirepFinanceService extends Service
|
||||
public function processFinancesForPirep(Pirep $pirep)
|
||||
{
|
||||
if (!$pirep->airline->journal) {
|
||||
$pirep->airline->journal = $pirep->airline->initJournal(config('phpvms.currency'));
|
||||
$pirep->airline->journal = $pirep->airline->initJournal(setting('units.currency', 'USD'));
|
||||
}
|
||||
|
||||
if (!$pirep->user->journal) {
|
||||
$pirep->user->journal = $pirep->user->initJournal(config('phpvms.currency'));
|
||||
$pirep->user->journal = $pirep->user->initJournal(setting('units.currency', 'USD'));
|
||||
}
|
||||
|
||||
// Clean out the expenses first
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -248,7 +248,7 @@ class SeederService extends Service
|
||||
|
||||
// See if any of the options have changed
|
||||
if ($row->type === 'select') {
|
||||
if ($row->options !== $setting['options']) {
|
||||
if (!empty($row->options) && $row->options !== $setting['options']) {
|
||||
Log::info('Options for '.$id.' changed, update available');
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user