Fix: current balance was visible when it should not
This commit is contained in:
parent
27b33cafe6
commit
521b3a89bf
@ -301,7 +301,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
{
|
{
|
||||||
$text=$langs->trans('ConfirmDeleteTransaction');
|
$text=$langs->trans('ConfirmDeleteTransaction');
|
||||||
print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id.'&rowid='.GETPOST("rowid"),$langs->trans('DeleteTransaction'),$text,'confirm_delete');
|
print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id.'&rowid='.GETPOST("rowid"),$langs->trans('DeleteTransaction'),$text,'confirm_delete');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Define transaction list navigation string
|
// Define transaction list navigation string
|
||||||
@ -487,7 +487,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
$var=true;
|
$var=true;
|
||||||
|
|
||||||
$num = $db->num_rows($result);
|
$num = $db->num_rows($result);
|
||||||
$i = 0; $total = 0; $sep = 0;
|
$i = 0; $total = 0; $sep = -1;
|
||||||
|
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
@ -500,13 +500,14 @@ if ($id > 0 || ! empty($ref))
|
|||||||
// Is it a transaction in future ?
|
// Is it a transaction in future ?
|
||||||
$dos=dol_print_date($db->jdate($objp->do),'%Y%m%d');
|
$dos=dol_print_date($db->jdate($objp->do),'%Y%m%d');
|
||||||
//print "dos=".$dos." nows=".$nows;
|
//print "dos=".$dos." nows=".$nows;
|
||||||
if ($dos > $nows && !$sep) // Yes, we show a subtotal
|
if ($dos < $nows) $sep=0; // 0 means there was at least one line before current date
|
||||||
|
if ($dos > $nows && ! $sep) // We have found a line in future and we already found on line before current date
|
||||||
{
|
{
|
||||||
$sep = 1 ;
|
$sep = 1 ;
|
||||||
print '<tr class="liste_total"><td colspan="8">';
|
print '<tr class="liste_total"><td colspan="8">';
|
||||||
print $langs->trans("CurrentBalance");
|
print $langs->trans("CurrentBalance");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td align="right" nowrap><b>'.price($total - $objp->amount).'</b></td>';
|
print '<td align="right" class="nowrap"><b>'.price($total - $objp->amount).'</b></td>';
|
||||||
print "<td> </td>";
|
print "<td> </td>";
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
@ -754,10 +755,10 @@ if ($id > 0 || ! empty($ref))
|
|||||||
if ($page == 0 && ! $mode_search)
|
if ($page == 0 && ! $mode_search)
|
||||||
{
|
{
|
||||||
print '<tr class="liste_total"><td align="left" colspan="8">';
|
print '<tr class="liste_total"><td align="left" colspan="8">';
|
||||||
if ($sep) print ' ';
|
if ($sep > 0) print ' '; // If we had at least one line in future
|
||||||
else print $langs->trans("CurrentBalance");
|
else print $langs->trans("CurrentBalance");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td align="right" nowrap>'.price($total).'</td>';
|
print '<td align="right" nowrap><b>'.price($total).'</b></td>';
|
||||||
print '<td> </td>';
|
print '<td> </td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user