Experimental count thing.

This commit is contained in:
James Cole 2015-05-23 17:38:16 +02:00
parent 5c55fa5fbb
commit 422f429725

View File

@ -34,20 +34,21 @@ class Steam
$firstDate = is_null($firstDateObject) ? clone $date : new Carbon($firstDateObject->date);
$date = $date < $firstDate ? $firstDate : $date;
$set = $account->transactions()->leftJoin(
bcscale(2);
$set = $account->transactions()->leftJoin(
'transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id'
)->where('transaction_journals.date', '<=', $date->format('Y-m-d'))->get(['transactions.*']);
$balance = 0;
foreach($set as $entry) {
$balance += $entry->amount;
$balance = '0';
foreach ($set as $entry) {
$balance = bcadd($balance, $entry->amount);
}
if (!$ignoreVirtualBalance) {
$balance += floatval($account->virtual_balance);
$balance = bcadd($balance, $account->virtual_balance);
//$balance += floatval($account->virtual_balance);
}
return $balance;
return round($balance, 2);
}
/**