From f045e4ea69e0b3594d9d8bbceb1181ef7cd58534 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 21 Jan 2024 18:01:00 +0100 Subject: [PATCH] Fix amount --- app/Rules/IsValidAmount.php | 2 +- app/Rules/IsValidPositiveAmount.php | 2 +- app/Rules/IsValidZeroOrMoreAmount.php | 2 +- app/Support/Validation/ValidatesAmountsTrait.php | 3 ++- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/Rules/IsValidAmount.php b/app/Rules/IsValidAmount.php index e22c4aa911..8a91e64fb5 100644 --- a/app/Rules/IsValidAmount.php +++ b/app/Rules/IsValidAmount.php @@ -60,7 +60,7 @@ class IsValidAmount implements ValidationRule return; } - // must be less than 100 million and 1709: + // must be less than a large number if($this->moreThanLots($value)) { $fail('validation.lte.numeric')->translate(['value' => self::BIG_AMOUNT]); $message = sprintf('IsValidAmount: "%s" must be more than %s.', $value, self::BIG_AMOUNT); diff --git a/app/Rules/IsValidPositiveAmount.php b/app/Rules/IsValidPositiveAmount.php index 3324db8b23..8e6e8d0dd8 100644 --- a/app/Rules/IsValidPositiveAmount.php +++ b/app/Rules/IsValidPositiveAmount.php @@ -55,7 +55,7 @@ class IsValidPositiveAmount implements ValidationRule return; } - // must be less than 100 million and 1709: + // must be less than a large number if($this->moreThanLots($value)) { $fail('validation.lte.numeric')->translate(['value' => self::BIG_AMOUNT]); $message = sprintf('IsValidPositiveAmount: "%s" must be less than %s.', $value, self::BIG_AMOUNT); diff --git a/app/Rules/IsValidZeroOrMoreAmount.php b/app/Rules/IsValidZeroOrMoreAmount.php index 57d194b776..fdc03ff80e 100644 --- a/app/Rules/IsValidZeroOrMoreAmount.php +++ b/app/Rules/IsValidZeroOrMoreAmount.php @@ -55,7 +55,7 @@ class IsValidZeroOrMoreAmount implements ValidationRule return; } - // must be less than 100 million and 1709: + // must be less than a large number if($this->moreThanLots($value)) { $fail('validation.lte.numeric')->translate(['value' => self::BIG_AMOUNT]); $message = sprintf('IsValidPositiveAmount: "%s" must be less than %s.', $value, self::BIG_AMOUNT); diff --git a/app/Support/Validation/ValidatesAmountsTrait.php b/app/Support/Validation/ValidatesAmountsTrait.php index f305c74d5d..9b2a1d9c5e 100644 --- a/app/Support/Validation/ValidatesAmountsTrait.php +++ b/app/Support/Validation/ValidatesAmountsTrait.php @@ -25,7 +25,8 @@ namespace FireflyIII\Support\Validation; trait ValidatesAmountsTrait { - protected const string BIG_AMOUNT = '10000170900'; + // 19-09-2020: my wedding day lol + protected const string BIG_AMOUNT = '10019092020'; final protected function emptyString(string $value): bool {