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))."'";
diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index 8604e95b5a2..85bcf2c68fa 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -1954,7 +1954,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))
{
diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php
index e8c722dcab3..23df8a06593 100644
--- a/htdocs/contrat/list.php
+++ b/htdocs/contrat/list.php
@@ -245,7 +245,7 @@ if ($resql)
print '';
print '';
print '
';
- print '';
+ print '';
print ' | ';
print '';
print '';
diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php
index 152291c56e2..4b7ddc337b0 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');
diff --git a/htdocs/fourn/ajax/getSupplierPrices.php b/htdocs/fourn/ajax/getSupplierPrices.php
index 9a94553930d..6725c813403 100644
--- a/htdocs/fourn/ajax/getSupplierPrices.php
+++ b/htdocs/fourn/ajax/getSupplierPrices.php
@@ -89,9 +89,11 @@ if ($idprod > 0)
}
}
- // Add price for pmp
- $price=$producttmp->pmp;
- $prices[] = array("id" => 'pmpprice', "price" => price2num($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)); // For price field, we must use price2num(), for label or title, price()
+ if(!empty($conf->stock->enabled)) {
+ // Add price for pmp
+ $price=$producttmp->pmp;
+ $prices[] = array("id" => 'pmpprice', "price" => price2num($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)); // For price field, we must use price2num(), for label or title, price()
+ }
}
echo json_encode($prices);
diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php
index 5ed3655615e..02fa370fc13 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 ' ';
diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php
index cb4f65abeed..85eacc44341 100644
--- a/htdocs/societe/soc.php
+++ b/htdocs/societe/soc.php
@@ -1864,7 +1864,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; }
|