mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-15 16:57:09 +00:00
Build edit split transactions.
This commit is contained in:
@@ -182,8 +182,18 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
->expanded()
|
||||
->sortCorrectly()
|
||||
->before($end)
|
||||
->where('destination_account.id', $account->id)
|
||||
->whereIn('source_account.id', $ids)
|
||||
->leftJoin(
|
||||
'transactions as dest', function (JoinClause $join) {
|
||||
$join->on('dest.transaction_journal_id', '=', 'transaction_journals.id')->where('dest.amount', '>', 0);
|
||||
}
|
||||
)
|
||||
->leftJoin(
|
||||
'transactions as source', function (JoinClause $join) {
|
||||
$join->on('source.transaction_journal_id', '=', 'transaction_journals.id')->where('source.amount', '<', 0);
|
||||
}
|
||||
)
|
||||
->where('dest.account_id', $account->id)
|
||||
->whereIn('source.account_id', $ids)
|
||||
->after($start)
|
||||
->get(TransactionJournal::queryFields());
|
||||
|
||||
|
Reference in New Issue
Block a user