mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Clean up code after changing routes.
This commit is contained in:
parent
02257e3887
commit
d8f291be6e
@ -245,7 +245,7 @@ class CategoryController extends Controller
|
|||||||
*
|
*
|
||||||
* @return View
|
* @return View
|
||||||
*/
|
*/
|
||||||
public function showWithDate(Category $category, string $date)
|
public function showByDate(Category $category, string $date)
|
||||||
{
|
{
|
||||||
$carbon = new Carbon($date);
|
$carbon = new Carbon($date);
|
||||||
$range = Preferences::get('viewRange', '1M')->data;
|
$range = Preferences::get('viewRange', '1M')->data;
|
||||||
@ -263,7 +263,7 @@ class CategoryController extends Controller
|
|||||||
$journals->setPath('categories/show/' . $category->id . '/' . $date);
|
$journals->setPath('categories/show/' . $category->id . '/' . $date);
|
||||||
|
|
||||||
|
|
||||||
return view('categories.show_with_date', compact('category', 'journals', 'hideCategory', 'subTitle', 'carbon'));
|
return view('categories.show-by-date', compact('category', 'journals', 'hideCategory', 'subTitle', 'carbon'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -155,11 +155,13 @@ class CategoryController extends Controller
|
|||||||
/**
|
/**
|
||||||
* @param CRI $repository
|
* @param CRI $repository
|
||||||
* @param Category $category
|
* @param Category $category
|
||||||
|
* @param Collection $accounts
|
||||||
* @param Carbon $start
|
* @param Carbon $start
|
||||||
* @param Carbon $end
|
* @param Carbon $end
|
||||||
* @param Collection $accounts
|
*
|
||||||
|
* @return \Illuminate\Http\JsonResponse|mixed
|
||||||
*/
|
*/
|
||||||
public function reportPeriod(CRI $repository, Category $category, Carbon $start, Carbon $end, Collection $accounts)
|
public function reportPeriod(CRI $repository, Category $category, Collection $accounts, Carbon $start, Carbon $end)
|
||||||
{
|
{
|
||||||
$cache = new CacheProperties;
|
$cache = new CacheProperties;
|
||||||
$cache->addProperty($start);
|
$cache->addProperty($start);
|
||||||
@ -171,8 +173,9 @@ class CategoryController extends Controller
|
|||||||
|
|
||||||
return $cache->get();
|
return $cache->get();
|
||||||
}
|
}
|
||||||
$report = $repository->getCategoryPeriodReport(new Collection([$category]), $accounts, $start, $end, true);
|
$expenses = $repository->periodExpenses(new Collection([$category]), $accounts, $start, $end);
|
||||||
$periods = Navigation::listOfPeriods($start, $end);
|
$income = $repository->periodIncome(new Collection([$category]), $accounts, $start, $end);
|
||||||
|
$periods = Navigation::listOfPeriods($start, $end);
|
||||||
|
|
||||||
|
|
||||||
// join them:
|
// join them:
|
||||||
@ -180,8 +183,46 @@ class CategoryController extends Controller
|
|||||||
foreach (array_keys($periods) as $period) {
|
foreach (array_keys($periods) as $period) {
|
||||||
$nice = $periods[$period];
|
$nice = $periods[$period];
|
||||||
$result[$nice] = [
|
$result[$nice] = [
|
||||||
'earned' => $report['income'][$category->id]['entries'][$period] ?? '0',
|
'earned' => $income[$category->id]['entries'][$period] ?? '0',
|
||||||
'spent' => $report['expense'][$category->id]['entries'][$period] ?? '0',
|
'spent' => $expenses[$category->id]['entries'][$period] ?? '0',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
$data = $this->generator->reportPeriod($result);
|
||||||
|
|
||||||
|
return Response::json($data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param CRI $repository
|
||||||
|
* @param Category $category
|
||||||
|
* @param Collection $accounts
|
||||||
|
* @param Carbon $start
|
||||||
|
* @param Carbon $end
|
||||||
|
*
|
||||||
|
* @return \Illuminate\Http\JsonResponse|mixed
|
||||||
|
*/
|
||||||
|
public function reportPeriodNoCategory(CRI $repository, Collection $accounts, Carbon $start, Carbon $end)
|
||||||
|
{
|
||||||
|
$cache = new CacheProperties;
|
||||||
|
$cache->addProperty($start);
|
||||||
|
$cache->addProperty($end);
|
||||||
|
$cache->addProperty('no-category-period-chart');
|
||||||
|
$cache->addProperty($accounts->pluck('id')->toArray());
|
||||||
|
if ($cache->has()) {
|
||||||
|
|
||||||
|
return $cache->get();
|
||||||
|
}
|
||||||
|
$expenses = $repository->periodExpensesNoCategory($accounts, $start, $end);
|
||||||
|
$income = $repository->periodIncomeNoCategory($accounts, $start, $end);
|
||||||
|
$periods = Navigation::listOfPeriods($start, $end);
|
||||||
|
|
||||||
|
// join them:
|
||||||
|
$result = [];
|
||||||
|
foreach (array_keys($periods) as $period) {
|
||||||
|
$nice = $periods[$period];
|
||||||
|
$result[$nice] = [
|
||||||
|
'earned' => $income['entries'][$period] ?? '0',
|
||||||
|
'spent' => $expenses['entries'][$period] ?? '0',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
$data = $this->generator->reportPeriod($result);
|
$data = $this->generator->reportPeriod($result);
|
||||||
|
@ -60,14 +60,13 @@ class CategoryController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* @param Collection $accounts
|
||||||
* @param Carbon $start
|
* @param Carbon $start
|
||||||
* @param Carbon $end
|
* @param Carbon $end
|
||||||
* @param Collection $accounts
|
|
||||||
*
|
*
|
||||||
* @return string
|
* @return mixed|string
|
||||||
*/
|
*/
|
||||||
public function expenseReport(Carbon $start, Carbon $end, Collection $accounts)
|
public function expenses(Collection $accounts, Carbon $start, Carbon $end)
|
||||||
{
|
{
|
||||||
$cache = new CacheProperties;
|
$cache = new CacheProperties;
|
||||||
$cache->addProperty($start);
|
$cache->addProperty($start);
|
||||||
@ -100,7 +99,7 @@ class CategoryController extends Controller
|
|||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function incomeReport(Carbon $start, Carbon $end, Collection $accounts)
|
public function income(Collection $accounts, Carbon $start, Carbon $end)
|
||||||
{
|
{
|
||||||
$cache = new CacheProperties;
|
$cache = new CacheProperties;
|
||||||
$cache->addProperty($start);
|
$cache->addProperty($start);
|
||||||
|
@ -23,6 +23,7 @@ use FireflyIII\Models\TransactionType;
|
|||||||
use FireflyIII\User;
|
use FireflyIII\User;
|
||||||
use Illuminate\Database\Query\JoinClause;
|
use Illuminate\Database\Query\JoinClause;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
|
use Log;
|
||||||
use Navigation;
|
use Navigation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -258,6 +259,10 @@ class CategoryRepository implements CategoryRepositoryInterface
|
|||||||
// loop transactions:
|
// loop transactions:
|
||||||
/** @var Transaction $transaction */
|
/** @var Transaction $transaction */
|
||||||
foreach ($transactions as $transaction) {
|
foreach ($transactions as $transaction) {
|
||||||
|
// if positive, skip:
|
||||||
|
if (bccomp($transaction->transaction_amount, '0') === 1) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$categoryId = max(intval($transaction->transaction_journal_category_id), intval($transaction->transaction_category_id));
|
$categoryId = max(intval($transaction->transaction_journal_category_id), intval($transaction->transaction_category_id));
|
||||||
$date = $transaction->date->format($carbonFormat);
|
$date = $transaction->date->format($carbonFormat);
|
||||||
$data[$categoryId]['entries'][$date] = bcadd($data[$categoryId]['entries'][$date] ?? '0', $transaction->transaction_amount);
|
$data[$categoryId]['entries'][$date] = bcadd($data[$categoryId]['entries'][$date] ?? '0', $transaction->transaction_amount);
|
||||||
@ -278,7 +283,7 @@ class CategoryRepository implements CategoryRepositoryInterface
|
|||||||
$carbonFormat = Navigation::preferredCarbonFormat($start, $end);
|
$carbonFormat = Navigation::preferredCarbonFormat($start, $end);
|
||||||
/** @var JournalCollectorInterface $collector */
|
/** @var JournalCollectorInterface $collector */
|
||||||
$collector = app(JournalCollectorInterface::class);
|
$collector = app(JournalCollectorInterface::class);
|
||||||
$collector->setAccounts($accounts)->setRange($start, $end);
|
$collector->setAccounts($accounts)->setRange($start, $end)->withOpposingAccount();
|
||||||
$collector->setTypes([TransactionType::WITHDRAWAL, TransactionType::TRANSFER])->enableInternalFilter();
|
$collector->setTypes([TransactionType::WITHDRAWAL, TransactionType::TRANSFER])->enableInternalFilter();
|
||||||
$collector->withoutCategory();
|
$collector->withoutCategory();
|
||||||
$transactions = $collector->getJournals();
|
$transactions = $collector->getJournals();
|
||||||
@ -289,6 +294,10 @@ class CategoryRepository implements CategoryRepositoryInterface
|
|||||||
];
|
];
|
||||||
|
|
||||||
foreach ($transactions as $transaction) {
|
foreach ($transactions as $transaction) {
|
||||||
|
// if positive, skip:
|
||||||
|
if (bccomp($transaction->transaction_amount, '0') === 1) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$date = $transaction->date->format($carbonFormat);
|
$date = $transaction->date->format($carbonFormat);
|
||||||
|
|
||||||
if (!isset($result['entries'][$date])) {
|
if (!isset($result['entries'][$date])) {
|
||||||
@ -334,6 +343,10 @@ class CategoryRepository implements CategoryRepositoryInterface
|
|||||||
// loop transactions:
|
// loop transactions:
|
||||||
/** @var Transaction $transaction */
|
/** @var Transaction $transaction */
|
||||||
foreach ($transactions as $transaction) {
|
foreach ($transactions as $transaction) {
|
||||||
|
// if negative, skip:
|
||||||
|
if (bccomp($transaction->transaction_amount, '0') === -1) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$categoryId = max(intval($transaction->transaction_journal_category_id), intval($transaction->transaction_category_id));
|
$categoryId = max(intval($transaction->transaction_journal_category_id), intval($transaction->transaction_category_id));
|
||||||
$date = $transaction->date->format($carbonFormat);
|
$date = $transaction->date->format($carbonFormat);
|
||||||
$data[$categoryId]['entries'][$date] = bcadd($data[$categoryId]['entries'][$date] ?? '0', $transaction->transaction_amount);
|
$data[$categoryId]['entries'][$date] = bcadd($data[$categoryId]['entries'][$date] ?? '0', $transaction->transaction_amount);
|
||||||
@ -351,10 +364,11 @@ class CategoryRepository implements CategoryRepositoryInterface
|
|||||||
*/
|
*/
|
||||||
public function periodIncomeNoCategory(Collection $accounts, Carbon $start, Carbon $end): array
|
public function periodIncomeNoCategory(Collection $accounts, Carbon $start, Carbon $end): array
|
||||||
{
|
{
|
||||||
|
Log::debug('Now in periodIncomeNoCategory()');
|
||||||
$carbonFormat = Navigation::preferredCarbonFormat($start, $end);
|
$carbonFormat = Navigation::preferredCarbonFormat($start, $end);
|
||||||
/** @var JournalCollectorInterface $collector */
|
/** @var JournalCollectorInterface $collector */
|
||||||
$collector = app(JournalCollectorInterface::class);
|
$collector = app(JournalCollectorInterface::class);
|
||||||
$collector->setAccounts($accounts)->setRange($start, $end);
|
$collector->setAccounts($accounts)->setRange($start, $end)->withOpposingAccount();
|
||||||
$collector->setTypes([TransactionType::DEPOSIT, TransactionType::TRANSFER])->enableInternalFilter();
|
$collector->setTypes([TransactionType::DEPOSIT, TransactionType::TRANSFER])->enableInternalFilter();
|
||||||
$collector->withoutCategory();
|
$collector->withoutCategory();
|
||||||
$transactions = $collector->getJournals();
|
$transactions = $collector->getJournals();
|
||||||
@ -363,8 +377,13 @@ class CategoryRepository implements CategoryRepositoryInterface
|
|||||||
'name' => strval(trans('firefly.no_category')),
|
'name' => strval(trans('firefly.no_category')),
|
||||||
'sum' => '0',
|
'sum' => '0',
|
||||||
];
|
];
|
||||||
|
Log::debug('Looping transactions..');
|
||||||
foreach ($transactions as $transaction) {
|
foreach ($transactions as $transaction) {
|
||||||
|
|
||||||
|
// if negative, skip:
|
||||||
|
if (bccomp($transaction->transaction_amount, '0') === -1) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$date = $transaction->date->format($carbonFormat);
|
$date = $transaction->date->format($carbonFormat);
|
||||||
|
|
||||||
if (!isset($result['entries'][$date])) {
|
if (!isset($result['entries'][$date])) {
|
||||||
@ -372,6 +391,8 @@ class CategoryRepository implements CategoryRepositoryInterface
|
|||||||
}
|
}
|
||||||
$result['entries'][$date] = bcadd($result['entries'][$date], $transaction->transaction_amount);
|
$result['entries'][$date] = bcadd($result['entries'][$date], $transaction->transaction_amount);
|
||||||
}
|
}
|
||||||
|
Log::debug('Done looping transactions..');
|
||||||
|
Log::debug('Finished periodIncomeNoCategory()');
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
4
public/js/ff/categories/show-by-date.js
Normal file
4
public/js/ff/categories/show-by-date.js
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
$(function () {
|
||||||
|
"use strict";
|
||||||
|
columnChart(specific, 'period-specific-period');
|
||||||
|
});
|
@ -1,19 +1,5 @@
|
|||||||
/* globals $, categoryID, columnChart, categoryDate */
|
|
||||||
$(function () {
|
$(function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
if (typeof categoryID !== 'undefined') {
|
columnChart(all, 'all');
|
||||||
// more splits:
|
columnChart(current, 'period');
|
||||||
if ($('#all').length > 0) {
|
|
||||||
columnChart('chart/category/' + categoryID + '/all', 'all');
|
|
||||||
}
|
|
||||||
if ($('#period').length > 0) {
|
|
||||||
columnChart('chart/category/' + categoryID + '/period', 'period');
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
if (typeof categoryID !== 'undefined' && typeof categoryDate !== 'undefined') {
|
|
||||||
columnChart('chart/category/' + categoryID + '/period/' + categoryDate, 'period-specific-period');
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
@ -1,19 +0,0 @@
|
|||||||
/* globals $, categoryID, columnChart, categoryDate */
|
|
||||||
$(function () {
|
|
||||||
"use strict";
|
|
||||||
if (typeof categoryID !== 'undefined') {
|
|
||||||
// more splits:
|
|
||||||
if ($('#all').length > 0) {
|
|
||||||
columnChart('chart/category/' + categoryID + '/all', 'all');
|
|
||||||
}
|
|
||||||
if ($('#period').length > 0) {
|
|
||||||
columnChart('chart/category/' + categoryID + '/period', 'period');
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
if (typeof categoryID !== 'undefined' && typeof categoryDate !== undefined) {
|
|
||||||
columnChart('chart/category/' + categoryID + '/period/' + categoryDate, 'period-specific-period');
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
});
|
|
@ -8,31 +8,25 @@
|
|||||||
* See the LICENSE file for details.
|
* See the LICENSE file for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// it's hard coded, but what you're gonna do?
|
|
||||||
var catInUri = 'chart/category/' + accountIds + '/' + categoryIds + '/' + startDate + '/' + endDate + '/OTHERS/income';
|
|
||||||
var catOutUri = 'chart/category/' + accountIds + '/' + categoryIds + '/' + startDate + '/' + endDate + '/OTHERS/expense';
|
|
||||||
var accInUri = 'chart/account/' + accountIds + '/' + categoryIds + '/' + startDate + '/' + endDate + '/OTHERS/income';
|
|
||||||
var accOutUri = 'chart/account/' + accountIds + '/' + categoryIds + '/' + startDate + '/' + endDate + '/OTHERS/expense';
|
|
||||||
|
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
drawChart();
|
drawChart();
|
||||||
|
|
||||||
$('#categories-in-pie-chart-checked').on('change', function () {
|
$('#categories-in-pie-chart-checked').on('change', function () {
|
||||||
redrawPieChart('categories-in-pie-chart', catInUri);
|
redrawPieChart('categories-in-pie-chart', categoryIncomeUri);
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#categories-out-pie-chart-checked').on('change', function () {
|
$('#categories-out-pie-chart-checked').on('change', function () {
|
||||||
redrawPieChart('categories-out-pie-chart', catOutUri);
|
redrawPieChart('categories-out-pie-chart', categoryExpenseUri);
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#accounts-in-pie-chart-checked').on('change', function () {
|
$('#accounts-in-pie-chart-checked').on('change', function () {
|
||||||
redrawPieChart('accounts-in-pie-chart', accInUri);
|
redrawPieChart('accounts-in-pie-chart', accountIncomeUri);
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#accounts-out-pie-chart-checked').on('change', function () {
|
$('#accounts-out-pie-chart-checked').on('change', function () {
|
||||||
redrawPieChart('accounts-out-pie-chart', accOutUri);
|
redrawPieChart('accounts-out-pie-chart', accountExpenseUri);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
@ -42,13 +36,13 @@ function drawChart() {
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
// month view:
|
// month view:
|
||||||
stackedColumnChart('chart/category-report-in-out/' + accountIds + '/' + categoryIds + '/' + startDate + '/' + endDate, 'in-out-chart');
|
stackedColumnChart(mainUri, 'in-out-chart');
|
||||||
|
|
||||||
// draw pie chart of income, depending on "show other transactions too":
|
// draw pie chart of income, depending on "show other transactions too":
|
||||||
redrawPieChart('categories-in-pie-chart', catInUri);
|
redrawPieChart('categories-in-pie-chart', categoryIncomeUri);
|
||||||
redrawPieChart('categories-out-pie-chart', catOutUri);
|
redrawPieChart('categories-out-pie-chart', categoryExpenseUri);
|
||||||
redrawPieChart('accounts-in-pie-chart', accInUri);
|
redrawPieChart('accounts-in-pie-chart', accountIncomeUri);
|
||||||
redrawPieChart('accounts-out-pie-chart', accOutUri);
|
redrawPieChart('accounts-out-pie-chart', accountExpenseUri);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -108,8 +108,7 @@ function clickCategoryChart(e) {
|
|||||||
var link = $(e.target);
|
var link = $(e.target);
|
||||||
var categoryId = link.data('category');
|
var categoryId = link.data('category');
|
||||||
|
|
||||||
// this url is different from the one below. this is something that must be fixed
|
var URL = 'chart/category/report-period/' + categoryId + '/' + accountIds + '/' + startDate + '/' + endDate;
|
||||||
var URL = 'chart/category/' + categoryId + '/report-period/' + startDate + '/' + endDate + '/' + accountIds;
|
|
||||||
var container = 'category_chart';
|
var container = 'category_chart';
|
||||||
columnChart(URL, container);
|
columnChart(URL, container);
|
||||||
return false;
|
return false;
|
||||||
|
@ -5,7 +5,6 @@ $(function () {
|
|||||||
drawChart();
|
drawChart();
|
||||||
|
|
||||||
loadAjaxPartial('budgetPeriodReport', budgetPeriodReportUri);
|
loadAjaxPartial('budgetPeriodReport', budgetPeriodReportUri);
|
||||||
|
|
||||||
loadAjaxPartial('categoryExpense', categoryExpenseUri);
|
loadAjaxPartial('categoryExpense', categoryExpenseUri);
|
||||||
loadAjaxPartial('categoryIncome', categoryIncomeUri);
|
loadAjaxPartial('categoryIncome', categoryIncomeUri);
|
||||||
});
|
});
|
||||||
|
@ -77,7 +77,3 @@
|
|||||||
</div>
|
</div>
|
||||||
{{ Form.close|raw }}
|
{{ Form.close|raw }}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block scripts %}
|
|
||||||
<script type="text/javascript" src="js/ff/accounts/create-edit.js"></script>
|
|
||||||
{% endblock %}
|
|
@ -40,12 +40,11 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block scripts %}
|
{% block scripts %}
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var categoryID = {{ category.id }};
|
var specific = '{{ route('chart.category.specific', [category.id, carbon.format('Ymd')]) }}';
|
||||||
var categoryDate = "{{ carbon.format('Y-m-d') }}";
|
|
||||||
</script>
|
</script>
|
||||||
<script type="text/javascript" src="js/lib/Chart.bundle.min.js"></script>
|
<script type="text/javascript" src="js/lib/Chart.bundle.min.js"></script>
|
||||||
<script type="text/javascript" src="js/ff/charts.defaults.js"></script>
|
<script type="text/javascript" src="js/ff/charts.defaults.js"></script>
|
||||||
<script type="text/javascript" src="js/ff/charts.js"></script>
|
<script type="text/javascript" src="js/ff/charts.js"></script>
|
||||||
<script type="text/javascript" src="js/ff/categories/show_with_date.js"></script>
|
<script type="text/javascript" src="js/ff/categories/show-by-date.js"></script>
|
||||||
<script type="text/javascript" src="js/ff/transactions/list.js"></script>
|
<script type="text/javascript" src="js/ff/transactions/list.js"></script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -73,7 +73,8 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block scripts %}
|
{% block scripts %}
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var categoryID = {{ category.id }};
|
var current = '{{ route('chart.category.current', [category.id]) }}';
|
||||||
|
var all = '{{ route('chart.category.all', [category.id]) }}';
|
||||||
</script>
|
</script>
|
||||||
<script type="text/javascript" src="js/lib/Chart.bundle.min.js"></script>
|
<script type="text/javascript" src="js/lib/Chart.bundle.min.js"></script>
|
||||||
<script type="text/javascript" src="js/ff/charts.defaults.js"></script>
|
<script type="text/javascript" src="js/ff/charts.defaults.js"></script>
|
||||||
|
@ -369,6 +369,13 @@
|
|||||||
var endDate = '{{ end.format('Ymd') }}';
|
var endDate = '{{ end.format('Ymd') }}';
|
||||||
var accountIds = '{{ accountIds }}';
|
var accountIds = '{{ accountIds }}';
|
||||||
var categoryIds = '{{ categoryIds }}';
|
var categoryIds = '{{ categoryIds }}';
|
||||||
|
|
||||||
|
// chart uri's
|
||||||
|
var categoryIncomeUri = '{{ route('chart.category.category-income', [accountIds, categoryIds, start.format('Ymd'), end.format('Ymd'),'OTHERS']) }}';
|
||||||
|
var categoryExpenseUri = '{{ route('chart.category.category-expense', [accountIds, categoryIds, start.format('Ymd'), end.format('Ymd'),'OTHERS']) }}';
|
||||||
|
var accountIncomeUri = '{{ route('chart.category.account-income', [accountIds, categoryIds, start.format('Ymd'), end.format('Ymd'),'OTHERS']) }}';
|
||||||
|
var accountExpenseUri = '{{ route('chart.category.account-expense', [accountIds, categoryIds, start.format('Ymd'), end.format('Ymd'),'OTHERS']) }}';
|
||||||
|
var mainUri = '{{ route('chart.category.main', [accountIds, categoryIds, start.format('Ymd'), end.format('Ymd')]) }}';
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
@ -242,9 +242,9 @@ Route::group(
|
|||||||
* Chart\Bill Controller
|
* Chart\Bill Controller
|
||||||
*/
|
*/
|
||||||
Route::group(
|
Route::group(
|
||||||
['middleware' => 'user-full-auth', 'namespace' => 'Chart', 'prefix' => 'chart/bill','as' => 'chart.bill.'], function () {
|
['middleware' => 'user-full-auth', 'namespace' => 'Chart', 'prefix' => 'chart/bill', 'as' => 'chart.bill.'], function () {
|
||||||
Route::get('frontpage', ['uses' => 'BillController@frontpage' ,'as' => 'frontpage']);
|
Route::get('frontpage', ['uses' => 'BillController@frontpage', 'as' => 'frontpage']);
|
||||||
Route::get('single/{bill}', ['uses' => 'BillController@single','as' => 'single']);
|
Route::get('single/{bill}', ['uses' => 'BillController@single', 'as' => 'single']);
|
||||||
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@ -253,14 +253,14 @@ Route::group(
|
|||||||
* Chart\Budget Controller
|
* Chart\Budget Controller
|
||||||
*/
|
*/
|
||||||
Route::group(
|
Route::group(
|
||||||
['middleware' => 'user-full-auth', 'namespace' => 'Chart', 'prefix' => 'chart/budget','as' => 'chart.budget.'], function () {
|
['middleware' => 'user-full-auth', 'namespace' => 'Chart', 'prefix' => 'chart/budget', 'as' => 'chart.budget.'], function () {
|
||||||
|
|
||||||
Route::get('frontpage', ['uses' => 'BudgetController@frontpage']);
|
Route::get('frontpage', ['uses' => 'BudgetController@frontpage']);
|
||||||
|
|
||||||
Route::get('period/0/{accountList}/{start_date}/{end_date}', ['uses' => 'BudgetController@periodNoBudget']);
|
Route::get('period/0/{accountList}/{start_date}/{end_date}', ['uses' => 'BudgetController@periodNoBudget']);
|
||||||
Route::get('period/{budget}/{accountList}/{start_date}/{end_date}', ['uses' => 'BudgetController@period']);
|
Route::get('period/{budget}/{accountList}/{start_date}/{end_date}', ['uses' => 'BudgetController@period']);
|
||||||
Route::get('budget/{budget}/{limitrepetition}', ['uses' => 'BudgetController@budgetLimit', 'as' => 'budget-limit']);
|
Route::get('budget/{budget}/{limitrepetition}', ['uses' => 'BudgetController@budgetLimit', 'as' => 'budget-limit']);
|
||||||
Route::get('budget/{budget}', ['uses' => 'BudgetController@budget', 'as' => 'budget']);
|
Route::get('budget/{budget}', ['uses' => 'BudgetController@budget', 'as' => 'budget']);
|
||||||
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@ -269,20 +269,36 @@ Route::group(
|
|||||||
* Chart\Category Controller
|
* Chart\Category Controller
|
||||||
*/
|
*/
|
||||||
Route::group(
|
Route::group(
|
||||||
['middleware' => 'user-full-auth', 'namespace' => 'Chart', 'prefix' => 'chart/category'], function () {
|
['middleware' => 'user-full-auth', 'namespace' => 'Chart', 'prefix' => 'chart/category', 'as' => 'chart.category.'], function () {
|
||||||
|
|
||||||
Route::get('frontpage', ['uses' => 'CategoryController@frontpage']);
|
Route::get('frontpage', ['uses' => 'CategoryController@frontpage']);
|
||||||
Route::get('period/{category}', ['uses' => 'CategoryController@currentPeriod']);
|
|
||||||
Route::get('period/{category}/{date}', ['uses' => 'CategoryController@specificPeriod']);
|
Route::get('period/{category}', ['uses' => 'CategoryController@currentPeriod', 'as' => 'current']);
|
||||||
Route::get('all/{category}', ['uses' => 'CategoryController@all']);
|
Route::get('period/{category}/{date}', ['uses' => 'CategoryController@specificPeriod', 'as' => 'specific']);
|
||||||
|
Route::get('all/{category}', ['uses' => 'CategoryController@all', 'as' => 'all']);
|
||||||
|
Route::get('report-period/0/{accountList}/{start_date}/{end_date}', ['uses' => 'CategoryController@reportPeriodNoCategory']);
|
||||||
Route::get('report-period/{category}/{accountList}/{start_date}/{end_date}', ['uses' => 'CategoryController@reportPeriod']);
|
Route::get('report-period/{category}/{accountList}/{start_date}/{end_date}', ['uses' => 'CategoryController@reportPeriod']);
|
||||||
|
|
||||||
// these charts are used in reports (category reports):
|
// these charts are used in reports (category reports):
|
||||||
Route::get('category/income/{accountList}/{categoryList}/{start_date}/{end_date}/{others}', ['uses' => 'CategoryReportController@categoryIncome']);
|
Route::get(
|
||||||
Route::get('category/expense/{accountList}/{categoryList}/{start_date}/{end_date}/{others}', ['uses' => 'CategoryReportController@categoryExpense']);
|
'category/income/{accountList}/{categoryList}/{start_date}/{end_date}/{others}',
|
||||||
Route::get('account/income/{accountList}/{categoryList}/{start_date}/{end_date}/{others}', ['uses' => 'CategoryReportController@accountIncome']);
|
['uses' => 'CategoryReportController@categoryIncome', 'as' => 'category-income']
|
||||||
Route::get('account/income/{accountList}/{categoryList}/{start_date}/{end_date}/{others}', ['uses' => 'CategoryReportController@accountExpense']);
|
);
|
||||||
Route::get('report-in-out/{accountList}/{categoryList}/{start_date}/{end_date}', ['uses' => 'CategoryReportController@mainChart']);
|
Route::get(
|
||||||
|
'category/expense/{accountList}/{categoryList}/{start_date}/{end_date}/{others}',
|
||||||
|
['uses' => 'CategoryReportController@categoryExpense', 'as' => 'category-expense']
|
||||||
|
);
|
||||||
|
Route::get(
|
||||||
|
'account/income/{accountList}/{categoryList}/{start_date}/{end_date}/{others}',
|
||||||
|
['uses' => 'CategoryReportController@accountIncome', 'as' => 'account-income']
|
||||||
|
);
|
||||||
|
Route::get(
|
||||||
|
'account/expense/{accountList}/{categoryList}/{start_date}/{end_date}/{others}',
|
||||||
|
['uses' => 'CategoryReportController@accountExpense', 'as' => 'account-expense']
|
||||||
|
);
|
||||||
|
|
||||||
|
Route::get('report-in-out/{accountList}/{categoryList}/{start_date}/{end_date}',
|
||||||
|
['uses' => 'CategoryReportController@mainChart', 'as' => 'main']);
|
||||||
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@ -292,6 +308,7 @@ Route::group(
|
|||||||
*/
|
*/
|
||||||
Route::group(
|
Route::group(
|
||||||
['middleware' => 'user-full-auth', 'namespace' => 'Chart', 'prefix' => 'chart/piggy-bank'], function () {
|
['middleware' => 'user-full-auth', 'namespace' => 'Chart', 'prefix' => 'chart/piggy-bank'], function () {
|
||||||
|
// continue here.
|
||||||
Route::get('{piggyBank}', ['uses' => 'PiggyBankController@history']);
|
Route::get('{piggyBank}', ['uses' => 'PiggyBankController@history']);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@ -473,6 +490,8 @@ Route::group(
|
|||||||
*/
|
*/
|
||||||
Route::group(
|
Route::group(
|
||||||
['middleware' => 'user-full-auth', 'namespace' => 'Report', 'prefix' => 'report-data/category', 'as' => 'report-data.category.'], function () {
|
['middleware' => 'user-full-auth', 'namespace' => 'Report', 'prefix' => 'report-data/category', 'as' => 'report-data.category.'], function () {
|
||||||
|
|
||||||
|
|
||||||
Route::get('operations/{accountList}/{start_date}/{end_date}', ['uses' => 'CategoryController@operations', 'as' => 'operations']);
|
Route::get('operations/{accountList}/{start_date}/{end_date}', ['uses' => 'CategoryController@operations', 'as' => 'operations']);
|
||||||
Route::get('income/{accountList}/{start_date}/{end_date}', ['uses' => 'CategoryController@income', 'as' => 'income']);
|
Route::get('income/{accountList}/{start_date}/{end_date}', ['uses' => 'CategoryController@income', 'as' => 'income']);
|
||||||
Route::get('expenses/{accountList}/{start_date}/{end_date}', ['uses' => 'CategoryController@expenses', 'as' => 'expenses']);
|
Route::get('expenses/{accountList}/{start_date}/{end_date}', ['uses' => 'CategoryController@expenses', 'as' => 'expenses']);
|
||||||
|
Loading…
Reference in New Issue
Block a user