Merge branch '3.9' of git@github.com:Dolibarr/dolibarr.git into 4.0

Conflicts:
	htdocs/core/modules/barcode/modules_barcode.class.php
	htdocs/product/admin/product.php
This commit is contained in:
Laurent Destailleur 2016-08-05 00:42:40 +02:00
commit 782ab6a02b
5 changed files with 37 additions and 24 deletions

View File

@ -3144,7 +3144,7 @@ class Commande extends CommonOrder
*/ */
function getNomUrl($withpicto=0,$option=0,$max=0,$short=0) function getNomUrl($withpicto=0,$option=0,$max=0,$short=0)
{ {
global $conf, $langs; global $conf, $langs, $user;
$result=''; $result='';
@ -3154,17 +3154,29 @@ class Commande extends CommonOrder
if ($short) return $url; if ($short) return $url;
$picto = 'order'; $picto = 'order';
$label = '<u>' . $langs->trans("ShowOrder") . '</u>'; $label = '';
if (! empty($this->ref))
$label .= '<br><b>' . $langs->trans('Ref') . ':</b> ' . $this->ref; if ($user->rights->commande->lire) {
if (! empty($this->ref_client)) $label = '<u>'.$langs->trans("ShowOrder").'</u>';
$label.= '<br><b>' . $langs->trans('RefCustomer') . ':</b> ' . $this->ref_client; if (!empty($this->ref)) {
if (! empty($this->total_ht)) $label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
$label.= '<br><b>' . $langs->trans('AmountHT') . ':</b> ' . price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency); }
if (! empty($this->total_tva)) if (!empty($this->ref_client)) {
$label.= '<br><b>' . $langs->trans('VAT') . ':</b> ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency); $label .= '<br><b>'.$langs->trans('RefCustomer').':</b> '.$this->ref_client;
if (! empty($this->total_ttc)) }
$label.= '<br><b>' . $langs->trans('AmountTTC') . ':</b> ' . price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency); if (!empty($this->total_ht)) {
$label .= '<br><b>'.$langs->trans('AmountHT').':</b> '.price($this->total_ht, 0, $langs, 0, -1, -1,
$conf->currency);
}
if (!empty($this->total_tva)) {
$label .= '<br><b>'.$langs->trans('VAT').':</b> '.price($this->total_tva, 0, $langs, 0, -1, -1,
$conf->currency);
}
if (!empty($this->total_ttc)) {
$label .= '<br><b>'.$langs->trans('AmountTTC').':</b> '.price($this->total_ttc, 0, $langs, 0, -1, -1,
$conf->currency);
}
}
$linkstart = '<a href="'.$url.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">'; $linkstart = '<a href="'.$url.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$linkend='</a>'; $linkend='</a>';

View File

@ -141,7 +141,7 @@ if ($prev_id)
print price($row[0]); print price($row[0]);
print '</td><td align="right">'; print '</td><td align="right">';
print round($row[0]/$bon->amount*100,2)." %"; if ($bon->amount) print round($row[0]/$bon->amount*100,2)." %";
print '</td>'; print '</td>';
print "</tr>\n"; print "</tr>\n";

View File

@ -109,7 +109,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
*/ */
function getExample($langs,$objproduct=0) function getExample($langs,$objproduct=0)
{ {
$examplebarcode = $this->getNextValue($objproduct,0); $examplebarcode = $this->getNextValue($objproduct,'');
if (! $examplebarcode) if (! $examplebarcode)
{ {
$examplebarcode = $langs->trans('NotConfigured'); $examplebarcode = $langs->trans('NotConfigured');
@ -127,7 +127,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
* Return next value * Return next value
* *
* @param Product $objproduct Object product * @param Product $objproduct Object product
* @param string $type type of barcode (EAN, ISBN, ...) * @param string $type Type of barcode (EAN, ISBN, ...)
* @return string Value if OK, '' if module not configured, <0 if KO * @return string Value if OK, '' if module not configured, <0 if KO
*/ */
function getNextValue($objproduct=null,$type='') function getNextValue($objproduct=null,$type='')

View File

@ -87,11 +87,11 @@ abstract class ModeleNumRefBarCode
/** /**
* Return next value available * Return next value available
* *
* @param Societe $objsoc Object thirdparty * @param Product $objproduct Object Product
* @param int $type Type * @param string $type Type of barcode (EAN, ISBN, ...)
* @return string Value * @return string Value
*/ */
function getNextValue($objsoc=null,$type=-1) function getNextValue($objproduct,$type='')
{ {
global $langs; global $langs;
return $langs->trans("Function_getNextValue_InModuleNotWorking"); return $langs->trans("Function_getNextValue_InModuleNotWorking");
@ -165,7 +165,7 @@ abstract class ModeleNumRefBarCode
$s.=$langs->trans("AutomaticCode").': '.yn($this->code_auto,1,2).'<br>'; $s.=$langs->trans("AutomaticCode").': '.yn($this->code_auto,1,2).'<br>';
$s.='<br>'; $s.='<br>';
$nextval=$this->getNextValue($soc,0); $nextval=$this->getNextValue($soc,'');
if (empty($nextval)) $nextval=$langs->trans("Undefined"); if (empty($nextval)) $nextval=$langs->trans("Undefined");
$s.=$langs->trans("NextValue").': <b>'.$nextval.'</b><br>'; $s.=$langs->trans("NextValue").': <b>'.$nextval.'</b><br>';

View File

@ -8,6 +8,7 @@
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr> * Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr> * Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com> * Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
* Copyright (C) 2016 Ferran Marcet <fmarcet@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -114,7 +115,7 @@ if ($action == 'setModuleOptions')
} }
} }
if ($action == 'other' && GETPOST('value_PRODUIT_LIMIT_SIZE') > 0) if ($action == 'other' && GETPOST('value_PRODUIT_LIMIT_SIZE') >= 0)
{ {
$res = dolibarr_set_const($db, "PRODUIT_LIMIT_SIZE", GETPOST('value_PRODUIT_LIMIT_SIZE'),'chaine',0,'',$conf->entity); $res = dolibarr_set_const($db, "PRODUIT_LIMIT_SIZE", GETPOST('value_PRODUIT_LIMIT_SIZE'),'chaine',0,'',$conf->entity);
} }