mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Code cleanup.
This commit is contained in:
@@ -236,7 +236,7 @@ class BudgetController extends Controller
|
||||
// we already have amount, startdate and enddate.
|
||||
// if this "is" a limit repetition (as opposed to a budget without one entirely)
|
||||
// depends on whether startdate and enddate are null.
|
||||
$name = $budget->name;
|
||||
$name = $budget->name;
|
||||
if (is_null($budget->startdate) && is_null($budget->enddate)) {
|
||||
$currentStart = clone $start;
|
||||
$currentEnd = clone $end;
|
||||
@@ -252,7 +252,7 @@ class BudgetController extends Controller
|
||||
$amount = $budget->amount;
|
||||
// smaller than 1 means spent MORE than budget allows.
|
||||
$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;
|
||||
}
|
||||
|
||||
|
@@ -1,7 +1,6 @@
|
||||
<?php namespace FireflyIII\Http\Controllers;
|
||||
|
||||
use Auth;
|
||||
use Config;
|
||||
use Illuminate\Foundation\Bus\DispatchesJobs;
|
||||
use Illuminate\Foundation\Validation\ValidatesRequests;
|
||||
use Illuminate\Routing\Controller as BaseController;
|
||||
|
@@ -1,15 +1,12 @@
|
||||
<?php namespace FireflyIII\Http\Controllers;
|
||||
|
||||
use Artisan;
|
||||
use Auth;
|
||||
use Carbon\Carbon;
|
||||
use Config;
|
||||
use FireflyIII\Models\Tag;
|
||||
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
||||
use Input;
|
||||
use Log;
|
||||
use Preferences;
|
||||
use Route;
|
||||
use Session;
|
||||
use Steam;
|
||||
|
||||
|
@@ -64,9 +64,12 @@ class ReportController extends Controller
|
||||
$accountList = join(',', $accountIds);
|
||||
|
||||
|
||||
return view('reports.index', compact('months', 'accounts', 'start', 'accountList',
|
||||
'startOfMonth', 'endOfMonth', 'startOfYear', 'endOfYear'
|
||||
));
|
||||
return view(
|
||||
'reports.index', compact(
|
||||
'months', 'accounts', 'start', 'accountList',
|
||||
'startOfMonth', 'endOfMonth', 'startOfYear', 'endOfYear'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -4,7 +4,6 @@ use App;
|
||||
use Auth;
|
||||
use Carbon\Carbon;
|
||||
use Closure;
|
||||
use Config;
|
||||
use Illuminate\Contracts\Auth\Guard;
|
||||
use Illuminate\Http\Request;
|
||||
use Preferences;
|
||||
@@ -61,9 +60,9 @@ class Authenticate
|
||||
}
|
||||
|
||||
// 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);
|
||||
Carbon::setLocale(substr($pref->data,0,2));
|
||||
Carbon::setLocale(substr($pref->data, 0, 2));
|
||||
$locale = explode(',', trans('config.locale'));
|
||||
$locale = array_map('trim', $locale);
|
||||
|
||||
|
Reference in New Issue
Block a user