diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index a26fa443496..4dca2d3fd02 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -12639,7 +12639,7 @@ function getFieldErrorIcon($fieldValidationErrorMsg) * @param string $url the url for link * @param string $id attribute id of button * @param int<-2,2> $status 0 no user rights, 1 active, 2 current action or selected, -1 Feature Disabled, -2 disable Other reason use param $helpText as tooltip help - * @param array $params various params for future : recommended rather than adding more function arguments + * @param array $params various parameters for future : recommended rather than adding more function arguments * @return string html button */ function dolGetButtonTitle($label, $helpText = '', $iconClass = 'fa fa-file', $url = '', $id = '', $status = 1, $params = array()) diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 1b5edf77e7c..3aeac657350 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -997,9 +997,13 @@ if ($id > 0 || !empty($ref)) { } // Qty to dispatch - print ''; - print ''.img_picto($langs->trans("Reset"), 'eraser', 'class="pictofixedwidth opacitymedium"').''; - print ''; + print ''; + if ($remaintodispatch>0) { + $btnLabel = $langs->trans("Fill").' : '.$remaintodispatch; + print ''; + } + print ''; + print ''; print ''; print ''; @@ -1136,6 +1140,11 @@ if ($id > 0 || !empty($ref)) { $("select[name^=entrepot_]").val(fk_default_warehouse).change(); }); + $(".auto-fill-qty").on("click touchstart", function(e){ + e.preventDefault(); + $("input[name="+$(this).data("rowname")+"]").val($(this).data("value")).trigger("change"); + }); + $("#autoreset").click(function() { $(".qtydispatchinput").each(function(){ id = $(this).attr("id"); @@ -1154,7 +1163,8 @@ if ($id > 0 || !empty($ref)) { }); }); - $(".resetline").click(function(){ + $(".resetline").click(function(e){ + e.preventDefault(); id = $(this).attr("id"); id = id.split("reset_"); console.log("Reset trigger for id = qty_"+id[1]); diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 7b2930044c3..ccde48cade0 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2419,7 +2419,7 @@ class Societe extends CommonObject // Writes trace in discount history $sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_remise"; $sql .= " (entity, datec, fk_soc, remise_client, note, fk_user_author)"; - $sql .= " VALUES (".$conf->entity.", '".$this->db->idate($now)."', ".((int) $this->id).", '".$this->db->escape($remise)."',"; + $sql .= " VALUES (".((int) $conf->entity).", '".$this->db->idate($now)."', ".((int) $this->id).", '".$this->db->escape($remise)."',"; $sql .= " '".$this->db->escape($note)."',"; $sql .= " ".((int) $user->id); $sql .= ")"; @@ -2480,7 +2480,7 @@ class Societe extends CommonObject // Writes trace in discount history $sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_remise_supplier"; $sql .= " (entity, datec, fk_soc, remise_supplier, note, fk_user_author)"; - $sql .= " VALUES (".$conf->entity.", '".$this->db->idate($now)."', ".((int) $this->id).", '".$this->db->escape($remise)."',"; + $sql .= " VALUES (".((int) $conf->entity).", '".$this->db->idate($now)."', ".((int) $this->id).", '".$this->db->escape($remise)."',"; $sql .= " '".$this->db->escape($note)."',"; $sql .= " ".((int) $user->id); $sql .= ")"; diff --git a/htdocs/theme/eldy/btn.inc.php b/htdocs/theme/eldy/btn.inc.php index 7b41cfa6b2c..95df3a93ebd 100644 --- a/htdocs/theme/eldy/btn.inc.php +++ b/htdocs/theme/eldy/btn.inc.php @@ -344,7 +344,7 @@ div.pagination li:first-child a.btnTitle, div.pagination li.paginationafterarrow /* - * BTN LINK + * BTN LINK (used with tag in general but not with