diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index 2167f15a7e5..70f14f9edf5 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -2,7 +2,7 @@ /* Copyright (C) 2001-2007 Rodolphe Quiedeville * Copyright (C) 2004-2017 Laurent Destailleur * Copyright (C) 2005 Eric Seigne - * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2005-2018 Regis Houssin * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2011-2014 Juanjo Menent * Copyright (C) 2015 Raphaël Doursenaud @@ -342,6 +342,7 @@ if ($id > 0 || ! empty($ref)) $class='pair'; + $totalsell=0; if (count($prods_arbo)) { foreach($prods_arbo as $value) @@ -369,11 +370,16 @@ if ($id > 0 || ! empty($ref)) } print ''; - $totalline=price2num($value['nb'] * ($product_fourn->fourn_unitprice * (1 - $product_fourn->fourn_remise_percent/100) - $product_fourn->fourn_remise), 'MT'); + // For avoid a non-numeric value + $fourn_unitprice = (!empty($product_fourn->fourn_unitprice)?$product_fourn->fourn_unitprice:0); + $fourn_remise_percent = (!empty($product_fourn->fourn_remise_percent)?$product_fourn->fourn_remise_percent:0); + $fourn_remise = (!empty($product_fourn->fourn_remise)?$product_fourn->fourn_remise:0); + + $totalline=price2num($value['nb'] * ($fourn_unitprice * (1 - $fourn_remise_percent/100) - $fourn_remise), 'MT'); $total+=$totalline; print ''; - print ($notdefined?'':($value['nb']> 1 ? $value['nb'].'x' : '').price($product_fourn->fourn_unitprice,'','',0,0,-1,$conf->currency)); + print ($notdefined?'':($value['nb']> 1 ? $value['nb'].'x' : '').price($fourn_unitprice,'','',0,0,-1,$conf->currency)); print ''; // Best selling price @@ -382,10 +388,15 @@ if ($id > 0 || ! empty($ref)) { $pricesell='Variable'; } - $totallinesell=price2num($value['nb'] * ($pricesell), 'MT'); - $totalsell+=$totallinesell; + else + { + $totallinesell=price2num($value['nb'] * ($pricesell), 'MT'); + $totalsell+=$totallinesell; + } print ''; - print ($notdefined?'':($value['nb']> 1 ? $value['nb'].'x' : '').price($pricesell,'','',0,0,-1,$conf->currency)); + print ($notdefined?'':($value['nb']> 1 ? $value['nb'].'x' : ''); + if (is_numeric($pricesell)) print price($pricesell,'','',0,0,-1,$conf->currency)); + else print $langs->trans($pricesell); print ''; // Stock diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php index 4bade1db2cf..959f2377d9d 100644 --- a/htdocs/product/reassort.php +++ b/htdocs/product/reassort.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2015 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2005-2018 Regis Houssin * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2015 Raphaël Doursenaud * @@ -57,6 +57,7 @@ $page = GETPOST("page",'int'); if (! $sortfield) $sortfield="p.ref"; if (! $sortorder) $sortorder="ASC"; $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; +if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 $offset = $limit * $page ; // Load sale and categ filters diff --git a/htdocs/product/reassortlot.php b/htdocs/product/reassortlot.php index 7b82408cfc0..b4d14ef1231 100644 --- a/htdocs/product/reassortlot.php +++ b/htdocs/product/reassortlot.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2016 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2005-2018 Regis Houssin * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2016 Ferran Marcet @@ -61,6 +61,7 @@ $page = GETPOST("page",'int'); if (! $sortfield) $sortfield="p.ref"; if (! $sortorder) $sortorder="ASC"; $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; +if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 $offset = $limit * $page ; // Load sale and categ filters diff --git a/htdocs/product/traduction.php b/htdocs/product/traduction.php index e8900d51bb4..c96e1c0f025 100644 --- a/htdocs/product/traduction.php +++ b/htdocs/product/traduction.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2005-2018 Regis Houssin * Copyright (C) 2007 Rodolphe Quiedeville * Copyright (C) 2010-2012 Destailleur Laurent * Copyright (C) 2014 Henry Florian @@ -205,7 +205,7 @@ $linkback = '