mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-23 04:46:44 +00:00
Some dependency clean up.
This commit is contained in:
@@ -83,7 +83,8 @@ class GoogleBillChartGenerator implements BillChartGenerator
|
|||||||
clone $result->date,
|
clone $result->date,
|
||||||
floatval($bill->amount_max),
|
floatval($bill->amount_max),
|
||||||
floatval($bill->amount_min),
|
floatval($bill->amount_min),
|
||||||
floatval($result->amount));
|
floatval($result->amount)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$chart->generate();
|
$chart->generate();
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
<?php namespace FireflyIII\Handlers\Events;
|
<?php namespace FireflyIII\Handlers\Events;
|
||||||
|
|
||||||
use App;
|
|
||||||
use FireflyIII\Events\JournalSaved;
|
use FireflyIII\Events\JournalSaved;
|
||||||
use Log;
|
use Log;
|
||||||
|
|
||||||
@@ -36,7 +35,7 @@ class RescanJournal
|
|||||||
Log::debug('Triggered saved event for journal #' . $journal->id . ' (' . $journal->description . ')');
|
Log::debug('Triggered saved event for journal #' . $journal->id . ' (' . $journal->description . ')');
|
||||||
|
|
||||||
/** @var \FireflyIII\Repositories\Bill\BillRepositoryInterface $repository */
|
/** @var \FireflyIII\Repositories\Bill\BillRepositoryInterface $repository */
|
||||||
$repository = App::make('FireflyIII\Repositories\Bill\BillRepositoryInterface');
|
$repository = app('FireflyIII\Repositories\Bill\BillRepositoryInterface');
|
||||||
$list = $journal->user->bills()->where('active', 1)->where('automatch', 1)->get();
|
$list = $journal->user->bills()->where('active', 1)->where('automatch', 1)->get();
|
||||||
|
|
||||||
Log::debug('Found ' . $list->count() . ' bills to check.');
|
Log::debug('Found ' . $list->count() . ' bills to check.');
|
||||||
|
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
namespace FireflyIII\Helpers\Csv;
|
namespace FireflyIII\Helpers\Csv;
|
||||||
|
|
||||||
use App;
|
|
||||||
use Auth;
|
use Auth;
|
||||||
use Config;
|
use Config;
|
||||||
use FireflyIII\Exceptions\FireflyException;
|
use FireflyIII\Exceptions\FireflyException;
|
||||||
@@ -125,7 +124,7 @@ class Importer
|
|||||||
$field = Config::get('csv.roles.' . $role . '.field');
|
$field = Config::get('csv.roles.' . $role . '.field');
|
||||||
|
|
||||||
/** @var ConverterInterface $converter */
|
/** @var ConverterInterface $converter */
|
||||||
$converter = App::make('FireflyIII\Helpers\Csv\Converter\\' . $class);
|
$converter = app('FireflyIII\Helpers\Csv\Converter\\' . $class);
|
||||||
$converter->setData($data); // the complete array so far.
|
$converter->setData($data); // the complete array so far.
|
||||||
$converter->setField($field);
|
$converter->setField($field);
|
||||||
$converter->setIndex($index);
|
$converter->setIndex($index);
|
||||||
@@ -186,7 +185,7 @@ class Importer
|
|||||||
|
|
||||||
foreach ($this->getSpecifix() as $className) {
|
foreach ($this->getSpecifix() as $className) {
|
||||||
/** @var SpecifixInterface $specifix */
|
/** @var SpecifixInterface $specifix */
|
||||||
$specifix = App::make('FireflyIII\Helpers\Csv\Specifix\\' . $className);
|
$specifix = app('FireflyIII\Helpers\Csv\Specifix\\' . $className);
|
||||||
$specifix->setData($this->importData);
|
$specifix->setData($this->importData);
|
||||||
$specifix->setRow($this->importRow);
|
$specifix->setRow($this->importRow);
|
||||||
$this->importData = $specifix->fix();
|
$this->importData = $specifix->fix();
|
||||||
@@ -196,7 +195,7 @@ class Importer
|
|||||||
$set = Config::get('csv.post_processors');
|
$set = Config::get('csv.post_processors');
|
||||||
foreach ($set as $className) {
|
foreach ($set as $className) {
|
||||||
/** @var PostProcessorInterface $postProcessor */
|
/** @var PostProcessorInterface $postProcessor */
|
||||||
$postProcessor = App::make('FireflyIII\Helpers\Csv\PostProcessing\\' . $className);
|
$postProcessor = app('FireflyIII\Helpers\Csv\PostProcessing\\' . $className);
|
||||||
$postProcessor->setData($this->importData);
|
$postProcessor->setData($this->importData);
|
||||||
$this->importData = $postProcessor->process();
|
$this->importData = $postProcessor->process();
|
||||||
}
|
}
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace FireflyIII\Helpers\Csv;
|
namespace FireflyIII\Helpers\Csv;
|
||||||
|
|
||||||
use App;
|
|
||||||
use Auth;
|
use Auth;
|
||||||
use Config;
|
use Config;
|
||||||
use Crypt;
|
use Crypt;
|
||||||
@@ -137,7 +136,7 @@ class Wizard implements WizardInterface
|
|||||||
$class = 'FireflyIII\Helpers\Csv\Mapper\\' . $mapper;
|
$class = 'FireflyIII\Helpers\Csv\Mapper\\' . $mapper;
|
||||||
try {
|
try {
|
||||||
/** @var MapperInterface $mapObject */
|
/** @var MapperInterface $mapObject */
|
||||||
$mapObject = App::make($class);
|
$mapObject = app($class);
|
||||||
} catch (ReflectionException $e) {
|
} catch (ReflectionException $e) {
|
||||||
throw new FireflyException('Column "' . $columnRole . '" cannot be mapped because class ' . $mapper . ' does not exist.');
|
throw new FireflyException('Column "' . $columnRole . '" cannot be mapped because class ' . $mapper . ' does not exist.');
|
||||||
}
|
}
|
||||||
|
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
namespace FireflyIII\Helpers\Report;
|
namespace FireflyIII\Helpers\Report;
|
||||||
|
|
||||||
use App;
|
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use FireflyIII\Helpers\Collection\Account as AccountCollection;
|
use FireflyIII\Helpers\Collection\Account as AccountCollection;
|
||||||
use FireflyIII\Helpers\Collection\Balance;
|
use FireflyIII\Helpers\Collection\Balance;
|
||||||
@@ -115,8 +114,8 @@ class ReportHelper implements ReportHelperInterface
|
|||||||
*/
|
*/
|
||||||
public function getBalanceReport(Carbon $start, Carbon $end, $shared)
|
public function getBalanceReport(Carbon $start, Carbon $end, $shared)
|
||||||
{
|
{
|
||||||
$repository = App::make('FireflyIII\Repositories\Budget\BudgetRepositoryInterface');
|
$repository = app('FireflyIII\Repositories\Budget\BudgetRepositoryInterface');
|
||||||
$tagRepository = App::make('FireflyIII\Repositories\Tag\TagRepositoryInterface');
|
$tagRepository = app('FireflyIII\Repositories\Tag\TagRepositoryInterface');
|
||||||
$balance = new Balance;
|
$balance = new Balance;
|
||||||
|
|
||||||
// build a balance header:
|
// build a balance header:
|
||||||
@@ -200,15 +199,15 @@ class ReportHelper implements ReportHelperInterface
|
|||||||
* This method generates a full report for the given period on all
|
* This method generates a full report for the given period on all
|
||||||
* the users bills and their payments.
|
* the users bills and their payments.
|
||||||
*
|
*
|
||||||
* @param Carbon $start
|
* @param Carbon $start
|
||||||
* @param Carbon $end
|
* @param Carbon $end
|
||||||
*
|
*
|
||||||
* @return BillCollection
|
* @return BillCollection
|
||||||
*/
|
*/
|
||||||
public function getBillReport(Carbon $start, Carbon $end)
|
public function getBillReport(Carbon $start, Carbon $end)
|
||||||
{
|
{
|
||||||
/** @var \FireflyIII\Repositories\Bill\BillRepositoryInterface $repository */
|
/** @var \FireflyIII\Repositories\Bill\BillRepositoryInterface $repository */
|
||||||
$repository = App::make('FireflyIII\Repositories\Bill\BillRepositoryInterface');
|
$repository = app('FireflyIII\Repositories\Bill\BillRepositoryInterface');
|
||||||
$bills = $repository->getBills();
|
$bills = $repository->getBills();
|
||||||
$collection = new BillCollection;
|
$collection = new BillCollection;
|
||||||
|
|
||||||
@@ -253,7 +252,7 @@ class ReportHelper implements ReportHelperInterface
|
|||||||
{
|
{
|
||||||
$object = new BudgetCollection;
|
$object = new BudgetCollection;
|
||||||
/** @var \FireflyIII\Repositories\Budget\BudgetRepositoryInterface $repository */
|
/** @var \FireflyIII\Repositories\Budget\BudgetRepositoryInterface $repository */
|
||||||
$repository = App::make('FireflyIII\Repositories\Budget\BudgetRepositoryInterface');
|
$repository = app('FireflyIII\Repositories\Budget\BudgetRepositoryInterface');
|
||||||
$set = $repository->getBudgets();
|
$set = $repository->getBudgets();
|
||||||
|
|
||||||
foreach ($set as $budget) {
|
foreach ($set as $budget) {
|
||||||
@@ -323,7 +322,7 @@ class ReportHelper implements ReportHelperInterface
|
|||||||
* GET CATEGORIES:
|
* GET CATEGORIES:
|
||||||
*/
|
*/
|
||||||
/** @var \FireflyIII\Repositories\Category\CategoryRepositoryInterface $repository */
|
/** @var \FireflyIII\Repositories\Category\CategoryRepositoryInterface $repository */
|
||||||
$repository = App::make('FireflyIII\Repositories\Category\CategoryRepositoryInterface');
|
$repository = app('FireflyIII\Repositories\Category\CategoryRepositoryInterface');
|
||||||
$set = $repository->getCategories();
|
$set = $repository->getCategories();
|
||||||
foreach ($set as $category) {
|
foreach ($set as $category) {
|
||||||
$spent = $repository->spentInPeriodCorrected($category, $start, $end, $shared);
|
$spent = $repository->spentInPeriodCorrected($category, $start, $end, $shared);
|
||||||
|
@@ -35,8 +35,8 @@ interface ReportHelperInterface
|
|||||||
* This method generates a full report for the given period on all
|
* This method generates a full report for the given period on all
|
||||||
* the users bills and their payments.
|
* the users bills and their payments.
|
||||||
*
|
*
|
||||||
* @param Carbon $start
|
* @param Carbon $start
|
||||||
* @param Carbon $end
|
* @param Carbon $end
|
||||||
*
|
*
|
||||||
* @return BillCollection
|
* @return BillCollection
|
||||||
*/
|
*/
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
<?php namespace FireflyIII\Http\Controllers\Auth;
|
<?php namespace FireflyIII\Http\Controllers\Auth;
|
||||||
|
|
||||||
use App;
|
|
||||||
use Auth;
|
use Auth;
|
||||||
use FireflyIII\Http\Controllers\Controller;
|
use FireflyIII\Http\Controllers\Controller;
|
||||||
use FireflyIII\Models\Role;
|
use FireflyIII\Models\Role;
|
||||||
@@ -109,7 +108,7 @@ class AuthController extends Controller
|
|||||||
return redirect($this->redirectPath());
|
return redirect($this->redirectPath());
|
||||||
}
|
}
|
||||||
// @codeCoverageIgnoreStart
|
// @codeCoverageIgnoreStart
|
||||||
App::abort(500, 'Not a user!');
|
abort(500, 'Not a user!');
|
||||||
|
|
||||||
return redirect('/');
|
return redirect('/');
|
||||||
// @codeCoverageIgnoreEnd
|
// @codeCoverageIgnoreEnd
|
||||||
|
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
namespace FireflyIII\Http\Controllers\Chart;
|
namespace FireflyIII\Http\Controllers\Chart;
|
||||||
|
|
||||||
use App;
|
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use FireflyIII\Http\Controllers\Controller;
|
use FireflyIII\Http\Controllers\Controller;
|
||||||
use FireflyIII\Models\Account;
|
use FireflyIII\Models\Account;
|
||||||
@@ -31,7 +30,7 @@ class AccountController extends Controller
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
// create chart generator:
|
// create chart generator:
|
||||||
$this->generator = App::make('FireflyIII\Generator\Chart\Account\AccountChartGenerator');
|
$this->generator = app('FireflyIII\Generator\Chart\Account\AccountChartGenerator');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
namespace FireflyIII\Http\Controllers\Chart;
|
namespace FireflyIII\Http\Controllers\Chart;
|
||||||
|
|
||||||
use App;
|
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use FireflyIII\Http\Controllers\Controller;
|
use FireflyIII\Http\Controllers\Controller;
|
||||||
use FireflyIII\Models\Bill;
|
use FireflyIII\Models\Bill;
|
||||||
@@ -33,7 +32,7 @@ class BillController extends Controller
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
// create chart generator:
|
// create chart generator:
|
||||||
$this->generator = App::make('FireflyIII\Generator\Chart\Bill\BillChartGenerator');
|
$this->generator = app('FireflyIII\Generator\Chart\Bill\BillChartGenerator');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
namespace FireflyIII\Http\Controllers\Chart;
|
namespace FireflyIII\Http\Controllers\Chart;
|
||||||
|
|
||||||
use App;
|
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use FireflyIII\Http\Controllers\Controller;
|
use FireflyIII\Http\Controllers\Controller;
|
||||||
use FireflyIII\Models\Budget;
|
use FireflyIII\Models\Budget;
|
||||||
@@ -33,7 +32,7 @@ class BudgetController extends Controller
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
// create chart generator:
|
// create chart generator:
|
||||||
$this->generator = App::make('FireflyIII\Generator\Chart\Budget\BudgetChartGenerator');
|
$this->generator = app('FireflyIII\Generator\Chart\Budget\BudgetChartGenerator');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -3,7 +3,6 @@
|
|||||||
namespace FireflyIII\Http\Controllers\Chart;
|
namespace FireflyIII\Http\Controllers\Chart;
|
||||||
|
|
||||||
|
|
||||||
use App;
|
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use FireflyIII\Http\Controllers\Controller;
|
use FireflyIII\Http\Controllers\Controller;
|
||||||
use FireflyIII\Models\Category;
|
use FireflyIII\Models\Category;
|
||||||
@@ -32,7 +31,7 @@ class CategoryController extends Controller
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
// create chart generator:
|
// create chart generator:
|
||||||
$this->generator = App::make('FireflyIII\Generator\Chart\Category\CategoryChartGenerator');
|
$this->generator = app('FireflyIII\Generator\Chart\Category\CategoryChartGenerator');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
namespace FireflyIII\Http\Controllers\Chart;
|
namespace FireflyIII\Http\Controllers\Chart;
|
||||||
|
|
||||||
use App;
|
|
||||||
use FireflyIII\Http\Controllers\Controller;
|
use FireflyIII\Http\Controllers\Controller;
|
||||||
use FireflyIII\Models\PiggyBank;
|
use FireflyIII\Models\PiggyBank;
|
||||||
use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface;
|
use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface;
|
||||||
@@ -29,7 +28,7 @@ class PiggyBankController extends Controller
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
// create chart generator:
|
// create chart generator:
|
||||||
$this->generator = App::make('FireflyIII\Generator\Chart\PiggyBank\PiggyBankChartGenerator');
|
$this->generator = app('FireflyIII\Generator\Chart\PiggyBank\PiggyBankChartGenerator');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -3,7 +3,6 @@
|
|||||||
namespace FireflyIII\Http\Controllers\Chart;
|
namespace FireflyIII\Http\Controllers\Chart;
|
||||||
|
|
||||||
|
|
||||||
use App;
|
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use FireflyIII\Helpers\Report\ReportQueryInterface;
|
use FireflyIII\Helpers\Report\ReportQueryInterface;
|
||||||
use FireflyIII\Http\Controllers\Controller;
|
use FireflyIII\Http\Controllers\Controller;
|
||||||
@@ -29,7 +28,7 @@ class ReportController extends Controller
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
// create chart generator:
|
// create chart generator:
|
||||||
$this->generator = App::make('FireflyIII\Generator\Chart\Report\ReportChartGenerator');
|
$this->generator = app('FireflyIII\Generator\Chart\Report\ReportChartGenerator');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
namespace FireflyIII\Http\Controllers;
|
namespace FireflyIII\Http\Controllers;
|
||||||
|
|
||||||
use App;
|
|
||||||
use Config;
|
use Config;
|
||||||
use FireflyIII\Exceptions\FireflyException;
|
use FireflyIII\Exceptions\FireflyException;
|
||||||
use FireflyIII\Helpers\Csv\Data;
|
use FireflyIII\Helpers\Csv\Data;
|
||||||
@@ -41,8 +40,8 @@ class CsvController extends Controller
|
|||||||
throw new FireflyException('CSV Import is not enabled.');
|
throw new FireflyException('CSV Import is not enabled.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->wizard = App::make('FireflyIII\Helpers\Csv\WizardInterface');
|
$this->wizard = app('FireflyIII\Helpers\Csv\WizardInterface');
|
||||||
$this->data = App::make('FireflyIII\Helpers\Csv\Data');
|
$this->data = app('FireflyIII\Helpers\Csv\Data');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -72,7 +72,6 @@ class HomeController extends Controller
|
|||||||
$count = $repository->countAccounts($types);
|
$count = $repository->countAccounts($types);
|
||||||
bcscale(2);
|
bcscale(2);
|
||||||
|
|
||||||
|
|
||||||
if ($count == 0) {
|
if ($count == 0) {
|
||||||
return redirect(route('new-user.index'));
|
return redirect(route('new-user.index'));
|
||||||
}
|
}
|
||||||
|
@@ -133,7 +133,7 @@ class JsonController extends Controller
|
|||||||
/** @var Bill $entry */
|
/** @var Bill $entry */
|
||||||
foreach ($unpaid as $entry) {
|
foreach ($unpaid as $entry) {
|
||||||
$current = ($entry[0]->amount_max + $entry[0]->amount_min) / 2;
|
$current = ($entry[0]->amount_max + $entry[0]->amount_min) / 2;
|
||||||
$amount = bcadd($amount, $current);
|
$amount = bcadd($amount, $current);
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = ['box' => 'bills-unpaid', 'amount' => Amount::format($amount, false), 'amount_raw' => $amount];
|
$data = ['box' => 'bills-unpaid', 'amount' => Amount::format($amount, false), 'amount_raw' => $amount];
|
||||||
|
@@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
namespace FireflyIII\Http\Middleware;
|
namespace FireflyIII\Http\Middleware;
|
||||||
|
|
||||||
use App;
|
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use Closure;
|
use Closure;
|
||||||
use Illuminate\Contracts\Auth\Guard;
|
use Illuminate\Contracts\Auth\Guard;
|
||||||
@@ -65,7 +64,7 @@ class Range
|
|||||||
}
|
}
|
||||||
if (!Session::has('first')) {
|
if (!Session::has('first')) {
|
||||||
/** @var \FireflyIII\Repositories\Journal\JournalRepositoryInterface $repository */
|
/** @var \FireflyIII\Repositories\Journal\JournalRepositoryInterface $repository */
|
||||||
$repository = App::make('FireflyIII\Repositories\Journal\JournalRepositoryInterface');
|
$repository = app('FireflyIII\Repositories\Journal\JournalRepositoryInterface');
|
||||||
$journal = $repository->first();
|
$journal = $repository->first();
|
||||||
if ($journal) {
|
if ($journal) {
|
||||||
Session::put('first', $journal->date);
|
Session::put('first', $journal->date);
|
||||||
|
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
namespace FireflyIII\Http\Requests;
|
namespace FireflyIII\Http\Requests;
|
||||||
|
|
||||||
use App;
|
|
||||||
use Auth;
|
use Auth;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use Exception;
|
use Exception;
|
||||||
@@ -85,7 +84,7 @@ class JournalFormRequest extends Request
|
|||||||
$rules['category'] = 'between:1,255';
|
$rules['category'] = 'between:1,255';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
App::abort(500, 'Cannot handle ' . $what);
|
abort(500, 'Cannot handle ' . $what);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
namespace FireflyIII\Providers;
|
namespace FireflyIII\Providers;
|
||||||
|
|
||||||
use App;
|
|
||||||
use FireflyIII\Support\Amount;
|
use FireflyIII\Support\Amount;
|
||||||
use FireflyIII\Support\ExpandedForm;
|
use FireflyIII\Support\ExpandedForm;
|
||||||
use FireflyIII\Support\Navigation;
|
use FireflyIII\Support\Navigation;
|
||||||
@@ -38,7 +37,7 @@ class FireflyServiceProvider extends ServiceProvider
|
|||||||
* Default Twig configuration:
|
* Default Twig configuration:
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$config = App::make('config');
|
$config = app('config');
|
||||||
Twig::addExtension(new Functions($config));
|
Twig::addExtension(new Functions($config));
|
||||||
Twig::addExtension(new PiggyBank);
|
Twig::addExtension(new PiggyBank);
|
||||||
Twig::addExtension(new General);
|
Twig::addExtension(new General);
|
||||||
|
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
namespace FireflyIII\Repositories\Account;
|
namespace FireflyIII\Repositories\Account;
|
||||||
|
|
||||||
use App;
|
|
||||||
use Auth;
|
use Auth;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use Config;
|
use Config;
|
||||||
@@ -505,7 +504,7 @@ class AccountRepository implements AccountRepositoryInterface
|
|||||||
$existingAccount = Account::firstOrNullEncrypted($searchData);
|
$existingAccount = Account::firstOrNullEncrypted($searchData);
|
||||||
if (!$existingAccount) {
|
if (!$existingAccount) {
|
||||||
Log::error('Account create error: ' . $newAccount->getErrors()->toJson());
|
Log::error('Account create error: ' . $newAccount->getErrors()->toJson());
|
||||||
App::abort(500);
|
abort(500);
|
||||||
// @codeCoverageIgnoreStart
|
// @codeCoverageIgnoreStart
|
||||||
}
|
}
|
||||||
// @codeCoverageIgnoreEnd
|
// @codeCoverageIgnoreEnd
|
||||||
|
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
namespace FireflyIII\Repositories\Journal;
|
namespace FireflyIII\Repositories\Journal;
|
||||||
|
|
||||||
use App;
|
|
||||||
use Auth;
|
use Auth;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use DB;
|
use DB;
|
||||||
@@ -138,7 +137,7 @@ class JournalRepository implements JournalRepositoryInterface
|
|||||||
public function saveTags(TransactionJournal $journal, array $array)
|
public function saveTags(TransactionJournal $journal, array $array)
|
||||||
{
|
{
|
||||||
/** @var \FireflyIII\Repositories\Tag\TagRepositoryInterface $tagRepository */
|
/** @var \FireflyIII\Repositories\Tag\TagRepositoryInterface $tagRepository */
|
||||||
$tagRepository = App::make('FireflyIII\Repositories\Tag\TagRepositoryInterface');
|
$tagRepository = app('FireflyIII\Repositories\Tag\TagRepositoryInterface');
|
||||||
|
|
||||||
foreach ($array as $name) {
|
foreach ($array as $name) {
|
||||||
if (strlen(trim($name)) > 0) {
|
if (strlen(trim($name)) > 0) {
|
||||||
@@ -287,7 +286,7 @@ class JournalRepository implements JournalRepositoryInterface
|
|||||||
{
|
{
|
||||||
// create tag repository
|
// create tag repository
|
||||||
/** @var \FireflyIII\Repositories\Tag\TagRepositoryInterface $tagRepository */
|
/** @var \FireflyIII\Repositories\Tag\TagRepositoryInterface $tagRepository */
|
||||||
$tagRepository = App::make('FireflyIII\Repositories\Tag\TagRepositoryInterface');
|
$tagRepository = app('FireflyIII\Repositories\Tag\TagRepositoryInterface');
|
||||||
|
|
||||||
|
|
||||||
// find or create all tags:
|
// find or create all tags:
|
||||||
@@ -344,14 +343,15 @@ class JournalRepository implements JournalRepositoryInterface
|
|||||||
|
|
||||||
if (is_null($toAccount)) {
|
if (is_null($toAccount)) {
|
||||||
Log::error('"to"-account is null, so we cannot continue!');
|
Log::error('"to"-account is null, so we cannot continue!');
|
||||||
App::abort(500, '"to"-account is null, so we cannot continue!');
|
abort(500, '"to"-account is null, so we cannot continue!');
|
||||||
// @codeCoverageIgnoreStart
|
// @codeCoverageIgnoreStart
|
||||||
}
|
}
|
||||||
// @codeCoverageIgnoreEnd
|
// @codeCoverageIgnoreEnd
|
||||||
|
|
||||||
if (is_null($fromAccount)) {
|
if (is_null($fromAccount)) {
|
||||||
Log::error('"from"-account is null, so we cannot continue!');
|
Log::error('"from"-account is null, so we cannot continue!');
|
||||||
App::abort(500, '"from"-account is null, so we cannot continue!');
|
abort(500, '"from"-account is null, so we cannot continue!');
|
||||||
|
|
||||||
// @codeCoverageIgnoreStart
|
// @codeCoverageIgnoreStart
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
namespace FireflyIII\Support\Twig;
|
namespace FireflyIII\Support\Twig;
|
||||||
|
|
||||||
use App;
|
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use Config;
|
use Config;
|
||||||
use FireflyIII\Models\Account;
|
use FireflyIII\Models\Account;
|
||||||
@@ -74,7 +73,7 @@ class General extends Twig_Extension
|
|||||||
{
|
{
|
||||||
return new Twig_SimpleFilter(
|
return new Twig_SimpleFilter(
|
||||||
'formatAmount', function ($string) {
|
'formatAmount', function ($string) {
|
||||||
return App::make('amount')->format($string);
|
return app('amount')->format($string);
|
||||||
}, ['is_safe' => ['html']]
|
}, ['is_safe' => ['html']]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -86,7 +85,7 @@ class General extends Twig_Extension
|
|||||||
{
|
{
|
||||||
return new Twig_SimpleFilter(
|
return new Twig_SimpleFilter(
|
||||||
'formatTransaction', function (Transaction $transaction) {
|
'formatTransaction', function (Transaction $transaction) {
|
||||||
return App::make('amount')->formatTransaction($transaction);
|
return app('amount')->formatTransaction($transaction);
|
||||||
}, ['is_safe' => ['html']]
|
}, ['is_safe' => ['html']]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -98,7 +97,7 @@ class General extends Twig_Extension
|
|||||||
{
|
{
|
||||||
return new Twig_SimpleFilter(
|
return new Twig_SimpleFilter(
|
||||||
'formatAmountPlain', function ($string) {
|
'formatAmountPlain', function ($string) {
|
||||||
return App::make('amount')->format($string, false);
|
return app('amount')->format($string, false);
|
||||||
}, ['is_safe' => ['html']]
|
}, ['is_safe' => ['html']]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -110,7 +109,7 @@ class General extends Twig_Extension
|
|||||||
{
|
{
|
||||||
return new Twig_SimpleFilter(
|
return new Twig_SimpleFilter(
|
||||||
'formatJournal', function ($journal) {
|
'formatJournal', function ($journal) {
|
||||||
return App::make('amount')->formatJournal($journal);
|
return app('amount')->formatJournal($journal);
|
||||||
}, ['is_safe' => ['html']]
|
}, ['is_safe' => ['html']]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -127,7 +126,7 @@ class General extends Twig_Extension
|
|||||||
}
|
}
|
||||||
$date = Session::get('end', Carbon::now()->endOfMonth());
|
$date = Session::get('end', Carbon::now()->endOfMonth());
|
||||||
|
|
||||||
return App::make('steam')->balance($account, $date);
|
return app('steam')->balance($account, $date);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -151,7 +150,7 @@ class General extends Twig_Extension
|
|||||||
{
|
{
|
||||||
return new Twig_SimpleFunction(
|
return new Twig_SimpleFunction(
|
||||||
'getCurrencyCode', function () {
|
'getCurrencyCode', function () {
|
||||||
return App::make('amount')->getCurrencyCode();
|
return app('amount')->getCurrencyCode();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -163,7 +162,7 @@ class General extends Twig_Extension
|
|||||||
{
|
{
|
||||||
return new Twig_SimpleFunction(
|
return new Twig_SimpleFunction(
|
||||||
'getCurrencySymbol', function () {
|
'getCurrencySymbol', function () {
|
||||||
return App::make('amount')->getCurrencySymbol();
|
return app('amount')->getCurrencySymbol();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@@ -3,7 +3,6 @@
|
|||||||
namespace FireflyIII\Support\Twig;
|
namespace FireflyIII\Support\Twig;
|
||||||
|
|
||||||
|
|
||||||
use App;
|
|
||||||
use FireflyIII\Models\Tag;
|
use FireflyIII\Models\Tag;
|
||||||
use FireflyIII\Models\TransactionJournal;
|
use FireflyIII\Models\TransactionJournal;
|
||||||
use FireflyIII\Support\CacheProperties;
|
use FireflyIII\Support\CacheProperties;
|
||||||
@@ -156,7 +155,7 @@ class Journal extends Twig_Extension
|
|||||||
*/
|
*/
|
||||||
protected function relevantTagsNoTags(TransactionJournal $journal)
|
protected function relevantTagsNoTags(TransactionJournal $journal)
|
||||||
{
|
{
|
||||||
return App::make('amount')->formatJournal($journal);
|
return app('amount')->formatJournal($journal);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -182,7 +181,7 @@ class Journal extends Twig_Extension
|
|||||||
if ($tag->tagMode == 'balancingAct') {
|
if ($tag->tagMode == 'balancingAct') {
|
||||||
// return tag formatted for a "balancing act", even if other
|
// return tag formatted for a "balancing act", even if other
|
||||||
// tags are present.
|
// tags are present.
|
||||||
$amount = App::make('amount')->format($journal->actual_amount, false);
|
$amount = app('amount')->format($journal->actual_amount, false);
|
||||||
$string = '<a href="' . route('tags.show', [$tag->id]) . '" class="label label-success" title="' . $amount
|
$string = '<a href="' . route('tags.show', [$tag->id]) . '" class="label label-success" title="' . $amount
|
||||||
. '"><i class="fa fa-fw fa-refresh"></i> ' . $tag->tag . '</a>';
|
. '"><i class="fa fa-fw fa-refresh"></i> ' . $tag->tag . '</a>';
|
||||||
|
|
||||||
@@ -191,7 +190,7 @@ class Journal extends Twig_Extension
|
|||||||
|
|
||||||
if ($tag->tagMode == 'advancePayment') {
|
if ($tag->tagMode == 'advancePayment') {
|
||||||
if ($journal->transactionType->type == 'Deposit') {
|
if ($journal->transactionType->type == 'Deposit') {
|
||||||
$amount = App::make('amount')->formatJournal($journal, false);
|
$amount = app('amount')->formatJournal($journal, false);
|
||||||
$string = '<a href="' . route('tags.show', [$tag->id]) . '" class="label label-success" title="' . $amount
|
$string = '<a href="' . route('tags.show', [$tag->id]) . '" class="label label-success" title="' . $amount
|
||||||
. '"><i class="fa fa-fw fa-sort-numeric-desc"></i> ' . $tag->tag . '</a>';
|
. '"><i class="fa fa-fw fa-sort-numeric-desc"></i> ' . $tag->tag . '</a>';
|
||||||
|
|
||||||
@@ -203,7 +202,7 @@ class Journal extends Twig_Extension
|
|||||||
* the tag. The TransactionJournal should properly calculate the amount.
|
* the tag. The TransactionJournal should properly calculate the amount.
|
||||||
*/
|
*/
|
||||||
if ($journal->transactionType->type == 'Withdrawal') {
|
if ($journal->transactionType->type == 'Withdrawal') {
|
||||||
$amount = App::make('amount')->formatJournal($journal);
|
$amount = app('amount')->formatJournal($journal);
|
||||||
|
|
||||||
$string = '<a href="' . route('tags.show', [$tag->id]) . '">' . $amount . '</a>';
|
$string = '<a href="' . route('tags.show', [$tag->id]) . '">' . $amount . '</a>';
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user