🤖 Auto commit for release 'develop' on 2026-01-23

This commit is contained in:
JC5
2026-01-23 15:14:29 +01:00
parent 8f15a32bd6
commit eeeba86d38
888 changed files with 10732 additions and 10387 deletions

View File

@@ -50,11 +50,11 @@ class SetDestinationToCashAccount implements ActionInterface
public function actOnArray(array $journal): bool
{
/** @var User $user */
$user = User::find($journal['user_id']);
$user = User::find($journal['user_id']);
/** @var null|TransactionJournal $object */
$object = $user->transactionJournals()->find((int) $journal['transaction_journal_id']);
$repository = app(AccountRepositoryInterface::class);
$object = $user->transactionJournals()->find((int) $journal['transaction_journal_id']);
$repository = app(AccountRepositoryInterface::class);
if (null === $object) {
Log::error('Could not find journal.');
@@ -62,7 +62,7 @@ class SetDestinationToCashAccount implements ActionInterface
return false;
}
$type = $object->transactionType->type;
$type = $object->transactionType->type;
if (TransactionTypeEnum::WITHDRAWAL->value !== $type) {
Log::error('Transaction must be withdrawal.');
event(new RuleActionFailedOnArray($this->action, $journal, trans('rules.not_withdrawal')));
@@ -76,7 +76,7 @@ class SetDestinationToCashAccount implements ActionInterface
// new destination account must be different from the current source account:
/** @var null|Transaction $source */
$source = $object->transactions()->where('amount', '<', 0)->first();
$source = $object->transactions()->where('amount', '<', 0)->first();
if (null === $source) {
Log::error('Could not find source transaction.');
event(new RuleActionFailedOnArray($this->action, $journal, trans('rules.cannot_find_source_transaction')));
@@ -108,7 +108,8 @@ class SetDestinationToCashAccount implements ActionInterface
DB::table('transactions')
->where('transaction_journal_id', '=', $object->id)
->where('amount', '>', 0)
->update(['account_id' => $cashAccount->id]);
->update(['account_id' => $cashAccount->id])
;
Log::debug(sprintf('Updated journal #%d (group #%d) and gave it new destination account ID.', $object->id, $object->transaction_group_id));