mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-19 19:01:58 +00:00
Fix issue with renamed field.
This commit is contained in:
@@ -50,28 +50,28 @@ class UpdateRequest extends FormRequest
|
|||||||
public function getUpdateData(): array
|
public function getUpdateData(): array
|
||||||
{
|
{
|
||||||
$fields = [
|
$fields = [
|
||||||
'name' => ['name', 'string'],
|
'name' => ['name', 'convertString'],
|
||||||
'active' => ['active', 'boolean'],
|
'active' => ['active', 'boolean'],
|
||||||
'include_net_worth' => ['include_net_worth', 'boolean'],
|
'include_net_worth' => ['include_net_worth', 'boolean'],
|
||||||
'account_type_name' => ['type', 'string'],
|
'account_type_name' => ['type', 'convertString'],
|
||||||
'virtual_balance' => ['virtual_balance', 'string'],
|
'virtual_balance' => ['virtual_balance', 'convertString'],
|
||||||
'iban' => ['iban', 'string'],
|
'iban' => ['iban', 'convertString'],
|
||||||
'BIC' => ['bic', 'string'],
|
'BIC' => ['bic', 'convertString'],
|
||||||
'account_number' => ['account_number', 'string'],
|
'account_number' => ['account_number', 'convertString'],
|
||||||
'account_role' => ['account_role', 'string'],
|
'account_role' => ['account_role', 'convertString'],
|
||||||
'liability_type' => ['liability_type', 'string'],
|
'liability_type' => ['liability_type', 'convertString'],
|
||||||
'opening_balance' => ['opening_balance', 'string'],
|
'opening_balance' => ['opening_balance', 'convertString'],
|
||||||
'opening_balance_date' => ['opening_balance_date', 'date'],
|
'opening_balance_date' => ['opening_balance_date', 'date'],
|
||||||
'cc_type' => ['credit_card_type', 'string'],
|
'cc_type' => ['credit_card_type', 'convertString'],
|
||||||
'cc_monthly_payment_date' => ['monthly_payment_date', 'string'],
|
'cc_monthly_payment_date' => ['monthly_payment_date', 'convertString'],
|
||||||
'notes' => ['notes', 'stringWithNewlines'],
|
'notes' => ['notes', 'stringWithNewlines'],
|
||||||
'interest' => ['interest', 'string'],
|
'interest' => ['interest', 'convertString'],
|
||||||
'interest_period' => ['interest_period', 'string'],
|
'interest_period' => ['interest_period', 'convertString'],
|
||||||
'order' => ['order', 'integer'],
|
'order' => ['order', 'integer'],
|
||||||
'currency_id' => ['currency_id', 'integer'],
|
'currency_id' => ['currency_id', 'integer'],
|
||||||
'currency_code' => ['currency_code', 'string'],
|
'currency_code' => ['currency_code', 'convertString'],
|
||||||
'liability_direction' => ['liability_direction', 'string'],
|
'liability_direction' => ['liability_direction', 'convertString'],
|
||||||
'liability_amount' => ['liability_amount', 'string'],
|
'liability_amount' => ['liability_amount', 'convertString'],
|
||||||
'liability_start_date' => ['liability_start_date', 'date'],
|
'liability_start_date' => ['liability_start_date', 'date'],
|
||||||
];
|
];
|
||||||
/** @var Account $account */
|
/** @var Account $account */
|
||||||
|
@@ -45,10 +45,10 @@ class UpdateRequest extends FormRequest
|
|||||||
public function getAll(): array
|
public function getAll(): array
|
||||||
{
|
{
|
||||||
$fields = [
|
$fields = [
|
||||||
'filename' => ['filename', 'string'],
|
'filename' => ['filename', 'convertString'],
|
||||||
'title' => ['title', 'string'],
|
'title' => ['title', 'convertString'],
|
||||||
'notes' => ['notes', 'stringWithNewlines'],
|
'notes' => ['notes', 'stringWithNewlines'],
|
||||||
'attachable_type' => ['attachable_type', 'string'],
|
'attachable_type' => ['attachable_type', 'convertString'],
|
||||||
'attachable_id' => ['attachable_id', 'integer'],
|
'attachable_id' => ['attachable_id', 'integer'],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@@ -48,8 +48,8 @@ class Request extends FormRequest
|
|||||||
// this is the way:
|
// this is the way:
|
||||||
$fields = [
|
$fields = [
|
||||||
'currency_id' => ['currency_id', 'integer'],
|
'currency_id' => ['currency_id', 'integer'],
|
||||||
'currency_code' => ['currency_code', 'string'],
|
'currency_code' => ['currency_code', 'convertString'],
|
||||||
'amount' => ['amount', 'string'],
|
'amount' => ['amount', 'convertString'],
|
||||||
'start' => ['start', 'date'],
|
'start' => ['start', 'date'],
|
||||||
'end' => ['end', 'date'],
|
'end' => ['end', 'date'],
|
||||||
];
|
];
|
||||||
|
@@ -49,21 +49,21 @@ class StoreRequest extends FormRequest
|
|||||||
{
|
{
|
||||||
Log::debug('Raw fields in Bill StoreRequest', $this->all());
|
Log::debug('Raw fields in Bill StoreRequest', $this->all());
|
||||||
$fields = [
|
$fields = [
|
||||||
'name' => ['name', 'string'],
|
'name' => ['name', 'convertString'],
|
||||||
'amount_min' => ['amount_min', 'string'],
|
'amount_min' => ['amount_min', 'convertString'],
|
||||||
'amount_max' => ['amount_max', 'string'],
|
'amount_max' => ['amount_max', 'convertString'],
|
||||||
'currency_id' => ['currency_id', 'integer'],
|
'currency_id' => ['currency_id', 'integer'],
|
||||||
'currency_code' => ['currency_code', 'string'],
|
'currency_code' => ['currency_code', 'convertString'],
|
||||||
'date' => ['date', 'date'],
|
'date' => ['date', 'date'],
|
||||||
'end_date' => ['end_date', 'date'],
|
'end_date' => ['end_date', 'date'],
|
||||||
'extension_date' => ['extension_date', 'date'],
|
'extension_date' => ['extension_date', 'date'],
|
||||||
'repeat_freq' => ['repeat_freq', 'string'],
|
'repeat_freq' => ['repeat_freq', 'convertString'],
|
||||||
'skip' => ['skip', 'integer'],
|
'skip' => ['skip', 'integer'],
|
||||||
'active' => ['active', 'boolean'],
|
'active' => ['active', 'boolean'],
|
||||||
'order' => ['order', 'integer'],
|
'order' => ['order', 'integer'],
|
||||||
'notes' => ['notes', 'stringWithNewlines'],
|
'notes' => ['notes', 'stringWithNewlines'],
|
||||||
'object_group_id' => ['object_group_id', 'integer'],
|
'object_group_id' => ['object_group_id', 'integer'],
|
||||||
'object_group_title' => ['object_group_title', 'string'],
|
'object_group_title' => ['object_group_title', 'convertString'],
|
||||||
];
|
];
|
||||||
|
|
||||||
return $this->getAllData($fields);
|
return $this->getAllData($fields);
|
||||||
|
@@ -47,21 +47,21 @@ class UpdateRequest extends FormRequest
|
|||||||
public function getAll(): array
|
public function getAll(): array
|
||||||
{
|
{
|
||||||
$fields = [
|
$fields = [
|
||||||
'name' => ['name', 'string'],
|
'name' => ['name', 'convertString'],
|
||||||
'amount_min' => ['amount_min', 'string'],
|
'amount_min' => ['amount_min', 'convertString'],
|
||||||
'amount_max' => ['amount_max', 'string'],
|
'amount_max' => ['amount_max', 'convertString'],
|
||||||
'currency_id' => ['currency_id', 'integer'],
|
'currency_id' => ['currency_id', 'integer'],
|
||||||
'currency_code' => ['currency_code', 'string'],
|
'currency_code' => ['currency_code', 'convertString'],
|
||||||
'date' => ['date', 'date'],
|
'date' => ['date', 'date'],
|
||||||
'end_date' => ['end_date', 'date'],
|
'end_date' => ['end_date', 'date'],
|
||||||
'extension_date' => ['extension_date', 'date'],
|
'extension_date' => ['extension_date', 'date'],
|
||||||
'repeat_freq' => ['repeat_freq', 'string'],
|
'repeat_freq' => ['repeat_freq', 'convertString'],
|
||||||
'skip' => ['skip', 'integer'],
|
'skip' => ['skip', 'integer'],
|
||||||
'active' => ['active', 'boolean'],
|
'active' => ['active', 'boolean'],
|
||||||
'order' => ['order', 'integer'],
|
'order' => ['order', 'integer'],
|
||||||
'notes' => ['notes', 'stringWithNewlines'],
|
'notes' => ['notes', 'stringWithNewlines'],
|
||||||
'object_group_id' => ['object_group_id', 'integer'],
|
'object_group_id' => ['object_group_id', 'integer'],
|
||||||
'object_group_title' => ['object_group_title', 'string'],
|
'object_group_title' => ['object_group_title', 'convertString'],
|
||||||
];
|
];
|
||||||
|
|
||||||
return $this->getAllData($fields);
|
return $this->getAllData($fields);
|
||||||
|
@@ -47,17 +47,17 @@ class StoreRequest extends FormRequest
|
|||||||
public function getAll(): array
|
public function getAll(): array
|
||||||
{
|
{
|
||||||
$fields = [
|
$fields = [
|
||||||
'name' => ['name', 'string'],
|
'name' => ['name', 'convertString'],
|
||||||
'active' => ['active', 'boolean'],
|
'active' => ['active', 'boolean'],
|
||||||
'order' => ['active', 'integer'],
|
'order' => ['active', 'integer'],
|
||||||
'notes' => ['notes', 'string'],
|
'notes' => ['notes', 'convertString'],
|
||||||
|
|
||||||
// auto budget currency:
|
// auto budget currency:
|
||||||
'currency_id' => ['auto_budget_currency_id', 'integer'],
|
'currency_id' => ['auto_budget_currency_id', 'integer'],
|
||||||
'currency_code' => ['auto_budget_currency_code', 'string'],
|
'currency_code' => ['auto_budget_currency_code', 'convertString'],
|
||||||
'auto_budget_type' => ['auto_budget_type', 'string'],
|
'auto_budget_type' => ['auto_budget_type', 'convertString'],
|
||||||
'auto_budget_amount' => ['auto_budget_amount', 'string'],
|
'auto_budget_amount' => ['auto_budget_amount', 'convertString'],
|
||||||
'auto_budget_period' => ['auto_budget_period', 'string'],
|
'auto_budget_period' => ['auto_budget_period', 'convertString'],
|
||||||
];
|
];
|
||||||
|
|
||||||
return $this->getAllData($fields);
|
return $this->getAllData($fields);
|
||||||
|
@@ -48,15 +48,15 @@ class UpdateRequest extends FormRequest
|
|||||||
{
|
{
|
||||||
// this is the way:
|
// this is the way:
|
||||||
$fields = [
|
$fields = [
|
||||||
'name' => ['name', 'string'],
|
'name' => ['name', 'convertString'],
|
||||||
'active' => ['active', 'boolean'],
|
'active' => ['active', 'boolean'],
|
||||||
'order' => ['order', 'integer'],
|
'order' => ['order', 'integer'],
|
||||||
'notes' => ['notes', 'string'],
|
'notes' => ['notes', 'convertString'],
|
||||||
'currency_id' => ['auto_budget_currency_id', 'integer'],
|
'currency_id' => ['auto_budget_currency_id', 'integer'],
|
||||||
'currency_code' => ['auto_budget_currency_code', 'string'],
|
'currency_code' => ['auto_budget_currency_code', 'convertString'],
|
||||||
'auto_budget_type' => ['auto_budget_type', 'string'],
|
'auto_budget_type' => ['auto_budget_type', 'convertString'],
|
||||||
'auto_budget_amount' => ['auto_budget_amount', 'string'],
|
'auto_budget_amount' => ['auto_budget_amount', 'convertString'],
|
||||||
'auto_budget_period' => ['auto_budget_period', 'string'],
|
'auto_budget_period' => ['auto_budget_period', 'convertString'],
|
||||||
];
|
];
|
||||||
$allData = $this->getAllData($fields);
|
$allData = $this->getAllData($fields);
|
||||||
if (array_key_exists('auto_budget_type', $allData)) {
|
if (array_key_exists('auto_budget_type', $allData)) {
|
||||||
|
@@ -48,9 +48,9 @@ class UpdateRequest extends FormRequest
|
|||||||
$fields = [
|
$fields = [
|
||||||
'start' => ['start', 'date'],
|
'start' => ['start', 'date'],
|
||||||
'end' => ['end', 'date'],
|
'end' => ['end', 'date'],
|
||||||
'amount' => ['amount', 'string'],
|
'amount' => ['amount', 'convertString'],
|
||||||
'currency_id' => ['currency_id', 'integer'],
|
'currency_id' => ['currency_id', 'integer'],
|
||||||
'currency_code' => ['currency_code', 'string'],
|
'currency_code' => ['currency_code', 'convertString'],
|
||||||
];
|
];
|
||||||
|
|
||||||
return $this->getAllData($fields);
|
return $this->getAllData($fields);
|
||||||
|
@@ -44,7 +44,7 @@ class UpdateRequest extends FormRequest
|
|||||||
public function getAll(): array
|
public function getAll(): array
|
||||||
{
|
{
|
||||||
$fields = [
|
$fields = [
|
||||||
'name' => ['name', 'string'],
|
'name' => ['name', 'convertString'],
|
||||||
'notes' => ['notes', 'stringWithNewlines'],
|
'notes' => ['notes', 'stringWithNewlines'],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@@ -43,7 +43,7 @@ class UpdateRequest extends FormRequest
|
|||||||
public function getUpdateData(): array
|
public function getUpdateData(): array
|
||||||
{
|
{
|
||||||
$fields = [
|
$fields = [
|
||||||
'title' => ['title', 'string'],
|
'title' => ['title', 'convertString'],
|
||||||
'order' => ['order', 'integer'],
|
'order' => ['order', 'integer'],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@@ -46,15 +46,15 @@ class UpdateRequest extends FormRequest
|
|||||||
public function getAll(): array
|
public function getAll(): array
|
||||||
{
|
{
|
||||||
$fields = [
|
$fields = [
|
||||||
'name' => ['name', 'string'],
|
'name' => ['name', 'convertString'],
|
||||||
'account_id' => ['account_id', 'integer'],
|
'account_id' => ['account_id', 'integer'],
|
||||||
'targetamount' => ['target_amount', 'string'],
|
'targetamount' => ['target_amount', 'convertString'],
|
||||||
'current_amount' => ['current_amount', 'string'],
|
'current_amount' => ['current_amount', 'convertString'],
|
||||||
'startdate' => ['start_date', 'date'],
|
'startdate' => ['start_date', 'date'],
|
||||||
'targetdate' => ['target_date', 'string'],
|
'targetdate' => ['target_date', 'convertString'],
|
||||||
'notes' => ['notes', 'stringWithNewlines'],
|
'notes' => ['notes', 'stringWithNewlines'],
|
||||||
'order' => ['order', 'integer'],
|
'order' => ['order', 'integer'],
|
||||||
'object_group_title' => ['object_group_title', 'string'],
|
'object_group_title' => ['object_group_title', 'convertString'],
|
||||||
'object_group_id' => ['object_group_id', 'integer'],
|
'object_group_id' => ['object_group_id', 'integer'],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@@ -49,9 +49,9 @@ class StoreRequest extends FormRequest
|
|||||||
public function getAll(): array
|
public function getAll(): array
|
||||||
{
|
{
|
||||||
$fields = [
|
$fields = [
|
||||||
'type' => ['type', 'string'],
|
'type' => ['type', 'convertString'],
|
||||||
'title' => ['title', 'string'],
|
'title' => ['title', 'convertString'],
|
||||||
'description' => ['description', 'string'],
|
'description' => ['description', 'convertString'],
|
||||||
'first_date' => ['first_date', 'date'],
|
'first_date' => ['first_date', 'date'],
|
||||||
'repeat_until' => ['repeat_until', 'date'],
|
'repeat_until' => ['repeat_until', 'date'],
|
||||||
'nr_of_repetitions' => ['nr_of_repetitions', 'integer'],
|
'nr_of_repetitions' => ['nr_of_repetitions', 'integer'],
|
||||||
|
@@ -51,14 +51,14 @@ class UpdateRequest extends FormRequest
|
|||||||
{
|
{
|
||||||
// this is the way:
|
// this is the way:
|
||||||
$fields = [
|
$fields = [
|
||||||
'title' => ['title', 'string'],
|
'title' => ['title', 'convertString'],
|
||||||
'description' => ['description', 'string'],
|
'description' => ['description', 'convertString'],
|
||||||
'first_date' => ['first_date', 'date'],
|
'first_date' => ['first_date', 'date'],
|
||||||
'repeat_until' => ['repeat_until', 'date'],
|
'repeat_until' => ['repeat_until', 'date'],
|
||||||
'nr_of_repetitions' => ['nr_of_repetitions', 'integer'],
|
'nr_of_repetitions' => ['nr_of_repetitions', 'integer'],
|
||||||
'apply_rules' => ['apply_rules', 'boolean'],
|
'apply_rules' => ['apply_rules', 'boolean'],
|
||||||
'active' => ['active', 'boolean'],
|
'active' => ['active', 'boolean'],
|
||||||
'notes' => ['notes', 'string'],
|
'notes' => ['notes', 'convertString'],
|
||||||
];
|
];
|
||||||
$reps = $this->getRepetitionData();
|
$reps = $this->getRepetitionData();
|
||||||
$transactions = $this->getTransactionData();
|
$transactions = $this->getTransactionData();
|
||||||
|
@@ -46,12 +46,12 @@ class StoreRequest extends FormRequest
|
|||||||
public function getAll(): array
|
public function getAll(): array
|
||||||
{
|
{
|
||||||
$fields = [
|
$fields = [
|
||||||
'title' => ['title', 'string'],
|
'title' => ['title', 'convertString'],
|
||||||
'description' => ['description', 'string'],
|
'description' => ['description', 'convertString'],
|
||||||
'rule_group_id' => ['rule_group_id', 'integer'],
|
'rule_group_id' => ['rule_group_id', 'integer'],
|
||||||
'order' => ['order', 'integer'],
|
'order' => ['order', 'integer'],
|
||||||
'rule_group_title' => ['rule_group_title', 'string'],
|
'rule_group_title' => ['rule_group_title', 'convertString'],
|
||||||
'trigger' => ['trigger', 'string'],
|
'trigger' => ['trigger', 'convertString'],
|
||||||
'strict' => ['strict', 'boolean'],
|
'strict' => ['strict', 'boolean'],
|
||||||
'stop_processing' => ['stop_processing', 'boolean'],
|
'stop_processing' => ['stop_processing', 'boolean'],
|
||||||
'active' => ['active', 'boolean'],
|
'active' => ['active', 'boolean'],
|
||||||
|
@@ -46,10 +46,10 @@ class UpdateRequest extends FormRequest
|
|||||||
public function getAll(): array
|
public function getAll(): array
|
||||||
{
|
{
|
||||||
$fields = [
|
$fields = [
|
||||||
'title' => ['title', 'string'],
|
'title' => ['title', 'convertString'],
|
||||||
'description' => ['description', 'stringWithNewlines'],
|
'description' => ['description', 'stringWithNewlines'],
|
||||||
'rule_group_id' => ['rule_group_id', 'integer'],
|
'rule_group_id' => ['rule_group_id', 'integer'],
|
||||||
'trigger' => ['trigger', 'string'],
|
'trigger' => ['trigger', 'convertString'],
|
||||||
'strict' => ['strict', 'boolean'],
|
'strict' => ['strict', 'boolean'],
|
||||||
'stop_processing' => ['stop_processing', 'boolean'],
|
'stop_processing' => ['stop_processing', 'boolean'],
|
||||||
'active' => ['active', 'boolean'],
|
'active' => ['active', 'boolean'],
|
||||||
|
@@ -45,7 +45,7 @@ class UpdateRequest extends FormRequest
|
|||||||
{
|
{
|
||||||
// This is the way.
|
// This is the way.
|
||||||
$fields = [
|
$fields = [
|
||||||
'title' => ['title', 'string'],
|
'title' => ['title', 'convertString'],
|
||||||
'description' => ['description', 'stringWithNewlines'],
|
'description' => ['description', 'stringWithNewlines'],
|
||||||
'active' => ['active', 'boolean'],
|
'active' => ['active', 'boolean'],
|
||||||
'order' => ['order', 'integer'],
|
'order' => ['order', 'integer'],
|
||||||
|
@@ -48,9 +48,9 @@ class UpdateRequest extends FormRequest
|
|||||||
{
|
{
|
||||||
// This is the way.
|
// This is the way.
|
||||||
$fields = [
|
$fields = [
|
||||||
'tag' => ['tag', 'string'],
|
'tag' => ['tag', 'convertString'],
|
||||||
'date' => ['date', 'date'],
|
'date' => ['date', 'date'],
|
||||||
'description' => ['description', 'string'],
|
'description' => ['description', 'convertString'],
|
||||||
];
|
];
|
||||||
$data = $this->getAllData($fields);
|
$data = $this->getAllData($fields);
|
||||||
|
|
||||||
|
@@ -46,9 +46,9 @@ class UpdateRequest extends FormRequest
|
|||||||
{
|
{
|
||||||
// return nothing that isn't explicitely in the array:
|
// return nothing that isn't explicitely in the array:
|
||||||
$fields = [
|
$fields = [
|
||||||
'name' => ['name', 'string'],
|
'name' => ['name', 'convertString'],
|
||||||
'code' => ['code', 'string'],
|
'code' => ['code', 'convertString'],
|
||||||
'symbol' => ['symbol', 'string'],
|
'symbol' => ['symbol', 'convertString'],
|
||||||
'decimal_places' => ['decimal_places', 'integer'],
|
'decimal_places' => ['decimal_places', 'integer'],
|
||||||
'default' => ['default', 'boolean'],
|
'default' => ['default', 'boolean'],
|
||||||
'enabled' => ['enabled', 'boolean'],
|
'enabled' => ['enabled', 'boolean'],
|
||||||
|
@@ -45,12 +45,12 @@ class CreateRequest extends FormRequest
|
|||||||
$deliveries = array_flip(config('firefly.webhooks.deliveries'));
|
$deliveries = array_flip(config('firefly.webhooks.deliveries'));
|
||||||
|
|
||||||
$fields = [
|
$fields = [
|
||||||
'title' => ['title', 'string'],
|
'title' => ['title', 'convertString'],
|
||||||
'active' => ['active', 'boolean'],
|
'active' => ['active', 'boolean'],
|
||||||
'trigger' => ['trigger', 'string'],
|
'trigger' => ['trigger', 'convertString'],
|
||||||
'response' => ['response', 'string'],
|
'response' => ['response', 'convertString'],
|
||||||
'delivery' => ['delivery', 'string'],
|
'delivery' => ['delivery', 'convertString'],
|
||||||
'url' => ['url', 'string'],
|
'url' => ['url', 'convertString'],
|
||||||
];
|
];
|
||||||
|
|
||||||
// this is the way.
|
// this is the way.
|
||||||
|
@@ -45,12 +45,12 @@ class UpdateRequest extends FormRequest
|
|||||||
$deliveries = array_flip(config('firefly.webhooks.deliveries'));
|
$deliveries = array_flip(config('firefly.webhooks.deliveries'));
|
||||||
|
|
||||||
$fields = [
|
$fields = [
|
||||||
'title' => ['title', 'string'],
|
'title' => ['title', 'convertString'],
|
||||||
'active' => ['active', 'boolean'],
|
'active' => ['active', 'boolean'],
|
||||||
'trigger' => ['trigger', 'string'],
|
'trigger' => ['trigger', 'convertString'],
|
||||||
'response' => ['response', 'string'],
|
'response' => ['response', 'convertString'],
|
||||||
'delivery' => ['delivery', 'string'],
|
'delivery' => ['delivery', 'convertString'],
|
||||||
'url' => ['url', 'string'],
|
'url' => ['url', 'convertString'],
|
||||||
];
|
];
|
||||||
|
|
||||||
// this is the way.
|
// this is the way.
|
||||||
|
Reference in New Issue
Block a user