Add note for wallet config agent remove
This commit is contained in:
parent
c9800f8bce
commit
ea2ce38a13
|
@ -1592,16 +1592,12 @@ class Gestion extends CI_Controller
|
||||||
case 'agent_remove_cash':
|
case 'agent_remove_cash':
|
||||||
$plr_agent_wallet_cash_national = $_POST['plr_agent_wallet_cash_national'] ?? null;
|
$plr_agent_wallet_cash_national = $_POST['plr_agent_wallet_cash_national'] ?? null;
|
||||||
$plr_sup_wallet_cash_national = $_POST['plr_sup_wallet_cash_national'] ?? null;
|
$plr_sup_wallet_cash_national = $_POST['plr_sup_wallet_cash_national'] ?? null;
|
||||||
$plr_customer_wallet_cash_national = $_POST['plr_customer_wallet_cash_national'] ?? null;
|
|
||||||
$plr_agent_wallet_cash_international = $_POST['plr_agent_wallet_cash_international'] ?? null;
|
$plr_agent_wallet_cash_international = $_POST['plr_agent_wallet_cash_international'] ?? null;
|
||||||
$plr_sup_wallet_cash_international = $_POST['plr_sup_wallet_cash_international'] ?? null;
|
$plr_sup_wallet_cash_international = $_POST['plr_sup_wallet_cash_international'] ?? null;
|
||||||
$plr_customer_wallet_cash_international = $_POST['plr_customer_wallet_cash_international'] ?? null;
|
|
||||||
$this->insertPalier($plr_agent_wallet_cash_national, "agent_wallet_cash_national", $idConfig,'paliers_commissions_wallet');
|
$this->insertPalier($plr_agent_wallet_cash_national, "agent_wallet_cash_national", $idConfig,'paliers_commissions_wallet');
|
||||||
$this->insertPalier($plr_sup_wallet_cash_national, "sup_wallet_cash_national", $idConfig ,'paliers_commissions_wallet');
|
$this->insertPalier($plr_sup_wallet_cash_national, "sup_wallet_cash_national", $idConfig ,'paliers_commissions_wallet');
|
||||||
$this->insertPalier($plr_customer_wallet_cash_national, "customer_wallet_cash_national", $idConfig,'paliers_commissions_wallet');
|
|
||||||
$this->insertPalier($plr_agent_wallet_cash_international, "agent_wallet_cash_international", $idConfig,'paliers_commissions_wallet');
|
$this->insertPalier($plr_agent_wallet_cash_international, "agent_wallet_cash_international", $idConfig,'paliers_commissions_wallet');
|
||||||
$this->insertPalier($plr_sup_wallet_cash_international, "sup_wallet_cash_international", $idConfig ,'paliers_commissions_wallet');
|
$this->insertPalier($plr_sup_wallet_cash_international, "sup_wallet_cash_international", $idConfig ,'paliers_commissions_wallet');
|
||||||
$this->insertPalier($plr_customer_wallet_cash_international, "customer_wallet_cash_international", $idConfig,'paliers_commissions_wallet');
|
|
||||||
break;
|
break;
|
||||||
case 'agent_remove_carte_cash':
|
case 'agent_remove_carte_cash':
|
||||||
// $plr_customer_cart_cash_international = $_POST['plr_customer_cart_cash_international'] ?? null;
|
// $plr_customer_cart_cash_international = $_POST['plr_customer_cart_cash_international'] ?? null;
|
||||||
|
|
|
@ -1450,9 +1450,6 @@ class Hyperviseur_dash extends CI_Controller
|
||||||
$data['plr_sup_wallet_cash_national'] = $this->wallet_model->getPalierCommissionsWallet("sup_wallet_cash_national", $data['idConfig']);
|
$data['plr_sup_wallet_cash_national'] = $this->wallet_model->getPalierCommissionsWallet("sup_wallet_cash_national", $data['idConfig']);
|
||||||
$data['plr_sup_wallet_cash_international'] = $this->wallet_model->getPalierCommissionsWallet("sup_wallet_cash_international", $data['idConfig']);
|
$data['plr_sup_wallet_cash_international'] = $this->wallet_model->getPalierCommissionsWallet("sup_wallet_cash_international", $data['idConfig']);
|
||||||
|
|
||||||
$data['plr_customer_wallet_cash_national'] = $this->wallet_model->getPalierCommissionsWallet("customer_wallet_cash_national", $data['idConfig']);
|
|
||||||
$data['plr_customer_wallet_cash_international'] = $this->wallet_model->getPalierCommissionsWallet("customer_wallet_cash_international", $data['idConfig']);
|
|
||||||
|
|
||||||
$this->load->view('header_hyp', $data);
|
$this->load->view('header_hyp', $data);
|
||||||
$this->load->view('config_wallet_ilink_hyp/agent_remove_cash');
|
$this->load->view('config_wallet_ilink_hyp/agent_remove_cash');
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -940,4 +940,5 @@ $lang['EXPIRED'] = 'EXPIRED';
|
||||||
$lang['SUSPENDED'] = "SUSPENDED";
|
$lang['SUSPENDED'] = "SUSPENDED";
|
||||||
$lang['billed_quantity'] = "Billed quantity";
|
$lang['billed_quantity'] = "Billed quantity";
|
||||||
$lang['ceiling'] = "Ceiling";
|
$lang['ceiling'] = "Ceiling";
|
||||||
|
$lang['note_config_wallet_agent_remove_cash'] = "The hypervisor's commission is the amount remaining in the client's commission once the agent's and supervisor's commissions are removed"
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -949,4 +949,5 @@ $lang['SUSPENDED'] = "SUSPENDU";
|
||||||
$lang['EXPIRED'] = 'EXPIRÉE';
|
$lang['EXPIRED'] = 'EXPIRÉE';
|
||||||
$lang['billed_quantity'] = "Quantité facturée";
|
$lang['billed_quantity'] = "Quantité facturée";
|
||||||
$lang['ceiling'] = "Plafond";
|
$lang['ceiling'] = "Plafond";
|
||||||
|
$lang['note_config_wallet_agent_remove_cash'] = "La commission de l'hyperviseur est le montant restant de la commission client une fois qu'on a retiré les commissions de l'agent et du superviseur"
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -63,71 +63,9 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row" style="display:flex; justify-content: center">
|
<div class="callout callout-info">
|
||||||
<div class="col-lg-6 col-xs-12">
|
<p>Note</p>
|
||||||
<div class="box">
|
<h4><?= $this->lang->line('note_config_wallet_agent_remove_cash') ?></h4>
|
||||||
<div class="box-header">
|
|
||||||
<h3 class="box-title"><?= $this->lang->line('rate_com_customer_remove_cash_international'); ?></h3>
|
|
||||||
</div>
|
|
||||||
<!-- /.box-header -->
|
|
||||||
<div class="box-body table-responsive" style="overflow-x:auto;">
|
|
||||||
<table class="table table-hover">
|
|
||||||
<tbody>
|
|
||||||
<tr>
|
|
||||||
<th>Min</th>
|
|
||||||
<th>Max</th>
|
|
||||||
<th>Taux (%)</th>
|
|
||||||
<th><?= $this->lang->line('ceiling')?></th>
|
|
||||||
</tr>
|
|
||||||
<?php
|
|
||||||
if ($plr_customer_wallet_cash_international) {
|
|
||||||
foreach ($plr_customer_wallet_cash_international->result() as $row) {
|
|
||||||
echo "<tr>
|
|
||||||
<td>" . $fmt->format($row->min) . "</td>
|
|
||||||
<td>" . $fmt->format($row->max) . "</td>
|
|
||||||
<td>" . $row->taux . "</td>
|
|
||||||
<td>" . (isset($row->plafond) ? floatval($row->plafond) : '') . "</td>" . '
|
|
||||||
</tr>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
<!-- /.box-body -->
|
|
||||||
</div>
|
|
||||||
<div class="box">
|
|
||||||
<div class="box-header">
|
|
||||||
<h3 class="box-title"><?= $this->lang->line('rate_com_customer_remove_cash_national'); ?></h3>
|
|
||||||
</div>
|
|
||||||
<!-- /.box-header -->
|
|
||||||
<div class="box-body table-responsive" style="overflow-x:auto;">
|
|
||||||
<table class="table table-hover">
|
|
||||||
<tbody>
|
|
||||||
<tr>
|
|
||||||
<th>Min</th>
|
|
||||||
<th>Max</th>
|
|
||||||
<th>Taux (%)</th>
|
|
||||||
<th><?= $this->lang->line('ceiling')?></th>
|
|
||||||
</tr>
|
|
||||||
<?php
|
|
||||||
if ($plr_customer_wallet_cash_national) {
|
|
||||||
foreach ($plr_customer_wallet_cash_national->result() as $row) {
|
|
||||||
echo "<tr>
|
|
||||||
<td>" . $fmt->format($row->min) . "</td>
|
|
||||||
<td>" . $fmt->format($row->max) . "</td>
|
|
||||||
<td>" . $row->taux . "</td>
|
|
||||||
<td>" . (isset($row->plafond) ? floatval($row->plafond) : '') . "</td>" . '
|
|
||||||
</tr>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
<!-- /.box-body -->
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-6 col-xs-12">
|
<div class="col-lg-6 col-xs-12">
|
||||||
|
@ -270,100 +208,6 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<form id="walletForm">
|
<form id="walletForm">
|
||||||
<div class="row" style="display:flex; justify-content: center">
|
|
||||||
<div class="col-lg-6">
|
|
||||||
<div class="form-group" style="overflow-x:auto;">
|
|
||||||
<div class="table-title">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-sm-8">
|
|
||||||
<label for="nom"
|
|
||||||
class="col-form-label"><?= $this->lang->line('rate_com_customer_remove_cash_international'); ?></label>
|
|
||||||
</div>
|
|
||||||
<div class="col-sm-4">
|
|
||||||
<button type="button" class="btn btn-info add-new new72"><i
|
|
||||||
class="fa fa-plus"></i> <?= $this->lang->line('new_level'); ?>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<table id="customer_wallet_cash_international" class="table table-bordered">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th>Min</th>
|
|
||||||
<th>Max</th>
|
|
||||||
<th><?= $this->lang->line('rate'); ?> (%)</th>
|
|
||||||
<th><?= $this->lang->line('ceiling')?></th>
|
|
||||||
<th>Actions</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<?php
|
|
||||||
if ($plr_customer_wallet_cash_international) {
|
|
||||||
foreach ($plr_customer_wallet_cash_international->result() as $row) {
|
|
||||||
echo "<tr>
|
|
||||||
<td>" . $row->min . "</td>
|
|
||||||
<td>" . $row->max . "</td>
|
|
||||||
<td>" . $row->taux . "</td>
|
|
||||||
<td>" . (isset($row->plafond) ? floatval($row->plafond) : '') . "</td>" . '
|
|
||||||
<td>
|
|
||||||
<a class="add add72" title="Add" data-toggle="tooltip"><i class="material-icons"></i></a>
|
|
||||||
<a class="edit edit72" title="Edit" data-toggle="tooltip"><i class="material-icons"></i></a>
|
|
||||||
<a class="delete delete72" title="Delete" data-toggle="tooltip"><i class="material-icons"></i></a>
|
|
||||||
</td>
|
|
||||||
</tr>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
<div class="form-group" style="overflow-x:auto;">
|
|
||||||
<div class="table-title">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-sm-8">
|
|
||||||
<label for="nom"
|
|
||||||
class="col-form-label"><?= $this->lang->line('rate_com_customer_remove_cash_national'); ?></label>
|
|
||||||
</div>
|
|
||||||
<div class="col-sm-4">
|
|
||||||
<button type="button" class="btn btn-info add-new new7"><i
|
|
||||||
class="fa fa-plus"></i> <?= $this->lang->line('new_level'); ?>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<table id="customer_wallet_cash_national" class="table table-bordered">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th>Min</th>
|
|
||||||
<th>Max</th>
|
|
||||||
<th><?= $this->lang->line('rate'); ?> (%)</th>
|
|
||||||
<th><?= $this->lang->line('ceiling')?></th>
|
|
||||||
<th>Actions</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<?php
|
|
||||||
if ($plr_customer_wallet_cash_national) {
|
|
||||||
foreach ($plr_customer_wallet_cash_national->result() as $row) {
|
|
||||||
echo "<tr>
|
|
||||||
<td>" . $row->min . "</td>
|
|
||||||
<td>" . $row->max . "</td>
|
|
||||||
<td>" . $row->taux . "</td>
|
|
||||||
<td>" . (isset($row->plafond) ? floatval($row->plafond) : '') . "</td>" . '
|
|
||||||
<td>
|
|
||||||
<a class="add add7" title="Add" data-toggle="tooltip"><i class="material-icons"></i></a>
|
|
||||||
<a class="edit edit7" title="Edit" data-toggle="tooltip"><i class="material-icons"></i></a>
|
|
||||||
<a class="delete delete7" title="Delete" data-toggle="tooltip"><i class="material-icons"></i></a>
|
|
||||||
</td>
|
|
||||||
</tr>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-6">
|
<div class="col-lg-6">
|
||||||
<div class="form-group" style="overflow-x:auto;">
|
<div class="form-group" style="overflow-x:auto;">
|
||||||
|
@ -603,11 +447,9 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
|
||||||
// Paliers
|
// Paliers
|
||||||
let plr_agent_wallet_cash_national = getPaliersTable('agent_wallet_cash_national');
|
let plr_agent_wallet_cash_national = getPaliersTable('agent_wallet_cash_national');
|
||||||
let plr_sup_wallet_cash_national = getPaliersTable('sup_wallet_cash_national');
|
let plr_sup_wallet_cash_national = getPaliersTable('sup_wallet_cash_national');
|
||||||
let plr_customer_wallet_cash_national = getPaliersTable('customer_wallet_cash_national');
|
|
||||||
|
|
||||||
let plr_agent_wallet_cash_international = getPaliersTable('agent_wallet_cash_international');
|
let plr_agent_wallet_cash_international = getPaliersTable('agent_wallet_cash_international');
|
||||||
let plr_sup_wallet_cash_international = getPaliersTable('sup_wallet_cash_international');
|
let plr_sup_wallet_cash_international = getPaliersTable('sup_wallet_cash_international');
|
||||||
let plr_customer_wallet_cash_international = getPaliersTable('customer_wallet_cash_international');
|
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '<?= base_url('Gestion/config_wallet/update')?>',
|
url: '<?= base_url('Gestion/config_wallet/update')?>',
|
||||||
|
@ -619,10 +461,8 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
|
||||||
"network_id": network_id, "id_config": id_config,
|
"network_id": network_id, "id_config": id_config,
|
||||||
"plr_agent_wallet_cash_national": plr_agent_wallet_cash_national,
|
"plr_agent_wallet_cash_national": plr_agent_wallet_cash_national,
|
||||||
"plr_sup_wallet_cash_national": plr_sup_wallet_cash_national,
|
"plr_sup_wallet_cash_national": plr_sup_wallet_cash_national,
|
||||||
"plr_customer_wallet_cash_national": plr_customer_wallet_cash_national,
|
|
||||||
"plr_agent_wallet_cash_international": plr_agent_wallet_cash_international,
|
"plr_agent_wallet_cash_international": plr_agent_wallet_cash_international,
|
||||||
"plr_sup_wallet_cash_international": plr_sup_wallet_cash_international,
|
"plr_sup_wallet_cash_international": plr_sup_wallet_cash_international,
|
||||||
"plr_customer_wallet_cash_international": plr_customer_wallet_cash_international,
|
|
||||||
},
|
},
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
if (data == '200') {
|
if (data == '200') {
|
||||||
|
@ -836,93 +676,6 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
|
||||||
|
|
||||||
|
|
||||||
// Paliers nationaux
|
// Paliers nationaux
|
||||||
|
|
||||||
// Table 7
|
|
||||||
var actions7 = $("#customer_wallet_cash_national td:last-child").html();
|
|
||||||
// Append table with add row form on add new button click
|
|
||||||
$(".new7").click(function () {
|
|
||||||
if (!actions7) {
|
|
||||||
actions7 = '<a class="add add7" title="Add" data-toggle="tooltip"><i class="material-icons"></i></a>\n' +
|
|
||||||
' <a class="edit edit7" title="Edit" data-toggle="tooltip"><i class="material-icons"></i></a>\n' +
|
|
||||||
' <a class="delete delete7" title="Delete" data-toggle="tooltip"><i class="material-icons"></i></a>';
|
|
||||||
}
|
|
||||||
$(this).attr("disabled", "disabled");
|
|
||||||
var index = $("#customer_wallet_cash_national tbody tr:last-child").index();
|
|
||||||
var row = '<tr>' +
|
|
||||||
'<td><input type="number" required min="0" class="form-control" name="min" id="min"></td>' +
|
|
||||||
'<td><input type="number" required class="form-control" name="max" id="max"></td>' +
|
|
||||||
'<td><input type="number" required step="any" class="form-control" name="taux" id="taux"></td>' +
|
|
||||||
'<td><input type="number" min="1" class="form-control" name="plafond" id="plafond"></td>' +
|
|
||||||
'<td> ' + actions7 + '</td>' +
|
|
||||||
'</tr>';
|
|
||||||
$("#customer_wallet_cash_national").append(row);
|
|
||||||
$("#customer_wallet_cash_national tbody tr").eq(index + 1).find(".add7, .edit7").toggle();
|
|
||||||
$('[data-toggle="tooltip"]').tooltip();
|
|
||||||
});
|
|
||||||
// Add row on add button click
|
|
||||||
$(document).on("click", ".add7", function () {
|
|
||||||
var empty = false;
|
|
||||||
var input = $(this).parents("tr").find('input[type="number"]');
|
|
||||||
var min = parseFloat($(this).parents("tr").find('input[id="min"]').first().val());
|
|
||||||
var max = parseFloat($(this).parents("tr").find('input[id="max"]').first().val());
|
|
||||||
|
|
||||||
input.each(function () {
|
|
||||||
if ($(this).attr('id') == 'min') {
|
|
||||||
if (min >= max) {
|
|
||||||
$(this).addClass("error");
|
|
||||||
$(this)[0].reportValidity();
|
|
||||||
empty = true;
|
|
||||||
} else {
|
|
||||||
$(this).removeClass("error");
|
|
||||||
}
|
|
||||||
} else if ($(this).attr('id') == 'max') {
|
|
||||||
if (max <= min) {
|
|
||||||
$(this).addClass("error");
|
|
||||||
$(this)[0].reportValidity();
|
|
||||||
empty = true;
|
|
||||||
} else {
|
|
||||||
$(this).removeClass("error");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (!$(this)[0].checkValidity()) {
|
|
||||||
$(this).addClass("error");
|
|
||||||
$(this)[0].reportValidity();
|
|
||||||
empty = true;
|
|
||||||
} else {
|
|
||||||
$(this).removeClass("error");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
$(this).parents("tr").find(".error").first().focus();
|
|
||||||
if (!empty) {
|
|
||||||
input.each(function () {
|
|
||||||
$(this).parent("td").html($(this).val());
|
|
||||||
});
|
|
||||||
$(this).parents("tr").find(".add7, .edit7").toggle();
|
|
||||||
$(".new7").removeAttr("disabled");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// Edit row on edit button click
|
|
||||||
$(document).on("click", ".edit7", function () {
|
|
||||||
$(this).parents("tr").find("td:not(:last-child)").each(function (index) {
|
|
||||||
if (index == 0)
|
|
||||||
$(this).html('<input type="number" required class="form-control" min="0" id="min" value="' + $(this).text() + '">');
|
|
||||||
if (index == 1)
|
|
||||||
$(this).html('<input type="number" required class="form-control" id="max" value="' + $(this).text() + '">');
|
|
||||||
if (index == 2)
|
|
||||||
$(this).html('<input type="number" required class="form-control" step="any" min="0" value="' + $(this).text() + '">');
|
|
||||||
if (index == 3)
|
|
||||||
$(this).html('<input type="number" class="form-control" min="1" value="' + $(this).text() + '">');
|
|
||||||
});
|
|
||||||
$(this).parents("tr").find(".add7, .edit7").toggle();
|
|
||||||
$(".new7").attr("disabled", "disabled");
|
|
||||||
});
|
|
||||||
// Delete row on delete button click
|
|
||||||
$(document).on("click", ".delete7", function () {
|
|
||||||
$(this).parents("tr").remove();
|
|
||||||
$(".new7").removeAttr("disabled");
|
|
||||||
});
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* INTERNATIONAUX
|
* INTERNATIONAUX
|
||||||
*/
|
*/
|
||||||
|
@ -1099,94 +852,5 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
|
||||||
$(this).parents("tr").remove();
|
$(this).parents("tr").remove();
|
||||||
$(".new12").removeAttr("disabled");
|
$(".new12").removeAttr("disabled");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// Paliers nationaux
|
|
||||||
|
|
||||||
// Table 7
|
|
||||||
var actions72 = $("#customer_wallet_cash_international td:last-child").html();
|
|
||||||
// Append table with add row form on add new button click
|
|
||||||
$(".new72").click(function () {
|
|
||||||
if (!actions72) {
|
|
||||||
actions72 = '<a class="add add72" title="Add" data-toggle="tooltip"><i class="material-icons"></i></a>\n' +
|
|
||||||
' <a class="edit edit72" title="Edit" data-toggle="tooltip"><i class="material-icons"></i></a>\n' +
|
|
||||||
' <a class="delete delete72" title="Delete" data-toggle="tooltip"><i class="material-icons"></i></a>';
|
|
||||||
}
|
|
||||||
$(this).attr("disabled", "disabled");
|
|
||||||
var index = $("#customer_wallet_cash_international tbody tr:last-child").index();
|
|
||||||
var row = '<tr>' +
|
|
||||||
'<td><input type="number" required min="0" class="form-control" name="min" id="min"></td>' +
|
|
||||||
'<td><input type="number" required class="form-control" name="max" id="max"></td>' +
|
|
||||||
'<td><input type="number" required step="any" class="form-control" name="taux" id="taux"></td>' +
|
|
||||||
'<td><input type="number" min="1" class="form-control" name="plafond" id="plafond"></td>' +
|
|
||||||
'<td> ' + actions72 + '</td>' +
|
|
||||||
'</tr>';
|
|
||||||
$("#customer_wallet_cash_international").append(row);
|
|
||||||
$("#customer_wallet_cash_international tbody tr").eq(index + 1).find(".add72, .edit72").toggle();
|
|
||||||
$('[data-toggle="tooltip"]').tooltip();
|
|
||||||
});
|
|
||||||
// Add row on add button click
|
|
||||||
$(document).on("click", ".add72", function () {
|
|
||||||
var empty = false;
|
|
||||||
var input = $(this).parents("tr").find('input[type="number"]');
|
|
||||||
var min = parseFloat($(this).parents("tr").find('input[id="min"]').first().val());
|
|
||||||
var max = parseFloat($(this).parents("tr").find('input[id="max"]').first().val());
|
|
||||||
|
|
||||||
input.each(function () {
|
|
||||||
if ($(this).attr('id') == 'min') {
|
|
||||||
if (min >= max) {
|
|
||||||
$(this).addClass("error");
|
|
||||||
$(this)[0].reportValidity();
|
|
||||||
empty = true;
|
|
||||||
} else {
|
|
||||||
$(this).removeClass("error");
|
|
||||||
}
|
|
||||||
} else if ($(this).attr('id') == 'max') {
|
|
||||||
if (max <= min) {
|
|
||||||
$(this).addClass("error");
|
|
||||||
$(this)[0].reportValidity();
|
|
||||||
empty = true;
|
|
||||||
} else {
|
|
||||||
$(this).removeClass("error");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (!$(this)[0].checkValidity()) {
|
|
||||||
$(this).addClass("error");
|
|
||||||
$(this)[0].reportValidity();
|
|
||||||
empty = true;
|
|
||||||
} else {
|
|
||||||
$(this).removeClass("error");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
$(this).parents("tr").find(".error").first().focus();
|
|
||||||
if (!empty) {
|
|
||||||
input.each(function () {
|
|
||||||
$(this).parent("td").html($(this).val());
|
|
||||||
});
|
|
||||||
$(this).parents("tr").find(".add72, .edit72").toggle();
|
|
||||||
$(".new72").removeAttr("disabled");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// Edit row on edit button click
|
|
||||||
$(document).on("click", ".edit72", function () {
|
|
||||||
$(this).parents("tr").find("td:not(:last-child)").each(function (index) {
|
|
||||||
if (index == 0)
|
|
||||||
$(this).html('<input type="number" required class="form-control" min="0" id="min" value="' + $(this).text() + '">');
|
|
||||||
if (index == 1)
|
|
||||||
$(this).html('<input type="number" required class="form-control" id="max" value="' + $(this).text() + '">');
|
|
||||||
if (index == 2)
|
|
||||||
$(this).html('<input type="number" required class="form-control" step="any" min="0" value="' + $(this).text() + '">');
|
|
||||||
if (index == 3)
|
|
||||||
$(this).html('<input type="number" class="form-control" min="1" value="' + $(this).text() + '">');
|
|
||||||
});
|
|
||||||
$(this).parents("tr").find(".add7, .edit7").toggle();
|
|
||||||
$(".new72").attr("disabled", "disabled");
|
|
||||||
});
|
|
||||||
// Delete row on delete button click
|
|
||||||
$(document).on("click", ".delete72", function () {
|
|
||||||
$(this).parents("tr").remove();
|
|
||||||
$(".new72").removeAttr("disabled");
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -62,6 +62,10 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="callout callout-info">
|
||||||
|
<p>Note</p>
|
||||||
|
<h4><?= $this->lang->line('note_config_wallet_agent_remove_cash') ?></h4>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-6 col-xs-12">
|
<div class="col-lg-6 col-xs-12">
|
||||||
|
|
|
@ -928,7 +928,7 @@
|
||||||
'<td>'+(it.description || '')+'</td>' +
|
'<td>'+(it.description || '')+'</td>' +
|
||||||
'<td>'+(it.quantity || '')+'</td>' +
|
'<td>'+(it.quantity || '')+'</td>' +
|
||||||
'<td>'+(parseFloat(it.unit_price) || '')+'</td>' +
|
'<td>'+(parseFloat(it.unit_price) || '')+'</td>' +
|
||||||
'<td>'+actions2+'</td>' +
|
(showActionsButtons ? '<td>'+actions2+'</td>' : '' ) +
|
||||||
'</tr>')
|
'</tr>')
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -948,7 +948,7 @@
|
||||||
'<td>'+(it.dosage || '')+'</td>' +
|
'<td>'+(it.dosage || '')+'</td>' +
|
||||||
'<td>'+(it.quantity || '')+'</td>' +
|
'<td>'+(it.quantity || '')+'</td>' +
|
||||||
'<td>'+(parseFloat(it.unit_price) || '')+'</td>' +
|
'<td>'+(parseFloat(it.unit_price) || '')+'</td>' +
|
||||||
'<td>'+actions3+'</td>' +
|
(showActionsButtons ? '<td>'+actions3+'</td>' : '' ) +
|
||||||
'</tr>')
|
'</tr>')
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue