mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-30 10:33:30 +00:00
Some code cleanup [skip ci]
This commit is contained in:
@@ -17,16 +17,14 @@ class BudgetLine
|
|||||||
|
|
||||||
/** @var BudgetModel */
|
/** @var BudgetModel */
|
||||||
protected $budget;
|
protected $budget;
|
||||||
|
|
||||||
/** @var LimitRepetition */
|
|
||||||
protected $repetition;
|
|
||||||
|
|
||||||
/** @var float */
|
/** @var float */
|
||||||
protected $budgeted = 0;
|
protected $budgeted = 0;
|
||||||
/** @var float */
|
/** @var float */
|
||||||
protected $left = 0;
|
protected $left = 0;
|
||||||
/** @var float */
|
/** @var float */
|
||||||
protected $overspent = 0;
|
protected $overspent = 0;
|
||||||
|
/** @var LimitRepetition */
|
||||||
|
protected $repetition;
|
||||||
/** @var float */
|
/** @var float */
|
||||||
protected $spent = 0;
|
protected $spent = 0;
|
||||||
|
|
||||||
@@ -94,22 +92,6 @@ class BudgetLine
|
|||||||
$this->overspent = $overspent;
|
$this->overspent = $overspent;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return float
|
|
||||||
*/
|
|
||||||
public function getSpent()
|
|
||||||
{
|
|
||||||
return $this->spent;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param float $spent
|
|
||||||
*/
|
|
||||||
public function setSpent($spent)
|
|
||||||
{
|
|
||||||
$this->spent = $spent;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return LimitRepetition
|
* @return LimitRepetition
|
||||||
*/
|
*/
|
||||||
@@ -126,5 +108,21 @@ class BudgetLine
|
|||||||
$this->repetition = $repetition;
|
$this->repetition = $repetition;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return float
|
||||||
|
*/
|
||||||
|
public function getSpent()
|
||||||
|
{
|
||||||
|
return $this->spent;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param float $spent
|
||||||
|
*/
|
||||||
|
public function setSpent($spent)
|
||||||
|
{
|
||||||
|
$this->spent = $spent;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -34,6 +34,7 @@ class ReportHelper implements ReportHelperInterface
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @codeCoverageIgnore
|
* @codeCoverageIgnore
|
||||||
|
*
|
||||||
* @param ReportQueryInterface $query
|
* @param ReportQueryInterface $query
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -64,11 +65,13 @@ class ReportHelper implements ReportHelperInterface
|
|||||||
$diff = 0;
|
$diff = 0;
|
||||||
|
|
||||||
// remove cash account, if any:
|
// remove cash account, if any:
|
||||||
$accounts =$accounts->filter(function(Account $account) {
|
$accounts = $accounts->filter(
|
||||||
if($account->accountType->type != 'Cash account') {
|
function (Account $account) {
|
||||||
|
if ($account->accountType->type != 'Cash account') {
|
||||||
return $account;
|
return $account;
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
);
|
||||||
|
|
||||||
// summarize:
|
// summarize:
|
||||||
foreach ($accounts as $account) {
|
foreach ($accounts as $account) {
|
||||||
|
@@ -5,12 +5,10 @@ namespace FireflyIII\Helpers\Report;
|
|||||||
use Auth;
|
use Auth;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use Crypt;
|
use Crypt;
|
||||||
use DB;
|
|
||||||
use FireflyIII\Models\Account;
|
use FireflyIII\Models\Account;
|
||||||
use FireflyIII\Models\Budget;
|
use FireflyIII\Models\Budget;
|
||||||
use FireflyIII\Models\TransactionJournal;
|
use FireflyIII\Models\TransactionJournal;
|
||||||
use Illuminate\Database\Eloquent\Builder;
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
|
||||||
use Illuminate\Database\Query\JoinClause;
|
use Illuminate\Database\Query\JoinClause;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
use Steam;
|
use Steam;
|
||||||
@@ -138,7 +136,6 @@ class ReportQuery implements ReportQueryInterface
|
|||||||
* This method returns all "income" journals in a certain period, which are both transfers from a shared account
|
* This method returns all "income" journals in a certain period, which are both transfers from a shared account
|
||||||
* and "ordinary" deposits. The query used is almost equal to ReportQueryInterface::journalsByRevenueAccount but it does
|
* and "ordinary" deposits. The query used is almost equal to ReportQueryInterface::journalsByRevenueAccount but it does
|
||||||
* not group and returns different fields.
|
* not group and returns different fields.
|
||||||
|
|
||||||
*
|
*
|
||||||
* @param Carbon $start
|
* @param Carbon $start
|
||||||
* @param Carbon $end
|
* @param Carbon $end
|
||||||
@@ -241,7 +238,8 @@ class ReportQuery implements ReportQueryInterface
|
|||||||
->where('transactions.account_id', $account->id)
|
->where('transactions.account_id', $account->id)
|
||||||
->before($end)
|
->before($end)
|
||||||
->after($start)
|
->after($start)
|
||||||
->whereNull('budget_transaction_journal.budget_id')->get(['transaction_journals.*'])->sum('amount'));
|
->whereNull('budget_transaction_journal.budget_id')->get(['transaction_journals.*'])->sum('amount')
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use DaveJamesMiller\Breadcrumbs\Generator;
|
use DaveJamesMiller\Breadcrumbs\Generator;
|
||||||
use FireflyIII\Exceptions\FireflyException;
|
|
||||||
use FireflyIII\Models\Account;
|
use FireflyIII\Models\Account;
|
||||||
use FireflyIII\Models\Bill;
|
use FireflyIII\Models\Bill;
|
||||||
use FireflyIII\Models\Budget;
|
use FireflyIII\Models\Budget;
|
||||||
@@ -71,7 +70,7 @@ Breadcrumbs::register(
|
|||||||
$breadcrumbs->parent('accounts.show', $account);
|
$breadcrumbs->parent('accounts.show', $account);
|
||||||
$what = Config::get('firefly.shortNamesByFullName.' . $account->accountType->type);
|
$what = Config::get('firefly.shortNamesByFullName.' . $account->accountType->type);
|
||||||
|
|
||||||
$breadcrumbs->push(trans('breadcrumbs.edit_'.$what.'_account', ['name' => e($account->name)]), route('accounts.edit', $account->id));
|
$breadcrumbs->push(trans('breadcrumbs.edit_' . $what . '_account', ['name' => e($account->name)]), route('accounts.edit', $account->id));
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@@ -199,7 +199,7 @@ Route::controllers(
|
|||||||
*/
|
*/
|
||||||
Route::group(
|
Route::group(
|
||||||
['middleware' => ['auth', 'range', 'reminders', 'piggybanks']], function () {
|
['middleware' => ['auth', 'range', 'reminders', 'piggybanks']], function () {
|
||||||
Route::get('/', ['uses' => 'HomeController@index', 'as' => 'index','middleware' => 'cleanup']);
|
Route::get('/', ['uses' => 'HomeController@index', 'as' => 'index', 'middleware' => 'cleanup']);
|
||||||
Route::get('/home', ['uses' => 'HomeController@index', 'as' => 'home']);
|
Route::get('/home', ['uses' => 'HomeController@index', 'as' => 'home']);
|
||||||
Route::post('/daterange', ['uses' => 'HomeController@dateRange', 'as' => 'daterange']);
|
Route::post('/daterange', ['uses' => 'HomeController@dateRange', 'as' => 'daterange']);
|
||||||
Route::get('/flush', ['uses' => 'HomeController@flush', 'as' => 'flush']);
|
Route::get('/flush', ['uses' => 'HomeController@flush', 'as' => 'flush']);
|
||||||
|
@@ -310,7 +310,6 @@ class BudgetRepository implements BudgetRepositoryInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Budget $budget
|
* @param Budget $budget
|
||||||
* @param array $data
|
* @param array $data
|
||||||
|
@@ -5,7 +5,6 @@ namespace FireflyIII\Repositories\Category;
|
|||||||
use Auth;
|
use Auth;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use Crypt;
|
use Crypt;
|
||||||
use DB;
|
|
||||||
use FireflyIII\Models\Category;
|
use FireflyIII\Models\Category;
|
||||||
use FireflyIII\Models\TransactionJournal;
|
use FireflyIII\Models\TransactionJournal;
|
||||||
use Illuminate\Database\Query\JoinClause;
|
use Illuminate\Database\Query\JoinClause;
|
||||||
|
Reference in New Issue
Block a user