diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php
index 6f14d407a5d..3680672bc53 100644
--- a/htdocs/commande/class/commande.class.php
+++ b/htdocs/commande/class/commande.class.php
@@ -3144,7 +3144,7 @@ class Commande extends CommonOrder
*/
function getNomUrl($withpicto=0,$option=0,$max=0,$short=0)
{
- global $conf, $langs;
+ global $conf, $langs, $user;
$result='';
@@ -3154,17 +3154,29 @@ class Commande extends CommonOrder
if ($short) return $url;
$picto = 'order';
- $label = '' . $langs->trans("ShowOrder") . '';
- if (! empty($this->ref))
- $label .= '
' . $langs->trans('Ref') . ': ' . $this->ref;
- if (! empty($this->ref_client))
- $label.= '
' . $langs->trans('RefCustomer') . ': ' . $this->ref_client;
- if (! empty($this->total_ht))
- $label.= '
' . $langs->trans('AmountHT') . ': ' . price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
- if (! empty($this->total_tva))
- $label.= '
' . $langs->trans('VAT') . ': ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
- if (! empty($this->total_ttc))
- $label.= '
' . $langs->trans('AmountTTC') . ': ' . price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
+ $label = '';
+
+ if ($user->rights->commande->lire) {
+ $label = ''.$langs->trans("ShowOrder").'';
+ if (!empty($this->ref)) {
+ $label .= '
'.$langs->trans('Ref').': '.$this->ref;
+ }
+ if (!empty($this->ref_client)) {
+ $label .= '
'.$langs->trans('RefCustomer').': '.$this->ref_client;
+ }
+ if (!empty($this->total_ht)) {
+ $label .= '
'.$langs->trans('AmountHT').': '.price($this->total_ht, 0, $langs, 0, -1, -1,
+ $conf->currency);
+ }
+ if (!empty($this->total_tva)) {
+ $label .= '
'.$langs->trans('VAT').': '.price($this->total_tva, 0, $langs, 0, -1, -1,
+ $conf->currency);
+ }
+ if (!empty($this->total_ttc)) {
+ $label .= '
'.$langs->trans('AmountTTC').': '.price($this->total_ttc, 0, $langs, 0, -1, -1,
+ $conf->currency);
+ }
+ }
$linkstart = '';
$linkend='';
diff --git a/htdocs/compta/prelevement/fiche-stat.php b/htdocs/compta/prelevement/fiche-stat.php
index c2316578130..25ae7c52c50 100644
--- a/htdocs/compta/prelevement/fiche-stat.php
+++ b/htdocs/compta/prelevement/fiche-stat.php
@@ -141,7 +141,7 @@ if ($prev_id)
print price($row[0]);
print '
';
- print round($row[0]/$bon->amount*100,2)." %";
+ if ($bon->amount) print round($row[0]/$bon->amount*100,2)." %";
print ' | ';
print "\n";
diff --git a/htdocs/core/modules/barcode/mod_barcode_product_standard.php b/htdocs/core/modules/barcode/mod_barcode_product_standard.php
index 8db0d2001cd..1aadf650487 100644
--- a/htdocs/core/modules/barcode/mod_barcode_product_standard.php
+++ b/htdocs/core/modules/barcode/mod_barcode_product_standard.php
@@ -109,7 +109,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
*/
function getExample($langs,$objproduct=0)
{
- $examplebarcode = $this->getNextValue($objproduct,0);
+ $examplebarcode = $this->getNextValue($objproduct,'');
if (! $examplebarcode)
{
$examplebarcode = $langs->trans('NotConfigured');
@@ -127,7 +127,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
* Return next value
*
* @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
*/
function getNextValue($objproduct=null,$type='')
@@ -278,7 +278,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
}
dol_syslog(get_class($this).'::verif_syntax codefortest='.$codefortest." typefortest=".$typefortest);
-
+
$newcodefortest=$codefortest;
// Special case, if mask is on 12 digits instead of 13, we remove last char into code to test
@@ -290,7 +290,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
dol_syslog(get_class($this).'::verif_syntax newcodefortest='.$newcodefortest);
}
}
-
+
$result=check_value($mask,$newcodefortest);
return $result;
diff --git a/htdocs/core/modules/barcode/modules_barcode.class.php b/htdocs/core/modules/barcode/modules_barcode.class.php
index 00f5fb967f7..4720ffb1341 100644
--- a/htdocs/core/modules/barcode/modules_barcode.class.php
+++ b/htdocs/core/modules/barcode/modules_barcode.class.php
@@ -87,11 +87,11 @@ abstract class ModeleNumRefBarCode
/**
* Return next value available
*
- * @param Societe $objsoc Object thirdparty
- * @param int $type Type
+ * @param Product $objproduct Object Product
+ * @param string $type Type of barcode (EAN, ISBN, ...)
* @return string Value
*/
- function getNextValue($objsoc=null,$type=-1)
+ function getNextValue($objproduct,$type='')
{
global $langs;
return $langs->trans("Function_getNextValue_InModuleNotWorking");
@@ -165,7 +165,7 @@ abstract class ModeleNumRefBarCode
$s.=$langs->trans("AutomaticCode").': '.yn($this->code_auto,1,2).'
';
$s.='
';
- $nextval=$this->getNextValue($soc,0);
+ $nextval=$this->getNextValue($soc,'');
if (empty($nextval)) $nextval=$langs->trans("Undefined");
$s.=$langs->trans("NextValue").': '.$nextval.'
';
diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php
index 130a0e55208..c42c3981494 100644
--- a/htdocs/product/admin/product.php
+++ b/htdocs/product/admin/product.php
@@ -5,9 +5,10 @@
* Copyright (C) 2007 Auguria SARL
* Copyright (C) 2005-2012 Regis Houssin
* Copyright (C) 2011-2012 Juanjo Menent
- * Copyright (C) 2012 Christophe Battarel
+ * Copyright (C) 2012 Christophe Battarel
* Copyright (C) 2012 Cedric Salvador
- * Copyright (C) 2016 Charlie Benke
+ * Copyright (C) 2016 Charlie Benke
+ * Copyright (C) 2016 Ferran Marcet
*
* 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
@@ -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);
}