From 4503659cba8707a6ef2bc2e704d84cbc09c286c5 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 6 Jul 2016 16:50:10 +0200 Subject: [PATCH 1/4] Fix: wrong multicompany filter --- htdocs/product/index.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/product/index.php b/htdocs/product/index.php index 83366690476..cfa936346b4 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -372,14 +372,13 @@ function activitytrim($product_type) // breakdown by quarter $sql = "SELECT DATE_FORMAT(p.datep,'%Y') as annee, DATE_FORMAT(p.datep,'%m') as mois, SUM(fd.total_ht) as Mnttot"; - $sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."facturedet as fd"; + $sql.= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."facturedet as fd"; $sql.= " , ".MAIN_DB_PREFIX."paiement as p,".MAIN_DB_PREFIX."paiement_facture as pf"; - $sql.= " WHERE f.fk_soc = s.rowid"; + $sql.= " WHERE f.entity = " . $conf->entity; $sql.= " AND f.rowid = fd.fk_facture"; $sql.= " AND pf.fk_facture = f.rowid"; $sql.= " AND pf.fk_paiement= p.rowid"; $sql.= " AND fd.product_type=".$product_type; - $sql.= " AND s.entity IN (".getEntity('societe', 1).")"; $sql.= " AND p.datep >= '".$db->idate(dol_get_first_day($yearofbegindate),1)."'"; $sql.= " GROUP BY annee, mois "; $sql.= " ORDER BY annee, mois "; From 1232e25859099c5d63b8fbaa11c77facc0a8627e Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Sat, 16 Jul 2016 20:00:55 +0200 Subject: [PATCH 2/4] FIX #5474 Country_id of "Don" object is still empty --- htdocs/don/class/don.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index 2b84f0d0727..45dd027212b 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -4,6 +4,7 @@ * Copyright (C) 2009 Regis Houssin * Copyright (C) 2014 Florian Henry * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2016 Juanjo Menent * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -645,7 +646,7 @@ class Don extends CommonObject $this->town = $obj->town; $this->zip = $obj->zip; $this->town = $obj->town; - $this->country_id = $obj->country_id; + $this->country_id = $obj->fk_country; $this->country_code = $obj->country_code; $this->country = $obj->country; $this->country_olddata= $obj->country_olddata; // deprecated From 3b563700604f5afc24eea8b69e715b2d8a9a0162 Mon Sep 17 00:00:00 2001 From: Sergio Sanchis Climent Date: Sun, 17 Jul 2016 02:48:04 +0200 Subject: [PATCH 3/4] Fix #5450 --- htdocs/expensereport/class/expensereport.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index cc32f08b0ac..b4ea91f85b6 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -1747,7 +1747,7 @@ class ExpenseReportLine // Mise a jour ligne en base $sql = "UPDATE ".MAIN_DB_PREFIX."expensereport_det SET"; $sql.= " comments='".$this->db->escape($this->comments)."'"; - $sql.= ",value_unit=".$this->value_unit.""; + $sql.= ",value_unit=".price2num($this->value_unit).""; $sql.= ",qty=".$this->qty.""; $sql.= ",date='".$this->db->idate($this->date)."'"; $sql.= ",total_ht=".$this->total_ht.""; From e52d6db3fd53ec9cdde999b4e4517a6de4aaf240 Mon Sep 17 00:00:00 2001 From: Sergio Sanchis Climent Date: Sun, 17 Jul 2016 12:18:29 +0200 Subject: [PATCH 4/4] Fix #5450 --- htdocs/expensereport/class/expensereport.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index b4ea91f85b6..83038074695 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -1741,13 +1741,14 @@ class ExpenseReportLine // Clean parameters $this->comments=trim($this->comments); $this->vatrate = price2num($this->vatrate); + $this->value_unit = price2num($this->value_unit); $this->db->begin(); // Mise a jour ligne en base $sql = "UPDATE ".MAIN_DB_PREFIX."expensereport_det SET"; $sql.= " comments='".$this->db->escape($this->comments)."'"; - $sql.= ",value_unit=".price2num($this->value_unit).""; + $sql.= ",value_unit=".$this->value_unit.""; $sql.= ",qty=".$this->qty.""; $sql.= ",date='".$this->db->idate($this->date)."'"; $sql.= ",total_ht=".$this->total_ht."";