Skip to content
Code-Schnipsel Gruppen Projekte
Commit 9289fdee erstellt von Patrick Müller's avatar Patrick Müller
Dateien durchsuchen

fix: purchase quantity from/to validation

Übergeordneter f8a6f865
No related branches found
No related tags found
Keine zugehörigen Merge Requests gefunden
......@@ -142,29 +142,28 @@ public function __construct($id, Handler $Factory)
$purchaseValueFrom = $this->getAttribute('purchase_value_from');
$purchaseValueUntil = $this->getAttribute('purchase_value_until');
if ($purchaseQuantityFrom === false || $purchaseQuantityFrom < 0) {
if ($purchaseQuantityFrom !== '' && ($purchaseQuantityFrom === false || $purchaseQuantityFrom < 0)) {
throw new QUI\ERP\Discount\Exception([
'quiqqer/discount',
'exception.discount.purchase_quantity_from.wrong'
]);
}
if ($purchaseQuantityUntil === false || $purchaseQuantityUntil < 0) {
if ($purchaseQuantityUntil !== '' && ($purchaseQuantityUntil === false || $purchaseQuantityUntil < 0)) {
throw new QUI\ERP\Discount\Exception([
'quiqqer/discount',
'exception.discount.purchase_quantity_until.wrong'
]);
}
if ($purchaseValueFrom === false || $purchaseValueFrom < 0) {
if ($purchaseValueFrom !== '' && ($purchaseValueFrom === false || $purchaseValueFrom < 0)) {
throw new QUI\ERP\Discount\Exception([
'quiqqer/discount',
'exception.discount.purchase_value_from.wrong'
]);
}
if ($purchaseValueUntil === false || $purchaseValueUntil < 0) {
if ($purchaseValueUntil !== '' && ($purchaseValueUntil === false || $purchaseValueUntil < 0)) {
throw new QUI\ERP\Discount\Exception([
'quiqqer/discount',
'exception.discount.purchase_value_until.wrong'
......
0% oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren