diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index fd1e38e2438..5beeb013dbf 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -240,7 +240,7 @@ if (empty($reshook)) $stockLocation = "ent1".$i."_0"; $qty = "qtyl".$i; - if ($objectsrc->lines[$i]->product_tobatch) // If product need a batch number + if (!empty($conf->productbatch->enabled) && $objectsrc->lines[$i]->product_tobatch) // If product need a batch number { if (GETPOSTISSET($batch)) { @@ -275,27 +275,26 @@ if (empty($reshook)) setEventMessages($langs->trans("StockIsRequiredToChooseWhichLotToUse"), null, 'errors'); } } - } elseif (GETPOSTISSET($stockLocation)) - { + } elseif (GETPOSTISSET($stockLocation)) { //shipment line from multiple stock locations $qty .= '_'.$j; while (GETPOSTISSET($stockLocation)) { // save sub line of warehouse - $stockLine[$i][$j]['qty'] = GETPOST($qty, 'int'); + $stockLine[$i][$j]['qty'] = price2num(GETPOST($qty, 'alpha'), 'MS'); $stockLine[$i][$j]['warehouse_id'] = GETPOST($stockLocation, 'int'); $stockLine[$i][$j]['ix_l'] = GETPOST($idl, 'int'); - $totalqty += GETPOST($qty, 'int'); + $totalqty += price2num(GETPOST($qty, 'alpha'), 'MS'); $j++; $stockLocation = "ent1".$i."_".$j; $qty = "qtyl".$i.'_'.$j; } } else { - //var_dump(GETPOST($qty,'int')); var_dump($_POST); var_dump($batch);exit; + //var_dump(GETPOST($qty,'alpha')); var_dump($_POST); var_dump($batch);exit; //shipment line for product with no batch management and no multiple stock location - if (GETPOST($qty, 'int') > 0) $totalqty += GETPOST($qty, 'int'); + if (GETPOST($qty, 'int') > 0) $totalqty += price2num(GETPOST($qty, 'alpha'), 'MS'); } // Extrafields