+ Update historic list

This commit is contained in:
Djery-Tom 2020-06-27 18:01:38 +01:00
parent bfd3a246e4
commit 25d43c532b
1 changed files with 19 additions and 7 deletions

View File

@ -122,11 +122,12 @@ use Brick\Money\Money;
<thead> <thead>
<tr> <tr>
<th align='center'>ID</th> <th align='center'>ID</th>
<th align='center'>Type</th>
<th align='center'>Operation</th> <th align='center'>Operation</th>
<th><?php echo $this->lang->line('cart_number') ?></th> <th><?php echo $this->lang->line('cart_number') ?></th>
<th><?php echo $this->lang->line('customer_net_amount_init') ?></th> <th><?php echo $this->lang->line('customer_net_amount_init') ?></th>
<th><?php echo $this->lang->line('customer_net_amount_final') ?></th> <th><?php echo $this->lang->line('customer_net_amount_final') ?></th>
<th>Pays de depart</th>
<th>Pays d'arrivée</th>
<th><?php echo $this->lang->line('fees') ?></th> <th><?php echo $this->lang->line('fees') ?></th>
<th><?php echo $this->lang->line('tax') ?></th> <th><?php echo $this->lang->line('tax') ?></th>
<th><?php echo $this->lang->line('Commission de la banque') ?></th> <th><?php echo $this->lang->line('Commission de la banque') ?></th>
@ -134,7 +135,8 @@ use Brick\Money\Money;
<th><?php echo $this->lang->line('Commission du superviseur') ?></th> <th><?php echo $this->lang->line('Commission du superviseur') ?></th>
<th><?php echo $this->lang->line('Commission de l\'agent') ?></th> <th><?php echo $this->lang->line('Commission de l\'agent') ?></th>
<th><?php echo $this->lang->line('agent_name') ?></th> <th><?php echo $this->lang->line('agent_name') ?></th>
<th><?php echo $this->lang->line('user_name') ?></th> <th> ID emetteur</th>
<th> ID destinataire</th>
<th align='center'>Date</th> <th align='center'>Date</th>
<?php if ($this->session->userdata('category') != 'super') { ?> <?php if ($this->session->userdata('category') != 'super') { ?>
<th align='center'>Action</th> <th align='center'>Action</th>
@ -147,7 +149,6 @@ use Brick\Money\Money;
$config = $configWallet->first_row(); $config = $configWallet->first_row();
foreach ($transactions->result() as $row) { foreach ($transactions->result() as $row) {
$num++; $num++;
$type = $row->type_transaction == 'depot' ? $this->lang->line('DEPOT') : $this->lang->line('RETRAIT');
$net = 0; $net = 0;
$banque = 0; $banque = 0;
@ -158,14 +159,24 @@ use Brick\Money\Money;
$net = $row->montant_retrait ; $net = $row->montant_retrait ;
} }
$moneyNetInit = Money::of(round($net,2), $row->init_currency,$context); $moneyNetInit = Money::of(round($net,2), $row->init_currency,$context);
if($row->destinataire_phone){
$destinataire = $row->destinataire_phone.' | '.$row->destinataire_name;
}else{
if($row->id_destinataire){
$destinataire = $row->id_destinataire;
}else{
$destinataire =$row->nom_destinataire.' '.$row->prenom_destinataire ;
}
}
$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_transaction</td>
<td>".strtoupper($type)."</td>
<td>".strtoupper($row->acteur).' - '.$row->operation."</td> <td>".strtoupper($row->acteur).' - '.$row->operation."</td>
<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>".$row->pays_init."</td>
<td>".$row->pays_final."</td>
<td>".Money::of(round($row->frais,2), $row->init_currency,$context)->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, 2),$row->init_currency,$context)->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, 2),$row->init_currency,$context)->formatTo('fr_FR')."</td> <td>".Money::of(round($row->commission_banque ? $row->commission_banque : 0, 2),$row->init_currency,$context)->formatTo('fr_FR')."</td>
@ -173,7 +184,8 @@ use Brick\Money\Money;
<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_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, 2),$row->init_currency,$context)->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_phone.' | '.$row->user."</td>
<td>".$destinataire."</td>
<td>".toLocateDate($row->date,$this->session->userdata('timezone'))."</td>"; <td>".toLocateDate($row->date,$this->session->userdata('timezone'))."</td>";
?> ?>
<?php if ($this->session->userdata('category') != 'super') { ?> <?php if ($this->session->userdata('category') != 'super') { ?>
@ -241,7 +253,7 @@ use Brick\Money\Money;
$('#transactions').DataTable({ $('#transactions').DataTable({
"aaSorting": [[ 0, "desc" ]], "aaSorting": [[ 0, "desc" ]],
"columnDefs": [ { "columnDefs": [ {
targets: 14, targets: 16,
render: $.fn.dataTable.render.moment( 'YYYY-MM-DD HH:mm:ss' , 'D MMMM YYYY HH:mm:ss', format) render: $.fn.dataTable.render.moment( 'YYYY-MM-DD HH:mm:ss' , 'D MMMM YYYY HH:mm:ss', format)
}] }]
}); });