Merge remote-tracking branch 'origin/3.8' into 3.9

Conflicts:
	htdocs/contrat/list.php
	htdocs/fourn/ajax/getSupplierPrices.php
This commit is contained in:
Laurent Destailleur 2016-06-04 00:58:16 +02:00
commit 085fa6902b
7 changed files with 11 additions and 9 deletions

View File

@ -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))."'";

View File

@ -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))
{

View File

@ -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).'">';

View File

@ -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');

View File

@ -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);

View File

@ -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>';

View File

@ -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; }