diff --git a/htdocs/commande/class/commandestats.class.php b/htdocs/commande/class/commandestats.class.php index 1ab418a9daa597a3845d8f954c1121c0c9a53b44..e38097e4e3ad09e8036c03c3d2e613f8e11e33e4 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 8604e95b5a28a244106362c3eff3c6cd72bcbc4a..85bcf2c68fa8ee7a642a4b506d6277355b6c32d7 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 e8c722dcab3227f15e1258b4021099b19ab6e4f4..23df8a06593a13ca9054080f3313dc22cd1df4d3 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -245,7 +245,7 @@ if ($resql) print '<input type="text" class="flat" size="3" name="search_contract" value="'.dol_escape_htmltag($search_contract).'">'; print '</td>'; print '<td class="liste_titre">'; - print '<input type="text" class="flat" size="6" name="search_ref_customer value="'.dol_escape_htmltag($search_ref_supplier).'">'; + print '<input type="text" class="flat" size="6" name="search_ref_customer value="'.dol_escape_htmltag($search_ref_customer).'">'; print '</td>'; print '<td class="liste_titre">'; print '<input type="text" class="flat" size="6" name="search_ref_supplier value="'.dol_escape_htmltag($search_ref_supplier).'">'; diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 152291c56e2616c03e7dca10db1df3abc5c140cf..4b7ddc337b0a4215ca29ff0898f7f930170c3f30 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 9a94553930d866f86579df31253229b4d3714983..6725c813403df9b3c3e22514eaf2f8dc0c6890c8 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 5ed3655615e95796acf44ce1fd6fe110d90b2204..02fa370fc13eac4ccd62c6ddd6d33524888f4d00 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 '<br>'; diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index cb4f65abeed49c134949bf7e6c53661b82c54e98..85eacc443413b452b1469634552c2046066d9233 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; }