Merge branch 'hotfix/3.4.4.2' into develop

This commit is contained in:
James Cole 2015-06-08 18:52:30 +02:00
commit 06862a2812
2 changed files with 8 additions and 3 deletions

View File

@ -1,4 +1,4 @@
# Firefly III (v3.4.4)
# Firefly III (v3.4.4.2)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/JC5/firefly-iii/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/JC5/firefly-iii/?branch=master)
[![Code Coverage](https://scrutinizer-ci.com/g/JC5/firefly-iii/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/JC5/firefly-iii/?branch=master)

View File

@ -320,13 +320,18 @@ class TagRepository implements TagRepositoryInterface
$match = true;
/** @var TransactionJournal $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;
}
if ($check->transactionType->type == 'Deposit' && $check->destination_account->id != $journal->destination_account->id) {
$match = false;
}
}
if ($match) {
$journal->tags()->save($tag);
return true;
}