diff --git a/htdocs/product/index.php b/htdocs/product/index.php
index 88c4158617a..f80815a1ed6 100644
--- a/htdocs/product/index.php
+++ b/htdocs/product/index.php
@@ -136,20 +136,24 @@ if ($conf->service->enabled)
$statServices.= '
'.$langs->trans("ServicesOnSell").' | '.round($prodser[1][1]).' | ';
$statServices.= "";
}
+$total=0;
if ($type == '0')
{
print $statProducts;
+ $total=round($prodser[0][0])+round($prodser[0][1]);
}
else if ($type == '1')
{
print $statServices;
+ $total=round($prodser[1][0])+round($prodser[1][1]);
}
else
{
print $statProducts.$statServices;
+ $total=round($prodser[1][0])+round($prodser[1][1])+round($prodser[0][0])+round($prodser[0][1]);
}
print '| '.$langs->trans("Total").' | ';
-print round($prodser[1][0])+round($prodser[1][1])+round($prodser[0][0])+round($prodser[0][1]);
+print $total;
print ' |
';
print '';