From 4900e85fa804af1932ed95cf561c1c32b16ba6e2 Mon Sep 17 00:00:00 2001 From: bahfir abbes Date: Mon, 3 Aug 2020 20:31:39 +0100 Subject: [PATCH] fix: reset link on supplier dispatch --- htdocs/fourn/commande/dispatch.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) 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 ' }); ';