mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Small bugfixes for issues in beta 2
This commit is contained in:
@@ -44,11 +44,8 @@ class CreateController extends Controller
|
||||
{
|
||||
use ModelInformation;
|
||||
|
||||
/** @var AttachmentHelperInterface Helper for attachments. */
|
||||
private $attachments;
|
||||
|
||||
/** @var AccountRepositoryInterface The account repository */
|
||||
private $repository;
|
||||
private AttachmentHelperInterface $attachments;
|
||||
private AccountRepositoryInterface $repository;
|
||||
|
||||
/**
|
||||
* CreateController constructor.
|
||||
|
@@ -58,7 +58,7 @@ class AvailableBudgetController extends Controller
|
||||
|
||||
$this->middleware(
|
||||
function ($request, $next) {
|
||||
app('view')->share('title', (string) trans('firefly.budgets'));
|
||||
app('view')->share('title', (string)trans('firefly.budgets'));
|
||||
app('view')->share('mainTitleIcon', 'fa-pie-chart');
|
||||
$this->abRepository = app(AvailableBudgetRepositoryInterface::class);
|
||||
$this->currencyRepos = app(CurrencyRepositoryInterface::class);
|
||||
@@ -95,7 +95,7 @@ class AvailableBudgetController extends Controller
|
||||
|
||||
return redirect(route('available-budgets.edit', [$first->id]));
|
||||
}
|
||||
$page = (int) ($request->get('page') ?? 1);
|
||||
$page = (int)($request->get('page') ?? 1);
|
||||
|
||||
return prefixView('budgets.available-budgets.create', compact('start', 'end', 'page', 'currency'));
|
||||
}
|
||||
@@ -129,7 +129,7 @@ class AvailableBudgetController extends Controller
|
||||
);
|
||||
|
||||
|
||||
$page = (int) ($request->get('page') ?? 1);
|
||||
$page = (int)($request->get('page') ?? 1);
|
||||
|
||||
return prefixView('budgets.available-budgets.create-alternative', compact('start', 'end', 'page', 'currencies'));
|
||||
}
|
||||
@@ -157,7 +157,8 @@ class AvailableBudgetController extends Controller
|
||||
*/
|
||||
public function edit(AvailableBudget $availableBudget, Carbon $start, Carbon $end)
|
||||
{
|
||||
$availableBudget->amount = number_format((float) $availableBudget->amount, $availableBudget->transactionCurrency->decimal_places, '.', '');
|
||||
$availableBudget->amount = number_format((float)$availableBudget->amount, $availableBudget->transactionCurrency->decimal_places, '.', '');
|
||||
|
||||
return prefixView('budgets.available-budgets.edit', compact('availableBudget', 'start', 'end'));
|
||||
}
|
||||
|
||||
@@ -179,7 +180,7 @@ class AvailableBudgetController extends Controller
|
||||
}
|
||||
|
||||
// validate amount
|
||||
$amount = (string) $request->get('amount');
|
||||
$amount = (string)$request->get('amount');
|
||||
if ('' === $amount) {
|
||||
session()->flash('error', trans('firefly.invalid_amount'));
|
||||
|
||||
@@ -192,7 +193,7 @@ class AvailableBudgetController extends Controller
|
||||
}
|
||||
|
||||
// find currency
|
||||
$currency = $this->currencyRepos->find((int) $request->get('currency_id'));
|
||||
$currency = $this->currencyRepos->find((int)$request->get('currency_id'));
|
||||
if (null === $currency) {
|
||||
session()->flash('error', trans('firefly.invalid_currency'));
|
||||
|
||||
@@ -205,10 +206,10 @@ class AvailableBudgetController extends Controller
|
||||
if (null === $existing) {
|
||||
$this->abRepository->store(
|
||||
[
|
||||
'amount' => $amount,
|
||||
'currency' => $currency,
|
||||
'start' => $start,
|
||||
'end' => $end,
|
||||
'amount' => $amount,
|
||||
'currency_id' => $currency->id,
|
||||
'start' => $start,
|
||||
'end' => $end,
|
||||
]
|
||||
);
|
||||
}
|
||||
@@ -233,7 +234,7 @@ class AvailableBudgetController extends Controller
|
||||
public function update(Request $request, AvailableBudget $availableBudget, Carbon $start, Carbon $end)
|
||||
{
|
||||
// validate amount
|
||||
$amount = (string) $request->get('amount');
|
||||
$amount = (string)$request->get('amount');
|
||||
if ('' === $amount) {
|
||||
session()->flash('error', trans('firefly.invalid_amount'));
|
||||
|
||||
|
@@ -41,17 +41,17 @@ class BillStoreRequest extends FormRequest
|
||||
public function getBillData(): array
|
||||
{
|
||||
return [
|
||||
'name' => $this->string('name'),
|
||||
'amount_min' => $this->string('amount_min'),
|
||||
'currency_id' => $this->integer('transaction_currency_id'),
|
||||
'currency_code' => '',
|
||||
'amount_max' => $this->string('amount_max'),
|
||||
'date' => $this->date('date'),
|
||||
'repeat_freq' => $this->string('repeat_freq'),
|
||||
'skip' => $this->integer('skip'),
|
||||
'notes' => $this->nlString('notes'),
|
||||
'active' => $this->boolean('active'),
|
||||
'object_group' => $this->string('object_group'),
|
||||
'name' => $this->string('name'),
|
||||
'amount_min' => $this->string('amount_min'),
|
||||
'currency_id' => $this->integer('transaction_currency_id'),
|
||||
'currency_code' => '',
|
||||
'amount_max' => $this->string('amount_max'),
|
||||
'date' => $this->date('date'),
|
||||
'repeat_freq' => $this->string('repeat_freq'),
|
||||
'skip' => $this->integer('skip'),
|
||||
'notes' => $this->nlString('notes'),
|
||||
'active' => $this->boolean('active'),
|
||||
'object_group_title' => $this->string('object_group'),
|
||||
];
|
||||
}
|
||||
|
||||
|
@@ -42,17 +42,17 @@ class BillUpdateRequest extends FormRequest
|
||||
public function getBillData(): array
|
||||
{
|
||||
return [
|
||||
'name' => $this->string('name'),
|
||||
'amount_min' => $this->string('amount_min'),
|
||||
'currency_id' => $this->integer('transaction_currency_id'),
|
||||
'currency_code' => '',
|
||||
'amount_max' => $this->string('amount_max'),
|
||||
'date' => $this->date('date'),
|
||||
'repeat_freq' => $this->string('repeat_freq'),
|
||||
'skip' => $this->integer('skip'),
|
||||
'notes' => $this->nlString('notes'),
|
||||
'active' => $this->boolean('active'),
|
||||
'object_group' => $this->string('object_group'),
|
||||
'name' => $this->string('name'),
|
||||
'amount_min' => $this->string('amount_min'),
|
||||
'currency_id' => $this->integer('transaction_currency_id'),
|
||||
'currency_code' => '',
|
||||
'amount_max' => $this->string('amount_max'),
|
||||
'date' => $this->date('date'),
|
||||
'repeat_freq' => $this->string('repeat_freq'),
|
||||
'skip' => $this->integer('skip'),
|
||||
'notes' => $this->nlString('notes'),
|
||||
'active' => $this->boolean('active'),
|
||||
'object_group_title' => $this->string('object_group'),
|
||||
];
|
||||
}
|
||||
|
||||
|
@@ -44,12 +44,12 @@ class BudgetFormStoreRequest extends FormRequest
|
||||
public function getBudgetData(): array
|
||||
{
|
||||
return [
|
||||
'name' => $this->string('name'),
|
||||
'active' => $this->boolean('active'),
|
||||
'auto_budget_type' => $this->integer('auto_budget_type'),
|
||||
'transaction_currency_id' => $this->integer('auto_budget_currency_id'),
|
||||
'auto_budget_amount' => $this->string('auto_budget_amount'),
|
||||
'auto_budget_period' => $this->string('auto_budget_period'),
|
||||
'name' => $this->string('name'),
|
||||
'active' => $this->boolean('active'),
|
||||
'auto_budget_type' => $this->integer('auto_budget_type'),
|
||||
'currency_id' => $this->integer('auto_budget_currency_id'),
|
||||
'auto_budget_amount' => $this->string('auto_budget_amount'),
|
||||
'auto_budget_period' => $this->string('auto_budget_period'),
|
||||
];
|
||||
}
|
||||
|
||||
|
@@ -45,12 +45,12 @@ class BudgetFormUpdateRequest extends FormRequest
|
||||
public function getBudgetData(): array
|
||||
{
|
||||
return [
|
||||
'name' => $this->string('name'),
|
||||
'active' => $this->boolean('active'),
|
||||
'auto_budget_type' => $this->integer('auto_budget_type'),
|
||||
'transaction_currency_id' => $this->integer('auto_budget_currency_id'),
|
||||
'auto_budget_amount' => $this->string('auto_budget_amount'),
|
||||
'auto_budget_period' => $this->string('auto_budget_period'),
|
||||
'name' => $this->string('name'),
|
||||
'active' => $this->boolean('active'),
|
||||
'auto_budget_type' => $this->integer('auto_budget_type'),
|
||||
'currency_id' => $this->integer('auto_budget_currency_id'),
|
||||
'auto_budget_amount' => $this->string('auto_budget_amount'),
|
||||
'auto_budget_period' => $this->string('auto_budget_period'),
|
||||
];
|
||||
}
|
||||
|
||||
|
@@ -47,7 +47,7 @@ class PiggyBankStoreRequest extends FormRequest
|
||||
'targetamount' => $this->string('targetamount'),
|
||||
'targetdate' => $this->date('targetdate'),
|
||||
'notes' => $this->nlString('notes'),
|
||||
'object_group' => $this->string('object_group'),
|
||||
'object_group_title' => $this->string('object_group'),
|
||||
];
|
||||
}
|
||||
|
||||
|
@@ -42,13 +42,13 @@ class PiggyBankUpdateRequest extends FormRequest
|
||||
public function getPiggyBankData(): array
|
||||
{
|
||||
return [
|
||||
'name' => $this->string('name'),
|
||||
'startdate' => $this->date('startdate'),
|
||||
'account_id' => $this->integer('account_id'),
|
||||
'targetamount' => $this->string('targetamount'),
|
||||
'targetdate' => $this->date('targetdate'),
|
||||
'notes' => $this->nlString('notes'),
|
||||
'object_group' => $this->string('object_group'),
|
||||
'name' => $this->string('name'),
|
||||
'startdate' => $this->date('startdate'),
|
||||
'account_id' => $this->integer('account_id'),
|
||||
'targetamount' => $this->string('targetamount'),
|
||||
'targetdate' => $this->date('targetdate'),
|
||||
'notes' => $this->nlString('notes'),
|
||||
'object_group_title' => $this->string('object_group'),
|
||||
];
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user