mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Fix max amount.
This commit is contained in:
@@ -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',
|
||||
|
@@ -840,7 +840,7 @@ class BudgetRepository implements BudgetRepositoryInterface
|
||||
Log::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',
|
||||
|
@@ -203,6 +203,23 @@ class FireflyValidator extends Validator
|
||||
return 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)
|
||||
*
|
||||
|
Reference in New Issue
Block a user