Added possibility to ignore the checks of withdraw amount when building projects

This fixes #349
This commit is contained in:
Jan Böhmer 2023-08-20 23:23:18 +02:00
parent b62dc1241d
commit 33a0981981
6 changed files with 118 additions and 2 deletions

View file

@ -69,12 +69,12 @@ class ValidProjectBuildRequestValidator extends ConstraintValidator
->addViolation();
}
if ($withdraw_sum > $needed_amount) {
if ($withdraw_sum > $needed_amount && $value->isDontCheckQuantity() === false) {
$this->buildViolationForLot($lot, 'validator.project_build.lot_bigger_than_needed')
->addViolation();
}
if ($withdraw_sum < $needed_amount) {
if ($withdraw_sum < $needed_amount && $value->isDontCheckQuantity() === false) {
$this->buildViolationForLot($lot, 'validator.project_build.lot_smaller_than_needed')
->addViolation();
}