mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-25 23:06:14 +00:00
Code cleanup.
This commit is contained in:
@@ -25,13 +25,13 @@ class ChartJsBillChartGenerator implements BillChartGenerator
|
|||||||
bcscale(2);
|
bcscale(2);
|
||||||
$data = [
|
$data = [
|
||||||
[
|
[
|
||||||
'value' => round($unpaid,2),
|
'value' => round($unpaid, 2),
|
||||||
'color' => 'rgba(53, 124, 165,0.7)',
|
'color' => 'rgba(53, 124, 165,0.7)',
|
||||||
'highlight' => 'rgba(53, 124, 165,0.9)',
|
'highlight' => 'rgba(53, 124, 165,0.9)',
|
||||||
'label' => trans('firefly.unpaid'),
|
'label' => trans('firefly.unpaid'),
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'value' => round($paid * -1,2), // paid is negative, must be positive.
|
'value' => round($paid * -1, 2), // paid is negative, must be positive.
|
||||||
'color' => 'rgba(0, 141, 76, 0.7)',
|
'color' => 'rgba(0, 141, 76, 0.7)',
|
||||||
'highlight' => 'rgba(0, 141, 76, 0.9)',
|
'highlight' => 'rgba(0, 141, 76, 0.9)',
|
||||||
'label' => trans('firefly.paid'),
|
'label' => trans('firefly.paid'),
|
||||||
@@ -73,7 +73,7 @@ class ChartJsBillChartGenerator implements BillChartGenerator
|
|||||||
/*
|
/*
|
||||||
* journalAmount has been collected in BillRepository::getJournals
|
* journalAmount has been collected in BillRepository::getJournals
|
||||||
*/
|
*/
|
||||||
$actualAmount[] = round(($entry->journalAmount * -1), 2);
|
$actualAmount[] = round(($entry->journalAmount * -1), 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
$data['datasets'][] = [
|
$data['datasets'][] = [
|
||||||
|
@@ -49,53 +49,13 @@ class ChartJsCategoryChartGenerator implements CategoryChartGenerator
|
|||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param Collection $entries
|
|
||||||
*
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function frontpage(Collection $entries)
|
|
||||||
{
|
|
||||||
$data = [
|
|
||||||
'count' => 1,
|
|
||||||
'labels' => [],
|
|
||||||
'datasets' => [
|
|
||||||
[
|
|
||||||
'label' => trans('firefly.spent'),
|
|
||||||
'data' => []
|
|
||||||
]
|
|
||||||
],
|
|
||||||
];
|
|
||||||
foreach ($entries as $entry) {
|
|
||||||
if ($entry['sum'] != 0) {
|
|
||||||
$data['labels'][] = $entry['name'];
|
|
||||||
$data['datasets'][0]['data'][] = round(($entry['sum'] * -1), 2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $data;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @codeCoverageIgnore
|
|
||||||
*
|
|
||||||
* @param Collection $entries
|
|
||||||
*
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function period(Collection $entries)
|
|
||||||
{
|
|
||||||
return $this->all($entries);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Collection $categories
|
* @param Collection $categories
|
||||||
* @param Collection $entries
|
* @param Collection $entries
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function spentInYear(Collection $categories, Collection $entries)
|
public function earnedInPeriod(Collection $categories, Collection $entries)
|
||||||
{
|
{
|
||||||
|
|
||||||
// language:
|
// language:
|
||||||
@@ -122,13 +82,90 @@ class ChartJsCategoryChartGenerator implements CategoryChartGenerator
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param Collection $entries
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function frontpage(Collection $entries)
|
||||||
|
{
|
||||||
|
$data = [
|
||||||
|
'count' => 1,
|
||||||
|
'labels' => [],
|
||||||
|
'datasets' => [
|
||||||
|
[
|
||||||
|
'label' => trans('firefly.spent'),
|
||||||
|
'data' => []
|
||||||
|
]
|
||||||
|
],
|
||||||
|
];
|
||||||
|
foreach ($entries as $entry) {
|
||||||
|
if ($entry['sum'] != 0) {
|
||||||
|
$data['labels'][] = $entry['name'];
|
||||||
|
$data['datasets'][0]['data'][] = round(($entry['sum'] * -1), 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param Collection $entries
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function multiYear(Collection $entries)
|
||||||
|
{
|
||||||
|
// dataset:
|
||||||
|
$data = [
|
||||||
|
'count' => 0,
|
||||||
|
'labels' => [],
|
||||||
|
'datasets' => [],
|
||||||
|
];
|
||||||
|
// get labels from one of the categories (assuming there's at least one):
|
||||||
|
$first = $entries->first();
|
||||||
|
foreach ($first['spent'] as $year => $noInterest) {
|
||||||
|
$data['labels'][] = strval($year);
|
||||||
|
}
|
||||||
|
|
||||||
|
// then, loop all entries and create datasets:
|
||||||
|
foreach ($entries as $entry) {
|
||||||
|
$name = $entry['name'];
|
||||||
|
$spent = $entry['spent'];
|
||||||
|
$earned = $entry['earned'];
|
||||||
|
if (array_sum(array_values($spent)) != 0) {
|
||||||
|
$data['datasets'][] = ['label' => 'Spent in category ' . $name, 'data' => array_values($spent)];
|
||||||
|
}
|
||||||
|
if (array_sum(array_values($earned)) != 0) {
|
||||||
|
$data['datasets'][] = ['label' => 'Earned in category ' . $name, 'data' => array_values($earned)];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$data['count'] = count($data['datasets']);
|
||||||
|
|
||||||
|
return $data;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
|
*
|
||||||
|
* @param Collection $entries
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function period(Collection $entries)
|
||||||
|
{
|
||||||
|
return $this->all($entries);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Collection $categories
|
* @param Collection $categories
|
||||||
* @param Collection $entries
|
* @param Collection $entries
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function earnedInPeriod(Collection $categories, Collection $entries)
|
public function spentInYear(Collection $categories, Collection $entries)
|
||||||
{
|
{
|
||||||
|
|
||||||
// language:
|
// language:
|
||||||
@@ -187,41 +224,4 @@ class ChartJsCategoryChartGenerator implements CategoryChartGenerator
|
|||||||
return $data;
|
return $data;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param Collection $entries
|
|
||||||
*
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function multiYear(Collection $entries)
|
|
||||||
{
|
|
||||||
// dataset:
|
|
||||||
$data = [
|
|
||||||
'count' => 0,
|
|
||||||
'labels' => [],
|
|
||||||
'datasets' => [],
|
|
||||||
];
|
|
||||||
// get labels from one of the categories (assuming there's at least one):
|
|
||||||
$first = $entries->first();
|
|
||||||
foreach ($first['spent'] as $year => $noInterest) {
|
|
||||||
$data['labels'][] = strval($year);
|
|
||||||
}
|
|
||||||
|
|
||||||
// then, loop all entries and create datasets:
|
|
||||||
foreach ($entries as $entry) {
|
|
||||||
$name = $entry['name'];
|
|
||||||
$spent = $entry['spent'];
|
|
||||||
$earned = $entry['earned'];
|
|
||||||
if (array_sum(array_values($spent)) != 0) {
|
|
||||||
$data['datasets'][] = ['label' => 'Spent in category ' . $name, 'data' => array_values($spent)];
|
|
||||||
}
|
|
||||||
if (array_sum(array_values($earned)) != 0) {
|
|
||||||
$data['datasets'][] = ['label' => 'Earned in category ' . $name, 'data' => array_values($earned)];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$data['count'] = count($data['datasets']);
|
|
||||||
|
|
||||||
return $data;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -3,9 +3,7 @@
|
|||||||
namespace FireflyIII\Generator\Chart\PiggyBank;
|
namespace FireflyIII\Generator\Chart\PiggyBank;
|
||||||
|
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use Config;
|
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
use Preferences;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -25,7 +23,7 @@ class ChartJsPiggyBankChartGenerator implements PiggyBankChartGenerator
|
|||||||
{
|
{
|
||||||
|
|
||||||
// language:
|
// language:
|
||||||
$format = trans('config.month_and_day');
|
$format = trans('config.month_and_day');
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'count' => 1,
|
'count' => 1,
|
||||||
|
@@ -2,9 +2,7 @@
|
|||||||
|
|
||||||
namespace FireflyIII\Generator\Chart\Report;
|
namespace FireflyIII\Generator\Chart\Report;
|
||||||
|
|
||||||
use Config;
|
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
use Preferences;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class ChartJsReportChartGenerator
|
* Class ChartJsReportChartGenerator
|
||||||
@@ -14,40 +12,6 @@ use Preferences;
|
|||||||
class ChartJsReportChartGenerator implements ReportChartGenerator
|
class ChartJsReportChartGenerator implements ReportChartGenerator
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
|
||||||
* @param Collection $entries
|
|
||||||
*
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function yearInOut(Collection $entries)
|
|
||||||
{
|
|
||||||
// language:
|
|
||||||
$format = trans('config.month');
|
|
||||||
|
|
||||||
$data = [
|
|
||||||
'count' => 2,
|
|
||||||
'labels' => [],
|
|
||||||
'datasets' => [
|
|
||||||
[
|
|
||||||
'label' => trans('firefly.income'),
|
|
||||||
'data' => []
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'label' => trans('firefly.expenses'),
|
|
||||||
'data' => []
|
|
||||||
]
|
|
||||||
],
|
|
||||||
];
|
|
||||||
|
|
||||||
foreach ($entries as $entry) {
|
|
||||||
$data['labels'][] = $entry[0]->formatLocalized($format);
|
|
||||||
$data['datasets'][0]['data'][] = round($entry[1], 2);
|
|
||||||
$data['datasets'][1]['data'][] = round($entry[2], 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $data;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Same as above but other translations.
|
* Same as above but other translations.
|
||||||
*
|
*
|
||||||
@@ -81,6 +45,71 @@ class ChartJsReportChartGenerator implements ReportChartGenerator
|
|||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $income
|
||||||
|
* @param string $expense
|
||||||
|
* @param int $count
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function multiYearInOutSummarized($income, $expense, $count)
|
||||||
|
{
|
||||||
|
$data = [
|
||||||
|
'count' => 2,
|
||||||
|
'labels' => [trans('firefly.sum_of_years'), trans('firefly.average_of_years')],
|
||||||
|
'datasets' => [
|
||||||
|
[
|
||||||
|
'label' => trans('firefly.income'),
|
||||||
|
'data' => []
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'label' => trans('firefly.expenses'),
|
||||||
|
'data' => []
|
||||||
|
]
|
||||||
|
],
|
||||||
|
];
|
||||||
|
$data['datasets'][0]['data'][] = round($income, 2);
|
||||||
|
$data['datasets'][1]['data'][] = round($expense, 2);
|
||||||
|
$data['datasets'][0]['data'][] = round(($income / $count), 2);
|
||||||
|
$data['datasets'][1]['data'][] = round(($expense / $count), 2);
|
||||||
|
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param Collection $entries
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function yearInOut(Collection $entries)
|
||||||
|
{
|
||||||
|
// language:
|
||||||
|
$format = trans('config.month');
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'count' => 2,
|
||||||
|
'labels' => [],
|
||||||
|
'datasets' => [
|
||||||
|
[
|
||||||
|
'label' => trans('firefly.income'),
|
||||||
|
'data' => []
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'label' => trans('firefly.expenses'),
|
||||||
|
'data' => []
|
||||||
|
]
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
foreach ($entries as $entry) {
|
||||||
|
$data['labels'][] = $entry[0]->formatLocalized($format);
|
||||||
|
$data['datasets'][0]['data'][] = round($entry[1], 2);
|
||||||
|
$data['datasets'][1]['data'][] = round($entry[2], 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $income
|
* @param string $income
|
||||||
* @param string $expense
|
* @param string $expense
|
||||||
@@ -112,35 +141,4 @@ class ChartJsReportChartGenerator implements ReportChartGenerator
|
|||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string $income
|
|
||||||
* @param string $expense
|
|
||||||
* @param int $count
|
|
||||||
*
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function multiYearInOutSummarized($income, $expense, $count)
|
|
||||||
{
|
|
||||||
$data = [
|
|
||||||
'count' => 2,
|
|
||||||
'labels' => [trans('firefly.sum_of_years'), trans('firefly.average_of_years')],
|
|
||||||
'datasets' => [
|
|
||||||
[
|
|
||||||
'label' => trans('firefly.income'),
|
|
||||||
'data' => []
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'label' => trans('firefly.expenses'),
|
|
||||||
'data' => []
|
|
||||||
]
|
|
||||||
],
|
|
||||||
];
|
|
||||||
$data['datasets'][0]['data'][] = round($income, 2);
|
|
||||||
$data['datasets'][1]['data'][] = round($expense, 2);
|
|
||||||
$data['datasets'][0]['data'][] = round(($income / $count), 2);
|
|
||||||
$data['datasets'][1]['data'][] = round(($expense / $count), 2);
|
|
||||||
|
|
||||||
return $data;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -161,15 +161,15 @@ class ReportQuery implements ReportQueryInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
// $data = $data->filter(
|
// $data = $data->filter(
|
||||||
// function (TransactionJournal $journal) {
|
// function (TransactionJournal $journal) {
|
||||||
// if ($journal->amount != 0) {
|
// if ($journal->amount != 0) {
|
||||||
// return $journal;
|
// return $journal;
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// return null;
|
// return null;
|
||||||
// }
|
// }
|
||||||
// );
|
// );
|
||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
@@ -236,7 +236,7 @@ class BudgetController extends Controller
|
|||||||
// we already have amount, startdate and enddate.
|
// we already have amount, startdate and enddate.
|
||||||
// if this "is" a limit repetition (as opposed to a budget without one entirely)
|
// if this "is" a limit repetition (as opposed to a budget without one entirely)
|
||||||
// depends on whether startdate and enddate are null.
|
// depends on whether startdate and enddate are null.
|
||||||
$name = $budget->name;
|
$name = $budget->name;
|
||||||
if (is_null($budget->startdate) && is_null($budget->enddate)) {
|
if (is_null($budget->startdate) && is_null($budget->enddate)) {
|
||||||
$currentStart = clone $start;
|
$currentStart = clone $start;
|
||||||
$currentEnd = clone $end;
|
$currentEnd = clone $end;
|
||||||
@@ -252,7 +252,7 @@ class BudgetController extends Controller
|
|||||||
$amount = $budget->amount;
|
$amount = $budget->amount;
|
||||||
// smaller than 1 means spent MORE than budget allows.
|
// smaller than 1 means spent MORE than budget allows.
|
||||||
$left = bccomp(bcadd($budget->amount, $expenses), '0') < 1 ? 0 : bcadd($budget->amount, $expenses);
|
$left = bccomp(bcadd($budget->amount, $expenses), '0') < 1 ? 0 : bcadd($budget->amount, $expenses);
|
||||||
$spent = bccomp(bcadd($budget->amount, $expenses), '0') < 1 ? ($amount*-1) : $expenses;
|
$spent = bccomp(bcadd($budget->amount, $expenses), '0') < 1 ? ($amount * -1) : $expenses;
|
||||||
$overspent = bccomp(bcadd($budget->amount, $expenses), '0') < 1 ? bcadd($budget->amount, $expenses) : 0;
|
$overspent = bccomp(bcadd($budget->amount, $expenses), '0') < 1 ? bcadd($budget->amount, $expenses) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
<?php namespace FireflyIII\Http\Controllers;
|
<?php namespace FireflyIII\Http\Controllers;
|
||||||
|
|
||||||
use Auth;
|
use Auth;
|
||||||
use Config;
|
|
||||||
use Illuminate\Foundation\Bus\DispatchesJobs;
|
use Illuminate\Foundation\Bus\DispatchesJobs;
|
||||||
use Illuminate\Foundation\Validation\ValidatesRequests;
|
use Illuminate\Foundation\Validation\ValidatesRequests;
|
||||||
use Illuminate\Routing\Controller as BaseController;
|
use Illuminate\Routing\Controller as BaseController;
|
||||||
|
@@ -1,15 +1,12 @@
|
|||||||
<?php namespace FireflyIII\Http\Controllers;
|
<?php namespace FireflyIII\Http\Controllers;
|
||||||
|
|
||||||
use Artisan;
|
use Artisan;
|
||||||
use Auth;
|
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use Config;
|
use Config;
|
||||||
use FireflyIII\Models\Tag;
|
use FireflyIII\Models\Tag;
|
||||||
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
||||||
use Input;
|
use Input;
|
||||||
use Log;
|
|
||||||
use Preferences;
|
use Preferences;
|
||||||
use Route;
|
|
||||||
use Session;
|
use Session;
|
||||||
use Steam;
|
use Steam;
|
||||||
|
|
||||||
|
@@ -64,9 +64,12 @@ class ReportController extends Controller
|
|||||||
$accountList = join(',', $accountIds);
|
$accountList = join(',', $accountIds);
|
||||||
|
|
||||||
|
|
||||||
return view('reports.index', compact('months', 'accounts', 'start', 'accountList',
|
return view(
|
||||||
'startOfMonth', 'endOfMonth', 'startOfYear', 'endOfYear'
|
'reports.index', compact(
|
||||||
));
|
'months', 'accounts', 'start', 'accountList',
|
||||||
|
'startOfMonth', 'endOfMonth', 'startOfYear', 'endOfYear'
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -4,7 +4,6 @@ use App;
|
|||||||
use Auth;
|
use Auth;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use Closure;
|
use Closure;
|
||||||
use Config;
|
|
||||||
use Illuminate\Contracts\Auth\Guard;
|
use Illuminate\Contracts\Auth\Guard;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Preferences;
|
use Preferences;
|
||||||
@@ -61,9 +60,9 @@ class Authenticate
|
|||||||
}
|
}
|
||||||
|
|
||||||
// if logged in, set user language:
|
// if logged in, set user language:
|
||||||
$pref = Preferences::get('language', env('DEFAULT_LANGUAGE','en_US'));
|
$pref = Preferences::get('language', env('DEFAULT_LANGUAGE', 'en_US'));
|
||||||
App::setLocale($pref->data);
|
App::setLocale($pref->data);
|
||||||
Carbon::setLocale(substr($pref->data,0,2));
|
Carbon::setLocale(substr($pref->data, 0, 2));
|
||||||
$locale = explode(',', trans('config.locale'));
|
$locale = explode(',', trans('config.locale'));
|
||||||
$locale = array_map('trim', $locale);
|
$locale = array_map('trim', $locale);
|
||||||
|
|
||||||
|
@@ -78,7 +78,7 @@ class Budget extends Model
|
|||||||
*/
|
*/
|
||||||
public function getDates()
|
public function getDates()
|
||||||
{
|
{
|
||||||
return ['created_at', 'updated_at', 'deleted_at','startdate','enddate'];
|
return ['created_at', 'updated_at', 'deleted_at', 'startdate', 'enddate'];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -115,16 +115,16 @@ class BillRepository implements BillRepositoryInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
$set = $bill->transactionjournals()
|
$set = $bill->transactionjournals()
|
||||||
->leftJoin(
|
->leftJoin(
|
||||||
'transactions', function (JoinClause $join) {
|
'transactions', function (JoinClause $join) {
|
||||||
$join->on('transactions.transaction_journal_id', '=', 'transaction_journals.id')
|
$join->on('transactions.transaction_journal_id', '=', 'transaction_journals.id')
|
||||||
->where('amount', '<', 0);
|
->where('amount', '<', 0);
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
->orderBy('transaction_journals.date', 'DESC')
|
->orderBy('transaction_journals.date', 'DESC')
|
||||||
->orderBy('transaction_journals.order', 'ASC')
|
->orderBy('transaction_journals.order', 'ASC')
|
||||||
->orderBy('transaction_journals.id', 'DESC')
|
->orderBy('transaction_journals.id', 'DESC')
|
||||||
->get(['transaction_journals.*', 'transactions.amount as journalAmount']);
|
->get(['transaction_journals.*', 'transactions.amount as journalAmount']);
|
||||||
$cache->store($set);
|
$cache->store($set);
|
||||||
|
|
||||||
return $set;
|
return $set;
|
||||||
|
@@ -108,6 +108,7 @@ interface BudgetRepositoryInterface
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated
|
* @deprecated
|
||||||
|
*
|
||||||
* @param Budget $budget
|
* @param Budget $budget
|
||||||
*
|
*
|
||||||
* @return Carbon
|
* @return Carbon
|
||||||
@@ -116,6 +117,7 @@ interface BudgetRepositoryInterface
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated
|
* @deprecated
|
||||||
|
*
|
||||||
* @param Budget $budget
|
* @param Budget $budget
|
||||||
* @param Carbon $date
|
* @param Carbon $date
|
||||||
*
|
*
|
||||||
|
@@ -53,7 +53,7 @@ class CategoryRepository extends ComponentRepository implements CategoryReposito
|
|||||||
$cache = new CacheProperties;
|
$cache = new CacheProperties;
|
||||||
$cache->addProperty('category-list');
|
$cache->addProperty('category-list');
|
||||||
|
|
||||||
if($cache->has()) {
|
if ($cache->has()) {
|
||||||
return $cache->get();
|
return $cache->get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -46,7 +46,6 @@ class ComponentRepository
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$entry = $object->transactionjournals()
|
$entry = $object->transactionjournals()
|
||||||
->transactionTypes([TransactionType::WITHDRAWAL, TransactionType::DEPOSIT, TransactionType::OPENING_BALANCE])
|
->transactionTypes([TransactionType::WITHDRAWAL, TransactionType::DEPOSIT, TransactionType::OPENING_BALANCE])
|
||||||
->before($end)
|
->before($end)
|
||||||
|
@@ -328,7 +328,7 @@ return [
|
|||||||
'Default account' => 'Asset account',
|
'Default account' => 'Asset account',
|
||||||
'Expense account' => 'Expense account',
|
'Expense account' => 'Expense account',
|
||||||
'Revenue account' => 'Revenue account',
|
'Revenue account' => 'Revenue account',
|
||||||
'Initial balance account' => 'Initial balance account',
|
'Initial balance account' => 'Initial balance account',
|
||||||
'budgets' => 'Budgets',
|
'budgets' => 'Budgets',
|
||||||
'tags' => 'Tags',
|
'tags' => 'Tags',
|
||||||
'reports' => 'Reports',
|
'reports' => 'Reports',
|
||||||
@@ -364,13 +364,13 @@ return [
|
|||||||
'profile' => 'Profile',
|
'profile' => 'Profile',
|
||||||
|
|
||||||
// reports
|
// reports
|
||||||
'report_default' => 'Default financial report for :start until :end',
|
'report_default' => 'Default financial report for :start until :end',
|
||||||
'quick_link_reports' => 'Quick links',
|
'quick_link_reports' => 'Quick links',
|
||||||
'quick_link_default_report' => 'Default financial report',
|
'quick_link_default_report' => 'Default financial report',
|
||||||
'report_this_month_quick' => 'Current month, all accounts',
|
'report_this_month_quick' => 'Current month, all accounts',
|
||||||
'report_this_year_quick' => 'Current year, all accounts',
|
'report_this_year_quick' => 'Current year, all accounts',
|
||||||
'report_all_time_quick' => 'All-time, all accounts',
|
'report_all_time_quick' => 'All-time, all accounts',
|
||||||
'reports_can_bookmark' => 'Remember that reports can be bookmarked.',
|
'reports_can_bookmark' => 'Remember that reports can be bookmarked.',
|
||||||
'incomeVsExpenses' => 'Income vs. expenses',
|
'incomeVsExpenses' => 'Income vs. expenses',
|
||||||
'accountBalances' => 'Account balances',
|
'accountBalances' => 'Account balances',
|
||||||
'balanceStartOfYear' => 'Balance at start of year',
|
'balanceStartOfYear' => 'Balance at start of year',
|
||||||
@@ -389,7 +389,7 @@ return [
|
|||||||
'outsideOfBudgets' => 'Outside of budgets',
|
'outsideOfBudgets' => 'Outside of budgets',
|
||||||
'leftInBudget' => 'Left in budget',
|
'leftInBudget' => 'Left in budget',
|
||||||
'sumOfSums' => 'Sum of sums',
|
'sumOfSums' => 'Sum of sums',
|
||||||
'noCategory' => '(no category)',
|
'noCategory' => '(no category)',
|
||||||
'notCharged' => 'Not charged (yet)',
|
'notCharged' => 'Not charged (yet)',
|
||||||
'inactive' => 'Inactive',
|
'inactive' => 'Inactive',
|
||||||
'difference' => 'Difference',
|
'difference' => 'Difference',
|
||||||
@@ -399,18 +399,18 @@ return [
|
|||||||
'showTheRest' => 'Show everything',
|
'showTheRest' => 'Show everything',
|
||||||
'hideTheRest' => 'Show only the top :number',
|
'hideTheRest' => 'Show only the top :number',
|
||||||
'sum_of_year' => 'Sum of year',
|
'sum_of_year' => 'Sum of year',
|
||||||
'sum_of_years' => 'Sum of years',
|
'sum_of_years' => 'Sum of years',
|
||||||
'average_of_year' => 'Average of year',
|
'average_of_year' => 'Average of year',
|
||||||
'average_of_years' => 'Average of years',
|
'average_of_years' => 'Average of years',
|
||||||
'categories_earned_in_year' => 'Categories (by earnings)',
|
'categories_earned_in_year' => 'Categories (by earnings)',
|
||||||
'categories_spent_in_year' => 'Categories (by spendings)',
|
'categories_spent_in_year' => 'Categories (by spendings)',
|
||||||
'report_type' => 'Report type',
|
'report_type' => 'Report type',
|
||||||
'report_type_default' => 'Default financial report',
|
'report_type_default' => 'Default financial report',
|
||||||
'report_included_accounts' => 'Included accounts',
|
'report_included_accounts' => 'Included accounts',
|
||||||
'report_date_range' => 'Date range',
|
'report_date_range' => 'Date range',
|
||||||
'report_include_help' => 'In all cases, transfers to shared accounts count as expenses, and transfers from shared accounts count as income.',
|
'report_include_help' => 'In all cases, transfers to shared accounts count as expenses, and transfers from shared accounts count as income.',
|
||||||
'report_preset_ranges' => 'Pre-set ranges',
|
'report_preset_ranges' => 'Pre-set ranges',
|
||||||
'shared' => 'Shared',
|
'shared' => 'Shared',
|
||||||
|
|
||||||
// charts
|
// charts
|
||||||
'dayOfMonth' => 'Day of the month',
|
'dayOfMonth' => 'Day of the month',
|
||||||
|
@@ -35,7 +35,7 @@ return [
|
|||||||
"in" => ":attribute is ongeldig.",
|
"in" => ":attribute is ongeldig.",
|
||||||
"integer" => ":attribute moet een getal zijn.",
|
"integer" => ":attribute moet een getal zijn.",
|
||||||
"ip" => ":attribute moet een geldig IP-adres zijn.",
|
"ip" => ":attribute moet een geldig IP-adres zijn.",
|
||||||
'json' => 'De :attribute moet een JSON tekst zijn.',
|
'json' => 'De :attribute moet een JSON tekst zijn.',
|
||||||
"max.numeric" => ":attribute mag niet hoger dan :max zijn.",
|
"max.numeric" => ":attribute mag niet hoger dan :max zijn.",
|
||||||
"max.file" => ":attribute mag niet meer dan :max kilobytes zijn.",
|
"max.file" => ":attribute mag niet meer dan :max kilobytes zijn.",
|
||||||
"max.string" => ":attribute mag niet uit meer dan :max karakters bestaan.",
|
"max.string" => ":attribute mag niet uit meer dan :max karakters bestaan.",
|
||||||
@@ -50,7 +50,7 @@ return [
|
|||||||
"regex" => ":attribute formaat is ongeldig.",
|
"regex" => ":attribute formaat is ongeldig.",
|
||||||
"required" => ":attribute is verplicht.",
|
"required" => ":attribute is verplicht.",
|
||||||
"required_if" => ":attribute is verplicht indien :other gelijk is aan :value.",
|
"required_if" => ":attribute is verplicht indien :other gelijk is aan :value.",
|
||||||
'required_unless' => ':attribute is verplicht tenzij :other gelijk is aan :values.',
|
'required_unless' => ':attribute is verplicht tenzij :other gelijk is aan :values.',
|
||||||
"required_with" => ":attribute is verplicht i.c.m. :values",
|
"required_with" => ":attribute is verplicht i.c.m. :values",
|
||||||
"required_with_all" => ":attribute is verplicht i.c.m. :values",
|
"required_with_all" => ":attribute is verplicht i.c.m. :values",
|
||||||
"required_without" => ":attribute is verplicht als :values niet ingevuld is.",
|
"required_without" => ":attribute is verplicht als :values niet ingevuld is.",
|
||||||
|
@@ -35,7 +35,7 @@ return [
|
|||||||
"in" => "O campo :attribute não contém um valor válido.",
|
"in" => "O campo :attribute não contém um valor válido.",
|
||||||
"integer" => "O campo :attribute deverá conter um número inteiro.",
|
"integer" => "O campo :attribute deverá conter um número inteiro.",
|
||||||
"ip" => "O campo :attribute deverá conter um IP válido.",
|
"ip" => "O campo :attribute deverá conter um IP válido.",
|
||||||
'json' => 'O campo :attribute deverá conter uma string JSON válida.',
|
'json' => 'O campo :attribute deverá conter uma string JSON válida.',
|
||||||
"max.numeric" => "O campo :attribute não deverá conter um valor superior a :max.",
|
"max.numeric" => "O campo :attribute não deverá conter um valor superior a :max.",
|
||||||
"max.file" => "O campo :attribute não deverá ter um tamanho superior a :max kilobytes.",
|
"max.file" => "O campo :attribute não deverá ter um tamanho superior a :max kilobytes.",
|
||||||
"max.string" => "O campo :attribute não deverá conter mais de :max caracteres.",
|
"max.string" => "O campo :attribute não deverá conter mais de :max caracteres.",
|
||||||
@@ -50,7 +50,7 @@ return [
|
|||||||
"regex" => "O formato do valor para o campo :attribute é inválido.",
|
"regex" => "O formato do valor para o campo :attribute é inválido.",
|
||||||
"required" => "O campo :attribute é obrigatório.",
|
"required" => "O campo :attribute é obrigatório.",
|
||||||
"required_if" => "O campo :attribute é obrigatório quando o valor do campo :other é igual a :value.",
|
"required_if" => "O campo :attribute é obrigatório quando o valor do campo :other é igual a :value.",
|
||||||
'required_unless' => 'O campo :attribute é obrigatório a menos que :other esteja presente em :values.',
|
'required_unless' => 'O campo :attribute é obrigatório a menos que :other esteja presente em :values.',
|
||||||
"required_with" => "O campo :attribute é obrigatório quando :values está presente.",
|
"required_with" => "O campo :attribute é obrigatório quando :values está presente.",
|
||||||
"required_with_all" => "O campo :attribute é obrigatório quando um dos :values está presente.",
|
"required_with_all" => "O campo :attribute é obrigatório quando um dos :values está presente.",
|
||||||
"required_without" => "O campo :attribute é obrigatório quanto :values não está presente.",
|
"required_without" => "O campo :attribute é obrigatório quanto :values não está presente.",
|
||||||
|
@@ -60,6 +60,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
@@ -5,7 +5,8 @@
|
|||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<div class="input-group-btn">
|
<div class="input-group-btn">
|
||||||
<button type="button"
|
<button type="button"
|
||||||
class="btn btn-default dropdown-toggle currency-dropdown" id="currency_dropdown_{{ name }}" data-toggle="dropdown" aria-expanded="false">
|
class="btn btn-default dropdown-toggle currency-dropdown" id="currency_dropdown_{{ name }}" data-toggle="dropdown"
|
||||||
|
aria-expanded="false">
|
||||||
<span id="currency_select_symbol_{{ name }}">{{ defaultCurrency.symbol|raw }}</span> <span class="caret"></span>
|
<span id="currency_select_symbol_{{ name }}">{{ defaultCurrency.symbol|raw }}</span> <span class="caret"></span>
|
||||||
</button>
|
</button>
|
||||||
<ul class="dropdown-menu currency-dropdown-menu" role="menu">
|
<ul class="dropdown-menu currency-dropdown-menu" role="menu">
|
||||||
|
@@ -5,7 +5,8 @@
|
|||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<div class="input-group-btn">
|
<div class="input-group-btn">
|
||||||
<button type="button"
|
<button type="button"
|
||||||
class="btn btn-default dropdown-toggle currency-dropdown" id="currency_dropdown_{{ name }}" data-toggle="dropdown" aria-expanded="false">
|
class="btn btn-default dropdown-toggle currency-dropdown" id="currency_dropdown_{{ name }}" data-toggle="dropdown"
|
||||||
|
aria-expanded="false">
|
||||||
<span id="currency_select_symbol_{{ name }}">{{ defaultCurrency.symbol|raw }}</span> <span class="caret"></span>
|
<span id="currency_select_symbol_{{ name }}">{{ defaultCurrency.symbol|raw }}</span> <span class="caret"></span>
|
||||||
</button>
|
</button>
|
||||||
<ul class="dropdown-menu currency-dropdown-menu" role="menu">
|
<ul class="dropdown-menu currency-dropdown-menu" role="menu">
|
||||||
|
@@ -184,7 +184,7 @@
|
|||||||
var language = "{{ language }}";
|
var language = "{{ language }}";
|
||||||
var currencyCode = '{{ getCurrencyCode() }}';
|
var currencyCode = '{{ getCurrencyCode() }}';
|
||||||
var currencySymbol = '{{ getCurrencySymbol()|raw }}';
|
var currencySymbol = '{{ getCurrencySymbol()|raw }}';
|
||||||
var mon_decimal_point = "{{ localeconv.mon_decimal_point }}";
|
var mon_decimal_point = "{{ localeconv.mon_decimal_point }}";
|
||||||
var mon_thousands_sep = "{{ localeconv.mon_thousands_sep }}";
|
var mon_thousands_sep = "{{ localeconv.mon_thousands_sep }}";
|
||||||
var frac_digits = {{ localeconv.frac_digits }};
|
var frac_digits = {{ localeconv.frac_digits }};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user