mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-22 12:11:19 +00:00
New stuff!
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user