Improved insured details and add amount to act
This commit is contained in:
parent
1678e4e37b
commit
9338a6c7e2
|
@ -2052,6 +2052,26 @@ class Hyperviseur_dash extends CI_Controller
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function exclusions(){
|
||||||
|
if ($this->isLogged()) {
|
||||||
|
$data['alert'] = "";
|
||||||
|
$data['active'] = "wallet_exclusions";
|
||||||
|
$data['network'] = $this->session->userdata('network');
|
||||||
|
$data['villes'] = $this->user_model->getVilleByUserGeo($data['network'], $this->session->userdata('current_pays'));
|
||||||
|
|
||||||
|
$data['currency_code'] = $this->session->userdata('currency_code');
|
||||||
|
$data['category'] = $this->session->userdata('category');
|
||||||
|
$data['network_id'] = $this->session->userdata('network_id');
|
||||||
|
|
||||||
|
$data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('network_id'));
|
||||||
|
$data['exclusion'] = $this->nano_health_model->getConfig($data['network_id']);
|
||||||
|
|
||||||
|
$this->load->view('header_hyp', $data);
|
||||||
|
$this->load->view('nano_health/hyper/exclusions');
|
||||||
|
$this->load->view('footer');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function drugs_and_devices(){
|
public function drugs_and_devices(){
|
||||||
if ($this->isLogged()) {
|
if ($this->isLogged()) {
|
||||||
$data['active'] = "wallet_drugs_and_devices";
|
$data['active'] = "wallet_drugs_and_devices";
|
||||||
|
|
|
@ -76,6 +76,7 @@ class NanoHealthController extends CI_Controller
|
||||||
if (isset($_POST)) {
|
if (isset($_POST)) {
|
||||||
$id = $_POST['id'] ?? null;
|
$id = $_POST['id'] ?? null;
|
||||||
$_POST['nh_network_config_id'] = $_POST['config_id'];
|
$_POST['nh_network_config_id'] = $_POST['config_id'];
|
||||||
|
$_POST['amount'] = empty($_POST['amount']) ? null : $_POST['amount'];
|
||||||
unset($_POST['config_id']);
|
unset($_POST['config_id']);
|
||||||
|
|
||||||
$exist = $this->db->get_where('nh_acts', ['id !=' => $id , 'nh_network_config_id' => $_POST['nh_network_config_id'] , 'code' => $_POST['code']]);
|
$exist = $this->db->get_where('nh_acts', ['id !=' => $id , 'nh_network_config_id' => $_POST['nh_network_config_id'] , 'code' => $_POST['code']]);
|
||||||
|
|
|
@ -900,5 +900,8 @@ $lang['payment_duration_months'] = "Payment duration (in months)";
|
||||||
$lang['ONE_TIME'] = "One time only";
|
$lang['ONE_TIME'] = "One time only";
|
||||||
$lang['DAILY'] = "Daily";
|
$lang['DAILY'] = "Daily";
|
||||||
$lang['undefined'] = "Not defined";
|
$lang['undefined'] = "Not defined";
|
||||||
$lang['number_of_fractions'] = "Number of fractions"
|
$lang['number_of_fractions'] = "Number of fractions";
|
||||||
|
$lang['PARTIALLY_PAID'] = "Partially paid";
|
||||||
|
$lang['SUSPENDED'] = "Suspended";
|
||||||
|
$lang['amount_required'] = "Amount is required";
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -910,5 +910,8 @@ $lang['payment_duration_months'] = "Durée du paiment (en mois)";
|
||||||
$lang['ONE_TIME'] = "Une seule fois";
|
$lang['ONE_TIME'] = "Une seule fois";
|
||||||
$lang['DAILY'] = "Journalier";
|
$lang['DAILY'] = "Journalier";
|
||||||
$lang['undefined'] = "Non défini";
|
$lang['undefined'] = "Non défini";
|
||||||
$lang['number_of_fractions'] = "Nombre de fractions"
|
$lang['number_of_fractions'] = "Nombre de fractions";
|
||||||
|
$lang['PARTIALLY_PAID'] = "Partiellement payée";
|
||||||
|
$lang['SUSPENDED'] = "Suspendue";
|
||||||
|
$lang['amount_required'] = "Le montant est requis";
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -185,4 +185,8 @@ class Nano_health_model extends CI_Model
|
||||||
}
|
}
|
||||||
return $query->count_all_results();
|
return $query->count_all_results();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getExclusion($id_network){
|
||||||
|
return $this->db->get_where('nh_exclusions',['network_id'=> $id_network]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,11 +39,8 @@ class Insurances_model extends CI_Model
|
||||||
$this->db->from($this->table);
|
$this->db->from($this->table);
|
||||||
$this->db->where('network_id', $postData['id_network']);
|
$this->db->where('network_id', $postData['id_network']);
|
||||||
if (!empty($postData['state'])) {
|
if (!empty($postData['state'])) {
|
||||||
if($postData['state'] == "STOPPED"){
|
$state = explode(',',$postData['state']);
|
||||||
$this->db->where_in('state', ["STOPPED","EXPIRED"]);
|
$this->db->where_in('state', $state);
|
||||||
}else{
|
|
||||||
$this->db->where('state', $postData['state']);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return $this->db->count_all_results();
|
return $this->db->count_all_results();
|
||||||
}
|
}
|
||||||
|
@ -73,11 +70,8 @@ class Insurances_model extends CI_Model
|
||||||
$this->db->where('created_at <', date('Y-m-d', strtotime($postData['endDate']. "+1 day")));
|
$this->db->where('created_at <', date('Y-m-d', strtotime($postData['endDate']. "+1 day")));
|
||||||
}
|
}
|
||||||
if (!empty($postData['state'])) {
|
if (!empty($postData['state'])) {
|
||||||
if($postData['state'] == "STOPPED"){
|
$state = explode(',',$postData['state']);
|
||||||
$this->db->where_in('state', ["STOPPED","EXPIRED"]);
|
$this->db->where_in('state', $state);
|
||||||
}else{
|
|
||||||
$this->db->where('state', $postData['state']);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
|
@ -235,6 +235,12 @@
|
||||||
<span><?php echo $this->lang->line('invoices'); ?></span>
|
<span><?php echo $this->lang->line('invoices'); ?></span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="<?php if ($active == "wallet_exclusions") {echo "active";} ?>">
|
||||||
|
<a href="<?php echo base_url('Hyperviseur_dash/exclusions') ?>">
|
||||||
|
<i class="fa fa-times"></i>
|
||||||
|
<span>Exclusions</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<li class="<?php if ($active == "wallet_password") {
|
<li class="<?php if ($active == "wallet_password") {
|
||||||
echo "active";
|
echo "active";
|
||||||
|
|
|
@ -366,6 +366,7 @@ $careRequests = [];
|
||||||
<th>".$this->lang->line('Nom')."</th>
|
<th>".$this->lang->line('Nom')."</th>
|
||||||
<th>".$this->lang->line('billing_type')."</th>
|
<th>".$this->lang->line('billing_type')."</th>
|
||||||
<th>".$this->lang->line('authorization_type')."</th>
|
<th>".$this->lang->line('authorization_type')."</th>
|
||||||
|
<th>".$this->lang->line('Montant')."</th>
|
||||||
<th>Action</th>";
|
<th>Action</th>";
|
||||||
?>
|
?>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -373,16 +374,19 @@ $careRequests = [];
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php
|
<?php
|
||||||
if(isset($acts)){
|
if(isset($acts)){
|
||||||
foreach($acts->result() as $i => $row) { ?>
|
foreach($acts->result() as $i => $row) {
|
||||||
|
$amount = isset($row->amount) ? Money::of(round($row->amount, 2), $currency_code, $context)->formatTo('fr_FR') : ''
|
||||||
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?= $i+1 ?></td>
|
<td><?= $i+1 ?></td>
|
||||||
<td><?= $row->code ?></td>
|
<td><?= $row->code ?></td>
|
||||||
<td><?= $row->name ?></td>
|
<td><?= $row->name ?></td>
|
||||||
<td><?= $this->lang->line($row->billing_type); ?></td>
|
<td><?= $this->lang->line($row->billing_type); ?></td>
|
||||||
<td><?= $this->lang->line($row->authorization_type); ?></td>
|
<td><?= $this->lang->line($row->authorization_type); ?></td>
|
||||||
|
<td><?= $amount ?></td>
|
||||||
<td>
|
<td>
|
||||||
<button class='btn btn-success editAct' data-id="<?=$row->id?>" data-name="<?=$row->name?>" data-billing_type="<?=$row->billing_type?>"
|
<button class='btn btn-success editAct' data-id="<?=$row->id?>" data-name="<?=$row->name?>" data-billing_type="<?=$row->billing_type?>"
|
||||||
data-authorization_type="<?=$row->authorization_type?>" data-code="<?=$row->code?>" >
|
data-authorization_type="<?=$row->authorization_type?>" data-code="<?=$row->code?>" data-amount="<?=$row->amount?>" >
|
||||||
<i class='fa fa-edit'></i>
|
<i class='fa fa-edit'></i>
|
||||||
</button>
|
</button>
|
||||||
<button data-toggle='modal' class='btn btn-danger deleteAct' data-id="<?=$row->id?>" >
|
<button data-toggle='modal' class='btn btn-danger deleteAct' data-id="<?=$row->id?>" >
|
||||||
|
@ -715,6 +719,10 @@ $careRequests = [];
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group" id="div-amount">
|
||||||
|
<label class="col-form-label"><?= $this->lang->line('Montant'); ?></label>
|
||||||
|
<input type="number" min="0" step="1" class="form-control input-lg" name="amount">
|
||||||
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-form-label"><?= $this->lang->line('authorization_type'); ?></label>
|
<label class="col-form-label"><?= $this->lang->line('authorization_type'); ?></label>
|
||||||
<select class="form-control input-lg" name="authorization_type" required>
|
<select class="form-control input-lg" name="authorization_type" required>
|
||||||
|
@ -1027,47 +1035,68 @@ $careRequests = [];
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#actForm").submit(function( event ) {
|
$("#actForm").submit(function( event ) {
|
||||||
$.ajax({
|
let billing_type = $("select[name='billing_type'] :selected",this).val()
|
||||||
url: '<?php echo base_url('NanoHealthController/storeAct')?>',
|
let amount = parseFloat($("input[name='amount']",this).val())
|
||||||
type: 'POST',
|
if(billing_type === "UNIT_PRICE" && isNaN(amount)){
|
||||||
dataType: 'json',
|
toastr.error("<?= $this->lang->line('amount_required')?>", "<?= $this->lang->line('management_rule')?>");
|
||||||
data: {
|
}else{
|
||||||
"config_id": config_id,
|
$.ajax({
|
||||||
"id" : selectedActId,
|
url: '<?php echo base_url('NanoHealthController/storeAct')?>',
|
||||||
"code": $("input[name='code']",this).val(),
|
type: 'POST',
|
||||||
"name": $("input[name='name']",this).val(),
|
dataType: 'json',
|
||||||
"billing_type": $("select[name='billing_type'] :selected",this).val(),
|
data: {
|
||||||
"authorization_type": $("select[name='authorization_type'] :selected",this).val(),
|
"config_id": config_id,
|
||||||
},
|
"id" : selectedActId,
|
||||||
success: function (data) {
|
"code": $("input[name='code']",this).val(),
|
||||||
if (data.code === 200) {
|
"name": $("input[name='name']",this).val(),
|
||||||
Swal.fire({
|
"billing_type": billing_type,
|
||||||
icon: 'success',
|
"authorization_type": $("select[name='authorization_type'] :selected",this).val(),
|
||||||
title: "<?php echo $this->lang->line('wallet_update')?>",
|
"amount" : isNaN(amount) ? null : amount
|
||||||
text: "<?php echo $this->lang->line('informations_updated')?>",
|
},
|
||||||
timer: 3000
|
success: function (data) {
|
||||||
}).then(() => {
|
if (data.code === 200) {
|
||||||
location.reload();
|
Swal.fire({
|
||||||
});
|
icon: 'success',
|
||||||
} else {
|
title: "<?php echo $this->lang->line('wallet_update')?>",
|
||||||
toastr.error(data.message , "<?php echo $this->lang->line('request_error')?>");
|
text: "<?php echo $this->lang->line('informations_updated')?>",
|
||||||
|
timer: 3000
|
||||||
|
}).then(() => {
|
||||||
|
location.reload();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
toastr.error(data.message , "<?php echo $this->lang->line('request_error')?>");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function (resultat, statut, error) {
|
||||||
|
console.log(resultat + " " + error);
|
||||||
|
toastr.error("<?php echo $this->lang->line('error_message')?>", "<?php echo $this->lang->line('request_error')?>");
|
||||||
}
|
}
|
||||||
},
|
});
|
||||||
error: function (resultat, statut, error) {
|
}
|
||||||
console.log(resultat + " " + error);
|
|
||||||
toastr.error("<?php echo $this->lang->line('error_message')?>", "<?php echo $this->lang->line('request_error')?>");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// function hideOrShowActAmountDiv(billing_type){
|
||||||
|
// if(billing_type === 'PACKAGE'){
|
||||||
|
// $("#actForm div[id='div-amount']").hide()
|
||||||
|
// }else{
|
||||||
|
// $("#actForm div[id='div-amount']").show()
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// $("#actForm select[name='billing_type']").change(function () {
|
||||||
|
// hideOrShowActAmountDiv($(this).val())
|
||||||
|
// });
|
||||||
|
|
||||||
$('.editAct').click(function (){
|
$('.editAct').click(function (){
|
||||||
selectedActId = $(this).data('id');
|
selectedActId = $(this).data('id');
|
||||||
$("#modal-act h3").html("<?=$this->lang->line('edit_act')?>");
|
$("#modal-act h3").html("<?=$this->lang->line('edit_act')?>");
|
||||||
$("#actForm input[name='code']").val($(this).data('code'));
|
$("#actForm input[name='code']").val($(this).data('code'));
|
||||||
$("#actForm input[name='name']").val($(this).data('name'));
|
$("#actForm input[name='name']").val($(this).data('name'));
|
||||||
$("#actForm select[name='billing_type']").val($(this).data('billing_type'));
|
$("#actForm select[name='billing_type']").val($(this).data('billing_type'));
|
||||||
|
$("#actForm input[name='amount']").val($(this).data('amount'));
|
||||||
$("#actForm select[name='authorization_type']").val($(this).data('authorization_type'));
|
$("#actForm select[name='authorization_type']").val($(this).data('authorization_type'));
|
||||||
|
// hideOrShowActAmountDiv($(this).data('billing_type'))
|
||||||
$('#modal-act').modal('show');
|
$('#modal-act').modal('show');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1077,7 +1106,10 @@ $careRequests = [];
|
||||||
$("#actForm input[name='code']").val(null);
|
$("#actForm input[name='code']").val(null);
|
||||||
$("#actForm input[name='name']").val(null);
|
$("#actForm input[name='name']").val(null);
|
||||||
$("#actForm select[name='billing_type']").prop('selectedIndex',0);
|
$("#actForm select[name='billing_type']").prop('selectedIndex',0);
|
||||||
|
$("#actForm input[name='amount']").val(null);
|
||||||
$("#actForm select[name='authorization_type']").prop('selectedIndex',0);
|
$("#actForm select[name='authorization_type']").prop('selectedIndex',0);
|
||||||
|
|
||||||
|
// $("#actForm div[id='div-amount']").hide();
|
||||||
$('#modal-act').modal('show');
|
$('#modal-act').modal('show');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -159,6 +159,17 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
<div class="col-lg-6 col-xs-6">
|
||||||
|
<div class="small-box bg-aqua-active">
|
||||||
|
<div class="inner">
|
||||||
|
<h3 style="white-space: pre-wrap; font-size: 1.9em;"><?= $this->lang->line($insurance->state) ?></h3>
|
||||||
|
<p><?= $this->lang->line('state') ?></p>
|
||||||
|
</div>
|
||||||
|
<div class="icon">
|
||||||
|
<i class="fa fa-info"></i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="col-lg-3 col-xs-6">
|
<div class="col-lg-3 col-xs-6">
|
||||||
<div class="small-box bg-aqua-active">
|
<div class="small-box bg-aqua-active">
|
||||||
<div class="inner">
|
<div class="inner">
|
||||||
|
|
|
@ -125,7 +125,7 @@
|
||||||
"ajax": {
|
"ajax": {
|
||||||
"url": "<?= base_url('pagination/Insurances/getLists'); ?>",
|
"url": "<?= base_url('pagination/Insurances/getLists'); ?>",
|
||||||
"data":{
|
"data":{
|
||||||
"state" : "STOPPED",
|
"state" : "STOPPED,SUSPENDED,EXPIRED",
|
||||||
"startDate" : "<?= $startDate?>",
|
"startDate" : "<?= $startDate?>",
|
||||||
"endDate" : "<?= $endDate?>",
|
"endDate" : "<?= $endDate?>",
|
||||||
"id_network" : "<?= $id_network ?>",
|
"id_network" : "<?= $id_network ?>",
|
||||||
|
|
|
@ -128,7 +128,7 @@
|
||||||
"ajax": {
|
"ajax": {
|
||||||
"url": "<?= base_url('pagination/Insurances/getLists'); ?>",
|
"url": "<?= base_url('pagination/Insurances/getLists'); ?>",
|
||||||
"data":{
|
"data":{
|
||||||
"state" : "PAID",
|
"state" : "PAID,PARTIALLY_PAID",
|
||||||
"startDate" : "<?= $startDate?>",
|
"startDate" : "<?= $startDate?>",
|
||||||
"endDate" : "<?= $endDate?>",
|
"endDate" : "<?= $endDate?>",
|
||||||
"id_network" : "<?= $id_network ?>",
|
"id_network" : "<?= $id_network ?>",
|
||||||
|
|
Loading…
Reference in New Issue