mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-16 18:25:00 -06:00
Remove unused overview #384
This commit is contained in:
parent
12c15ea590
commit
d7f2b7cd63
@ -207,58 +207,9 @@ class ExpenseController extends Controller
|
||||
|
||||
/**
|
||||
* @param Collection $accounts
|
||||
* @param Collection $expense
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return array|mixed|string
|
||||
* @throws \Throwable
|
||||
* @return array
|
||||
*/
|
||||
public function spentGrouped(Collection $accounts, Collection $expense, Carbon $start, Carbon $end)
|
||||
{
|
||||
// Properties for cache:
|
||||
$cache = new CacheProperties;
|
||||
$cache->addProperty($start);
|
||||
$cache->addProperty($end);
|
||||
$cache->addProperty('expense-spent-grouped');
|
||||
$cache->addProperty($accounts->pluck('id')->toArray());
|
||||
$cache->addProperty($expense->pluck('id')->toArray());
|
||||
if ($cache->has()) {
|
||||
return $cache->get(); // @codeCoverageIgnore
|
||||
}
|
||||
|
||||
$combined = $this->combineAccounts($expense);
|
||||
$format = app('navigation')->preferredRangeFormat($start, $end);
|
||||
$result = [];
|
||||
|
||||
foreach ($combined as $name => $combi) {
|
||||
$current = clone $start;
|
||||
$combiSet = [];
|
||||
while ($current <= $end) {
|
||||
$period = $current->format('Ymd');
|
||||
$periodName = app('navigation')->periodShow($current, $format);
|
||||
$currentEnd = app('navigation')->endOfPeriod($current, $format);
|
||||
/**
|
||||
* @var string $name
|
||||
* @var Collection $combi
|
||||
*/
|
||||
$spent = $this->spentInPeriod($accounts, $combi, $current, $currentEnd);
|
||||
$earned = $this->earnedInPeriod($accounts, $combi, $current, $currentEnd);
|
||||
$current = app('navigation')->addPeriod($current, $format, 0);
|
||||
$combiSet[$period] = [
|
||||
'period' => $periodName,
|
||||
'spent' => $spent,
|
||||
'earned' => $earned,
|
||||
];
|
||||
}
|
||||
$result[$name] = $combiSet;
|
||||
}
|
||||
$result = view('reports.partials.exp-grouped', compact('result'))->render();
|
||||
$cache->store($result);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
protected function combineAccounts(Collection $accounts): array
|
||||
{
|
||||
$combined = [];
|
||||
|
1
public/js/ff/reports/account/month.js
vendored
1
public/js/ff/reports/account/month.js
vendored
@ -24,7 +24,6 @@ $(function () {
|
||||
drawChart();
|
||||
|
||||
loadAjaxPartial('inOutAccounts', spentUri);
|
||||
loadAjaxPartial('inOutPeriod', groupedUri);
|
||||
loadAjaxPartial('inOutCategory', categoryUri);
|
||||
loadAjaxPartial('inOutBudget', budgetUri);
|
||||
loadAjaxPartial('topXexpense', expenseUri);
|
||||
|
@ -21,20 +21,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
|
||||
<div class="box">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{{ ('in_out_accounts_period_'~preferredPeriod)|_ }}</h3>
|
||||
</div>
|
||||
<div class="box-body table-responsive no-padding" id="inOutPeriod">
|
||||
{# loading indicator #}
|
||||
<div class="overlay">
|
||||
<i class="fa fa-refresh fa-spin"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{# chart #}
|
||||
@ -133,7 +119,6 @@
|
||||
|
||||
// boxes with stuff:
|
||||
var spentUri = '{{ route('report-data.expense.spent', [accountIds, expenseIds, start.format('Ymd'), end.format('Ymd')]) }}';
|
||||
var groupedUri = '{{ route('report-data.expense.spent-grouped', [accountIds, expenseIds, start.format('Ymd'), end.format('Ymd')]) }}';
|
||||
var categoryUri = '{{ route('report-data.expense.category', [accountIds, expenseIds, start.format('Ymd'), end.format('Ymd')]) }}';
|
||||
var budgetUri = '{{ route('report-data.expense.budget', [accountIds, expenseIds, start.format('Ymd'), end.format('Ymd')]) }}';
|
||||
var expenseUri = '{{ route('report-data.expense.expenses', [accountIds, expenseIds, start.format('Ymd'), end.format('Ymd')]) }}';
|
||||
|
@ -1,37 +0,0 @@
|
||||
<table class="table table-hover sortable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:40%;" data-defaultsign="az">{{ 'name'|_ }}</th>
|
||||
<th style="width:20%;" data-defaultsign="az">{{ 'period'|_ }}</th>
|
||||
<th class="hidden-xs" style="width:20%;text-align: right;" data-defaultsort="disabled">{{ 'spent'|_ }}</th>
|
||||
<th class="hidden-xs" style="width:20%;text-align: right;" data-defaultsort="disabled">{{ 'earned'|_ }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for name, periods in result %}
|
||||
{% for periodIndex, period in periods %}
|
||||
<tr>
|
||||
<td>{{ name }}</td>
|
||||
<td data-value="{{ periodIndex }}">{{ period.period }}</td>
|
||||
<td style="text-align: right;" >
|
||||
{% if period.spent|length == 0%}
|
||||
{{ '0'|formatAmount }}
|
||||
{% endif %}
|
||||
{% for expense in period.spent %}
|
||||
{{ formatAmountBySymbol(expense.sum, expense.currency.symbol, expense.currency.dp) }}<br />
|
||||
{% endfor %}
|
||||
</td>
|
||||
<td style="text-align: right;" >
|
||||
{% if period.earned|length == 0 %}
|
||||
{{ '0'|formatAmount }}
|
||||
{% endif %}
|
||||
{% for income in period.earned %}
|
||||
{{ formatAmountBySymbol(income.sum, income.currency.symbol, income.currency.dp) }}<br />
|
||||
{% endfor %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
|
||||
</tbody>
|
||||
</table>
|
@ -614,9 +614,8 @@ Route::group(
|
||||
Route::group(
|
||||
['middleware' => 'user-full-auth', 'namespace' => 'Report', 'prefix' => 'report-data/expense', 'as' => 'report-data.expense.'], function () {
|
||||
|
||||
// spent per period / spent grouped
|
||||
// spent per period
|
||||
Route::get('spent/{accountList}/{expenseList}/{start_date}/{end_date}', ['uses' => 'ExpenseController@spent', 'as' => 'spent']);
|
||||
Route::get('spent-grouped/{accountList}/{expenseList}/{start_date}/{end_date}', ['uses' => 'ExpenseController@spentGrouped', 'as' => 'spent-grouped']);
|
||||
|
||||
// per category && per budget
|
||||
Route::get('category/{accountList}/{expenseList}/{start_date}/{end_date}', ['uses' => 'ExpenseController@category', 'as' => 'category']);
|
||||
|
Loading…
Reference in New Issue
Block a user