From 714b5556f3124d5c1358f5e61afd4d8f71ed072c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 26 Apr 2016 13:13:18 +0200 Subject: [PATCH] FIX if qty to ship is < 0, we sugest 0 --- htdocs/expedition/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 4547a94566a..867ea7a7245 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -885,6 +885,7 @@ if ($action == 'create') //ship from preselected location $stock = + $product->stock_warehouse[$warehouse_id]->real; // Convert to number $deliverableQty=min($quantityToBeDelivered, $stock); + if ($deliverableQty < 0) $deliverableQty = 0; if (empty($conf->productbatch->enabled) || ! ($product->hasbatch() && is_object($product->stock_warehouse[$warehouse_id]))) { // Quantity to send @@ -1774,13 +1775,12 @@ else if ($id || $ref) { print ''.$langs->trans("CreateDeliveryOrder").''; } - // Close if (! empty($conf->facture->enabled) && $object->statut > 0) { if ($user->rights->expedition->creer && $object->statut > 0 && ! $object->billed) { - $label="Close"; + $label="Close"; // = Transferred/Received // Label here should be "Close" or "ClassifyBilled" if we decided to make bill on shipments instead of orders if (! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) $label="ClassifyBilled"; print ''.$langs->trans($label).'';