Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2018-07-17 21:43:08 +02:00
commit 47cb1f920e

View File

@ -990,15 +990,15 @@ if ($resql)
$objforbalance = $db->fetch_object($resqlforbalance); $objforbalance = $db->fetch_object($resqlforbalance);
if ($objforbalance) if ($objforbalance)
{ {
// If sort is desc,desc,desc then total of previous date is balance of the line to show // If sort is desc,desc,desc then total of previous date + amount is the balancebefore of the previous line before the line to show
if ($sortfield == 'b.datev,b.dateo,b.rowid' && $sortorder == 'desc,desc,desc') if ($sortfield == 'b.datev,b.dateo,b.rowid' && $sortorder == 'desc,desc,desc')
{ {
$balancebefore = $objforbalance->previoustotal + ($sign * $objp->amount); $balancebefore = $objforbalance->previoustotal + ($sign * $objp->amount);
} }
// If sort is asc,asc,asc then total of previous date is balancebefore of the line to show // If sort is asc,asc,asc then total of previous date is balance of line before the next line to show
else else
{ {
$balancebefore = $objforbalance->previoustotal; $balance = $objforbalance->previoustotal;
} }
} }
} }