mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-16 01:06:46 +00:00
Fix #335
This commit is contained in:
@@ -295,14 +295,14 @@ class AccountController extends Controller
|
|||||||
public function store(AccountFormRequest $request, AccountCrudInterface $crud)
|
public function store(AccountFormRequest $request, AccountCrudInterface $crud)
|
||||||
{
|
{
|
||||||
$accountData = [
|
$accountData = [
|
||||||
'name' => $request->input('name'),
|
'name' => trim($request->input('name')),
|
||||||
'accountType' => $request->input('what'),
|
'accountType' => $request->input('what'),
|
||||||
'virtualBalance' => round($request->input('virtualBalance'), 2),
|
'virtualBalance' => round($request->input('virtualBalance'), 2),
|
||||||
'virtualBalanceCurrency' => intval($request->input('amount_currency_id_virtualBalance')),
|
'virtualBalanceCurrency' => intval($request->input('amount_currency_id_virtualBalance')),
|
||||||
'active' => true,
|
'active' => true,
|
||||||
'user' => auth()->user()->id,
|
'user' => auth()->user()->id,
|
||||||
'iban' => $request->input('iban'),
|
'iban' => trim($request->input('iban')),
|
||||||
'accountNumber' => $request->input('accountNumber'),
|
'accountNumber' => trim($request->input('accountNumber')),
|
||||||
'accountRole' => $request->input('accountRole'),
|
'accountRole' => $request->input('accountRole'),
|
||||||
'openingBalance' => round($request->input('openingBalance'), 2),
|
'openingBalance' => round($request->input('openingBalance'), 2),
|
||||||
'openingBalanceDate' => new Carbon((string)$request->input('openingBalanceDate')),
|
'openingBalanceDate' => new Carbon((string)$request->input('openingBalanceDate')),
|
||||||
|
@@ -263,7 +263,7 @@ class CategoryController extends Controller
|
|||||||
public function store(CategoryFormRequest $request, CRI $repository)
|
public function store(CategoryFormRequest $request, CRI $repository)
|
||||||
{
|
{
|
||||||
$categoryData = [
|
$categoryData = [
|
||||||
'name' => $request->input('name'),
|
'name' => trim($request->input('name')),
|
||||||
'user' => auth()->user()->id,
|
'user' => auth()->user()->id,
|
||||||
];
|
];
|
||||||
$category = $repository->store($categoryData);
|
$category = $repository->store($categoryData);
|
||||||
|
@@ -43,11 +43,11 @@ class JournalFormRequest extends Request
|
|||||||
|
|
||||||
return [
|
return [
|
||||||
'what' => $this->get('what'),
|
'what' => $this->get('what'),
|
||||||
'description' => $this->get('description'),
|
'description' => trim($this->get('description')),
|
||||||
'source_account_id' => intval($this->get('source_account_id')),
|
'source_account_id' => intval($this->get('source_account_id')),
|
||||||
'source_account_name' => $this->getFieldOrEmptyString('source_account_name'),
|
'source_account_name' => trim($this->getFieldOrEmptyString('source_account_name')),
|
||||||
'destination_account_id' => intval($this->get('destination_account_id')),
|
'destination_account_id' => intval($this->get('destination_account_id')),
|
||||||
'destination_account_name' => $this->getFieldOrEmptyString('destination_account_name'),
|
'destination_account_name' => trim($this->getFieldOrEmptyString('destination_account_name')),
|
||||||
'amount' => round($this->get('amount'), 2),
|
'amount' => round($this->get('amount'), 2),
|
||||||
'user' => auth()->user()->id,
|
'user' => auth()->user()->id,
|
||||||
'amount_currency_id_amount' => intval($this->get('amount_currency_id_amount')),
|
'amount_currency_id_amount' => intval($this->get('amount_currency_id_amount')),
|
||||||
@@ -56,7 +56,7 @@ class JournalFormRequest extends Request
|
|||||||
'book_date' => $this->getDateOrNull('book_date'),
|
'book_date' => $this->getDateOrNull('book_date'),
|
||||||
'process_date' => $this->getDateOrNull('process_date'),
|
'process_date' => $this->getDateOrNull('process_date'),
|
||||||
'budget_id' => intval($this->get('budget_id')),
|
'budget_id' => intval($this->get('budget_id')),
|
||||||
'category' => $this->getFieldOrEmptyString('category'),
|
'category' => trim($this->getFieldOrEmptyString('category')),
|
||||||
'tags' => explode(',', $tags),
|
'tags' => explode(',', $tags),
|
||||||
'piggy_bank_id' => intval($this->get('piggy_bank_id')),
|
'piggy_bank_id' => intval($this->get('piggy_bank_id')),
|
||||||
|
|
||||||
@@ -64,8 +64,8 @@ class JournalFormRequest extends Request
|
|||||||
'due_date' => $this->getDateOrNull('due_date'),
|
'due_date' => $this->getDateOrNull('due_date'),
|
||||||
'payment_date' => $this->getDateOrNull('payment_date'),
|
'payment_date' => $this->getDateOrNull('payment_date'),
|
||||||
'invoice_date' => $this->getDateOrNull('invoice_date'),
|
'invoice_date' => $this->getDateOrNull('invoice_date'),
|
||||||
'internal_reference' => $this->get('internal_reference'),
|
'internal_reference' => trim($this->get('internal_reference')),
|
||||||
'notes' => $this->get('notes'),
|
'notes' => trim($this->get('notes')),
|
||||||
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user