From 54c657e50c6456983199ba9d2490ece6c2f5e5a2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 Nov 2022 15:39:31 +0100 Subject: [PATCH] Fix negative reception was no more possible. Use hidden const to restore --- htdocs/reception/card.php | 1 + htdocs/reception/class/reception.class.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 97d56d56e09..2ee780f2e0d 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -359,6 +359,7 @@ if (empty($reshook)) { $batch = "batch".$i; $cost_price = "cost_price".$i; + //if (GETPOST($qty, 'int') > 0 || (GETPOST($qty, 'int') == 0 && getDolGlobalString('RECEPTION_GETS_ALL_ORDER_PRODUCTS')) || (GETPOST($qty, 'int') < 0 && getDolGlobalString('RECEPTION_ALLOW_NEGATIVE_QTY'))) { if (GETPOST($qty, 'int') > 0 || (GETPOST($qty, 'int') == 0 && $conf->global->RECEPTION_GETS_ALL_ORDER_PRODUCTS)) { $ent = "entl".$i; diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index e3434a9a298..2735d1b8006 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -583,7 +583,7 @@ class Reception extends CommonObject $qty = $obj->qty; - if ($qty <= 0) { + if ($qty == 0 || ($qty < 0 && !getDolGlobalInt('RECEPTION_ALLOW_NEGATIVE_QTY'))) { continue; } dol_syslog(get_class($this)."::valid movement index ".$i." ed.rowid=".$obj->rowid." edb.rowid=".$obj->edbrowid);