';
@@ -1188,14 +1188,16 @@ if ($action == 'create') {
if ($line->product_type == 1 && empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
$quantityToBeDelivered = 0;
} else {
- $quantityToBeDelivered = $quantityAsked - $quantityDelivered;
+ if (isset($quantityAsked) and isset($quantityDelivered)) {
+ $quantityToBeDelivered = is_float($quantityAsked) - is_float($quantityDelivered);
+ }
}
$warehouseObject = null;
if (count($warehousePicking) == 1 || !($line->fk_product > 0) || empty($conf->stock->enabled)) { // If warehouse was already selected or if product is not a predefined, we go into this part with no multiwarehouse selection
print '';
//ship from preselected location
- $stock = + $product->stock_warehouse[$warehouse_id]->real; // Convert to number
+ $stock = + isSET($product->stock_warehouse[$warehouse_id]->real) ? $product->stock_warehouse[$warehouse_id]->real : 0; // Convert to number
$deliverableQty = min($quantityToBeDelivered, $stock);
if ($deliverableQty < 0) {
$deliverableQty = 0;