From e2e95641a3198d527fe1b39667dd3eb803aca3b8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 23 May 2016 12:27:02 +0200 Subject: [PATCH 1/7] FIX Search supplier ref on contract --- htdocs/contrat/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 669f2b09775..e9a9e2cb8bc 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -180,7 +180,7 @@ if ($resql) print ''; print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; From 1ce91bac06f445c955e710d061caab0bb038d0ce Mon Sep 17 00:00:00 2001 From: gauthier Date: Wed, 25 May 2016 11:25:19 +0200 Subject: [PATCH 2/7] FIX : same page added several times on mergepropal option --- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index f8e6874f3b2..54ffdf0c437 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -710,7 +710,7 @@ class pdf_azur extends ModelePDFPropales if (file_exists($infile) && is_readable($infile)) { $pagecount = $pdf->setSourceFile($infile); for($i = 1; $i <= $pagecount; $i ++) { - $tplIdx = $pdf->importPage(1); + $tplIdx = $pdf->importPage($i); if ($tplIdx!==false) { $s = $pdf->getTemplatesize($tplIdx); $pdf->AddPage($s['h'] > $s['w'] ? 'P' : 'L'); From 71ee941cf84f3954b69bd0a6927cc6eb575dc02e Mon Sep 17 00:00:00 2001 From: gauthier Date: Wed, 25 May 2016 12:25:39 +0200 Subject: [PATCH 3/7] FIX : SQL error function on getAvailableDiscounts function, on bill create mode if socid is empty --- htdocs/compta/facture.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index c13d8197801..ccfd057ccde 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1935,7 +1935,7 @@ if ($action == 'create') $dateinvoice = (empty($dateinvoice)?(empty($conf->global->MAIN_AUTOFILL_DATE)?-1:''):$dateinvoice); // Do not set 0 here (0 for a date is 1970) } - $absolute_discount = $soc->getAvailableDiscounts(); + if(!empty($soc->id)) $absolute_discount = $soc->getAvailableDiscounts(); if (! empty($conf->use_javascript_ajax)) { From ab44adc6d5b7d7fe6d8c926fbe9d45ed225e6cac Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Thu, 2 Jun 2016 12:37:37 +0200 Subject: [PATCH 4/7] Fix SQL error on order stats --- htdocs/commande/class/commandestats.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/commande/class/commandestats.class.php b/htdocs/commande/class/commandestats.class.php index 1ab418a9daa..e38097e4e3a 100644 --- a/htdocs/commande/class/commandestats.class.php +++ b/htdocs/commande/class/commandestats.class.php @@ -206,7 +206,7 @@ class CommandeStats extends Stats $sql = "SELECT product.ref, COUNT(product.ref) as nb, SUM(tl.".$this->field_line.") as total, AVG(tl.".$this->field_line.") as avg"; $sql.= " FROM ".$this->from.", ".$this->from_line.", ".MAIN_DB_PREFIX."product as product"; - //if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE ".$this->where; $sql.= " AND c.rowid = tl.fk_commande AND tl.fk_product = product.rowid"; $sql.= " AND c.date_commande BETWEEN '".$this->db->idate(dol_get_first_day($year,1,false))."' AND '".$this->db->idate(dol_get_last_day($year,12,false))."'"; From 778b05c3416f9ba7c89792ce7e97a00229280f8f Mon Sep 17 00:00:00 2001 From: phf Date: Fri, 3 Jun 2016 23:06:53 +0200 Subject: [PATCH 5/7] Fix #4632 --- htdocs/societe/soc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 76a2c948636..76680649958 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -1863,7 +1863,7 @@ else /* * View */ - $res=$object->fetch_optionals($object->id,$extralabels); + if (!empty($object->id)) $res=$object->fetch_optionals($object->id,$extralabels); //if ($res < 0) { dol_print_error($db); exit; } From c9c7045a6f0ed6d925ac89635a45eeccd492b077 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Fri, 3 Jun 2016 23:34:37 +0200 Subject: [PATCH 6/7] Fix access to project task time spent creation #5249 --- htdocs/projet/tasks/time.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index e54eef4cf6e..7f820304b60 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -359,7 +359,7 @@ if ($id > 0 || ! empty($ref)) /* * Form to add time spent */ - if ($user->rights->projet->creer) + if ($user->rights->projet->lire) { print '
'; From 8b0b3b1a9dc1ac1db0b0d70a14005c9043945a1d Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Fri, 3 Jun 2016 23:49:34 +0200 Subject: [PATCH 7/7] PMP available only if stock module enabled --- htdocs/fourn/ajax/getSupplierPrices.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/ajax/getSupplierPrices.php b/htdocs/fourn/ajax/getSupplierPrices.php index 664c8a2da4e..ae711d2f01b 100644 --- a/htdocs/fourn/ajax/getSupplierPrices.php +++ b/htdocs/fourn/ajax/getSupplierPrices.php @@ -125,9 +125,11 @@ if ($idprod > 0) } } - // Add price for pmp - $price=$producttmp->pmp; - $prices[] = array("id" => 'pmpprice', "price" => $price, "label" => $langs->trans("PMPValueShort").': '.price($price,0,$langs,0,0,-1,$conf->currency), "title" => $langs->trans("PMPValueShort").': '.price($price,0,$langs,0,0,-1,$conf->currency)); + if(!empty($conf->stock->enabled)) { + // Add price for pmp + $price=$producttmp->pmp; + $prices[] = array("id" => 'pmpprice', "price" => $price, "label" => $langs->trans("PMPValueShort").': '.price($price,0,$langs,0,0,-1,$conf->currency), "title" => $langs->trans("PMPValueShort").': '.price($price,0,$langs,0,0,-1,$conf->currency)); + } } echo json_encode($prices);