diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php
index 0c0f084a230..ede9b22622a 100644
--- a/htdocs/fourn/commande/dispatch.php
+++ b/htdocs/fourn/commande/dispatch.php
@@ -743,7 +743,8 @@ if ($id > 0 || !empty($ref)) {
print '
'.$langs->trans("SupplierRef").' | ';
print ''.$langs->trans("QtyOrdered").' | ';
print ''.$langs->trans("QtyDispatchedShort").' | ';
- print ''.$langs->trans("QtyToDispatchShort").' | ';
+ print ' '.$langs->trans("QtyToDispatchShort");
+ print ' ('.$langs->trans("Reset").')'.' | ';
print ' | ';
if (!empty($conf->global->SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT)) {
@@ -1068,7 +1069,20 @@ if ($id > 0 || !empty($ref)) {
$("select[name=fk_default_warehouse]").change(function() {
var fk_default_warehouse = $("option:selected", this).val();
$("select[name^=entrepot_]").val(fk_default_warehouse).change();
- });
+ });';
+ $i = 0;
+ print '
+ jQuery("#autoreset").click(function() {';
+ $i = 0;
+ while ($i < $nbproduct)
+ {
+ print '
+ jQuery("#qty_0_'.$i.'").val(0);';
+ $i++;
+ }
+ print '
+ });';
+ print '
});
';