From 179022b129e0c4c526b47e28ebde8e779c82541d Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sat, 23 Apr 2016 16:49:43 +0200 Subject: [PATCH 1/5] Fix country and state were not properly updated after ziptown selection --- htdocs/core/lib/ajax.lib.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 4b3ab3b32f4..fc27f665e45 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -290,14 +290,15 @@ function ajax_multiautocompleter($htmlname, $fields, $url, $option='', $minLengt needtotrigger="#" + fields[i]; } } - } - if (needtotrigger != "") // To force select2 to refresh visible content - { - // We introduce a delay so hand is back to js and all other js change can be done before the trigger that may execute a submit is done - // This is required for example when changing zip with autocomplete that change the country - jQuery(needtotrigger).delay(500).queue(function() { - jQuery(needtotrigger).trigger("change"); - }); + + if (needtotrigger != "") // To force select2 to refresh visible content + { + // We introduce a delay so hand is back to js and all other js change can be done before the trigger that may execute a submit is done + // This is required for example when changing zip with autocomplete that change the country + jQuery(needtotrigger).delay(500).queue(function() { + jQuery(this).trigger("change"); + }); + } } } }); From 961c086be35fac66771841a9866cc81dd4b6168f Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Sat, 23 Apr 2016 20:17:45 +0200 Subject: [PATCH 2/5] not present in some select list --- htdocs/core/class/html.formother.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 5af984ba659..f446caa12a2 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -805,6 +805,7 @@ class FormOther $select_week .= ''; } $select_week .= ''; return $select_week; @@ -844,6 +845,7 @@ class FormOther $select_month .= ''; } $select_month .= ''; return $select_month; From dde4f7ed851a1925c6150ad7aae22ef83663e1c4 Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Sun, 24 Apr 2016 02:01:29 +0200 Subject: [PATCH 3/5] minor error code --- htdocs/product/class/product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 819a5438eda..c4650465fd9 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -3712,7 +3712,7 @@ class Product extends CommonObject } } - if ($size==1 || $size='small') + if ($size==1 || $size=='small') { if ($nbbyrow > 0) { From 6bf52558e49e7190bafaa12d841def7427851d8e Mon Sep 17 00:00:00 2001 From: fappels Date: Mon, 25 Apr 2016 12:13:28 +0200 Subject: [PATCH 4/5] Fix #5100 Develop unable to create new third party Only set fk_stcomm if available Do not set 'null' into float databasefield --- htdocs/societe/class/societe.class.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 17f96a93c3c..62364c57644 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -832,7 +832,10 @@ class Societe extends CommonObject $sql .= ",prefix_comm = ".(! empty($this->prefix_comm)?"'".$this->db->escape($this->prefix_comm)."'":"null"); $sql .= ",fk_effectif = ".(! empty($this->effectif_id)?"'".$this->db->escape($this->effectif_id)."'":"null"); - $sql .= ",fk_stcomm='".$this->stcomm_id."'"; + if (isset($this->stcomm_id)) + { + $sql .= ",fk_stcomm='".$this->stcomm_id."'"; + } $sql .= ",fk_typent = ".(! empty($this->typent_id)?"'".$this->db->escape($this->typent_id)."'":"0"); $sql .= ",fk_forme_juridique = ".(! empty($this->forme_juridique_code)?"'".$this->db->escape($this->forme_juridique_code)."'":"null"); @@ -848,7 +851,7 @@ class Societe extends CommonObject $sql .= ",barcode = ".(! empty($this->barcode)?"'".$this->db->escape($this->barcode)."'":"null"); $sql .= ",default_lang = ".(! empty($this->default_lang)?"'".$this->db->escape($this->default_lang)."'":"null"); $sql .= ",logo = ".(! empty($this->logo)?"'".$this->db->escape($this->logo)."'":"null"); - $sql .= ",outstanding_limit= '".($this->outstanding_limit!=''?$this->outstanding_limit:'null')."'"; + $sql .= ",outstanding_limit= ".($this->outstanding_limit!=''?$this->outstanding_limit:'null'); $sql .= ",fk_prospectlevel='".$this->fk_prospectlevel."'"; $sql .= ",webservices_url = ".(! empty($this->webservices_url)?"'".$this->db->escape($this->webservices_url)."'":"null"); From 75a91785497314fd986d1bf5b7a046636dc2b7ff Mon Sep 17 00:00:00 2001 From: esprit libre Date: Wed, 27 Apr 2016 16:42:59 +0200 Subject: [PATCH 5/5] Fix problem about unit buy price fetching To fix a bug encountered at customer shop about margin calculation. In some case, returned buy price is total buy price from provider and not unit buy price. Case opened on forum: http://www.dolibarr.fr/forum/527-bugs-sur-la-version-stable-courante/55467-calcul-des-marges --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 349ff1e20b1..049ccbd1bc9 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4560,7 +4560,7 @@ abstract class CommonObject $productFournisseur = new ProductFournisseur($this->db); if (($result = $productFournisseur->find_min_price_product_fournisseur($fk_product)) > 0) { - $buyPrice = $productFournisseur->fourn_price; + $buyPrice = $productFournisseur->fourn_unitprice; } else if ($result < 0) {