Removed some foreach() routines that are no longer necessary now that getAmountAttribute() exists.

This commit is contained in:
James Cole
2015-04-09 20:58:57 +02:00
parent 5124ce0302
commit 587b94153d
4 changed files with 4 additions and 38 deletions
@@ -51,14 +51,7 @@ class ConnectJournalToPiggyBank
return;
}
Log::debug('Found a piggy bank');
$amount = 0;
/** @var Transaction $transaction */
foreach ($journal->transactions()->get() as $transaction) {
if ($transaction->account_id === $piggyBank->account_id) {
// this transaction is the relevant one.
$amount = floatval($transaction->amount);
}
}
$amount = $journal->amount;
Log::debug('Amount: ' . $amount);
if ($amount == 0) {
return;