diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 7f948153e10..f98dd26816f 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -346,6 +346,13 @@ if (empty($reshook)) { } } + // check qty shipped not greater than ordered + if (dolGetGlobalInt("ErrorTooMuchShipped") && $totalqty > $objectsrc->lines[$i]->qty) { + setEventMessages($langs->trans("", $i), null, 'errors'); + $error++; + continue; + } + // Extrafields $array_options[$i] = $extrafields->getOptionalsFromPost($object->table_element_line, $i); // Unset extrafield diff --git a/htdocs/langs/en_US/sendings.lang b/htdocs/langs/en_US/sendings.lang index 84f85fb13b4..6ed59b35e89 100644 --- a/htdocs/langs/en_US/sendings.lang +++ b/htdocs/langs/en_US/sendings.lang @@ -78,4 +78,6 @@ DetailWarehouseFormat= W:%s (Qty: %d) ShipmentDistribution=Shipment distribution ErrorTooManyCombinationBatchcode=No dispatch for line %s as too many combination warehouse, product, batch code was found (%s). -ErrorNoCombinationBatchcode=No dispatch for line %s as no combination warehouse, product, batch code was found. \ No newline at end of file +ErrorNoCombinationBatchcode=No dispatch for line %s as no combination warehouse, product, batch code was found. + +ErrorTooMuchShipped=Quantity shipped should not be greater than quantity ordered for line %s