mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-19 19:01:58 +00:00
Optimize imports.
This commit is contained in:
@@ -24,7 +24,6 @@ namespace FireflyIII\Http\Controllers\Account;
|
|||||||
|
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use FireflyIII\Exceptions\FireflyException;
|
use FireflyIII\Exceptions\FireflyException;
|
||||||
use FireflyIII\Factory\TransactionJournalFactory;
|
|
||||||
use FireflyIII\Helpers\Collector\JournalCollectorInterface;
|
use FireflyIII\Helpers\Collector\JournalCollectorInterface;
|
||||||
use FireflyIII\Http\Controllers\Controller;
|
use FireflyIII\Http\Controllers\Controller;
|
||||||
use FireflyIII\Http\Requests\ReconciliationStoreRequest;
|
use FireflyIII\Http\Requests\ReconciliationStoreRequest;
|
||||||
@@ -37,12 +36,10 @@ use FireflyIII\Models\TransactionType;
|
|||||||
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
||||||
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
|
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
|
||||||
use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
|
use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
|
||||||
use FireflyIII\Services\Internal\Update\TransactionUpdateService;
|
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
use Log;
|
use Log;
|
||||||
use Preferences;
|
use Preferences;
|
||||||
use Response;
|
|
||||||
use Session;
|
use Session;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -163,7 +160,7 @@ class ReconcileController extends Controller
|
|||||||
)->render(),
|
)->render(),
|
||||||
];
|
];
|
||||||
|
|
||||||
return Response::json($return);
|
return response()->json($return);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -375,7 +372,7 @@ class ReconcileController extends Controller
|
|||||||
$transactions = $collector->getJournals();
|
$transactions = $collector->getJournals();
|
||||||
$html = view('accounts.reconcile.transactions', compact('account', 'transactions', 'start', 'end', 'selectionStart', 'selectionEnd'))->render();
|
$html = view('accounts.reconcile.transactions', compact('account', 'transactions', 'start', 'end', 'selectionStart', 'selectionEnd'))->render();
|
||||||
|
|
||||||
return Response::json(['html' => $html, 'startBalance' => $startBalance, 'endBalance' => $endBalance]);
|
return response()->json(['html' => $html, 'startBalance' => $startBalance, 'endBalance' => $endBalance]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -31,7 +31,6 @@ use FireflyIII\Services\Github\Object\Release;
|
|||||||
use FireflyIII\Services\Github\Request\UpdateRequest;
|
use FireflyIII\Services\Github\Request\UpdateRequest;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Log;
|
use Log;
|
||||||
use Response;
|
|
||||||
use Session;
|
use Session;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -137,6 +136,6 @@ class UpdateController extends Controller
|
|||||||
$string = strval(trans('firefly.update_newer_version_alert', ['your_version' => $current, 'new_version' => $first->getTitle()]));
|
$string = strval(trans('firefly.update_newer_version_alert', ['your_version' => $current, 'new_version' => $first->getTitle()]));
|
||||||
}
|
}
|
||||||
|
|
||||||
return Response::json(['result' => $string]);
|
return response()->json(['result' => $string]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -29,7 +29,6 @@ use FireflyIII\Repositories\Attachment\AttachmentRepositoryInterface;
|
|||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Http\Response as LaravelResponse;
|
use Illuminate\Http\Response as LaravelResponse;
|
||||||
use Preferences;
|
use Preferences;
|
||||||
use Response;
|
|
||||||
use View;
|
use View;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -182,7 +181,7 @@ class AttachmentController extends Controller
|
|||||||
if ($this->repository->exists($attachment)) {
|
if ($this->repository->exists($attachment)) {
|
||||||
$content = $this->repository->getContent($attachment);
|
$content = $this->repository->getContent($attachment);
|
||||||
|
|
||||||
return Response::make(
|
return response()->make(
|
||||||
$content, 200, [
|
$content, 200, [
|
||||||
'Content-Type' => $attachment->mime,
|
'Content-Type' => $attachment->mime,
|
||||||
'Content-Disposition' => 'inline; filename="' . $attachment->filename . '"',
|
'Content-Disposition' => 'inline; filename="' . $attachment->filename . '"',
|
||||||
|
@@ -22,7 +22,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace FireflyIII\Http\Controllers;
|
namespace FireflyIII\Http\Controllers;
|
||||||
|
|
||||||
use Carbon\Carbon;
|
|
||||||
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
|
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
|
||||||
use FireflyIII\Helpers\Collector\JournalCollectorInterface;
|
use FireflyIII\Helpers\Collector\JournalCollectorInterface;
|
||||||
use FireflyIII\Http\Requests\BillFormRequest;
|
use FireflyIII\Http\Requests\BillFormRequest;
|
||||||
|
@@ -39,7 +39,6 @@ use Illuminate\Pagination\LengthAwarePaginator;
|
|||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
use Log;
|
use Log;
|
||||||
use Preferences;
|
use Preferences;
|
||||||
use Response;
|
|
||||||
use View;
|
use View;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -82,9 +81,9 @@ class BudgetController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function amount(Request $request, BudgetRepositoryInterface $repository, Budget $budget)
|
public function amount(Request $request, BudgetRepositoryInterface $repository, Budget $budget)
|
||||||
{
|
{
|
||||||
$amount = strval($request->get('amount'));
|
$amount = strval($request->get('amount'));
|
||||||
$start = Carbon::createFromFormat('Y-m-d', $request->get('start'));
|
$start = Carbon::createFromFormat('Y-m-d', $request->get('start'));
|
||||||
$end = Carbon::createFromFormat('Y-m-d', $request->get('end'));
|
$end = Carbon::createFromFormat('Y-m-d', $request->get('end'));
|
||||||
$budgetLimit = $this->repository->updateLimitAmount($budget, $start, $end, $amount);
|
$budgetLimit = $this->repository->updateLimitAmount($budget, $start, $end, $amount);
|
||||||
if (0 === bccomp($amount, '0')) {
|
if (0 === bccomp($amount, '0')) {
|
||||||
$budgetLimit = null;
|
$budgetLimit = null;
|
||||||
@@ -97,7 +96,7 @@ class BudgetController extends Controller
|
|||||||
|
|
||||||
Preferences::mark();
|
Preferences::mark();
|
||||||
|
|
||||||
return Response::json(['left' => $left, 'name' => $budget->name, 'limit' => $budgetLimit ? $budgetLimit->id : 0, 'amount' => $amount]);
|
return response()->json(['left' => $left, 'name' => $budget->name, 'limit' => $budgetLimit ? $budgetLimit->id : 0, 'amount' => $amount]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -38,7 +38,6 @@ use FireflyIII\Support\CacheProperties;
|
|||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
use Log;
|
use Log;
|
||||||
use Preferences;
|
use Preferences;
|
||||||
use Response;
|
|
||||||
|
|
||||||
/** checked
|
/** checked
|
||||||
* Class AccountController.
|
* Class AccountController.
|
||||||
@@ -74,7 +73,7 @@ class AccountController extends Controller
|
|||||||
$cache->addProperty($end);
|
$cache->addProperty($end);
|
||||||
$cache->addProperty('chart.account.expense-accounts');
|
$cache->addProperty('chart.account.expense-accounts');
|
||||||
if ($cache->has()) {
|
if ($cache->has()) {
|
||||||
return Response::json($cache->get()); // @codeCoverageIgnore
|
return response()->json($cache->get()); // @codeCoverageIgnore
|
||||||
}
|
}
|
||||||
$start->subDay();
|
$start->subDay();
|
||||||
|
|
||||||
@@ -97,7 +96,7 @@ class AccountController extends Controller
|
|||||||
$data = $this->generator->singleSet(strval(trans('firefly.spent')), $chartData);
|
$data = $this->generator->singleSet(strval(trans('firefly.spent')), $chartData);
|
||||||
$cache->store($data);
|
$cache->store($data);
|
||||||
|
|
||||||
return Response::json($data);
|
return response()->json($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -115,7 +114,7 @@ class AccountController extends Controller
|
|||||||
$cache->addProperty($end);
|
$cache->addProperty($end);
|
||||||
$cache->addProperty('chart.account.expense-budget');
|
$cache->addProperty('chart.account.expense-budget');
|
||||||
if ($cache->has()) {
|
if ($cache->has()) {
|
||||||
return Response::json($cache->get()); // @codeCoverageIgnore
|
return response()->json($cache->get()); // @codeCoverageIgnore
|
||||||
}
|
}
|
||||||
$collector = app(JournalCollectorInterface::class);
|
$collector = app(JournalCollectorInterface::class);
|
||||||
$collector->setAccounts(new Collection([$account]))->setRange($start, $end)->withBudgetInformation()->setTypes([TransactionType::WITHDRAWAL]);
|
$collector->setAccounts(new Collection([$account]))->setRange($start, $end)->withBudgetInformation()->setTypes([TransactionType::WITHDRAWAL]);
|
||||||
@@ -140,7 +139,7 @@ class AccountController extends Controller
|
|||||||
$data = $this->generator->pieChart($chartData);
|
$data = $this->generator->pieChart($chartData);
|
||||||
$cache->store($data);
|
$cache->store($data);
|
||||||
|
|
||||||
return Response::json($data);
|
return response()->json($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -172,7 +171,7 @@ class AccountController extends Controller
|
|||||||
$cache->addProperty($end);
|
$cache->addProperty($end);
|
||||||
$cache->addProperty('chart.account.expense-category');
|
$cache->addProperty('chart.account.expense-category');
|
||||||
if ($cache->has()) {
|
if ($cache->has()) {
|
||||||
return Response::json($cache->get()); // @codeCoverageIgnore
|
return response()->json($cache->get()); // @codeCoverageIgnore
|
||||||
}
|
}
|
||||||
|
|
||||||
$collector = app(JournalCollectorInterface::class);
|
$collector = app(JournalCollectorInterface::class);
|
||||||
@@ -197,7 +196,7 @@ class AccountController extends Controller
|
|||||||
$data = $this->generator->pieChart($chartData);
|
$data = $this->generator->pieChart($chartData);
|
||||||
$cache->store($data);
|
$cache->store($data);
|
||||||
|
|
||||||
return Response::json($data);
|
return response()->json($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -236,7 +235,7 @@ class AccountController extends Controller
|
|||||||
}
|
}
|
||||||
$accounts = $repository->getAccountsById($frontPage->data);
|
$accounts = $repository->getAccountsById($frontPage->data);
|
||||||
|
|
||||||
return Response::json($this->accountBalanceChart($accounts, $start, $end));
|
return response()->json($this->accountBalanceChart($accounts, $start, $end));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -254,7 +253,7 @@ class AccountController extends Controller
|
|||||||
$cache->addProperty($end);
|
$cache->addProperty($end);
|
||||||
$cache->addProperty('chart.account.income-category');
|
$cache->addProperty('chart.account.income-category');
|
||||||
if ($cache->has()) {
|
if ($cache->has()) {
|
||||||
return Response::json($cache->get()); // @codeCoverageIgnore
|
return response()->json($cache->get()); // @codeCoverageIgnore
|
||||||
}
|
}
|
||||||
|
|
||||||
// grab all journals:
|
// grab all journals:
|
||||||
@@ -279,7 +278,7 @@ class AccountController extends Controller
|
|||||||
$data = $this->generator->pieChart($chartData);
|
$data = $this->generator->pieChart($chartData);
|
||||||
$cache->store($data);
|
$cache->store($data);
|
||||||
|
|
||||||
return Response::json($data);
|
return response()->json($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -310,7 +309,7 @@ class AccountController extends Controller
|
|||||||
$cache->addProperty($end);
|
$cache->addProperty($end);
|
||||||
$cache->addProperty($account->id);
|
$cache->addProperty($account->id);
|
||||||
if ($cache->has()) {
|
if ($cache->has()) {
|
||||||
return Response::json($cache->get()); // @codeCoverageIgnore
|
return response()->json($cache->get()); // @codeCoverageIgnore
|
||||||
}
|
}
|
||||||
// depending on diff, do something with range of chart.
|
// depending on diff, do something with range of chart.
|
||||||
$step = '1D';
|
$step = '1D';
|
||||||
@@ -356,7 +355,7 @@ class AccountController extends Controller
|
|||||||
$data = $this->generator->singleSet($account->name, $chartData);
|
$data = $this->generator->singleSet($account->name, $chartData);
|
||||||
$cache->store($data);
|
$cache->store($data);
|
||||||
|
|
||||||
return Response::json($data);
|
return response()->json($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -370,7 +369,7 @@ class AccountController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function report(Collection $accounts, Carbon $start, Carbon $end)
|
public function report(Collection $accounts, Carbon $start, Carbon $end)
|
||||||
{
|
{
|
||||||
return Response::json($this->accountBalanceChart($accounts, $start, $end));
|
return response()->json($this->accountBalanceChart($accounts, $start, $end));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -390,7 +389,7 @@ class AccountController extends Controller
|
|||||||
$cache->addProperty($end);
|
$cache->addProperty($end);
|
||||||
$cache->addProperty('chart.account.revenue-accounts');
|
$cache->addProperty('chart.account.revenue-accounts');
|
||||||
if ($cache->has()) {
|
if ($cache->has()) {
|
||||||
return Response::json($cache->get()); // @codeCoverageIgnore
|
return response()->json($cache->get()); // @codeCoverageIgnore
|
||||||
}
|
}
|
||||||
$accounts = $repository->getAccountsByType([AccountType::REVENUE]);
|
$accounts = $repository->getAccountsByType([AccountType::REVENUE]);
|
||||||
|
|
||||||
@@ -413,7 +412,7 @@ class AccountController extends Controller
|
|||||||
$data = $this->generator->singleSet(strval(trans('firefly.earned')), $chartData);
|
$data = $this->generator->singleSet(strval(trans('firefly.earned')), $chartData);
|
||||||
$cache->store($data);
|
$cache->store($data);
|
||||||
|
|
||||||
return Response::json($data);
|
return response()->json($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -31,7 +31,6 @@ use FireflyIII\Models\Transaction;
|
|||||||
use FireflyIII\Repositories\Bill\BillRepositoryInterface;
|
use FireflyIII\Repositories\Bill\BillRepositoryInterface;
|
||||||
use FireflyIII\Support\CacheProperties;
|
use FireflyIII\Support\CacheProperties;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
use Response;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class BillController.
|
* Class BillController.
|
||||||
@@ -66,7 +65,7 @@ class BillController extends Controller
|
|||||||
$cache->addProperty($end);
|
$cache->addProperty($end);
|
||||||
$cache->addProperty('chart.bill.frontpage');
|
$cache->addProperty('chart.bill.frontpage');
|
||||||
if ($cache->has()) {
|
if ($cache->has()) {
|
||||||
return Response::json($cache->get()); // @codeCoverageIgnore
|
return response()->json($cache->get()); // @codeCoverageIgnore
|
||||||
}
|
}
|
||||||
|
|
||||||
$paid = $repository->getBillsPaidInRange($start, $end); // will be a negative amount.
|
$paid = $repository->getBillsPaidInRange($start, $end); // will be a negative amount.
|
||||||
@@ -79,7 +78,7 @@ class BillController extends Controller
|
|||||||
$data = $this->generator->pieChart($chartData);
|
$data = $this->generator->pieChart($chartData);
|
||||||
$cache->store($data);
|
$cache->store($data);
|
||||||
|
|
||||||
return Response::json($data);
|
return response()->json($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -94,7 +93,7 @@ class BillController extends Controller
|
|||||||
$cache->addProperty('chart.bill.single');
|
$cache->addProperty('chart.bill.single');
|
||||||
$cache->addProperty($bill->id);
|
$cache->addProperty($bill->id);
|
||||||
if ($cache->has()) {
|
if ($cache->has()) {
|
||||||
return Response::json($cache->get()); // @codeCoverageIgnore
|
return response()->json($cache->get()); // @codeCoverageIgnore
|
||||||
}
|
}
|
||||||
|
|
||||||
$results = $collector->setAllAssetAccounts()->setBills(new Collection([$bill]))->getJournals();
|
$results = $collector->setAllAssetAccounts()->setBills(new Collection([$bill]))->getJournals();
|
||||||
@@ -120,6 +119,6 @@ class BillController extends Controller
|
|||||||
$data = $this->generator->multiSet($chartData);
|
$data = $this->generator->multiSet($chartData);
|
||||||
$cache->store($data);
|
$cache->store($data);
|
||||||
|
|
||||||
return Response::json($data);
|
return response()->json($data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -37,7 +37,6 @@ use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
|
|||||||
use FireflyIII\Repositories\Category\CategoryRepositoryInterface;
|
use FireflyIII\Repositories\Category\CategoryRepositoryInterface;
|
||||||
use FireflyIII\Support\CacheProperties;
|
use FireflyIII\Support\CacheProperties;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
use Response;
|
|
||||||
use Steam;
|
use Steam;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -86,7 +85,7 @@ class BudgetController extends Controller
|
|||||||
$cache->addProperty($budget->id);
|
$cache->addProperty($budget->id);
|
||||||
|
|
||||||
if ($cache->has()) {
|
if ($cache->has()) {
|
||||||
return Response::json($cache->get()); // @codeCoverageIgnore
|
return response()->json($cache->get()); // @codeCoverageIgnore
|
||||||
}
|
}
|
||||||
|
|
||||||
// depending on diff, do something with range of chart.
|
// depending on diff, do something with range of chart.
|
||||||
@@ -122,7 +121,7 @@ class BudgetController extends Controller
|
|||||||
|
|
||||||
$cache->store($data);
|
$cache->store($data);
|
||||||
|
|
||||||
return Response::json($data);
|
return response()->json($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -153,7 +152,7 @@ class BudgetController extends Controller
|
|||||||
$cache->addProperty($budget->id);
|
$cache->addProperty($budget->id);
|
||||||
|
|
||||||
if ($cache->has()) {
|
if ($cache->has()) {
|
||||||
return Response::json($cache->get()); // @codeCoverageIgnore
|
return response()->json($cache->get()); // @codeCoverageIgnore
|
||||||
}
|
}
|
||||||
|
|
||||||
$entries = [];
|
$entries = [];
|
||||||
@@ -170,7 +169,7 @@ class BudgetController extends Controller
|
|||||||
$data = $this->generator->singleSet(strval(trans('firefly.left')), $entries);
|
$data = $this->generator->singleSet(strval(trans('firefly.left')), $entries);
|
||||||
$cache->store($data);
|
$cache->store($data);
|
||||||
|
|
||||||
return Response::json($data);
|
return response()->json($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -186,7 +185,7 @@ class BudgetController extends Controller
|
|||||||
$cache->addProperty($budgetLimit->id ?? 0);
|
$cache->addProperty($budgetLimit->id ?? 0);
|
||||||
$cache->addProperty('chart.budget.expense-asset');
|
$cache->addProperty('chart.budget.expense-asset');
|
||||||
if ($cache->has()) {
|
if ($cache->has()) {
|
||||||
return Response::json($cache->get()); // @codeCoverageIgnore
|
return response()->json($cache->get()); // @codeCoverageIgnore
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @var JournalCollectorInterface $collector */
|
/** @var JournalCollectorInterface $collector */
|
||||||
@@ -214,7 +213,7 @@ class BudgetController extends Controller
|
|||||||
$data = $this->generator->pieChart($chartData);
|
$data = $this->generator->pieChart($chartData);
|
||||||
$cache->store($data);
|
$cache->store($data);
|
||||||
|
|
||||||
return Response::json($data);
|
return response()->json($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -230,7 +229,7 @@ class BudgetController extends Controller
|
|||||||
$cache->addProperty($budgetLimit->id ?? 0);
|
$cache->addProperty($budgetLimit->id ?? 0);
|
||||||
$cache->addProperty('chart.budget.expense-category');
|
$cache->addProperty('chart.budget.expense-category');
|
||||||
if ($cache->has()) {
|
if ($cache->has()) {
|
||||||
return Response::json($cache->get()); // @codeCoverageIgnore
|
return response()->json($cache->get()); // @codeCoverageIgnore
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @var JournalCollectorInterface $collector */
|
/** @var JournalCollectorInterface $collector */
|
||||||
@@ -260,7 +259,7 @@ class BudgetController extends Controller
|
|||||||
$data = $this->generator->pieChart($chartData);
|
$data = $this->generator->pieChart($chartData);
|
||||||
$cache->store($data);
|
$cache->store($data);
|
||||||
|
|
||||||
return Response::json($data);
|
return response()->json($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -276,7 +275,7 @@ class BudgetController extends Controller
|
|||||||
$cache->addProperty($budgetLimit->id ?? 0);
|
$cache->addProperty($budgetLimit->id ?? 0);
|
||||||
$cache->addProperty('chart.budget.expense-expense');
|
$cache->addProperty('chart.budget.expense-expense');
|
||||||
if ($cache->has()) {
|
if ($cache->has()) {
|
||||||
return Response::json($cache->get()); // @codeCoverageIgnore
|
return response()->json($cache->get()); // @codeCoverageIgnore
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @var JournalCollectorInterface $collector */
|
/** @var JournalCollectorInterface $collector */
|
||||||
@@ -305,7 +304,7 @@ class BudgetController extends Controller
|
|||||||
$data = $this->generator->pieChart($chartData);
|
$data = $this->generator->pieChart($chartData);
|
||||||
$cache->store($data);
|
$cache->store($data);
|
||||||
|
|
||||||
return Response::json($data);
|
return response()->json($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -326,7 +325,7 @@ class BudgetController extends Controller
|
|||||||
$cache->addProperty($end);
|
$cache->addProperty($end);
|
||||||
$cache->addProperty('chart.budget.frontpage');
|
$cache->addProperty('chart.budget.frontpage');
|
||||||
if ($cache->has()) {
|
if ($cache->has()) {
|
||||||
return Response::json($cache->get()); // @codeCoverageIgnore
|
return response()->json($cache->get()); // @codeCoverageIgnore
|
||||||
}
|
}
|
||||||
$budgets = $this->repository->getActiveBudgets();
|
$budgets = $this->repository->getActiveBudgets();
|
||||||
$chartData = [
|
$chartData = [
|
||||||
@@ -359,7 +358,7 @@ class BudgetController extends Controller
|
|||||||
$data = $this->generator->multiSet($chartData);
|
$data = $this->generator->multiSet($chartData);
|
||||||
$cache->store($data);
|
$cache->store($data);
|
||||||
|
|
||||||
return Response::json($data);
|
return response()->json($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -382,7 +381,7 @@ class BudgetController extends Controller
|
|||||||
$cache->addProperty($budget->id);
|
$cache->addProperty($budget->id);
|
||||||
$cache->addProperty('chart.budget.period');
|
$cache->addProperty('chart.budget.period');
|
||||||
if ($cache->has()) {
|
if ($cache->has()) {
|
||||||
return Response::json($cache->get()); // @codeCoverageIgnore
|
return response()->json($cache->get()); // @codeCoverageIgnore
|
||||||
}
|
}
|
||||||
$periods = app('navigation')->listOfPeriods($start, $end);
|
$periods = app('navigation')->listOfPeriods($start, $end);
|
||||||
$entries = $this->repository->getBudgetPeriodReport(new Collection([$budget]), $accounts, $start, $end); // get the expenses
|
$entries = $this->repository->getBudgetPeriodReport(new Collection([$budget]), $accounts, $start, $end); // get the expenses
|
||||||
@@ -404,7 +403,7 @@ class BudgetController extends Controller
|
|||||||
$data = $this->generator->multiSet($chartData);
|
$data = $this->generator->multiSet($chartData);
|
||||||
$cache->store($data);
|
$cache->store($data);
|
||||||
|
|
||||||
return Response::json($data);
|
return response()->json($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -423,7 +422,7 @@ class BudgetController extends Controller
|
|||||||
$cache->addProperty($accounts);
|
$cache->addProperty($accounts);
|
||||||
$cache->addProperty('chart.budget.no-budget');
|
$cache->addProperty('chart.budget.no-budget');
|
||||||
if ($cache->has()) {
|
if ($cache->has()) {
|
||||||
return Response::json($cache->get()); // @codeCoverageIgnore
|
return response()->json($cache->get()); // @codeCoverageIgnore
|
||||||
}
|
}
|
||||||
|
|
||||||
// the expenses:
|
// the expenses:
|
||||||
@@ -440,7 +439,7 @@ class BudgetController extends Controller
|
|||||||
$data = $this->generator->singleSet(strval(trans('firefly.spent')), $chartData);
|
$data = $this->generator->singleSet(strval(trans('firefly.spent')), $chartData);
|
||||||
$cache->store($data);
|
$cache->store($data);
|
||||||
|
|
||||||
return Response::json($data);
|
return response()->json($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -37,7 +37,6 @@ use FireflyIII\Models\TransactionType;
|
|||||||
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
|
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
|
||||||
use FireflyIII\Support\CacheProperties;
|
use FireflyIII\Support\CacheProperties;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
use Response;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Separate controller because many helper functions are shared.
|
* Separate controller because many helper functions are shared.
|
||||||
@@ -88,7 +87,7 @@ class BudgetReportController extends Controller
|
|||||||
$chartData = $helper->generate('expense', 'account');
|
$chartData = $helper->generate('expense', 'account');
|
||||||
$data = $this->generator->pieChart($chartData);
|
$data = $this->generator->pieChart($chartData);
|
||||||
|
|
||||||
return Response::json($data);
|
return response()->json($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -112,7 +111,7 @@ class BudgetReportController extends Controller
|
|||||||
$chartData = $helper->generate('expense', 'budget');
|
$chartData = $helper->generate('expense', 'budget');
|
||||||
$data = $this->generator->pieChart($chartData);
|
$data = $this->generator->pieChart($chartData);
|
||||||
|
|
||||||
return Response::json($data);
|
return response()->json($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -132,7 +131,7 @@ class BudgetReportController extends Controller
|
|||||||
$cache->addProperty($start);
|
$cache->addProperty($start);
|
||||||
$cache->addProperty($end);
|
$cache->addProperty($end);
|
||||||
if ($cache->has()) {
|
if ($cache->has()) {
|
||||||
return Response::json($cache->get()); // @codeCoverageIgnore
|
return response()->json($cache->get()); // @codeCoverageIgnore
|
||||||
}
|
}
|
||||||
$format = app('navigation')->preferredCarbonLocalizedFormat($start, $end);
|
$format = app('navigation')->preferredCarbonLocalizedFormat($start, $end);
|
||||||
$function = app('navigation')->preferredEndOfPeriod($start, $end);
|
$function = app('navigation')->preferredEndOfPeriod($start, $end);
|
||||||
@@ -195,7 +194,7 @@ class BudgetReportController extends Controller
|
|||||||
$data = $this->generator->multiSet($chartData);
|
$data = $this->generator->multiSet($chartData);
|
||||||
$cache->store($data);
|
$cache->store($data);
|
||||||
|
|
||||||
return Response::json($data);
|
return response()->json($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -32,7 +32,6 @@ use FireflyIII\Repositories\Category\CategoryRepositoryInterface;
|
|||||||
use FireflyIII\Support\CacheProperties;
|
use FireflyIII\Support\CacheProperties;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
use Preferences;
|
use Preferences;
|
||||||
use Response;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class CategoryController.
|
* Class CategoryController.
|
||||||
@@ -67,7 +66,7 @@ class CategoryController extends Controller
|
|||||||
$cache->addProperty('chart.category.all');
|
$cache->addProperty('chart.category.all');
|
||||||
$cache->addProperty($category->id);
|
$cache->addProperty($category->id);
|
||||||
if ($cache->has()) {
|
if ($cache->has()) {
|
||||||
return Response::json($cache->get()); // @codeCoverageIgnore
|
return response()->json($cache->get()); // @codeCoverageIgnore
|
||||||
}
|
}
|
||||||
|
|
||||||
$start = $repository->firstUseDate($category);
|
$start = $repository->firstUseDate($category);
|
||||||
@@ -114,7 +113,7 @@ class CategoryController extends Controller
|
|||||||
$data = $this->generator->multiSet($chartData);
|
$data = $this->generator->multiSet($chartData);
|
||||||
$cache->store($data);
|
$cache->store($data);
|
||||||
|
|
||||||
return Response::json($data);
|
return response()->json($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -133,7 +132,7 @@ class CategoryController extends Controller
|
|||||||
$cache->addProperty($end);
|
$cache->addProperty($end);
|
||||||
$cache->addProperty('chart.category.frontpage');
|
$cache->addProperty('chart.category.frontpage');
|
||||||
if ($cache->has()) {
|
if ($cache->has()) {
|
||||||
return Response::json($cache->get()); // @codeCoverageIgnore
|
return response()->json($cache->get()); // @codeCoverageIgnore
|
||||||
}
|
}
|
||||||
$chartData = [];
|
$chartData = [];
|
||||||
$categories = $repository->getCategories();
|
$categories = $repository->getCategories();
|
||||||
@@ -154,7 +153,7 @@ class CategoryController extends Controller
|
|||||||
$data = $this->generator->singleSet(strval(trans('firefly.spent')), $chartData);
|
$data = $this->generator->singleSet(strval(trans('firefly.spent')), $chartData);
|
||||||
$cache->store($data);
|
$cache->store($data);
|
||||||
|
|
||||||
return Response::json($data);
|
return response()->json($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -212,7 +211,7 @@ class CategoryController extends Controller
|
|||||||
$data = $this->generator->multiSet($chartData);
|
$data = $this->generator->multiSet($chartData);
|
||||||
$cache->store($data);
|
$cache->store($data);
|
||||||
|
|
||||||
return Response::json($data);
|
return response()->json($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -267,7 +266,7 @@ class CategoryController extends Controller
|
|||||||
$data = $this->generator->multiSet($chartData);
|
$data = $this->generator->multiSet($chartData);
|
||||||
$cache->store($data);
|
$cache->store($data);
|
||||||
|
|
||||||
return Response::json($data);
|
return response()->json($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -284,7 +283,7 @@ class CategoryController extends Controller
|
|||||||
$end = app('navigation')->endOfPeriod($date, $range);
|
$end = app('navigation')->endOfPeriod($date, $range);
|
||||||
$data = $this->makePeriodChart($repository, $category, $start, $end);
|
$data = $this->makePeriodChart($repository, $category, $start, $end);
|
||||||
|
|
||||||
return Response::json($data);
|
return response()->json($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -36,7 +36,6 @@ use FireflyIII\Models\Transaction;
|
|||||||
use FireflyIII\Models\TransactionType;
|
use FireflyIII\Models\TransactionType;
|
||||||
use FireflyIII\Support\CacheProperties;
|
use FireflyIII\Support\CacheProperties;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
use Response;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Separate controller because many helper functions are shared.
|
* Separate controller because many helper functions are shared.
|
||||||
@@ -81,7 +80,7 @@ class CategoryReportController extends Controller
|
|||||||
$chartData = $helper->generate('expense', 'account');
|
$chartData = $helper->generate('expense', 'account');
|
||||||
$data = $this->generator->pieChart($chartData);
|
$data = $this->generator->pieChart($chartData);
|
||||||
|
|
||||||
return Response::json($data);
|
return response()->json($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -105,7 +104,7 @@ class CategoryReportController extends Controller
|
|||||||
$chartData = $helper->generate('income', 'account');
|
$chartData = $helper->generate('income', 'account');
|
||||||
$data = $this->generator->pieChart($chartData);
|
$data = $this->generator->pieChart($chartData);
|
||||||
|
|
||||||
return Response::json($data);
|
return response()->json($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -129,7 +128,7 @@ class CategoryReportController extends Controller
|
|||||||
$chartData = $helper->generate('expense', 'category');
|
$chartData = $helper->generate('expense', 'category');
|
||||||
$data = $this->generator->pieChart($chartData);
|
$data = $this->generator->pieChart($chartData);
|
||||||
|
|
||||||
return Response::json($data);
|
return response()->json($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -153,7 +152,7 @@ class CategoryReportController extends Controller
|
|||||||
$chartData = $helper->generate('income', 'category');
|
$chartData = $helper->generate('income', 'category');
|
||||||
$data = $this->generator->pieChart($chartData);
|
$data = $this->generator->pieChart($chartData);
|
||||||
|
|
||||||
return Response::json($data);
|
return response()->json($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -173,7 +172,7 @@ class CategoryReportController extends Controller
|
|||||||
$cache->addProperty($start);
|
$cache->addProperty($start);
|
||||||
$cache->addProperty($end);
|
$cache->addProperty($end);
|
||||||
if ($cache->has()) {
|
if ($cache->has()) {
|
||||||
return Response::json($cache->get()); // @codeCoverageIgnore
|
return response()->json($cache->get()); // @codeCoverageIgnore
|
||||||
}
|
}
|
||||||
|
|
||||||
$format = app('navigation')->preferredCarbonLocalizedFormat($start, $end);
|
$format = app('navigation')->preferredCarbonLocalizedFormat($start, $end);
|
||||||
@@ -258,7 +257,7 @@ class CategoryReportController extends Controller
|
|||||||
$data = $this->generator->multiSet($newSet);
|
$data = $this->generator->multiSet($newSet);
|
||||||
$cache->store($data);
|
$cache->store($data);
|
||||||
|
|
||||||
return Response::json($data);
|
return response()->json($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -33,7 +33,6 @@ use FireflyIII\Models\TransactionType;
|
|||||||
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
||||||
use FireflyIII\Support\CacheProperties;
|
use FireflyIII\Support\CacheProperties;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
use Response;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Separate controller because many helper functions are shared.
|
* Separate controller because many helper functions are shared.
|
||||||
@@ -80,7 +79,7 @@ class ExpenseReportController extends Controller
|
|||||||
$cache->addProperty($start);
|
$cache->addProperty($start);
|
||||||
$cache->addProperty($end);
|
$cache->addProperty($end);
|
||||||
if ($cache->has()) {
|
if ($cache->has()) {
|
||||||
return Response::json($cache->get()); // @codeCoverageIgnore
|
return response()->json($cache->get()); // @codeCoverageIgnore
|
||||||
}
|
}
|
||||||
|
|
||||||
$format = app('navigation')->preferredCarbonLocalizedFormat($start, $end);
|
$format = app('navigation')->preferredCarbonLocalizedFormat($start, $end);
|
||||||
@@ -180,7 +179,7 @@ class ExpenseReportController extends Controller
|
|||||||
$data = $this->generator->multiSet($newSet);
|
$data = $this->generator->multiSet($newSet);
|
||||||
$cache->store($data);
|
$cache->store($data);
|
||||||
|
|
||||||
return Response::json($data);
|
return response()->json($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -28,7 +28,6 @@ use FireflyIII\Models\PiggyBank;
|
|||||||
use FireflyIII\Models\PiggyBankEvent;
|
use FireflyIII\Models\PiggyBankEvent;
|
||||||
use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface;
|
use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface;
|
||||||
use FireflyIII\Support\CacheProperties;
|
use FireflyIII\Support\CacheProperties;
|
||||||
use Response;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class PiggyBankController.
|
* Class PiggyBankController.
|
||||||
@@ -63,7 +62,7 @@ class PiggyBankController extends Controller
|
|||||||
$cache->addProperty('chart.piggy-bank.history');
|
$cache->addProperty('chart.piggy-bank.history');
|
||||||
$cache->addProperty($piggyBank->id);
|
$cache->addProperty($piggyBank->id);
|
||||||
if ($cache->has()) {
|
if ($cache->has()) {
|
||||||
return Response::json($cache->get()); // @codeCoverageIgnore
|
return response()->json($cache->get()); // @codeCoverageIgnore
|
||||||
}
|
}
|
||||||
|
|
||||||
$set = $repository->getEvents($piggyBank);
|
$set = $repository->getEvents($piggyBank);
|
||||||
@@ -80,6 +79,6 @@ class PiggyBankController extends Controller
|
|||||||
$data = $this->generator->singleSet($piggyBank->name, $chartData);
|
$data = $this->generator->singleSet($piggyBank->name, $chartData);
|
||||||
$cache->store($data);
|
$cache->store($data);
|
||||||
|
|
||||||
return Response::json($data);
|
return response()->json($data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -29,7 +29,6 @@ use FireflyIII\Repositories\Account\AccountTaskerInterface;
|
|||||||
use FireflyIII\Support\CacheProperties;
|
use FireflyIII\Support\CacheProperties;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
use Log;
|
use Log;
|
||||||
use Response;
|
|
||||||
use Steam;
|
use Steam;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -69,7 +68,7 @@ class ReportController extends Controller
|
|||||||
$cache->addProperty($accounts);
|
$cache->addProperty($accounts);
|
||||||
$cache->addProperty($end);
|
$cache->addProperty($end);
|
||||||
if ($cache->has()) {
|
if ($cache->has()) {
|
||||||
return Response::json($cache->get()); // @codeCoverageIgnore
|
return response()->json($cache->get()); // @codeCoverageIgnore
|
||||||
}
|
}
|
||||||
$current = clone $start;
|
$current = clone $start;
|
||||||
$chartData = [];
|
$chartData = [];
|
||||||
@@ -84,7 +83,7 @@ class ReportController extends Controller
|
|||||||
$data = $this->generator->singleSet(strval(trans('firefly.net_worth')), $chartData);
|
$data = $this->generator->singleSet(strval(trans('firefly.net_worth')), $chartData);
|
||||||
$cache->store($data);
|
$cache->store($data);
|
||||||
|
|
||||||
return Response::json($data);
|
return response()->json($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -105,7 +104,7 @@ class ReportController extends Controller
|
|||||||
$cache->addProperty($accounts);
|
$cache->addProperty($accounts);
|
||||||
$cache->addProperty($end);
|
$cache->addProperty($end);
|
||||||
if ($cache->has()) {
|
if ($cache->has()) {
|
||||||
return Response::json($cache->get()); // @codeCoverageIgnore
|
return response()->json($cache->get()); // @codeCoverageIgnore
|
||||||
}
|
}
|
||||||
Log::debug('Going to do operations for accounts ', $accounts->pluck('id')->toArray());
|
Log::debug('Going to do operations for accounts ', $accounts->pluck('id')->toArray());
|
||||||
$format = app('navigation')->preferredCarbonLocalizedFormat($start, $end);
|
$format = app('navigation')->preferredCarbonLocalizedFormat($start, $end);
|
||||||
@@ -139,7 +138,7 @@ class ReportController extends Controller
|
|||||||
$data = $this->generator->multiSet($chartData);
|
$data = $this->generator->multiSet($chartData);
|
||||||
$cache->store($data);
|
$cache->store($data);
|
||||||
|
|
||||||
return Response::json($data);
|
return response()->json($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -160,7 +159,7 @@ class ReportController extends Controller
|
|||||||
$cache->addProperty($end);
|
$cache->addProperty($end);
|
||||||
$cache->addProperty($accounts);
|
$cache->addProperty($accounts);
|
||||||
if ($cache->has()) {
|
if ($cache->has()) {
|
||||||
return Response::json($cache->get()); // @codeCoverageIgnore
|
return response()->json($cache->get()); // @codeCoverageIgnore
|
||||||
}
|
}
|
||||||
|
|
||||||
$source = $this->getChartData($accounts, $start, $end);
|
$source = $this->getChartData($accounts, $start, $end);
|
||||||
@@ -209,7 +208,7 @@ class ReportController extends Controller
|
|||||||
$data = $this->generator->multiSet($chartData);
|
$data = $this->generator->multiSet($chartData);
|
||||||
$cache->store($data);
|
$cache->store($data);
|
||||||
|
|
||||||
return Response::json($data);
|
return response()->json($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -36,7 +36,6 @@ use FireflyIII\Models\Transaction;
|
|||||||
use FireflyIII\Models\TransactionType;
|
use FireflyIII\Models\TransactionType;
|
||||||
use FireflyIII\Support\CacheProperties;
|
use FireflyIII\Support\CacheProperties;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
use Response;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class TagReportController
|
* Class TagReportController
|
||||||
@@ -77,7 +76,7 @@ class TagReportController extends Controller
|
|||||||
$chartData = $helper->generate('expense', 'account');
|
$chartData = $helper->generate('expense', 'account');
|
||||||
$data = $this->generator->pieChart($chartData);
|
$data = $this->generator->pieChart($chartData);
|
||||||
|
|
||||||
return Response::json($data);
|
return response()->json($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -101,7 +100,7 @@ class TagReportController extends Controller
|
|||||||
$chartData = $helper->generate('income', 'account');
|
$chartData = $helper->generate('income', 'account');
|
||||||
$data = $this->generator->pieChart($chartData);
|
$data = $this->generator->pieChart($chartData);
|
||||||
|
|
||||||
return Response::json($data);
|
return response()->json($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -124,7 +123,7 @@ class TagReportController extends Controller
|
|||||||
$chartData = $helper->generate('expense', 'budget');
|
$chartData = $helper->generate('expense', 'budget');
|
||||||
$data = $this->generator->pieChart($chartData);
|
$data = $this->generator->pieChart($chartData);
|
||||||
|
|
||||||
return Response::json($data);
|
return response()->json($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -147,7 +146,7 @@ class TagReportController extends Controller
|
|||||||
$chartData = $helper->generate('expense', 'category');
|
$chartData = $helper->generate('expense', 'category');
|
||||||
$data = $this->generator->pieChart($chartData);
|
$data = $this->generator->pieChart($chartData);
|
||||||
|
|
||||||
return Response::json($data);
|
return response()->json($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -167,7 +166,7 @@ class TagReportController extends Controller
|
|||||||
$cache->addProperty($start);
|
$cache->addProperty($start);
|
||||||
$cache->addProperty($end);
|
$cache->addProperty($end);
|
||||||
if ($cache->has()) {
|
if ($cache->has()) {
|
||||||
return Response::json($cache->get()); // @codeCoverageIgnore
|
return response()->json($cache->get()); // @codeCoverageIgnore
|
||||||
}
|
}
|
||||||
|
|
||||||
$format = app('navigation')->preferredCarbonLocalizedFormat($start, $end);
|
$format = app('navigation')->preferredCarbonLocalizedFormat($start, $end);
|
||||||
@@ -252,7 +251,7 @@ class TagReportController extends Controller
|
|||||||
$data = $this->generator->multiSet($newSet);
|
$data = $this->generator->multiSet($newSet);
|
||||||
$cache->store($data);
|
$cache->store($data);
|
||||||
|
|
||||||
return Response::json($data);
|
return response()->json($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -276,7 +275,7 @@ class TagReportController extends Controller
|
|||||||
$chartData = $helper->generate('expense', 'tag');
|
$chartData = $helper->generate('expense', 'tag');
|
||||||
$data = $this->generator->pieChart($chartData);
|
$data = $this->generator->pieChart($chartData);
|
||||||
|
|
||||||
return Response::json($data);
|
return response()->json($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -300,7 +299,7 @@ class TagReportController extends Controller
|
|||||||
$chartData = $helper->generate('income', 'tag');
|
$chartData = $helper->generate('income', 'tag');
|
||||||
$data = $this->generator->pieChart($chartData);
|
$data = $this->generator->pieChart($chartData);
|
||||||
|
|
||||||
return Response::json($data);
|
return response()->json($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -34,7 +34,6 @@ use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
|||||||
use FireflyIII\Repositories\ExportJob\ExportJobRepositoryInterface;
|
use FireflyIII\Repositories\ExportJob\ExportJobRepositoryInterface;
|
||||||
use Illuminate\Http\Response as LaravelResponse;
|
use Illuminate\Http\Response as LaravelResponse;
|
||||||
use Preferences;
|
use Preferences;
|
||||||
use Response;
|
|
||||||
use View;
|
use View;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -104,7 +103,7 @@ class ExportController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function getStatus(ExportJob $job)
|
public function getStatus(ExportJob $job)
|
||||||
{
|
{
|
||||||
return Response::json(['status' => trans('firefly.' . $job->status)]);
|
return response()->json(['status' => trans('firefly.' . $job->status)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -121,7 +120,8 @@ class ExportController extends Controller
|
|||||||
$jobs->cleanup();
|
$jobs->cleanup();
|
||||||
|
|
||||||
// does the user have shared accounts?
|
// does the user have shared accounts?
|
||||||
$accounts = $repository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET]);
|
$accounts = $repository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET]);
|
||||||
|
// todo could be removed?
|
||||||
$accountList = ExpandedForm::makeSelectList($accounts);
|
$accountList = ExpandedForm::makeSelectList($accounts);
|
||||||
$checked = array_keys($accountList);
|
$checked = array_keys($accountList);
|
||||||
$formats = array_keys(config('firefly.export_formats'));
|
$formats = array_keys(config('firefly.export_formats'));
|
||||||
@@ -193,6 +193,6 @@ class ExportController extends Controller
|
|||||||
$jobs->changeStatus($job, 'export_status_created_zip_file');
|
$jobs->changeStatus($job, 'export_status_created_zip_file');
|
||||||
$jobs->changeStatus($job, 'export_status_finished');
|
$jobs->changeStatus($job, 'export_status_finished');
|
||||||
|
|
||||||
return Response::json('ok');
|
return response()->json('ok');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -25,7 +25,6 @@ namespace FireflyIII\Http\Controllers;
|
|||||||
use FireflyIII\Helpers\Help\HelpInterface;
|
use FireflyIII\Helpers\Help\HelpInterface;
|
||||||
use Log;
|
use Log;
|
||||||
use Preferences;
|
use Preferences;
|
||||||
use Response;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class HelpController.
|
* Class HelpController.
|
||||||
@@ -61,7 +60,7 @@ class HelpController extends Controller
|
|||||||
$language = Preferences::get('language', config('firefly.default_language', 'en_US'))->data;
|
$language = Preferences::get('language', config('firefly.default_language', 'en_US'))->data;
|
||||||
$html = $this->getHelpText($route, $language);
|
$html = $this->getHelpText($route, $language);
|
||||||
|
|
||||||
return Response::json(['html' => $html]);
|
return response()->json(['html' => $html]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -38,7 +38,6 @@ use Illuminate\Routing\Route;
|
|||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
use Log;
|
use Log;
|
||||||
use Preferences;
|
use Preferences;
|
||||||
use Response;
|
|
||||||
use Route as RouteFacade;
|
use Route as RouteFacade;
|
||||||
use View;
|
use View;
|
||||||
|
|
||||||
@@ -93,7 +92,7 @@ class HomeController extends Controller
|
|||||||
$request->session()->put('end', $end);
|
$request->session()->put('end', $end);
|
||||||
Log::debug(sprintf('Set end to %s', $end->format('Y-m-d H:i:s')));
|
Log::debug(sprintf('Set end to %s', $end->format('Y-m-d H:i:s')));
|
||||||
|
|
||||||
return Response::json(['ok' => 'ok']);
|
return response()->json(['ok' => 'ok']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -30,7 +30,6 @@ use FireflyIII\Models\ImportJob;
|
|||||||
use FireflyIII\Repositories\ImportJob\ImportJobRepositoryInterface;
|
use FireflyIII\Repositories\ImportJob\ImportJobRepositoryInterface;
|
||||||
use Illuminate\Http\Response as LaravelResponse;
|
use Illuminate\Http\Response as LaravelResponse;
|
||||||
use Log;
|
use Log;
|
||||||
use Response;
|
|
||||||
use View;
|
use View;
|
||||||
|
|
||||||
|
|
||||||
@@ -155,7 +154,7 @@ class IndexController extends Controller
|
|||||||
$result = $routine->run();
|
$result = $routine->run();
|
||||||
|
|
||||||
if ($result) {
|
if ($result) {
|
||||||
return Response::json(['run' => 'ok']);
|
return response()->json(['run' => 'ok']);
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new FireflyException('Job did not complete successfully. Please review the log files.');
|
throw new FireflyException('Job did not complete successfully. Please review the log files.');
|
||||||
|
@@ -26,7 +26,6 @@ use FireflyIII\Http\Controllers\Controller;
|
|||||||
use FireflyIII\Http\Middleware\IsDemoUser;
|
use FireflyIII\Http\Middleware\IsDemoUser;
|
||||||
use FireflyIII\Models\ImportJob;
|
use FireflyIII\Models\ImportJob;
|
||||||
use FireflyIII\Repositories\Tag\TagRepositoryInterface;
|
use FireflyIII\Repositories\Tag\TagRepositoryInterface;
|
||||||
use Response;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class StatusController
|
* Class StatusController
|
||||||
@@ -119,6 +118,6 @@ class StatusController extends Controller
|
|||||||
}
|
}
|
||||||
$result['percentage'] = $result['percentage'] > 100 ? 100 : $result['percentage'];
|
$result['percentage'] = $result['percentage'] > 100 ? 100 : $result['percentage'];
|
||||||
|
|
||||||
return Response::json($result);
|
return response()->json($result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -29,7 +29,6 @@ use FireflyIII\Models\AccountType;
|
|||||||
use FireflyIII\Models\TransactionJournal;
|
use FireflyIII\Models\TransactionJournal;
|
||||||
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
||||||
use FireflyIII\Support\CacheProperties;
|
use FireflyIII\Support\CacheProperties;
|
||||||
use Response;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class AutoCompleteController.
|
* Class AutoCompleteController.
|
||||||
@@ -52,7 +51,7 @@ class AutoCompleteController extends Controller
|
|||||||
);
|
);
|
||||||
sort($return);
|
sort($return);
|
||||||
|
|
||||||
return Response::json($return);
|
return response()->json($return);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -66,7 +65,7 @@ class AutoCompleteController extends Controller
|
|||||||
$return = array_unique($collector->getJournals()->pluck('description')->toArray());
|
$return = array_unique($collector->getJournals()->pluck('description')->toArray());
|
||||||
sort($return);
|
sort($return);
|
||||||
|
|
||||||
return Response::json($return);
|
return response()->json($return);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -92,7 +91,7 @@ class AutoCompleteController extends Controller
|
|||||||
|
|
||||||
sort($return);
|
sort($return);
|
||||||
|
|
||||||
return Response::json($return);
|
return response()->json($return);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -125,7 +124,7 @@ class AutoCompleteController extends Controller
|
|||||||
|
|
||||||
$cache->store($return);
|
$cache->store($return);
|
||||||
|
|
||||||
return Response::json($return);
|
return response()->json($return);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -148,7 +147,7 @@ class AutoCompleteController extends Controller
|
|||||||
$return = array_unique($filtered->pluck('name')->toArray());
|
$return = array_unique($filtered->pluck('name')->toArray());
|
||||||
sort($return);
|
sort($return);
|
||||||
|
|
||||||
return Response::json($return);
|
return response()->json($return);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -166,6 +165,6 @@ class AutoCompleteController extends Controller
|
|||||||
$return = array_unique($collector->getJournals()->pluck('description')->toArray());
|
$return = array_unique($collector->getJournals()->pluck('description')->toArray());
|
||||||
sort($return);
|
sort($return);
|
||||||
|
|
||||||
return Response::json($return);
|
return response()->json($return);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -35,7 +35,6 @@ use FireflyIII\Repositories\Bill\BillRepositoryInterface;
|
|||||||
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
|
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
|
||||||
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
|
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
|
||||||
use FireflyIII\Support\CacheProperties;
|
use FireflyIII\Support\CacheProperties;
|
||||||
use Response;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class BoxController.
|
* Class BoxController.
|
||||||
@@ -58,7 +57,7 @@ class BoxController extends Controller
|
|||||||
$cache->addProperty($today);
|
$cache->addProperty($today);
|
||||||
$cache->addProperty('box-available');
|
$cache->addProperty('box-available');
|
||||||
if ($cache->has()) {
|
if ($cache->has()) {
|
||||||
return Response::json($cache->get()); // @codeCoverageIgnore
|
return response()->json($cache->get()); // @codeCoverageIgnore
|
||||||
}
|
}
|
||||||
// get available amount
|
// get available amount
|
||||||
$currency = app('amount')->getDefaultCurrency();
|
$currency = app('amount')->getDefaultCurrency();
|
||||||
@@ -86,7 +85,7 @@ class BoxController extends Controller
|
|||||||
|
|
||||||
$cache->store($return);
|
$cache->store($return);
|
||||||
|
|
||||||
return Response::json($return);
|
return response()->json($return);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -104,7 +103,7 @@ class BoxController extends Controller
|
|||||||
$cache->addProperty($end);
|
$cache->addProperty($end);
|
||||||
$cache->addProperty('box-balance');
|
$cache->addProperty('box-balance');
|
||||||
if ($cache->has()) {
|
if ($cache->has()) {
|
||||||
return Response::json($cache->get()); // @codeCoverageIgnore
|
return response()->json($cache->get()); // @codeCoverageIgnore
|
||||||
}
|
}
|
||||||
// prep some arrays:
|
// prep some arrays:
|
||||||
$incomes = [];
|
$incomes = [];
|
||||||
@@ -160,7 +159,7 @@ class BoxController extends Controller
|
|||||||
|
|
||||||
$cache->store($response);
|
$cache->store($response);
|
||||||
|
|
||||||
return Response::json($response);
|
return response()->json($response);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -178,7 +177,7 @@ class BoxController extends Controller
|
|||||||
$cache->addProperty($end);
|
$cache->addProperty($end);
|
||||||
$cache->addProperty('box-bills');
|
$cache->addProperty('box-bills');
|
||||||
if ($cache->has()) {
|
if ($cache->has()) {
|
||||||
return Response::json($cache->get()); // @codeCoverageIgnore
|
return response()->json($cache->get()); // @codeCoverageIgnore
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -195,7 +194,7 @@ class BoxController extends Controller
|
|||||||
];
|
];
|
||||||
$cache->store($return);
|
$cache->store($return);
|
||||||
|
|
||||||
return Response::json($return);
|
return response()->json($return);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -224,7 +223,7 @@ class BoxController extends Controller
|
|||||||
$cache->addProperty($date);
|
$cache->addProperty($date);
|
||||||
$cache->addProperty('box-net-worth');
|
$cache->addProperty('box-net-worth');
|
||||||
if ($cache->has()) {
|
if ($cache->has()) {
|
||||||
return Response::json($cache->get()); // @codeCoverageIgnore
|
return response()->json($cache->get()); // @codeCoverageIgnore
|
||||||
}
|
}
|
||||||
$netWorth = [];
|
$netWorth = [];
|
||||||
$accounts = $repository->getActiveAccountsByType([AccountType::DEFAULT, AccountType::ASSET]);
|
$accounts = $repository->getActiveAccountsByType([AccountType::DEFAULT, AccountType::ASSET]);
|
||||||
@@ -256,6 +255,6 @@ class BoxController extends Controller
|
|||||||
|
|
||||||
$cache->store($return);
|
$cache->store($return);
|
||||||
|
|
||||||
return Response::json($return);
|
return response()->json($return);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -29,7 +29,6 @@ use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
|
|||||||
use FireflyIII\Services\Currency\ExchangeRateInterface;
|
use FireflyIII\Services\Currency\ExchangeRateInterface;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Log;
|
use Log;
|
||||||
use Response;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class ExchangeController.
|
* Class ExchangeController.
|
||||||
@@ -67,6 +66,6 @@ class ExchangeController extends Controller
|
|||||||
$return['amount'] = round($return['amount'], $toCurrency->decimal_places);
|
$return['amount'] = round($return['amount'], $toCurrency->decimal_places);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Response::json($return);
|
return response()->json($return);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -25,7 +25,6 @@ namespace FireflyIII\Http\Controllers\Json;
|
|||||||
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;
|
||||||
use Response;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class FrontpageController.
|
* Class FrontpageController.
|
||||||
@@ -66,6 +65,6 @@ class FrontpageController extends Controller
|
|||||||
$html = view('json.piggy-banks', compact('info'))->render();
|
$html = view('json.piggy-banks', compact('info'))->render();
|
||||||
}
|
}
|
||||||
|
|
||||||
return Response::json(['html' => $html]);
|
return response()->json(['html' => $html]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -24,7 +24,6 @@ namespace FireflyIII\Http\Controllers\Json;
|
|||||||
|
|
||||||
use FireflyIII\Support\Facades\Preferences;
|
use FireflyIII\Support\Facades\Preferences;
|
||||||
use Log;
|
use Log;
|
||||||
use Response;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class IntroController.
|
* Class IntroController.
|
||||||
@@ -47,7 +46,7 @@ class IntroController
|
|||||||
if (0 === count($specificSteps)) {
|
if (0 === count($specificSteps)) {
|
||||||
Log::debug(sprintf('No specific steps for route "%s" and page "%s"', $route, $specificPage));
|
Log::debug(sprintf('No specific steps for route "%s" and page "%s"', $route, $specificPage));
|
||||||
|
|
||||||
return Response::json($steps);
|
return response()->json($steps);
|
||||||
}
|
}
|
||||||
if ($this->hasOutroStep($route)) {
|
if ($this->hasOutroStep($route)) {
|
||||||
// @codeCoverageIgnoreStart
|
// @codeCoverageIgnoreStart
|
||||||
@@ -64,7 +63,7 @@ class IntroController
|
|||||||
$steps = array_merge($steps, $specificSteps);
|
$steps = array_merge($steps, $specificSteps);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Response::json($steps);
|
return response()->json($steps);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -103,7 +102,7 @@ class IntroController
|
|||||||
Log::debug(sprintf('Going to mark the following route as NOT done: %s with special "%s" (%s)', $route, $specialPage, $key));
|
Log::debug(sprintf('Going to mark the following route as NOT done: %s with special "%s" (%s)', $route, $specialPage, $key));
|
||||||
Preferences::set($key, false);
|
Preferences::set($key, false);
|
||||||
|
|
||||||
return Response::json(['message' => trans('firefly.intro_boxes_after_refresh')]);
|
return response()->json(['message' => trans('firefly.intro_boxes_after_refresh')]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -121,7 +120,7 @@ class IntroController
|
|||||||
Log::debug(sprintf('Going to mark the following route as done: %s with special "%s" (%s)', $route, $specialPage, $key));
|
Log::debug(sprintf('Going to mark the following route as done: %s with special "%s" (%s)', $route, $specialPage, $key));
|
||||||
Preferences::set($key, true);
|
Preferences::set($key, true);
|
||||||
|
|
||||||
return Response::json(['result' => sprintf('Reported demo watched for route "%s".', $route)]);
|
return response()->json(['result' => sprintf('Reported demo watched for route "%s".', $route)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -27,7 +27,6 @@ use FireflyIII\Repositories\Category\CategoryRepositoryInterface;
|
|||||||
use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
|
use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
|
||||||
use FireflyIII\Repositories\Tag\TagRepositoryInterface;
|
use FireflyIII\Repositories\Tag\TagRepositoryInterface;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Response;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class JsonController.
|
* Class JsonController.
|
||||||
@@ -59,7 +58,7 @@ class JsonController extends Controller
|
|||||||
}
|
}
|
||||||
$view = view('rules.partials.action', compact('actions', 'count'))->render();
|
$view = view('rules.partials.action', compact('actions', 'count'))->render();
|
||||||
|
|
||||||
return Response::json(['html' => $view]);
|
return response()->json(['html' => $view]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -72,7 +71,7 @@ class JsonController extends Controller
|
|||||||
$return = array_unique($repository->getBudgets()->pluck('name')->toArray());
|
$return = array_unique($repository->getBudgets()->pluck('name')->toArray());
|
||||||
sort($return);
|
sort($return);
|
||||||
|
|
||||||
return Response::json($return);
|
return response()->json($return);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -87,7 +86,7 @@ class JsonController extends Controller
|
|||||||
$return = array_unique($repository->getCategories()->pluck('name')->toArray());
|
$return = array_unique($repository->getCategories()->pluck('name')->toArray());
|
||||||
sort($return);
|
sort($return);
|
||||||
|
|
||||||
return Response::json($return);
|
return response()->json($return);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -102,7 +101,7 @@ class JsonController extends Controller
|
|||||||
$return = array_unique($tagRepository->get()->pluck('tag')->toArray());
|
$return = array_unique($tagRepository->get()->pluck('tag')->toArray());
|
||||||
sort($return);
|
sort($return);
|
||||||
|
|
||||||
return Response::json($return);
|
return response()->json($return);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -115,7 +114,7 @@ class JsonController extends Controller
|
|||||||
$return = array_unique($repository->getTransactionTypes()->pluck('type')->toArray());
|
$return = array_unique($repository->getTransactionTypes()->pluck('type')->toArray());
|
||||||
sort($return);
|
sort($return);
|
||||||
|
|
||||||
return Response::json($return);
|
return response()->json($return);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -139,6 +138,6 @@ class JsonController extends Controller
|
|||||||
|
|
||||||
$view = view('rules.partials.trigger', compact('triggers', 'count'))->render();
|
$view = view('rules.partials.trigger', compact('triggers', 'count'))->render();
|
||||||
|
|
||||||
return Response::json(['html' => $view]);
|
return response()->json(['html' => $view]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -30,7 +30,6 @@ use Illuminate\Http\Request;
|
|||||||
use Illuminate\Pagination\LengthAwarePaginator;
|
use Illuminate\Pagination\LengthAwarePaginator;
|
||||||
use Log;
|
use Log;
|
||||||
use Preferences;
|
use Preferences;
|
||||||
use Response;
|
|
||||||
use Session;
|
use Session;
|
||||||
use Steam;
|
use Steam;
|
||||||
use View;
|
use View;
|
||||||
@@ -252,7 +251,7 @@ class PiggyBankController extends Controller
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return Response::json(['result' => 'ok']);
|
return response()->json(['result' => 'ok']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -34,7 +34,6 @@ use FireflyIII\Support\Binder\AccountList;
|
|||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Routing\Route;
|
use Illuminate\Routing\Route;
|
||||||
use InvalidArgumentException;
|
use InvalidArgumentException;
|
||||||
use Response;
|
|
||||||
use View;
|
use View;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -116,7 +115,7 @@ class ReportController extends Controller
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Response::json(['html' => $html]);
|
return response()->json(['html' => $html]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -36,7 +36,6 @@ use Illuminate\Http\RedirectResponse;
|
|||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
use Log;
|
use Log;
|
||||||
use Preferences;
|
use Preferences;
|
||||||
use Response;
|
|
||||||
use Session;
|
use Session;
|
||||||
use View;
|
use View;
|
||||||
|
|
||||||
@@ -305,7 +304,7 @@ class ReportController extends Controller
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Response::json(['html' => $result]);
|
return response()->json(['html' => $result]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -39,7 +39,6 @@ use FireflyIII\Repositories\RuleGroup\RuleGroupRepositoryInterface;
|
|||||||
use FireflyIII\TransactionRules\TransactionMatcher;
|
use FireflyIII\TransactionRules\TransactionMatcher;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Preferences;
|
use Preferences;
|
||||||
use Response;
|
|
||||||
use Session;
|
use Session;
|
||||||
use View;
|
use View;
|
||||||
|
|
||||||
@@ -287,7 +286,7 @@ class RuleController extends Controller
|
|||||||
$repository->reorderRuleActions($rule, $ids);
|
$repository->reorderRuleActions($rule, $ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Response::json('true');
|
return response()->json('true');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -304,7 +303,7 @@ class RuleController extends Controller
|
|||||||
$repository->reorderRuleTriggers($rule, $ids);
|
$repository->reorderRuleTriggers($rule, $ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Response::json('true');
|
return response()->json('true');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -373,7 +372,7 @@ class RuleController extends Controller
|
|||||||
$triggers = $this->getValidTriggerList($request);
|
$triggers = $this->getValidTriggerList($request);
|
||||||
|
|
||||||
if (0 === count($triggers)) {
|
if (0 === count($triggers)) {
|
||||||
return Response::json(['html' => '', 'warning' => trans('firefly.warning_no_valid_triggers')]); // @codeCoverageIgnore
|
return response()->json(['html' => '', 'warning' => trans('firefly.warning_no_valid_triggers')]); // @codeCoverageIgnore
|
||||||
}
|
}
|
||||||
|
|
||||||
$limit = intval(config('firefly.test-triggers.limit'));
|
$limit = intval(config('firefly.test-triggers.limit'));
|
||||||
@@ -398,7 +397,7 @@ class RuleController extends Controller
|
|||||||
// Return json response
|
// Return json response
|
||||||
$view = view('list.journals-tiny', ['transactions' => $matchingTransactions])->render();
|
$view = view('list.journals-tiny', ['transactions' => $matchingTransactions])->render();
|
||||||
|
|
||||||
return Response::json(['html' => $view, 'warning' => $warning]);
|
return response()->json(['html' => $view, 'warning' => $warning]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -421,7 +420,7 @@ class RuleController extends Controller
|
|||||||
$triggers = $rule->ruleTriggers;
|
$triggers = $rule->ruleTriggers;
|
||||||
|
|
||||||
if (0 === count($triggers)) {
|
if (0 === count($triggers)) {
|
||||||
return Response::json(['html' => '', 'warning' => trans('firefly.warning_no_valid_triggers')]); // @codeCoverageIgnore
|
return response()->json(['html' => '', 'warning' => trans('firefly.warning_no_valid_triggers')]); // @codeCoverageIgnore
|
||||||
}
|
}
|
||||||
|
|
||||||
$limit = intval(config('firefly.test-triggers.limit'));
|
$limit = intval(config('firefly.test-triggers.limit'));
|
||||||
@@ -446,7 +445,7 @@ class RuleController extends Controller
|
|||||||
// Return json response
|
// Return json response
|
||||||
$view = view('list.journals-tiny', ['transactions' => $matchingTransactions])->render();
|
$view = view('list.journals-tiny', ['transactions' => $matchingTransactions])->render();
|
||||||
|
|
||||||
return Response::json(['html' => $view, 'warning' => $warning]);
|
return response()->json(['html' => $view, 'warning' => $warning]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -26,7 +26,6 @@ use FireflyIII\Support\CacheProperties;
|
|||||||
use FireflyIII\Support\Search\SearchInterface;
|
use FireflyIII\Support\Search\SearchInterface;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
use Response;
|
|
||||||
use View;
|
use View;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -100,6 +99,6 @@ class SearchController extends Controller
|
|||||||
|
|
||||||
$html = view('search.search', compact('transactions'))->render();
|
$html = view('search.search', compact('transactions'))->render();
|
||||||
|
|
||||||
return Response::json(['count' => $transactions->count(), 'html' => $html]);
|
return response()->json(['count' => $transactions->count(), 'html' => $html]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -37,7 +37,6 @@ use Illuminate\Http\Request;
|
|||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
use Log;
|
use Log;
|
||||||
use Preferences;
|
use Preferences;
|
||||||
use Response;
|
|
||||||
use View;
|
use View;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -144,7 +143,7 @@ class TransactionController extends Controller
|
|||||||
$repository->reconcile($transaction);
|
$repository->reconcile($transaction);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Response::json(['ok' => 'reconciled']);
|
return response()->json(['ok' => 'reconciled']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -170,7 +169,7 @@ class TransactionController extends Controller
|
|||||||
}
|
}
|
||||||
Preferences::mark();
|
Preferences::mark();
|
||||||
|
|
||||||
return Response::json([true]);
|
return response()->json([true]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -26,7 +26,6 @@ use Closure;
|
|||||||
use FireflyIII\Exceptions\IsDemoUserException;
|
use FireflyIII\Exceptions\IsDemoUserException;
|
||||||
use FireflyIII\User;
|
use FireflyIII\User;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Session;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class IsDemoUser.
|
* Class IsDemoUser.
|
||||||
|
@@ -26,9 +26,7 @@ use App;
|
|||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use Closure;
|
use Closure;
|
||||||
use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
|
use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
|
||||||
use Illuminate\Contracts\Auth\Guard;
|
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\Auth;
|
|
||||||
use Preferences;
|
use Preferences;
|
||||||
use Session;
|
use Session;
|
||||||
use View;
|
use View;
|
||||||
|
@@ -22,8 +22,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace FireflyIII\Http\Requests;
|
namespace FireflyIII\Http\Requests;
|
||||||
|
|
||||||
use FireflyIII\Repositories\LinkType\LinkTypeRepositoryInterface;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class BillFormRequest.
|
* Class BillFormRequest.
|
||||||
*/
|
*/
|
||||||
@@ -44,8 +42,8 @@ class LinkTypeFormRequest extends Request
|
|||||||
public function rules()
|
public function rules()
|
||||||
{
|
{
|
||||||
// fixed
|
// fixed
|
||||||
$nameRule = 'required|min:1|unique:link_types,name';
|
$nameRule = 'required|min:1|unique:link_types,name';
|
||||||
$idRule = '';
|
$idRule = '';
|
||||||
|
|
||||||
// get parameter link:
|
// get parameter link:
|
||||||
$link = $this->route()->parameter('linkType');
|
$link = $this->route()->parameter('linkType');
|
||||||
|
Reference in New Issue
Block a user