Chart re-implemented and added coveralls and other instructions, which will probably not work at all.

This commit is contained in:
James Cole
2015-02-07 08:23:44 +01:00
parent 37e58ac13a
commit fb1c78c657
13 changed files with 371 additions and 25 deletions

34
app/Support/Steam.php Normal file
View File

@@ -0,0 +1,34 @@
<?php
namespace FireflyIII\Support;
use Carbon\Carbon;
use FireflyIII\Models\Account;
/**
* Class Steam
*
* @package FireflyIII\Support
*/
class Steam
{
/**
*
* @param Account $account
* @param Carbon $date
*
* @return float
*/
public function balance(Account $account, Carbon $date = null)
{
$date = is_null($date) ? Carbon::now() : $date;
$balance = floatval(
$account->transactions()->leftJoin(
'transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id'
)->where('transaction_journals.date', '<=', $date->format('Y-m-d'))->sum('transactions.amount')
);
return $balance;
}
}