Fix negative reception was no more possible. Use hidden const to restore

This commit is contained in:
Laurent Destailleur 2022-11-05 15:39:31 +01:00
parent 060f7bf67c
commit 54c657e50c
2 changed files with 2 additions and 1 deletions

View File

@ -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;

View File

@ -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);