Skip to content
Snippets Groups Projects
Commit 6184c711 authored by Marcos García de La Fuente's avatar Marcos García de La Fuente
Browse files

Corrected comparison of Account::canBeConciliated output

parent 66313f58
No related branches found
No related tags found
No related merge requests found
......@@ -397,15 +397,11 @@ if ($id > 0 || ! empty($ref))
}
}
if ($object->canBeConciliated())
{
if ($object->canBeConciliated() > 0) {
// If not cash account and can be reconciliate
if ($user->rights->banque->consolidate)
{
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/bank/rappro.php?account='.$object->id.($vline?'&amp;vline='.$vline:'').'">'.$langs->trans("Conciliate").'</a>';
}
else
{
if ($user->rights->banque->consolidate) {
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/bank/rappro.php?account='.$object->id.($vline ? '&amp;vline='.$vline : '').'">'.$langs->trans("Conciliate").'</a>';
} else {
print '<a class="butActionRefused" title="'.$langs->trans("NotEnoughPermissions").'" href="#">'.$langs->trans("Conciliate").'</a>';
}
}
......@@ -529,8 +525,11 @@ if ($id > 0 || ! empty($ref))
print '<td align="right">'.$langs->trans("Credit").'</td>';
print '<td align="right" width="80">'.$langs->trans("BankBalance").'</td>';
print '<td align="center" width="60">';
if ($object->canBeConciliated()) print $langs->trans("AccountStatementShort");
else print '&nbsp;';
if ($object->canBeConciliated() > 0) {
print $langs->trans("AccountStatementShort");
} else {
print '&nbsp;';
}
print '</td></tr>';
print '<form action="'.$_SERVER["PHP_SELF"].'?'.$param.'" name="search" method="POST">';
......
......@@ -143,15 +143,12 @@ if (empty($num))
dol_fiche_end();
print '<div class="tabsAction">';
if ($object->canBeConciliated()) {
if ($object->canBeConciliated() > 0) {
// If not cash account and can be reconciliate
if ($user->rights->banque->consolidate)
{
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/bank/rappro.php?account='.$object->id.($vline?'&amp;vline='.$vline:'').'">'.$langs->trans("Conciliate").'</a>';
}
else
{
if ($user->rights->banque->consolidate) {
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/bank/rappro.php?account='.$object->id.($vline ? '&amp;vline='.$vline : '').'">'.$langs->trans("Conciliate").'</a>';
} else {
print '<a class="butActionRefused" title="'.$langs->trans("NotEnoughPermissions").'" href="#">'.$langs->trans("Conciliate").'</a>';
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment