New stuff!

This commit is contained in:
James Cole
2014-12-07 15:37:53 +01:00
parent 742479bb01
commit 6aecd77b77
31 changed files with 678 additions and 477 deletions

View File

@@ -49,10 +49,13 @@ class TransactionJournal extends Eloquent
*
* @return float
*/
public function getAmount()
public function getAmount(\Account $account = null)
{
foreach ($this->transactions as $t) {
if (!is_null($account) && $account->id == $t->account_id) {
return floatval($t->amount);
}
if (floatval($t->amount) > 0) {
return floatval($t->amount);
}