+ Optimize transactions ilink interface

This commit is contained in:
Djery-Tom 2020-07-29 18:50:46 +01:00
parent 890ff5c0e5
commit a299394c77
4 changed files with 58 additions and 37 deletions

View File

@ -451,9 +451,13 @@ class Hyperviseur_dash extends CI_Controller
$endDate = Date('Y-m-d', strtotime($endDate . "+1 day")); $endDate = Date('Y-m-d', strtotime($endDate . "+1 day"));
if ($type == 'transaction') if ($type == 'transaction')
$data['transactions'] = $this->user_model->getTransactions($startDate, $endDate, $network_id); $data['transactions'] = $this->user_model->getTransactions($startDate, $endDate, $network_id);
else if ($type == 'transaction_ilink') else if ($type == 'transaction_ilink') {
$networkDetails = $this->user_model->getNetworkDetails($network_id);
$data['currency_name_fr'] = $networkDetails->first_row()->currency_name_fr;
$data['currency_name_en'] = $networkDetails->first_row()->currency_name_en;
$data['transactions'] = $this->user_model->getIlinkTransactions($startDate, $endDate, $network_id); $data['transactions'] = $this->user_model->getIlinkTransactions($startDate, $endDate, $network_id);
else if ($type == 'commission_transfer')
} else if ($type == 'commission_transfer')
$data['transactions'] = $this->user_model->getCommissionTransfers($startDate, $endDate, $this->session->userdata('member_code')); $data['transactions'] = $this->user_model->getCommissionTransfers($startDate, $endDate, $this->session->userdata('member_code'));
else if ($type == 'balance_statement') else if ($type == 'balance_statement')
$data['wallets'] = $this->user_model->getInfosWalletAgentForHyper($this->session->userdata('network_id')); $data['wallets'] = $this->user_model->getInfosWalletAgentForHyper($this->session->userdata('network_id'));

View File

@ -439,4 +439,5 @@ $lang ['refund_history'] = 'History of refunds';
$lang ['remaining_amount'] = 'Remaining amount'; $lang ['remaining_amount'] = 'Remaining amount';
$lang ['amount_greater_than_balance'] = 'Amount greater than the compensation balance'; $lang ['amount_greater_than_balance'] = 'Amount greater than the compensation balance';
$lang['no_refund'] = 'No refund'; $lang['no_refund'] = 'No refund';
$lang['final_currency'] = 'Currency of the country of arrival';
?> ?>

View File

@ -451,5 +451,6 @@ $lang['refund_history'] = 'Historique des remboursements';
$lang['remaining_amount'] = 'Montant restant'; $lang['remaining_amount'] = 'Montant restant';
$lang['amount_greater_than_balance'] = 'Montant supérieur au solde de compensation'; $lang['amount_greater_than_balance'] = 'Montant supérieur au solde de compensation';
$lang['no_refund'] = 'Aucun remboursement'; $lang['no_refund'] = 'Aucun remboursement';
$lang['final_currency'] = 'Monnaie du pays d\'arrivée';
?> ?>

View File

@ -92,8 +92,10 @@ use Brick\Money\Money;
<span class="info-box-text"><?php echo $this->lang->line('Période') ?> </span> <span class="info-box-text"><?php echo $this->lang->line('Période') ?> </span>
<span class="info-box-number"> <span class="info-box-number">
<input id="picker" <input id="picker"
style="background: #fff; cursor: pointer; padding: 1px 1px; border: 1px solid #ccc; width: 100%" data-category="<?php echo isset($category) ? $category : null ?>" style="background: #fff; cursor: pointer; padding: 1px 1px; border: 1px solid #ccc; width: 100%"
type="text" name="daterange" data-lang="<?php echo $this->session->userdata('site_lang') ?>" data-category="<?php echo isset($category) ? $category : null ?>"
type="text" name="daterange"
data-lang="<?php echo $this->session->userdata('site_lang') ?>"
value="<?php echo ($startDate != null & $endDate != null) ? $startDate . ' - ' . $endDate : '' ?>"/> value="<?php echo ($startDate != null & $endDate != null) ? $startDate . ' - ' . $endDate : '' ?>"/>
</span> </span>
@ -102,6 +104,17 @@ use Brick\Money\Money;
</div> </div>
</div> </div>
<div class="col-lg-2 col-xs-6">
<div class="small-box bg-red-active">
<div class="inner">
<h4>
<strong> <?php echo $this->session->userdata('currency_code') . ' - ' . $currency_name_fr; ?> </strong>
</h4>
<p><?php echo $this->lang->line('currency') ?></p>
</div>
</div>
</div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-xs-12"> <div class="col-xs-12">
@ -126,13 +139,14 @@ use Brick\Money\Money;
<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><?php echo $this->lang->line('commission_paying_network') ?></th>
<th><?php echo $this->lang->line('final_currency') ?></th>
<th><?php echo $this->lang->line('departure_country') ?></th> <th><?php echo $this->lang->line('departure_country') ?></th>
<th><?php echo $this->lang->line('country_of_destination') ?></th> <th><?php echo $this->lang->line('country_of_destination') ?></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>
<th><?php echo $this->lang->line('Commission de l\'hyperviseur') ?></th> <th><?php echo $this->lang->line('Commission de l\'hyperviseur') ?></th>
<th><?php echo $this->lang->line('commission_paying_network') ?></th>
<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>
@ -178,13 +192,14 @@ 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->part_reseau_payeur_final_country ? $row->part_reseau_payeur_final_country : 0, 2), $row->final_currency ? $row->final_currency : 'XAF', $context)->formatTo('fr_FR') . "</td>
<td>" . $row->final_currency . "</td>
<td>".$row->pays_init."</td> <td>".$row->pays_init."</td>
<td>".$row->pays_final."</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>
<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_hyp ? $row->commission_hyp : 0, 2),$row->init_currency,$context)->formatTo('fr_FR')."</td>
<td>".Money::of(round($row->part_reseau_payeur_final_country ? $row->part_reseau_payeur_final_country : 0, 2),$row->final_currency ? $row->final_currency : 'XAF',$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_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>
@ -263,9 +278,9 @@ use Brick\Money\Money;
const format = lang === 'french' ? 'fr' : 'en'; const format = lang === 'french' ? 'fr' : 'en';
moment.updateLocale(moment.locale(format), {invalidDate: ""}); // Blank text when is invalid date moment.updateLocale(moment.locale(format), {invalidDate: ""}); // Blank text when is invalid date
var table = $('#transactions').DataTable({ var table = $('#transactions').DataTable({
"aaSorting": [[ 17, "desc" ]], "aaSorting": [[18, "desc"]],
"columnDefs": [{ "columnDefs": [{
targets: 17, targets: 18,
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)
}], }],
dom: 'Bfrtip', dom: 'Bfrtip',
@ -281,7 +296,7 @@ use Brick\Money\Money;
for (var i = 0; i < data.body.length; i++) { for (var i = 0; i < data.body.length; i++) {
for (var j = 0; j < data.body[i].length; j++) { for (var j = 0; j < data.body[i].length; j++) {
// data.body[i][j] = '\u200C' + data.body[i][j]; // data.body[i][j] = '\u200C' + data.body[i][j];
if ([3, 4, 7, 8, 9, 10, 11, 12, 13].includes(j)) { if ([3, 4, 5, 9, 10, 11, 12, 13, 14].includes(j)) {
// Get the value and strip the non numeric characters // Get the value and strip the non numeric characters
// var value = $(this).text(); // var value = $(this).text();
value = data.body[i][j].replace(',', ".") value = data.body[i][j].replace(',', ".")