From 4900e85fa804af1932ed95cf561c1c32b16ba6e2 Mon Sep 17 00:00:00 2001 From: bahfir abbes Date: Mon, 3 Aug 2020 20:31:39 +0100 Subject: [PATCH 1/5] 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 ' }); '; From 8dd54e24e7e6924b6b0a6a11f33698a59f1a7771 Mon Sep 17 00:00:00 2001 From: Bahfir Abbes Date: Mon, 3 Aug 2020 20:42:25 +0100 Subject: [PATCH 2/5] empty is more useful than 0 --- htdocs/fourn/commande/dispatch.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index ede9b22622a..3bc69e6770b 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -1077,7 +1077,7 @@ if ($id > 0 || !empty($ref)) { while ($i < $nbproduct) { print ' - jQuery("#qty_0_'.$i.'").val(0);'; + jQuery("#qty_0_'.$i.'").val("");'; $i++; } print ' From dbb2e8b1ba909f2373d497d2ad9e4de1cad983a9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Aug 2020 11:56:01 +0200 Subject: [PATCH 3/5] Update dispatch.php --- htdocs/fourn/commande/dispatch.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 3bc69e6770b..46166cb31e0 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -744,7 +744,7 @@ if ($id > 0 || !empty($ref)) { print ''.$langs->trans("QtyOrdered").''; print ''.$langs->trans("QtyDispatchedShort").''; print ' '.$langs->trans("QtyToDispatchShort"); - print ' ('.$langs->trans("Reset").')'.''; + print ' ('.$langs->trans("Reset").')'; print ''; if (!empty($conf->global->SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT)) { From fd551261bbd7b1b1573b4db2444400bc2c080c9c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Aug 2020 11:58:29 +0200 Subject: [PATCH 4/5] Update dispatch.php --- htdocs/fourn/commande/dispatch.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 46166cb31e0..2293fd8aff0 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -744,7 +744,7 @@ if ($id > 0 || !empty($ref)) { print ''.$langs->trans("QtyOrdered").''; print ''.$langs->trans("QtyDispatchedShort").''; print ' '.$langs->trans("QtyToDispatchShort"); - print ' ('.$langs->trans("Reset").')'; + print '
'.$langs->trans("Reset").')'; print ''; if (!empty($conf->global->SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT)) { From 4bacb7d48ebbe34d3aa7256fa8aabf339601832e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Aug 2020 12:00:24 +0200 Subject: [PATCH 5/5] Update dispatch.php --- htdocs/fourn/commande/dispatch.php | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 2293fd8aff0..c64d158ac2c 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -744,7 +744,7 @@ if ($id > 0 || !empty($ref)) { print ''.$langs->trans("QtyOrdered").''; print ''.$langs->trans("QtyDispatchedShort").''; print ' '.$langs->trans("QtyToDispatchShort"); - print '
'.$langs->trans("Reset").')'; + print '
'.$langs->trans("Reset").''; print ''; if (!empty($conf->global->SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT)) { @@ -1069,20 +1069,16 @@ 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("");'; + while ($i < $nbproduct) { + print ' jQuery("#qty_0_'.$i.'").val("");'; $i++; } print ' - });'; - print ' + }); }); ';