Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Fix max amount.
James Cole662b832274ba
diff --git a/app/Http/Requests/JournalFormRequest.php b/app/Http/Requests/JournalFormRequest.phpindex 406e9f5439..c8b549e9be 100644--- a/app/Http/Requests/JournalFormRequest.php+++ b/app/Http/Requests/JournalFormRequest.php@@ -161,11 +161,11 @@ class JournalFormRequest extends Request'due_date' => 'date|nullable','payment_date' => 'date|nullable','invoice_date' => 'date|nullable',- 'internal_reference' => 'min:1,max:255|nullable',- 'notes' => 'min:1,max:50000|nullable',+ 'internal_reference' => 'min:1|max:255|nullable',+ 'notes' => 'min:1|max:50000|nullable',// and then transaction rules:'description' => 'required|between:1,255',- 'amount' => 'numeric|required|more:0',+ 'amount' => 'numeric|required|more:0|less:10000000',//'budget_id' => 'mustExist:budgets,id|belongsToUser:budgets,id|nullable','category' => 'between:1,255|nullable','source_id' => 'numeric|belongsToUser:accounts,id|nullable',diff --git a/app/Repositories/Budget/BudgetRepository.php b/app/Repositories/Budget/BudgetRepository.phpindex d9464e73a2..9f6a4676e7 100644--- a/app/Repositories/Budget/BudgetRepository.php+++ b/app/Repositories/Budget/BudgetRepository.php@@ -840,7 +840,7 @@ class BudgetRepository implements BudgetRepositoryInterfaceLog::debug(sprintf('Updated trigger %d: %s', $trigger->id, $trigger->trigger_value));}-+// find any rule actions related to budgets, with this budget name, and update them accordingly.$types = ['set_budget',diff --git a/app/Validation/FireflyValidator.php b/app/Validation/FireflyValidator.phpindex ff0669a98c..db51337bd4 100644--- a/app/Validation/FireflyValidator.php+++ b/app/Validation/FireflyValidator.php@@ -203,6 +203,23 @@ class FireflyValidator extends Validatorreturn bccomp((string)$value, (string)$compare) > 0;}+ /**+ * @param $attribute+ * @param $value+ * @param $parameters+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)+ *+ * @return bool+ */+ public function validateLess($attribute, $value, $parameters): bool+ {+ /** @var mixed $compare */+ $compare = $parameters[0] ?? '0';++ return bccomp((string)$value, (string)$compare) < 0;+ }++/*** @SuppressWarnings(PHPMD.UnusedFormalParameter)*diff --git a/resources/lang/en_US/validation.php b/resources/lang/en_US/validation.phpindex b573da5844..58266f14c9 100644--- a/resources/lang/en_US/validation.php+++ b/resources/lang/en_US/validation.php@@ -50,7 +50,8 @@ return ['at_least_one_action' => 'Rule must have at least one action.','base64' => 'This is not valid base64 encoded data.','model_id_invalid' => 'The given ID seems invalid for this model.',- 'more' => ':attribute must be larger than zero.',+ 'more' => ':attribute must be larger than :value.',+ 'less' => ':attribute must be less than 10,000,000','active_url' => 'The :attribute is not a valid URL.','after' => 'The :attribute must be a date after :date.','alpha' => 'The :attribute may only contain letters.',