mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-09-03 20:52:58 -05:00
Some cleaning up and suppressing.
This commit is contained in:
@@ -323,6 +323,8 @@ class JournalRepository implements JournalRepositoryInterface
|
||||
* @param array $data
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
|
||||
*/
|
||||
protected function storeAccounts(TransactionType $type, array $data)
|
||||
{
|
||||
|
||||
@@ -318,6 +318,8 @@ class TagRepository implements TagRepositoryInterface
|
||||
* @param TransactionJournal $journal
|
||||
* @param Tag $tag
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
protected function connectAdvancePayment(TransactionJournal $journal, Tag $tag)
|
||||
@@ -332,13 +334,11 @@ class TagRepository implements TagRepositoryInterface
|
||||
$withdrawals = $tag->transactionjournals()->where('transaction_type_id', $withdrawal->id)->count();
|
||||
$deposits = $tag->transactionjournals()->where('transaction_type_id', $deposit->id)->count();
|
||||
|
||||
// advance payments cannot accept transfers:
|
||||
if ($journal->transaction_type_id == $transfer->id) {
|
||||
if ($journal->transaction_type_id == $transfer->id) { // advance payments cannot accept transfers:
|
||||
return false;
|
||||
}
|
||||
|
||||
// the first transaction to be attached to this
|
||||
// tag is attached just like that:
|
||||
// the first transaction to be attached to this tag is attached just like that:
|
||||
if ($withdrawals < 1 && $deposits < 1) {
|
||||
$journal->tags()->save($tag);
|
||||
$journal->save();
|
||||
|
||||
Reference in New Issue
Block a user