Recalculate amounts.

This commit is contained in:
James Cole
2024-12-21 11:33:58 +01:00
parent e2a20dd63d
commit 76075401f9
3 changed files with 11 additions and 10 deletions

View File

@@ -117,7 +117,7 @@ class PreferencesEventHandler
private function resetTransactions(UserGroup $userGroup): void
{
// custom query because of the potential size of this update.
DB::table('transactions')
$success = DB::table('transactions')
->join('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id')
->where('transaction_journals.user_group_id', $userGroup->id)
->where(static function (Builder $q) {
@@ -125,5 +125,6 @@ class PreferencesEventHandler
->orWhereNotNull('native_foreign_amount');
})
->update(['native_amount' => null, 'native_foreign_amount' => null]);
Log::debug(sprintf('Updated %d transactions.', $success));
}
}