FIX view of balance before field

Conflicts:
	htdocs/compta/bank/bankentries_list.php
This commit is contained in:
Laurent Destailleur 2018-04-07 21:45:06 +02:00
parent 989d1c87c6
commit 304adff973

View File

@ -992,12 +992,12 @@ if ($resql)
{ {
$tmpnbfieldbeforebalance=0; $tmpnbfieldbeforebalance=0;
$tmpnbfieldafterbalance=0; $tmpnbfieldafterbalance=0;
$balancefieldfound=false; $balancefieldfound=0;
foreach($arrayfields as $key => $val) foreach($arrayfields as $key => $val)
{ {
if ($key == 'balancebefore' || $key == 'balance') if ($key == 'balancebefore' || $key == 'balance')
{ {
$balancefieldfound=true; $balancefieldfound++;
continue; continue;
} }
if (! empty($arrayfields[$key]['checked'])) if (! empty($arrayfields[$key]['checked']))
@ -1028,10 +1028,22 @@ if ($resql)
print '<td colspan="'.$tmpnbfieldbeforebalance.'">'; print '<td colspan="'.$tmpnbfieldbeforebalance.'">';
print '</td>'; print '</td>';
} }
if (! empty($arrayfields['balancebefore']['checked']))
{
print '<td align="right">'; print '<td align="right">';
print price(price2num($balance, 'MT'), 1, $langs); print price(price2num($balance, 'MT'), 1, $langs);
print '</td>'; print '</td>';
print '<td colspan="'.($tmpnbfieldafterbalance+3).'">'; }
if (! empty($arrayfields['balance']['checked']))
{
print '<td align="right">';
print price(price2num($balance, 'MT'), 1, $langs);
print '</td>';
}
print '<td align="center">';
print '</td>';
print '<td colspan="'.($tmpnbfieldafterbalance+2).'">';
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
} }
@ -1456,7 +1468,7 @@ if ($resql)
elseif ($totalarray['totalcredfield'] == $i) print '<td align="right">'.price($totalarray['totalcred']).'</td>'; elseif ($totalarray['totalcredfield'] == $i) print '<td align="right">'.price($totalarray['totalcred']).'</td>';
elseif ($i == $posconciliatecol) elseif ($i == $posconciliatecol)
{ {
print '<td>'; print '<td class="center">';
if ($user->rights->banque->consolidate && $action == 'reconcile') print '<input class="button" name="confirm_reconcile" type="submit" value="' . $langs->trans("Conciliate") . '">'; if ($user->rights->banque->consolidate && $action == 'reconcile') print '<input class="button" name="confirm_reconcile" type="submit" value="' . $langs->trans("Conciliate") . '">';
print '</td>'; print '</td>';
} }