mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-27 20:28:54 +02:00
Enforce positive values for min quantities and price quantites.
This commit is contained in:
parent
63508293bd
commit
b6ee0d1323
2 changed files with 7 additions and 2 deletions
|
@ -115,6 +115,7 @@ class Pricedetail extends DBElement
|
||||||
/**
|
/**
|
||||||
* @var int
|
* @var int
|
||||||
* @ORM\Column(type="integer")
|
* @ORM\Column(type="integer")
|
||||||
|
* @Assert\Positive()
|
||||||
*/
|
*/
|
||||||
protected $min_discount_quantity = 1;
|
protected $min_discount_quantity = 1;
|
||||||
|
|
||||||
|
|
|
@ -48,8 +48,12 @@ class PricedetailType extends AbstractType
|
||||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||||
{
|
{
|
||||||
//No labels needed, we define translation in templates
|
//No labels needed, we define translation in templates
|
||||||
$builder->add("min_discount_quantity", IntegerType::class);
|
$builder->add("min_discount_quantity", IntegerType::class, [
|
||||||
$builder->add("price_related_quantity", IntegerType::class);
|
'attr' => ['min' => 1]
|
||||||
|
]);
|
||||||
|
$builder->add("price_related_quantity", IntegerType::class, [
|
||||||
|
'attr' => ['min' => 1]
|
||||||
|
]);
|
||||||
$builder->add("price", NumberType::class);
|
$builder->add("price", NumberType::class);
|
||||||
$builder->add("currency", CurrencyEntityType::class, ['required' => false]);
|
$builder->add("currency", CurrencyEntityType::class, ['required' => false]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue