mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-07 10:28:22 +00:00
Fix tag bug. (again)
This commit is contained in:
@@ -320,13 +320,18 @@ class TagRepository implements TagRepositoryInterface
|
|||||||
$match = true;
|
$match = true;
|
||||||
/** @var TransactionJournal $check */
|
/** @var TransactionJournal $check */
|
||||||
foreach ($tag->transactionjournals as $check) {
|
foreach ($tag->transactionjournals as $check) {
|
||||||
if ($check->source_account->id != $journal->source_account->id) {
|
// $checkAccount is the source_account for a withdrawal
|
||||||
|
// $checkAccount is the destination_account for a deposit
|
||||||
|
if ($check->transactionType->type == 'Withdrawal' && $check->source_account->id != $journal->destination_account->id) {
|
||||||
$match = false;
|
$match = false;
|
||||||
}
|
}
|
||||||
|
if ($check->transactionType->type == 'Deposit' && $check->destination_account->id != $journal->destination_account->id) {
|
||||||
|
$match = false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if ($match) {
|
if ($match) {
|
||||||
$journal->tags()->save($tag);
|
$journal->tags()->save($tag);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user