Skip to content
Snippets Groups Projects
Commit efd5f5ea authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Look: Add line "None" when there is no bank account

parent 6d6231aa
No related branches found
No related tags found
No related merge requests found
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
/** /**
* \file htdocs/compta/bank/index.php * \file htdocs/compta/bank/index.php
* \ingroup banque * \ingroup banque
* \brief Page accueil banque * \brief Home page of bank module
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
...@@ -43,7 +43,8 @@ $statut=isset($_GET["statut"])?$_GET["statut"]:''; ...@@ -43,7 +43,8 @@ $statut=isset($_GET["statut"])?$_GET["statut"]:'';
* View * View
*/ */
llxHeader(); $help_url='EN:Module_Banks_and_Cash|FR:Module_Banques_et_Caisses|ES:Módulo_Bancos_y_Cajas';
llxHeader('',$langs->trans('AccountsArea'),$help_url);
$link=''; $link='';
if ($statut == '') $link='<a href="'.$_SERVER["PHP_SELF"].'?statut=all">'.$langs->trans("IncludeClosedAccount").'</a>'; if ($statut == '') $link='<a href="'.$_SERVER["PHP_SELF"].'?statut=all">'.$langs->trans("IncludeClosedAccount").'</a>';
...@@ -88,12 +89,14 @@ print '<td align="center" width="70">'.$langs->trans("Status").'</td>'; ...@@ -88,12 +89,14 @@ print '<td align="center" width="70">'.$langs->trans("Status").'</td>';
print '<td align="right" width="100">'.$langs->trans("BankBalance").'</td>'; print '<td align="right" width="100">'.$langs->trans("BankBalance").'</td>';
print "</tr>\n"; print "</tr>\n";
$total = 0; $total = 0; $found = 0;
$var=true; $var=true;
foreach ($accounts as $key=>$type) foreach ($accounts as $key=>$type)
{ {
if ($type == 1) if ($type == 1)
{ {
$found++;
$acc = new Account($db); $acc = new Account($db);
$acc->fetch($key); $acc->fetch($key);
...@@ -122,12 +125,12 @@ foreach ($accounts as $key=>$type) ...@@ -122,12 +125,12 @@ foreach ($accounts as $key=>$type)
$total += $solde; $total += $solde;
} }
} }
if (! $found) print '<tr '.$bc[$var].'><td colspan="6">'.$langs->trans("None").'</td></tr>';
// Total // Total
print '<tr class="liste_total"><td colspan="5" class="liste_total">'.$langs->trans("Total").'</td><td align="right" class="liste_total">'.price($total).'</td></tr>'; print '<tr class="liste_total"><td colspan="5" class="liste_total">'.$langs->trans("Total").'</td><td align="right" class="liste_total">'.price($total).'</td></tr>';
print '<tr><td colspan="5">&nbsp;</td></tr>'; //print '<tr><td colspan="5">&nbsp;</td></tr>';
/* /*
...@@ -140,12 +143,14 @@ print '<td align="center" width="70">'.$langs->trans("Status").'</td>'; ...@@ -140,12 +143,14 @@ print '<td align="center" width="70">'.$langs->trans("Status").'</td>';
print '<td align="right" width="100">'.$langs->trans("BankBalance").'</td>'; print '<td align="right" width="100">'.$langs->trans("BankBalance").'</td>';
print "</tr>\n"; print "</tr>\n";
$total = 0; $total = 0; $found = 0;
$var=true; $var=true;
foreach ($accounts as $key=>$type) foreach ($accounts as $key=>$type)
{ {
if ($type == 2) if ($type == 2)
{ {
$found++;
$acc = new Account($db); $acc = new Account($db);
$acc->fetch($key); $acc->fetch($key);
...@@ -166,13 +171,13 @@ foreach ($accounts as $key=>$type) ...@@ -166,13 +171,13 @@ foreach ($accounts as $key=>$type)
$total += $solde; $total += $solde;
} }
} }
if (! $found) print '<tr '.$bc[$var].'><td colspan="6">'.$langs->trans("None").'</td></tr>';
// Total // Total
print '<tr class="liste_total"><td colspan="5" class="liste_total">'.$langs->trans("Total").'</td><td align="right" class="liste_total">'.price($total).'</td></tr>'; print '<tr class="liste_total"><td colspan="5" class="liste_total">'.$langs->trans("Total").'</td><td align="right" class="liste_total">'.price($total).'</td></tr>';
print '<tr><td colspan="5">&nbsp;</td></tr>'; //print '<tr><td colspan="5">&nbsp;</td></tr>';
/* /*
...@@ -187,12 +192,14 @@ print '<td align="center" width="70">'.$langs->trans("Status").'</td>'; ...@@ -187,12 +192,14 @@ print '<td align="center" width="70">'.$langs->trans("Status").'</td>';
print '<td align="right" width="100">'.$langs->trans("BankBalance").'</td>'; print '<td align="right" width="100">'.$langs->trans("BankBalance").'</td>';
print "</tr>\n"; print "</tr>\n";
$total = 0; $total = 0; $found = 0;
$var=true; $var=true;
foreach ($accounts as $key=>$type) foreach ($accounts as $key=>$type)
{ {
if ($type == 0) if ($type == 0)
{ {
$found++;
$acc = new Account($db); $acc = new Account($db);
$acc->fetch($key); $acc->fetch($key);
...@@ -221,7 +228,7 @@ foreach ($accounts as $key=>$type) ...@@ -221,7 +228,7 @@ foreach ($accounts as $key=>$type)
$total += $solde; $total += $solde;
} }
} }
if (! $found) print '<tr '.$bc[$var].'><td colspan="6">'.$langs->trans("None").'</td></tr>';
// Total // Total
print '<tr class="liste_total"><td colspan="5" class="liste_total">'.$langs->trans("Total").'</td><td align="right" class="liste_total">'.price($total).'</td></tr>'; print '<tr class="liste_total"><td colspan="5" class="liste_total">'.$langs->trans("Total").'</td><td align="right" class="liste_total">'.price($total).'</td></tr>';
...@@ -241,7 +248,7 @@ if ($user->rights->banque->configurer) { ...@@ -241,7 +248,7 @@ if ($user->rights->banque->configurer) {
print "</div>"; print "</div>";
$db->close();
llxFooter(); llxFooter();
$db->close();
?> ?>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment