mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-22 12:11:19 +00:00
Expanded account view.
This commit is contained in:
@@ -36,14 +36,6 @@ class ReportHelper implements ReportHelperInterface
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return Carbon
|
|
||||||
*/
|
|
||||||
public function firstDate()
|
|
||||||
{
|
|
||||||
return Session::get('first');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method gets some kind of list for a monthly overview.
|
* This method gets some kind of list for a monthly overview.
|
||||||
*
|
*
|
||||||
|
@@ -14,11 +14,6 @@ interface ReportHelperInterface
|
|||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return Carbon
|
|
||||||
*/
|
|
||||||
public function firstDate();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Carbon $date
|
* @param Carbon $date
|
||||||
*
|
*
|
||||||
|
@@ -12,6 +12,7 @@ use Input;
|
|||||||
use Redirect;
|
use Redirect;
|
||||||
use Session;
|
use Session;
|
||||||
use View;
|
use View;
|
||||||
|
use Steam;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class AccountController
|
* Class AccountController
|
||||||
@@ -124,6 +125,22 @@ class AccountController extends Controller
|
|||||||
}]
|
}]
|
||||||
)->accountTypeIn($types)->get(['accounts.*']);
|
)->accountTypeIn($types)->get(['accounts.*']);
|
||||||
|
|
||||||
|
// last activity:
|
||||||
|
$accounts->each(
|
||||||
|
function (Account $account) {
|
||||||
|
$lastTransaction = $account->transactions()->leftJoin(
|
||||||
|
'transaction_journals', 'transactions.transaction_journal_id', '=', 'transaction_journals.id'
|
||||||
|
)->orderBy('transaction_journals.date', 'DESC')->first(['transactions.*', 'transaction_journals.date']);
|
||||||
|
if ($lastTransaction) {
|
||||||
|
$account->lastActivityDate = $lastTransaction->transactionjournal->date;
|
||||||
|
} else {
|
||||||
|
$account->lastActivityDate = null;
|
||||||
|
}
|
||||||
|
$account->startBalance = Steam::balance($account, Session::get('start'));
|
||||||
|
$account->endBalance = Steam::balance($account, Session::get('end'));
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
return view('accounts.index', compact('what', 'subTitleIcon', 'subTitle', 'accounts'));
|
return view('accounts.index', compact('what', 'subTitleIcon', 'subTitle', 'accounts'));
|
||||||
}
|
}
|
||||||
|
@@ -10,7 +10,7 @@ use FireflyIII\Models\Account;
|
|||||||
use Illuminate\Database\Query\JoinClause;
|
use Illuminate\Database\Query\JoinClause;
|
||||||
use Steam;
|
use Steam;
|
||||||
use View;
|
use View;
|
||||||
|
use Session;
|
||||||
/**
|
/**
|
||||||
* Class ReportController
|
* Class ReportController
|
||||||
*
|
*
|
||||||
@@ -115,7 +115,7 @@ class ReportController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function index(ReportHelperInterface $helper)
|
public function index(ReportHelperInterface $helper)
|
||||||
{
|
{
|
||||||
$start = $helper->firstDate();
|
$start = Session::get('first');
|
||||||
$months = $helper->listOfMonths($start);
|
$months = $helper->listOfMonths($start);
|
||||||
$years = $helper->listOfYears($start);
|
$years = $helper->listOfYears($start);
|
||||||
$title = 'Reports';
|
$title = 'Reports';
|
||||||
|
@@ -8,6 +8,7 @@
|
|||||||
<th>Current balance</th>
|
<th>Current balance</th>
|
||||||
<th>Active</th>
|
<th>Active</th>
|
||||||
<th>Last activity</th>
|
<th>Last activity</th>
|
||||||
|
<th>Balance difference between {{Session::get('start')->format('jS F Y')}} and {{Session::get('end')->format('jS F Y')}}</th>
|
||||||
</tr>
|
</tr>
|
||||||
@foreach($accounts as $account)
|
@foreach($accounts as $account)
|
||||||
<tr>
|
<tr>
|
||||||
@@ -42,6 +43,10 @@
|
|||||||
<em>Never</em>
|
<em>Never</em>
|
||||||
@endif
|
@endif
|
||||||
</td>
|
</td>
|
||||||
|
<td>
|
||||||
|
{!! Amount::format($account->endBalance - $account->startBalance) !!}
|
||||||
|
</td>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
@endforeach
|
@endforeach
|
||||||
|
Reference in New Issue
Block a user