Update acts informations
This commit is contained in:
parent
9338a6c7e2
commit
c9a1044610
|
@ -77,6 +77,7 @@ class NanoHealthController extends CI_Controller
|
|||
$id = $_POST['id'] ?? null;
|
||||
$_POST['nh_network_config_id'] = $_POST['config_id'];
|
||||
$_POST['amount'] = empty($_POST['amount']) ? null : $_POST['amount'];
|
||||
$_POST['unit_value'] = empty($_POST['unit_value']) ? null : $_POST['unit_value'];
|
||||
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']]);
|
||||
|
|
|
@ -904,4 +904,8 @@ $lang['number_of_fractions'] = "Number of fractions";
|
|||
$lang['PARTIALLY_PAID'] = "Partially paid";
|
||||
$lang['SUSPENDED'] = "Suspended";
|
||||
$lang['amount_required'] = "Amount is required";
|
||||
$lang['reminder_delay_days'] = "Invoice payment reminder time in days";
|
||||
$lang['suspension_delay_days_after_reminder'] = "Suspension period after reminder period in days";
|
||||
$lang['unit_value'] = "Unit value";
|
||||
$lang['unit_value_required'] = "Unit value is required";
|
||||
?>
|
||||
|
|
|
@ -914,4 +914,8 @@ $lang['number_of_fractions'] = "Nombre de fractions";
|
|||
$lang['PARTIALLY_PAID'] = "Partiellement payée";
|
||||
$lang['SUSPENDED'] = "Suspendue";
|
||||
$lang['amount_required'] = "Le montant est requis";
|
||||
$lang['reminder_delay_days'] = "Délai de relance de paiement d'une facture en jours";
|
||||
$lang['suspension_delay_days_after_reminder'] = "Délai de suspension apres le délai de relance de jours";
|
||||
$lang['unit_value'] = "Valeur de l'unité";
|
||||
$lang['unit_value_required'] = "La valeur de l'unité est requise";
|
||||
?>
|
||||
|
|
|
@ -139,7 +139,7 @@ $careRequests = [];
|
|||
</div>
|
||||
</div>
|
||||
<div class="row centered">
|
||||
<div class="col-lg-4 col-xs-6">
|
||||
<div class="col-lg-2 col-xs-6">
|
||||
<div class="small-box bg-aqua-active">
|
||||
<div class="inner">
|
||||
<h3><?= $nh_config->max_number_of_beneficiaries ?? ''; ?></h3>
|
||||
|
@ -150,7 +150,7 @@ $careRequests = [];
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4 col-xs-6">
|
||||
<div class="col-lg-2 col-xs-6">
|
||||
<div class="small-box bg-aqua-active">
|
||||
<div class="inner">
|
||||
<h3><?= $nh_config->age_limit_of_insured_and_spouse ?? ''; ?></h3>
|
||||
|
@ -161,7 +161,7 @@ $careRequests = [];
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4 col-xs-6">
|
||||
<div class="col-lg-2 col-xs-6">
|
||||
<div class="small-box bg-aqua-active">
|
||||
<div class="inner">
|
||||
<h3><?= $nh_config->age_limit_of_child_beneficiary ?? ''; ?></h3>
|
||||
|
@ -172,6 +172,28 @@ $careRequests = [];
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 col-xs-6">
|
||||
<div class="small-box bg-orange-active">
|
||||
<div class="inner">
|
||||
<h3><?= $nh_config->reminder_delay_days ?? ''; ?></h3>
|
||||
<p><?= $this->lang->line('reminder_delay_days') ?> </p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="ion ion-android-calendar"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 col-xs-6">
|
||||
<div class="small-box bg-orange-active">
|
||||
<div class="inner">
|
||||
<h3><?= $nh_config->suspension_delay_days_after_reminder ?? ''; ?></h3>
|
||||
<p><?= $this->lang->line('suspension_delay_days_after_reminder') ?> </p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="ion ion-android-calendar"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-2 col-xs-6">
|
||||
|
@ -346,7 +368,7 @@ $careRequests = [];
|
|||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-7">
|
||||
<div class="col-lg-8">
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title"><?= $this->lang->line('list_of_acts') ?></h3>
|
||||
|
@ -365,6 +387,7 @@ $careRequests = [];
|
|||
<th>Code</th>
|
||||
<th>".$this->lang->line('Nom')."</th>
|
||||
<th>".$this->lang->line('billing_type')."</th>
|
||||
<th>".$this->lang->line('unit_value')."</th>
|
||||
<th>".$this->lang->line('authorization_type')."</th>
|
||||
<th>".$this->lang->line('Montant')."</th>
|
||||
<th>Action</th>";
|
||||
|
@ -382,11 +405,12 @@ $careRequests = [];
|
|||
<td><?= $row->code ?></td>
|
||||
<td><?= $row->name ?></td>
|
||||
<td><?= $this->lang->line($row->billing_type); ?></td>
|
||||
<td><?= $row->unit_value ?></td>
|
||||
<td><?= $this->lang->line($row->authorization_type); ?></td>
|
||||
<td><?= $amount ?></td>
|
||||
<td>
|
||||
<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-amount="<?=$row->amount?>" >
|
||||
data-authorization_type="<?=$row->authorization_type?>" data-code="<?=$row->code?>" data-amount="<?=$row->amount?>" data-unit_value="<?=$row->unit_value?>">
|
||||
<i class='fa fa-edit'></i>
|
||||
</button>
|
||||
<button data-toggle='modal' class='btn btn-danger deleteAct' data-id="<?=$row->id?>" >
|
||||
|
@ -403,7 +427,7 @@ $careRequests = [];
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-5">
|
||||
<div class="col-lg-4">
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title"><?= $this->lang->line('provider_classes') ?></h3>
|
||||
|
@ -494,6 +518,16 @@ $careRequests = [];
|
|||
<input type="number" min="0" max="99" step="1" required class="form-control"
|
||||
name="age_limit_of_child_beneficiary" value="<?= $nh_config->age_limit_of_child_beneficiary ?? 0 ?>">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-form-label"><?= $this->lang->line('reminder_delay_days'); ?></label>
|
||||
<input type="number" min="1" max="99" step="1" required class="form-control"
|
||||
name="reminder_delay_days" value="<?= $nh_config->reminder_delay_days ?? 0 ?>">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-form-label"><?= $this->lang->line('suspension_delay_days_after_reminder'); ?></label>
|
||||
<input type="number" min="0" max="99" step="1" required class="form-control"
|
||||
name="suspension_delay_days_after_reminder" value="<?= $nh_config->suspension_delay_days_after_reminder ?? 0 ?>">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-form-label"><?= $this->lang->line('password_validation'); ?></label>
|
||||
<select class="form-control" name="password_validation" required>
|
||||
|
@ -719,7 +753,11 @@ $careRequests = [];
|
|||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group" id="div-amount">
|
||||
<div class="form-group" id="div-unit-value">
|
||||
<label class="col-form-label"><?= $this->lang->line('unit_value'); ?></label>
|
||||
<input type="text" class="form-control input-lg" name="unit_value">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<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>
|
||||
|
@ -888,6 +926,8 @@ $careRequests = [];
|
|||
"age_limit_of_insured_and_spouse": $("input[name=age_limit_of_insured_and_spouse]").val(),
|
||||
"age_limit_of_child_beneficiary": $("input[name=age_limit_of_child_beneficiary]").val(),
|
||||
"family_coverage_sharing" : family_coverage_sharing,
|
||||
"reminder_delay_days" : $("input[name=reminder_delay_days]").val(),
|
||||
"suspension_delay_days_after_reminder" : $("input[name=suspension_delay_days_after_reminder]").val(),
|
||||
"password_validation" : $("select[name=password_validation]").val(),
|
||||
"current_affection_percentage_insurer": current_affection_percentage_insurer,
|
||||
"current_affection_percentage_insured": current_affection_percentage_insured,
|
||||
|
@ -1037,8 +1077,11 @@ $careRequests = [];
|
|||
$("#actForm").submit(function( event ) {
|
||||
let billing_type = $("select[name='billing_type'] :selected",this).val()
|
||||
let amount = parseFloat($("input[name='amount']",this).val())
|
||||
if(billing_type === "UNIT_PRICE" && isNaN(amount)){
|
||||
let unit_value = $("input[name='unit_value']",this).val()
|
||||
if(billing_type === "UNIT_PRICE" && isNaN(amount)) {
|
||||
toastr.error("<?= $this->lang->line('amount_required')?>", "<?= $this->lang->line('management_rule')?>");
|
||||
}else if(billing_type === "UNIT_PRICE" && unit_value.length === 0) {
|
||||
toastr.error("<?= $this->lang->line('unit_value_required')?>", "<?= $this->lang->line('management_rule')?>");
|
||||
}else{
|
||||
$.ajax({
|
||||
url: '<?php echo base_url('NanoHealthController/storeAct')?>',
|
||||
|
@ -1051,6 +1094,7 @@ $careRequests = [];
|
|||
"name": $("input[name='name']",this).val(),
|
||||
"billing_type": billing_type,
|
||||
"authorization_type": $("select[name='authorization_type'] :selected",this).val(),
|
||||
"unit_value": $("input[name='unit_value']",this).val(),
|
||||
"amount" : isNaN(amount) ? null : amount
|
||||
},
|
||||
success: function (data) {
|
||||
|
@ -1076,17 +1120,17 @@ $careRequests = [];
|
|||
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())
|
||||
// });
|
||||
function hideOrShowUnitValueDiv(billing_type){
|
||||
if(billing_type === 'PACKAGE'){
|
||||
$("#actForm div[id='div-unit-value']").hide()
|
||||
}else{
|
||||
$("#actForm div[id='div-unit-value']").show()
|
||||
}
|
||||
}
|
||||
|
||||
$("#actForm select[name='billing_type']").change(function () {
|
||||
hideOrShowUnitValueDiv($(this).val())
|
||||
});
|
||||
|
||||
$('.editAct').click(function (){
|
||||
selectedActId = $(this).data('id');
|
||||
|
@ -1095,8 +1139,9 @@ $careRequests = [];
|
|||
$("#actForm input[name='name']").val($(this).data('name'));
|
||||
$("#actForm select[name='billing_type']").val($(this).data('billing_type'));
|
||||
$("#actForm input[name='amount']").val($(this).data('amount'));
|
||||
$("#actForm input[name='unit_value']").val($(this).data('unit_value'));
|
||||
$("#actForm select[name='authorization_type']").val($(this).data('authorization_type'));
|
||||
// hideOrShowActAmountDiv($(this).data('billing_type'))
|
||||
hideOrShowUnitValueDiv($(this).data('billing_type'))
|
||||
$('#modal-act').modal('show');
|
||||
});
|
||||
|
||||
|
@ -1107,9 +1152,10 @@ $careRequests = [];
|
|||
$("#actForm input[name='name']").val(null);
|
||||
$("#actForm select[name='billing_type']").prop('selectedIndex',0);
|
||||
$("#actForm input[name='amount']").val(null);
|
||||
$("#actForm input[name='unit_value']").val(null);
|
||||
$("#actForm select[name='authorization_type']").prop('selectedIndex',0);
|
||||
|
||||
// $("#actForm div[id='div-amount']").hide();
|
||||
$("#actForm div[id='div-unit-value']").hide();
|
||||
$('#modal-act').modal('show');
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue