+ Fix bugs of currency rounding

This commit is contained in:
Djery-Tom 2020-06-25 17:57:44 +01:00
parent 13bc4341df
commit df5f2c6121
7 changed files with 93 additions and 84 deletions

View File

@ -1,5 +1,7 @@
<?php <?php
defined('BASEPATH') or exit('No direct script access allowed'); defined('BASEPATH') or exit('No direct script access allowed');
use Brick\Money\Context\CustomContext;
use Brick\Money\CurrencyConverter; use Brick\Money\CurrencyConverter;
use Brick\Money\ExchangeRateProvider\PDOProvider; use Brick\Money\ExchangeRateProvider\PDOProvider;
use Brick\Money\ExchangeRateProvider\PDOProviderConfiguration; use Brick\Money\ExchangeRateProvider\PDOProviderConfiguration;
@ -324,6 +326,7 @@ class Hyperviseur_dash extends CI_Controller
} elseif ($this->input->get('show')) { } elseif ($this->input->get('show')) {
$this->show_config_infos($this->input->get('show')); $this->show_config_infos($this->input->get('show'));
}else { }else {
$context = new CustomContext(2);
$data["commission"] = ""; $data["commission"] = "";
$data["principal"] = ""; $data["principal"] = "";
@ -413,7 +416,7 @@ class Hyperviseur_dash extends CI_Controller
array_push($data['transactions'], $trans); array_push($data['transactions'], $trans);
} }
} }
$data["totalCommissionBanque"] = Money::of(round($totalCommissionBanque,0), $this->session->userdata('currency_code'), new AutoContext() )->formatTo('fr_FR'); $data["totalCommissionBanque"] = Money::of(round($totalCommissionBanque,2), $this->session->userdata('currency_code'), $context )->formatTo('fr_FR');
} }
@ -425,8 +428,8 @@ class Hyperviseur_dash extends CI_Controller
} }
$row = $res->first_row(); $row = $res->first_row();
$data["commission"] = Money::of(round($row->balance_com,0), $this->session->userdata('currency_code'),new AutoContext())->formatTo('fr_FR'); $data["commission"] = Money::of(round($row->balance_com,2), $this->session->userdata('currency_code'),$context)->formatTo('fr_FR');
$data["principal"] = Money::of(round($row->balance_princ,0), $this->session->userdata('currency_code'),new AutoContext())->formatTo('fr_FR'); $data["principal"] = Money::of(round($row->balance_princ,2), $this->session->userdata('currency_code'),$context)->formatTo('fr_FR');
$data['wallet_id'] = $row->wallet_id; $data['wallet_id'] = $row->wallet_id;
$data['curreny_code'] = $this->session->userdata('currency_code'); $data['curreny_code'] = $this->session->userdata('currency_code');

View File

@ -2499,7 +2499,7 @@ class User_model extends CI_Model
public function getPayingNetworksByConfigWallet($id_config){ public function getPayingNetworksByConfigWallet($id_config){
$query = $this->db->query("SELECT n.name , n.id , cw.type , c.name as country ,c.currency_code, pw.taux_partage as rate , pw.balance_com FROM networks n INNER JOIN countries_currencies c ON n.country_id=c.id $query = $this->db->query("SELECT n.name , n.id , cw.type , c.name as country ,c.currency_code, pw.taux_partage as rate , pw.balance_com FROM networks n INNER JOIN countries_currencies c ON n.country_id=c.id
INNER JOIN configWallet cw ON cw.id_network = n.id INNER JOIN paying_networks pw ON pw.id_network = n.id WHERE n.id IN ( SELECT id_network FROM paying_networks pw WHERE id_configWallet = $id_config )"); INNER JOIN configWallet cw ON cw.id_network = n.id INNER JOIN paying_networks pw ON pw.id_network = n.id WHERE pw.id_configWallet = $id_config ");
if($query->num_rows()>0){ if($query->num_rows()>0){
return $query; return $query;
}else{ }else{

View File

@ -8,8 +8,10 @@
<?php <?php
use Brick\Money\Context\AutoContext;
use Brick\Money\Context\CustomContext;
use Brick\Money\Money; use Brick\Money\Money;
$context = new CustomContext(2);
function convertDate($date) function convertDate($date)
{ {
$month = null; $month = null;
@ -177,7 +179,7 @@ $fmt = new NumberFormatter( 'fr_FR', NumberFormatter::DECIMAL );
<div class="col-lg-4 col-xs-6"> <div class="col-lg-4 col-xs-6">
<div class="small-box bg-green"> <div class="small-box bg-green">
<div class="inner"> <div class="inner">
<h3><?php echo Money::of(round($commission,0), $currency ? $currency->code : 'XAF',new AutoContext())->formatTo('fr_FR'); ?></h3> <h3><?php echo Money::of(round($commission,2), $currency ? $currency->code : 'XAF',$context)->formatTo('fr_FR'); ?></h3>
<p><?php echo $this->lang->line('Solde Commission') ?></p> <p><?php echo $this->lang->line('Solde Commission') ?></p>
</div> </div>
<div class="icon"> <div class="icon">

View File

@ -8,8 +8,9 @@
<?php <?php
use Brick\Money\Context\AutoContext; use Brick\Money\Context\CustomContext;
use Brick\Money\Money; use Brick\Money\Money;
$context = new CustomContext(2);
function convertDate($date) function convertDate($date)
{ {
$month = null; $month = null;
@ -441,8 +442,8 @@ $fmt = new NumberFormatter( 'fr_FR', NumberFormatter::DECIMAL );
<table class="table table-hover"> <table class="table table-hover">
<tbody> <tbody>
<tr> <tr>
<th>Min (FCFA)</th> <th>Min</th>
<th>Max (FCFA)</th> <th>Max</th>
<th>Taux (%)</th> <th>Taux (%)</th>
</tr> </tr>
<?php <?php
@ -470,8 +471,8 @@ $fmt = new NumberFormatter( 'fr_FR', NumberFormatter::DECIMAL );
<table class="table table-hover"> <table class="table table-hover">
<tbody> <tbody>
<tr> <tr>
<th>Min (FCFA)</th> <th>Min</th>
<th>Max (FCFA)</th> <th>Max</th>
<th>Taux (%)</th> <th>Taux (%)</th>
</tr> </tr>
<?php <?php
@ -501,8 +502,8 @@ $fmt = new NumberFormatter( 'fr_FR', NumberFormatter::DECIMAL );
<table class="table table-hover"> <table class="table table-hover">
<tbody> <tbody>
<tr> <tr>
<th>Min (FCFA)</th> <th>Min</th>
<th>Max (FCFA)</th> <th>Max</th>
<th>Taux (%)</th> <th>Taux (%)</th>
</tr> </tr>
<?php <?php
@ -530,8 +531,8 @@ $fmt = new NumberFormatter( 'fr_FR', NumberFormatter::DECIMAL );
<table class="table table-hover"> <table class="table table-hover">
<tbody> <tbody>
<tr> <tr>
<th>Min (FCFA)</th> <th>Min</th>
<th>Max (FCFA)</th> <th>Max</th>
<th>Taux (%)</th> <th>Taux (%)</th>
</tr> </tr>
<?php <?php
@ -561,8 +562,8 @@ $fmt = new NumberFormatter( 'fr_FR', NumberFormatter::DECIMAL );
<table class="table table-hover"> <table class="table table-hover">
<tbody> <tbody>
<tr> <tr>
<th>Min (FCFA)</th> <th>Min</th>
<th>Max (FCFA)</th> <th>Max</th>
<th>Taux (%)</th> <th>Taux (%)</th>
</tr> </tr>
<?php <?php
@ -590,8 +591,8 @@ $fmt = new NumberFormatter( 'fr_FR', NumberFormatter::DECIMAL );
<table class="table table-hover"> <table class="table table-hover">
<tbody> <tbody>
<tr> <tr>
<th>Min (FCFA)</th> <th>Min</th>
<th>Max (FCFA)</th> <th>Max</th>
<th>Taux (%)</th> <th>Taux (%)</th>
</tr> </tr>
<?php <?php
@ -621,8 +622,8 @@ $fmt = new NumberFormatter( 'fr_FR', NumberFormatter::DECIMAL );
<table class="table table-hover"> <table class="table table-hover">
<tbody> <tbody>
<tr> <tr>
<th>Min (FCFA)</th> <th>Min</th>
<th>Max (FCFA)</th> <th>Max</th>
<th>Taux (%)</th> <th>Taux (%)</th>
</tr> </tr>
<?php <?php
@ -650,8 +651,8 @@ $fmt = new NumberFormatter( 'fr_FR', NumberFormatter::DECIMAL );
<table class="table table-hover"> <table class="table table-hover">
<tbody> <tbody>
<tr> <tr>
<th>Min (FCFA)</th> <th>Min</th>
<th>Max (FCFA)</th> <th>Max</th>
<th>Taux (%)</th> <th>Taux (%)</th>
</tr> </tr>
<?php <?php
@ -683,8 +684,8 @@ $fmt = new NumberFormatter( 'fr_FR', NumberFormatter::DECIMAL );
<table class="table table-hover"> <table class="table table-hover">
<tbody> <tbody>
<tr> <tr>
<th>Min (FCFA)</th> <th>Min</th>
<th>Max (FCFA)</th> <th>Max</th>
<th>Taux (%)</th> <th>Taux (%)</th>
</tr> </tr>
<?php <?php
@ -712,8 +713,8 @@ $fmt = new NumberFormatter( 'fr_FR', NumberFormatter::DECIMAL );
<table class="table table-hover"> <table class="table table-hover">
<tbody> <tbody>
<tr> <tr>
<th>Min (FCFA)</th> <th>Min</th>
<th>Max (FCFA)</th> <th>Max</th>
<th>Taux (%)</th> <th>Taux (%)</th>
</tr> </tr>
<?php <?php
@ -826,9 +827,9 @@ $fmt = new NumberFormatter( 'fr_FR', NumberFormatter::DECIMAL );
$fmt = new NumberFormatter( 'fr_FR', NumberFormatter::DECIMAL ); $fmt = new NumberFormatter( 'fr_FR', NumberFormatter::DECIMAL );
echo "<tr> echo "<tr>
<td>" . $walletHyper->first_row()->lastname . "</td> <td>" . $walletHyper->first_row()->lastname . "</td>
<td>" . Money::of(round($walletHyper->first_row()->balance_princ, 0),$currency ? $currency->code : 'XAF',new AutoContext())->formatTo('fr_FR'). "</td> <td>" . Money::of(round($walletHyper->first_row()->balance_princ, 2),$currency ? $currency->code : 'XAF',$context)->formatTo('fr_FR'). "</td>
<td>" .Money::of(round($walletHyper->first_row()->balance_com, 0), $currency ? $currency->code : 'XAF',new AutoContext())->formatTo('fr_FR'). "</td> <td>" .Money::of(round($walletHyper->first_row()->balance_com, 2), $currency ? $currency->code : 'XAF',$context)->formatTo('fr_FR'). "</td>
<td>" .Money::of(round($totalCommissionBanque,0), $currency ? $currency->code : 'XAF',new AutoContext())->formatTo('fr_FR') . "</td>"; <td>" .Money::of(round($totalCommissionBanque,2), $currency ? $currency->code : 'XAF',$context)->formatTo('fr_FR') . "</td>";
echo "<td>" . $depots->num_rows() . "</td> echo "<td>" . $depots->num_rows() . "</td>
<td>" . $retraits->num_rows() . "</td> <td>" . $retraits->num_rows() . "</td>

View File

@ -93,8 +93,9 @@
</style> </style>
<?php <?php
use Brick\Money\Context\AutoContext; use Brick\Money\Context\CustomContext;
use Brick\Money\Money; use Brick\Money\Money;
$context = new CustomContext(2);
function convertDate($date){ function convertDate($date){
$month = null; $month = null;
switch ($date) { switch ($date) {
@ -613,8 +614,8 @@ use Brick\Money\Money;
<table class="table table-hover"> <table class="table table-hover">
<tbody> <tbody>
<tr> <tr>
<th>Min (FCFA)</th> <th>Min</th>
<th>Max (FCFA)</th> <th>Max</th>
<th>Taux (%)</th> <th>Taux (%)</th>
</tr> </tr>
<?php <?php
@ -642,8 +643,8 @@ use Brick\Money\Money;
<table class="table table-hover"> <table class="table table-hover">
<tbody> <tbody>
<tr> <tr>
<th>Min (FCFA)</th> <th>Min</th>
<th>Max (FCFA)</th> <th>Max</th>
<th>Taux (%)</th> <th>Taux (%)</th>
</tr> </tr>
<?php <?php
@ -673,8 +674,8 @@ use Brick\Money\Money;
<table class="table table-hover"> <table class="table table-hover">
<tbody> <tbody>
<tr> <tr>
<th>Min (FCFA)</th> <th>Min</th>
<th>Max (FCFA)</th> <th>Max</th>
<th>Taux (%)</th> <th>Taux (%)</th>
</tr> </tr>
<?php <?php
@ -702,8 +703,8 @@ use Brick\Money\Money;
<table class="table table-hover"> <table class="table table-hover">
<tbody> <tbody>
<tr> <tr>
<th>Min (FCFA)</th> <th>Min</th>
<th>Max (FCFA)</th> <th>Max</th>
<th>Taux (%)</th> <th>Taux (%)</th>
</tr> </tr>
<?php <?php
@ -733,8 +734,8 @@ use Brick\Money\Money;
<table class="table table-hover"> <table class="table table-hover">
<tbody> <tbody>
<tr> <tr>
<th>Min (FCFA)</th> <th>Min</th>
<th>Max (FCFA)</th> <th>Max</th>
<th>Taux (%)</th> <th>Taux (%)</th>
</tr> </tr>
<?php <?php
@ -762,8 +763,8 @@ use Brick\Money\Money;
<table class="table table-hover"> <table class="table table-hover">
<tbody> <tbody>
<tr> <tr>
<th>Min (FCFA)</th> <th>Min</th>
<th>Max (FCFA)</th> <th>Max</th>
<th>Taux (%)</th> <th>Taux (%)</th>
</tr> </tr>
<?php <?php
@ -793,8 +794,8 @@ use Brick\Money\Money;
<table class="table table-hover"> <table class="table table-hover">
<tbody> <tbody>
<tr> <tr>
<th>Min (FCFA)</th> <th>Min</th>
<th>Max (FCFA)</th> <th>Max</th>
<th>Taux (%)</th> <th>Taux (%)</th>
</tr> </tr>
<?php <?php
@ -822,8 +823,8 @@ use Brick\Money\Money;
<table class="table table-hover"> <table class="table table-hover">
<tbody> <tbody>
<tr> <tr>
<th>Min (FCFA)</th> <th>Min</th>
<th>Max (FCFA)</th> <th>Max</th>
<th>Taux (%)</th> <th>Taux (%)</th>
</tr> </tr>
<?php <?php
@ -855,8 +856,8 @@ use Brick\Money\Money;
<table class="table table-hover"> <table class="table table-hover">
<tbody> <tbody>
<tr> <tr>
<th>Min (FCFA)</th> <th>Min</th>
<th>Max (FCFA)</th> <th>Max</th>
<th>Taux (%)</th> <th>Taux (%)</th>
</tr> </tr>
<?php <?php
@ -884,8 +885,8 @@ use Brick\Money\Money;
<table class="table table-hover"> <table class="table table-hover">
<tbody> <tbody>
<tr> <tr>
<th>Min (FCFA)</th> <th>Min</th>
<th>Max (FCFA)</th> <th>Max</th>
<th>Taux (%)</th> <th>Taux (%)</th>
</tr> </tr>
<?php <?php
@ -1013,8 +1014,8 @@ use Brick\Money\Money;
} }
echo "<tr> echo "<tr>
<td>".$row->lastname."</td> <td>".$row->lastname."</td>
<td>".Money::of(round($princ,0), $this->session->userdata('currency_code'),new AutoContext())->formatTo('fr_FR')."</td> <td>".Money::of(round($princ,2), $this->session->userdata('currency_code'),$context)->formatTo('fr_FR')."</td>
<td>".Money::of(round($com,0), $this->session->userdata('currency_code'),new AutoContext())->formatTo('fr_FR')."</td>"; <td>".Money::of(round($com,2), $this->session->userdata('currency_code'),$context)->formatTo('fr_FR')."</td>";
$nb_depots = 0; $nb_depots = 0;
$nb_retraits = 0; $nb_retraits = 0;
$commission_banque = 0; $commission_banque = 0;
@ -1030,7 +1031,7 @@ use Brick\Money\Money;
$commission_banque+= $retrait->commission_banque; $commission_banque+= $retrait->commission_banque;
} }
} }
echo "<td>".Money::of(round($commission_banque,0), $this->session->userdata('currency_code'),new AutoContext())->formatTo('fr_FR')."</td> echo "<td>".Money::of(round($commission_banque,2), $this->session->userdata('currency_code'),$context)->formatTo('fr_FR')."</td>
<td>".$nb_depots."</td> <td>".$nb_depots."</td>
<td>".$nb_retraits."</td> <td>".$nb_retraits."</td>
</tr>"; </tr>";
@ -1071,8 +1072,8 @@ use Brick\Money\Money;
<table id="user_wallet_wallet" class="table table-bordered"> <table id="user_wallet_wallet" class="table table-bordered">
<thead> <thead>
<tr> <tr>
<th>Min (FCFA)</th> <th>Min</th>
<th>Max (FCFA)</th> <th>Max</th>
<th><?php echo $this->lang->line('rate') ; ?> (%) </th> <th><?php echo $this->lang->line('rate') ; ?> (%) </th>
<th>Actions</th> <th>Actions</th>
</tr> </tr>
@ -1112,8 +1113,8 @@ use Brick\Money\Money;
<table id="user_wallet_wallet_national" class="table table-bordered"> <table id="user_wallet_wallet_national" class="table table-bordered">
<thead> <thead>
<tr> <tr>
<th>Min (FCFA)</th> <th>Min</th>
<th>Max (FCFA)</th> <th>Max</th>
<th><?php echo $this->lang->line('rate') ; ?> (%) </th> <th><?php echo $this->lang->line('rate') ; ?> (%) </th>
<th>Actions</th> <th>Actions</th>
</tr> </tr>
@ -1153,8 +1154,8 @@ use Brick\Money\Money;
<table id="user_wallet_cash" class="table table-bordered"> <table id="user_wallet_cash" class="table table-bordered">
<thead> <thead>
<tr> <tr>
<th>Min (FCFA)</th> <th>Min</th>
<th>Max (FCFA)</th> <th>Max</th>
<th><?php echo $this->lang->line('rate') ; ?> (%) </th> <th><?php echo $this->lang->line('rate') ; ?> (%) </th>
<th>Actions</th> <th>Actions</th>
</tr> </tr>
@ -1194,8 +1195,8 @@ use Brick\Money\Money;
<table id="user_wallet_cash_national" class="table table-bordered"> <table id="user_wallet_cash_national" class="table table-bordered">
<thead> <thead>
<tr> <tr>
<th>Min (FCFA)</th> <th>Min</th>
<th>Max (FCFA)</th> <th>Max</th>
<th><?php echo $this->lang->line('rate') ; ?> (%) </th> <th><?php echo $this->lang->line('rate') ; ?> (%) </th>
<th>Actions</th> <th>Actions</th>
</tr> </tr>
@ -1255,8 +1256,8 @@ use Brick\Money\Money;
<table id="agent_depot_wallet_national" class="table table-bordered"> <table id="agent_depot_wallet_national" class="table table-bordered">
<thead> <thead>
<tr> <tr>
<th>Min (FCFA)</th> <th>Min</th>
<th>Max (FCFA)</th> <th>Max</th>
<th><?php echo $this->lang->line('rate') ; ?> (%) </th> <th><?php echo $this->lang->line('rate') ; ?> (%) </th>
<th>Actions</th> <th>Actions</th>
</tr> </tr>
@ -1296,8 +1297,8 @@ use Brick\Money\Money;
<table id="agent_depot_wallet" class="table table-bordered"> <table id="agent_depot_wallet" class="table table-bordered">
<thead> <thead>
<tr> <tr>
<th>Min (FCFA)</th> <th>Min</th>
<th>Max (FCFA)</th> <th>Max</th>
<th><?php echo $this->lang->line('rate') ; ?> (%) </th> <th><?php echo $this->lang->line('rate') ; ?> (%) </th>
<th>Actions</th> <th>Actions</th>
</tr> </tr>
@ -1337,8 +1338,8 @@ use Brick\Money\Money;
<table id="agent_depot_autre_wallet_national" class="table table-bordered"> <table id="agent_depot_autre_wallet_national" class="table table-bordered">
<thead> <thead>
<tr> <tr>
<th>Min (FCFA)</th> <th>Min</th>
<th>Max (FCFA)</th> <th>Max</th>
<th><?php echo $this->lang->line('rate') ; ?> (%) </th> <th><?php echo $this->lang->line('rate') ; ?> (%) </th>
<th>Actions</th> <th>Actions</th>
</tr> </tr>
@ -1378,8 +1379,8 @@ use Brick\Money\Money;
<table id="agent_depot_autre_wallet" class="table table-bordered"> <table id="agent_depot_autre_wallet" class="table table-bordered">
<thead> <thead>
<tr> <tr>
<th>Min (FCFA)</th> <th>Min</th>
<th>Max (FCFA)</th> <th>Max</th>
<th><?php echo $this->lang->line('rate') ; ?> (%) </th> <th><?php echo $this->lang->line('rate') ; ?> (%) </th>
<th>Actions</th> <th>Actions</th>
</tr> </tr>
@ -1425,8 +1426,8 @@ use Brick\Money\Money;
<table id="agent_cash_cash_national" class="table table-bordered"> <table id="agent_cash_cash_national" class="table table-bordered">
<thead> <thead>
<tr> <tr>
<th>Min (FCFA)</th> <th>Min</th>
<th>Max (FCFA)</th> <th>Max</th>
<th><?php echo $this->lang->line('rate') ; ?> (%) </th> <th><?php echo $this->lang->line('rate') ; ?> (%) </th>
<th>Actions</th> <th>Actions</th>
</tr> </tr>
@ -1466,8 +1467,8 @@ use Brick\Money\Money;
<table id="agent_cash_cash" class="table table-bordered"> <table id="agent_cash_cash" class="table table-bordered">
<thead> <thead>
<tr> <tr>
<th>Min (FCFA)</th> <th>Min</th>
<th>Max (FCFA)</th> <th>Max</th>
<th><?php echo $this->lang->line('rate') ; ?> (%) </th> <th><?php echo $this->lang->line('rate') ; ?> (%) </th>
<th>Actions</th> <th>Actions</th>
</tr> </tr>

View File

@ -12,8 +12,9 @@
</h1> </h1>
<?php <?php
use Brick\Money\Context\AutoContext; use Brick\Money\Context\CustomContext;
use Brick\Money\Money; use Brick\Money\Money;
$context = new CustomContext(2);
$site_url = base_url(); $site_url = base_url();
if ($alert == "ok") { if ($alert == "ok") {
@ -97,7 +98,7 @@
} }
?> ?>
<td> <td>
<?= Money::of(round($row->balance_com, 0),$row->currency_code ? $row->currency_code : 'XAF',new AutoContext())->formatTo('fr_FR')?> <?= Money::of(round($row->balance_com,2 ),$row->currency_code ? $row->currency_code : 'XAF',$context)->formatTo('fr_FR')?>
</td> </td>
<?php <?php
} }

View File

@ -7,7 +7,7 @@
<div class="content-wrapper"> <div class="content-wrapper">
<?php <?php
use Brick\Money\Context\AutoContext; use Brick\Money\Context\CustomContext;
use Carbon\Carbon; use Carbon\Carbon;
use Brick\Money\CurrencyConverter; use Brick\Money\CurrencyConverter;
use Brick\Money\ExchangeRateProvider\PDOProvider; use Brick\Money\ExchangeRateProvider\PDOProvider;
@ -79,6 +79,7 @@ use Brick\Money\Money;
// this currency converter can now handle any currency pair // this currency converter can now handle any currency pair
$converter = new CurrencyConverter($provider); $converter = new CurrencyConverter($provider);
$context = new CustomContext(2);
?> ?>
</section> </section>
<section class="content"> <section class="content">
@ -155,7 +156,7 @@ use Brick\Money\Money;
}else{ }else{
$net = $row->montant_retrait ; $net = $row->montant_retrait ;
} }
$moneyNetInit = Money::of(round($net,0), $row->init_currency,new AutoContext()); $moneyNetInit = Money::of(round($net,2), $row->init_currency,$context);
$moneyNetFinal = $converter->convert($moneyNetInit, $row->final_currency ? $row->final_currency : 'XAF', RoundingMode::DOWN); $moneyNetFinal = $converter->convert($moneyNetInit, $row->final_currency ? $row->final_currency : 'XAF', RoundingMode::DOWN);
echo "<tr> echo "<tr>
<td align='center' >$row->id</td> <td align='center' >$row->id</td>
@ -164,12 +165,12 @@ use Brick\Money\Money;
<td>".join(" ", str_split($row->numero_carte, 4))."</td> <td>".join(" ", str_split($row->numero_carte, 4))."</td>
<td>".$moneyNetInit->formatTo('fr_FR')."</td> <td>".$moneyNetInit->formatTo('fr_FR')."</td>
<td>".$moneyNetFinal->formatTo('fr_FR')."</td> <td>".$moneyNetFinal->formatTo('fr_FR')."</td>
<td>".Money::of(round($row->frais,0), $row->init_currency,new AutoContext())->formatTo('fr_FR')."</td> <td>".Money::of(round($row->frais,2), $row->init_currency,$context)->formatTo('fr_FR')."</td>
<td>".Money::of(round($row->taxe, 0),$row->init_currency,new AutoContext())->formatTo('fr_FR')."</td> <td>".Money::of(round($row->taxe, 2),$row->init_currency,$context)->formatTo('fr_FR')."</td>
<td>".Money::of(round($row->commission_banque ? $row->commission_banque : 0, 0),$row->init_currency,new AutoContext())->formatTo('fr_FR')."</td> <td>".Money::of(round($row->commission_banque ? $row->commission_banque : 0, 2),$row->init_currency,$context)->formatTo('fr_FR')."</td>
<td>".Money::of(round($row->commission_hyp ? $row->commission_hyp : 0, 0),$row->init_currency,new AutoContext())->formatTo('fr_FR')."</td> <td>".Money::of(round($row->commission_hyp ? $row->commission_hyp : 0, 2),$row->init_currency,$context)->formatTo('fr_FR')."</td>
<td>".Money::of(round($row->commission_sup ? $row->commission_sup : 0 , 0),$row->init_currency,new AutoContext())->formatTo('fr_FR')."</td> <td>".Money::of(round($row->commission_sup ? $row->commission_sup : 0 , 2),$row->init_currency,$context)->formatTo('fr_FR')."</td>
<td>".Money::of(round($row->commission_ag ? $row->commission_ag : 0, 0),$row->init_currency,new AutoContext())->formatTo('fr_FR')."</td> <td>".Money::of(round($row->commission_ag ? $row->commission_ag : 0, 2),$row->init_currency,$context)->formatTo('fr_FR')."</td>
<td>".$row->agent."</td> <td>".$row->agent."</td>
<td>".$row->user."</td> <td>".$row->user."</td>
<td>".toLocateDate($row->date,$this->session->userdata('timezone'))."</td>"; <td>".toLocateDate($row->date,$this->session->userdata('timezone'))."</td>";