From 89547dde37dcc0acc19e731333c64ec8b5d05916 Mon Sep 17 00:00:00 2001 From: frederic34 Date: Wed, 11 Jun 2014 17:42:03 +0200 Subject: [PATCH 1/2] Display the total by currency account --- htdocs/compta/bank/index.php | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/htdocs/compta/bank/index.php b/htdocs/compta/bank/index.php index cf43fc578fb..e98d8978440 100644 --- a/htdocs/compta/bank/index.php +++ b/htdocs/compta/bank/index.php @@ -90,7 +90,7 @@ print ''.$langs->trans("Status").''; print ''.$langs->trans("BankBalance").''; print "\n"; -$total = 0; $found = 0; +$total = array(); $found = 0; $var=true; foreach ($accounts as $key=>$type) { @@ -119,17 +119,19 @@ foreach ($accounts as $key=>$type) print ''; print ''.$acc->getLibStatut(2).''; print ''; - print ''.price($solde).''; + print ''.price($solde, 0, $langs, 0, 0, -1, $acc->currency_code).''; print ''; print ''; - $total += $solde; + $total[$acc->currency_code] += $solde; } } if (! $found) print ''.$langs->trans("None").''; // Total -print ''.$langs->trans("Total").''.price($total).''; - +foreach ($total as $key=>$solde) +{ + print ''.$langs->trans("Total ").$key.''.price($solde, 0, $langs, 0, 0, -1, $key).''; +} //print ' '; @@ -144,7 +146,7 @@ print ''.$langs->trans("Status").''; print ''.$langs->trans("BankBalance").''; print "\n"; -$total = 0; $found = 0; +$total = array(); $found = 0; $var=true; foreach ($accounts as $key=>$type) { @@ -165,16 +167,19 @@ foreach ($accounts as $key=>$type) print ' '; print ''.$acc->getLibStatut(2).''; print ''; - print ''.price($solde).''; + print ''.price($solde, 0, $langs, 0, 0, -1, $acc->currency_code).''; print ''; print ''; - $total += $solde; + $total[$acc->currency_code] += $solde; } } if (! $found) print ''.$langs->trans("None").''; // Total -print ''.$langs->trans("Total").''.price($total).''; +foreach ($total as $key=>$solde) +{ + print ''.$langs->trans("Total ").$key.''.price($solde, 0, $langs, 0, 0, -1, $key).''; +} @@ -193,7 +198,7 @@ print ''.$langs->trans("Status").''; print ''.$langs->trans("BankBalance").''; print "\n"; -$total = 0; $found = 0; +$total = array(); $found = 0; $var=true; foreach ($accounts as $key=>$type) { @@ -222,16 +227,19 @@ foreach ($accounts as $key=>$type) print ''; print ''.$acc->getLibStatut(2).''; print ''; - print ''.price($solde).''; + print ''.price($solde, 0, $langs, 0, 0, -1, $acc->currency_code).''; print ''; print ''; - $total += $solde; + $total[$acc->currency_code] += $solde; } } if (! $found) print ''.$langs->trans("None").''; // Total -print ''.$langs->trans("Total").''.price($total).''; +foreach ($total as $key=>$solde) +{ + print ''.$langs->trans("Total ").$key.''.price($solde, 0, $langs, 0, 0, -1, $key).''; +} print ""; From 88c5d6e5d100e8080f3ee5f588afe344dc81aba4 Mon Sep 17 00:00:00 2001 From: frederic34 Date: Wed, 11 Jun 2014 18:01:14 +0200 Subject: [PATCH 2/2] Display the total with currency --- htdocs/compta/bank/account.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index 27690ae7093..0e16f6744fd 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -784,8 +784,8 @@ if ($id > 0 || ! empty($ref)) print ''; if ($sep > 0) print ' '; // If we had at least one line in future else print $langs->trans("CurrentBalance"); - print ''; - print ''.price($total).''; + print ' '.$object->currency_code.''; + print ''.price($total, 0, $langs, 0, 0, -1, $object->currency_code).''; print ' '; print ''; }