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