Update health care sheets infos table
This commit is contained in:
parent
e0e33081b6
commit
d2d77e7785
|
@ -366,6 +366,12 @@ class NanoHealthController extends CI_Controller
|
||||||
echo $this->makeRequest('GET','/health-care-sheets/'.$id);
|
echo $this->makeRequest('GET','/health-care-sheets/'.$id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getActs()
|
||||||
|
{
|
||||||
|
echo $this->makeRequest('GET','/acts');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public function generateInvoice()
|
public function generateInvoice()
|
||||||
{
|
{
|
||||||
if($this->isLogged()) {
|
if($this->isLogged()) {
|
||||||
|
@ -413,7 +419,12 @@ class NanoHealthController extends CI_Controller
|
||||||
return json_encode(['status' => 401]);
|
return json_encode(['status' => 401]);
|
||||||
}
|
}
|
||||||
$url = NANO_SANTE_SERVICE_URL.$path;
|
$url = NANO_SANTE_SERVICE_URL.$path;
|
||||||
$ch = curl_init($url);
|
if($method == 'GET'){
|
||||||
|
$data = http_build_query($_POST);
|
||||||
|
$ch = curl_init($url."?".$data);
|
||||||
|
}else{
|
||||||
|
$ch = curl_init($url);
|
||||||
|
}
|
||||||
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
|
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
|
||||||
/* set the content type json */
|
/* set the content type json */
|
||||||
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
|
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
|
||||||
|
|
|
@ -910,6 +910,6 @@ $lang['unit_value'] = "Unit value";
|
||||||
$lang['unit_value_required'] = "Unit value is required";
|
$lang['unit_value_required'] = "Unit value is required";
|
||||||
$lang['issuer_agent'] = "Issuing agent";
|
$lang['issuer_agent'] = "Issuing agent";
|
||||||
$lang['CONSULTATION'] = "CONSULTATION";
|
$lang['CONSULTATION'] = "CONSULTATION";
|
||||||
$lang['EXAM'] = "EXAM";
|
$lang['EXAM_OR_OTHER'] = "EXAM OR OTHER";
|
||||||
$lang['consultation_cannot_have_unit_price'] = "A consultation cannot have a unit price";
|
$lang['consultation_cannot_have_unit_price'] = "A consultation cannot have a unit price";
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -920,6 +920,7 @@ $lang['unit_value'] = "Valeur de l'unité";
|
||||||
$lang['unit_value_required'] = "La valeur de l'unité est requise";
|
$lang['unit_value_required'] = "La valeur de l'unité est requise";
|
||||||
$lang['issuer_agent'] = "Agent emetteur";
|
$lang['issuer_agent'] = "Agent emetteur";
|
||||||
$lang['CONSULTATION'] = "CONSULTATION";
|
$lang['CONSULTATION'] = "CONSULTATION";
|
||||||
$lang['EXAM'] = "EXAMEN";
|
$lang['EXAM_OR_OTHER'] = "EXAMEN OU AUTRE";
|
||||||
$lang['consultation_cannot_have_unit_price'] = "Une consultation ne peut pas avoir de prix unitaire"
|
$lang['consultation_cannot_have_unit_price'] = "Une consultation ne peut pas avoir de prix unitaire";
|
||||||
|
$lang['SUSPENDED'] = "SUSPENDU"
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -103,7 +103,7 @@ class Nano_health_model extends CI_Model
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getHealthCareSheetExams($healthCareSheetId){
|
public function getHealthCareSheetExams($healthCareSheetId){
|
||||||
return $this->db->select('e.* , a.code as act_code , a.name as act_name')
|
return $this->db->select('e.* , a.code as act_code , a.name as act_name , a.unit_value as act_unit_value')
|
||||||
->from('nh_exams e')->join('nh_health_care_sheets_exams se', 'e.id = se.exam_id')
|
->from('nh_exams e')->join('nh_health_care_sheets_exams se', 'e.id = se.exam_id')
|
||||||
->join('nh_acts a', 'a.id = e.act_id')
|
->join('nh_acts a', 'a.id = e.act_id')
|
||||||
->where('se.sheet_id',$healthCareSheetId)->order_by('se.created_at','asc')->get();
|
->where('se.sheet_id',$healthCareSheetId)->order_by('se.created_at','asc')->get();
|
||||||
|
|
|
@ -180,7 +180,6 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
|
||||||
<tr>
|
<tr>
|
||||||
<th><?= $this->lang->line('exam_class'); ?></th>
|
<th><?= $this->lang->line('exam_class'); ?></th>
|
||||||
<th><?= $this->lang->line('exam_description'); ?></th>
|
<th><?= $this->lang->line('exam_description'); ?></th>
|
||||||
<th><?= $this->lang->line('quantity'); ?></th>
|
|
||||||
<th>Actions</th>
|
<th>Actions</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
@ -268,6 +267,8 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
|
||||||
toastr.options.closeDuration = 5000;
|
toastr.options.closeDuration = 5000;
|
||||||
toastr.options.closeEasing = 'swing';
|
toastr.options.closeEasing = 'swing';
|
||||||
|
|
||||||
|
var acts = []
|
||||||
|
|
||||||
$(document).ready(function (){
|
$(document).ready(function (){
|
||||||
$('#patient').hide();
|
$('#patient').hide();
|
||||||
$('#patient-details').hide();
|
$('#patient-details').hide();
|
||||||
|
@ -299,7 +300,8 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
|
||||||
$.each(insured, function (i, item) {
|
$.each(insured, function (i, item) {
|
||||||
$('#sheet-form').find('select[name="insured_id"]').append($('<option>', {
|
$('#sheet-form').find('select[name="insured_id"]').append($('<option>', {
|
||||||
value: item.insured_id,
|
value: item.insured_id,
|
||||||
text : item.insured_id+' - '+item.user.lastname +' '+(item.user.firstname || '')
|
text : item.insured_id+' - '+item.user.lastname +' '+(item.user.firstname || '') + (item.state === 'SUSPENDED' ? " - <?= $this->lang->line('SUSPENDED') ?>" : ''),
|
||||||
|
disabled : item.state === 'SUSPENDED'
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -332,16 +334,37 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
|
||||||
|
|
||||||
$('#sheet-form').find('select[name="beneficiary_id"]').change(function () {
|
$('#sheet-form').find('select[name="beneficiary_id"]').change(function () {
|
||||||
var val = parseInt($(this).val());
|
var val = parseInt($(this).val());
|
||||||
|
let beneficiary = null;
|
||||||
if(val === 0){
|
if(val === 0){
|
||||||
$('#sheet-form').find('input[name="patient_lastname"]').val(currentInsurance.user.lastname)
|
$('#sheet-form').find('input[name="patient_lastname"]').val(currentInsurance.user.lastname)
|
||||||
$('#sheet-form').find('input[name="patient_firstname"]').val(currentInsurance.user.firstname)
|
$('#sheet-form').find('input[name="patient_firstname"]').val(currentInsurance.user.firstname)
|
||||||
}else{
|
}else{
|
||||||
const b = currentInsurance.beneficiaries.filter(i => i.id === val);
|
beneficiary = currentInsurance.beneficiaries.filter(i => i.id === val);
|
||||||
$('#sheet-form').find('input[name="patient_lastname"]').val(b[0].lastname)
|
$('#sheet-form').find('input[name="patient_lastname"]').val(beneficiary[0].lastname)
|
||||||
$('#sheet-form').find('input[name="patient_firstname"]').val(b[0].firstname)
|
$('#sheet-form').find('input[name="patient_firstname"]').val(beneficiary[0].firstname)
|
||||||
}
|
}
|
||||||
$('#patient-details').show();
|
|
||||||
|
// Fetch acts
|
||||||
|
$.ajax({
|
||||||
|
url: '<?php echo base_url('NanoHealthController/getActs')?>',
|
||||||
|
type: 'POST',
|
||||||
|
dataType: 'json',
|
||||||
|
data: {
|
||||||
|
"network_id": "<?=$network_id?>", "user_id": currentInsurance.user.id, "beneficiary_id": beneficiary == null ? null : beneficiary[0].id,
|
||||||
|
},
|
||||||
|
success: function (data) {
|
||||||
|
if(data.status === 200){
|
||||||
|
acts = data.response
|
||||||
|
$('#patient-details').show();
|
||||||
|
}else{
|
||||||
|
toastr.error(data.error , "<?= $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')?>");
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}else{
|
}else{
|
||||||
history.back()
|
history.back()
|
||||||
|
@ -376,8 +399,8 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
|
||||||
arrayItem['act_id'] = $(item).attr('value');
|
arrayItem['act_id'] = $(item).attr('value');
|
||||||
if (index === 1)
|
if (index === 1)
|
||||||
arrayItem['description'] = $(item).html();
|
arrayItem['description'] = $(item).html();
|
||||||
if (index === 2)
|
// if (index === 2)
|
||||||
arrayItem['quantity'] = parseFloat($(item).html());
|
// arrayItem['quantity'] = parseFloat($(item).html());
|
||||||
});
|
});
|
||||||
exams.push(arrayItem);
|
exams.push(arrayItem);
|
||||||
});
|
});
|
||||||
|
@ -449,13 +472,14 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
|
||||||
// Paliers scripts
|
// Paliers scripts
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
|
|
||||||
function getActsOptions(selectedValue) {
|
function getActsOptions(selectedValue , type) {
|
||||||
var actsOptions = '';
|
var actsOptions = '';
|
||||||
<?php foreach ($acts->result() as $a ) {?>
|
acts.forEach(function (a) {
|
||||||
var id = <?= $a->id ?>;
|
if(type === a.type) {
|
||||||
var selected = id === parseInt(selectedValue) ? 'selected' : '';
|
var selected = a.id === parseInt(selectedValue) ? 'selected' : '';
|
||||||
actsOptions += (`<option value=<?= $a->id ?> ${selected} > <?= $a->name ?> </option>`);
|
actsOptions += (`<option value=${a.id} ${selected} > ${a.name} </option>`);
|
||||||
<?php } ?>
|
}
|
||||||
|
})
|
||||||
return actsOptions;
|
return actsOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -495,6 +519,14 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function autoFetchPrestationAmount(){
|
||||||
|
$('#act').on('change',function () {
|
||||||
|
let amount = $(this).find(":selected").attr('amount')
|
||||||
|
$("#amount").val(amount);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$('[data-toggle="tooltip"]').tooltip();
|
$('[data-toggle="tooltip"]').tooltip();
|
||||||
|
|
||||||
|
@ -510,8 +542,8 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
|
||||||
var index = $("#prestations tbody tr:last-child").index();
|
var index = $("#prestations tbody tr:last-child").index();
|
||||||
var row = '<tr>' +
|
var row = '<tr>' +
|
||||||
'<td>' +
|
'<td>' +
|
||||||
'<select required class="form-control" name="act_id" >' +
|
'<select required class="form-control" name="act_id" id="act">' +
|
||||||
getActsOptions(null)+
|
getActsOptions(null,'CONSULTATION')+
|
||||||
'</select>' +
|
'</select>' +
|
||||||
'</td>' +
|
'</td>' +
|
||||||
'<td><input type="number" required class="form-control" name="amount" min="0" id="amount"></td>' +
|
'<td><input type="number" required class="form-control" name="amount" min="0" id="amount"></td>' +
|
||||||
|
@ -526,7 +558,7 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
|
||||||
$('[data-toggle="tooltip"]').tooltip();
|
$('[data-toggle="tooltip"]').tooltip();
|
||||||
|
|
||||||
calculatePrestationsAmount();
|
calculatePrestationsAmount();
|
||||||
|
autoFetchPrestationAmount();
|
||||||
});
|
});
|
||||||
// Add row on add button click
|
// Add row on add button click
|
||||||
$(document).on("click", ".add1", function () {
|
$(document).on("click", ".add1", function () {
|
||||||
|
@ -560,7 +592,7 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
|
||||||
$(document).on("click", ".edit1", function () {
|
$(document).on("click", ".edit1", function () {
|
||||||
$(this).parents("tr").find("td:not(:last-child)").each(function (index) {
|
$(this).parents("tr").find("td:not(:last-child)").each(function (index) {
|
||||||
if (index == 0)
|
if (index == 0)
|
||||||
$(this).html('<select class="form-control" name="act_id" required >'+ getActsOptions($(this).attr("value"))+ '</select>');
|
$(this).html('<select class="form-control" name="act_id" required >'+ getActsOptions($(this).attr("value"),'CONSULTATION')+ '</select>');
|
||||||
if (index == 1)
|
if (index == 1)
|
||||||
$(this).html('<input type="number" required class="form-control" name="amount" min="0" id="amount" value="' + $(this).text() + '">');
|
$(this).html('<input type="number" required class="form-control" name="amount" min="0" id="amount" value="' + $(this).text() + '">');
|
||||||
if (index == 2)
|
if (index == 2)
|
||||||
|
@ -596,11 +628,11 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
|
||||||
var row = '<tr>' +
|
var row = '<tr>' +
|
||||||
'<td>' +
|
'<td>' +
|
||||||
'<select required class="form-control" name="act_id" >' +
|
'<select required class="form-control" name="act_id" >' +
|
||||||
getActsOptions(null)+
|
getActsOptions(null,'EXAM_OR_OTHER')+
|
||||||
'</select>' +
|
'</select>' +
|
||||||
'</td>' +
|
'</td>' +
|
||||||
'<td><input class="form-control" name="description"></td>' +
|
'<td><input class="form-control" name="description"></td>' +
|
||||||
'<td><input class="form-control" name="quantity" min="1" step="1" type="number"></td>' +
|
// '<td><input class="form-control" name="quantity" min="1" step="1" type="number"></td>' +
|
||||||
'<td> ' + actions2 + '</td>' +
|
'<td> ' + actions2 + '</td>' +
|
||||||
'</tr>';
|
'</tr>';
|
||||||
$("#exams").append(row);
|
$("#exams").append(row);
|
||||||
|
@ -639,11 +671,11 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
|
||||||
$(document).on("click", ".edit2", function () {
|
$(document).on("click", ".edit2", function () {
|
||||||
$(this).parents("tr").find("td:not(:last-child)").each(function (index) {
|
$(this).parents("tr").find("td:not(:last-child)").each(function (index) {
|
||||||
if (index == 0)
|
if (index == 0)
|
||||||
$(this).html('<select class="form-control" name="act_id" required >'+ getActsOptions($(this).attr("value"))+ '</select>');
|
$(this).html('<select class="form-control" name="act_id" required >'+ getActsOptions($(this).attr("value"),'EXAM_OR_OTHER')+ '</select>');
|
||||||
if (index == 1)
|
if (index == 1)
|
||||||
$(this).html('<input class="form-control" name="description" value="' + $(this).text() + '">');
|
$(this).html('<input class="form-control" name="description" value="' + $(this).text() + '">');
|
||||||
if (index == 2)
|
// if (index == 2)
|
||||||
$(this).html('<input class="form-control" name="quantity" min="1" step="1" value="' + $(this).text() + '">');
|
// $(this).html('<input class="form-control" name="quantity" min="1" step="1" value="' + $(this).text() + '">');
|
||||||
});
|
});
|
||||||
$(this).parents("tr").find(".add, .edit").toggle();
|
$(this).parents("tr").find(".add, .edit").toggle();
|
||||||
$(".new2").attr("disabled", "disabled");
|
$(".new2").attr("disabled", "disabled");
|
||||||
|
|
|
@ -228,7 +228,8 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
|
||||||
$('#sheet-form').find('select[name="insured_id"]').append($('<option>', {
|
$('#sheet-form').find('select[name="insured_id"]').append($('<option>', {
|
||||||
insured_id : item.insured_id,
|
insured_id : item.insured_id,
|
||||||
value: 0,
|
value: 0,
|
||||||
text : item.insured_id+' - '+item.user.lastname +' '+(item.user.firstname || '')
|
text : item.insured_id+' - '+item.user.lastname +' '+(item.user.firstname || '') + (item.state === 'SUSPENDED' ? " - <?= $this->lang->line('SUSPENDED') ?>" : ''),
|
||||||
|
disabled : item.state === 'SUSPENDED'
|
||||||
}));
|
}));
|
||||||
$('#sheet-form').find('select[name="insured_id"]').append($('<optgroup>', {
|
$('#sheet-form').find('select[name="insured_id"]').append($('<optgroup>', {
|
||||||
label: 'Ayants droits',
|
label: 'Ayants droits',
|
||||||
|
@ -237,7 +238,8 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
|
||||||
$('#sheet-form').find('select[name="insured_id"]').append($('<option>', {
|
$('#sheet-form').find('select[name="insured_id"]').append($('<option>', {
|
||||||
insured_id : item.insured_id,
|
insured_id : item.insured_id,
|
||||||
value: it.id,
|
value: it.id,
|
||||||
text : item.insured_id+' - '+it.lastname +' '+(it.firstname || '')
|
text : item.insured_id+' - '+it.lastname +' '+(it.firstname || '') + (item.state === 'SUSPENDED' ? " - <?= $this->lang->line('SUSPENDED') ?>" : ''),
|
||||||
|
disabled : item.state === 'SUSPENDED'
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -316,7 +316,8 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
|
||||||
$('#sheet-form').find('select[name="insured_id"]').append($('<option>', {
|
$('#sheet-form').find('select[name="insured_id"]').append($('<option>', {
|
||||||
insured_id : item.insured_id,
|
insured_id : item.insured_id,
|
||||||
value: 0,
|
value: 0,
|
||||||
text : item.insured_id+' - '+item.user.lastname +' '+(item.user.firstname || '')
|
text : item.insured_id+' - '+item.user.lastname +' '+(item.user.firstname || '') + (item.state === 'SUSPENDED' ? " - <?= $this->lang->line('SUSPENDED') ?>" : ''),
|
||||||
|
disabled : item.state === 'SUSPENDED'
|
||||||
}));
|
}));
|
||||||
$('#sheet-form').find('select[name="insured_id"]').append($('<optgroup>', {
|
$('#sheet-form').find('select[name="insured_id"]').append($('<optgroup>', {
|
||||||
label: 'Ayants droits',
|
label: 'Ayants droits',
|
||||||
|
@ -325,7 +326,8 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
|
||||||
$('#sheet-form').find('select[name="insured_id"]').append($('<option>', {
|
$('#sheet-form').find('select[name="insured_id"]').append($('<option>', {
|
||||||
insured_id : item.insured_id,
|
insured_id : item.insured_id,
|
||||||
value: it.id,
|
value: it.id,
|
||||||
text : item.insured_id+' - '+it.lastname +' '+(it.firstname || '')
|
text : item.insured_id+' - '+it.lastname +' '+(it.firstname || '') + (item.state === 'SUSPENDED' ? " - <?= $this->lang->line('SUSPENDED') ?>" : ''),
|
||||||
|
disabled : item.state === 'SUSPENDED'
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -206,7 +206,8 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
|
||||||
$('#sheet-form').find('select[name="insured_id"]').append($('<option>', {
|
$('#sheet-form').find('select[name="insured_id"]').append($('<option>', {
|
||||||
insured_id : item.insured_id,
|
insured_id : item.insured_id,
|
||||||
value: 0,
|
value: 0,
|
||||||
text : item.insured_id+' - '+item.user.lastname +' '+(item.user.firstname || '')
|
text : item.insured_id+' - '+item.user.lastname +' '+(item.user.firstname || '') + (item.state === 'SUSPENDED' ? " - <?= $this->lang->line('SUSPENDED') ?>" : ''),
|
||||||
|
disabled : item.state === 'SUSPENDED'
|
||||||
}));
|
}));
|
||||||
$('#sheet-form').find('select[name="insured_id"]').append($('<optgroup>', {
|
$('#sheet-form').find('select[name="insured_id"]').append($('<optgroup>', {
|
||||||
label: 'Ayants droits',
|
label: 'Ayants droits',
|
||||||
|
@ -215,7 +216,8 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
|
||||||
$('#sheet-form').find('select[name="insured_id"]').append($('<option>', {
|
$('#sheet-form').find('select[name="insured_id"]').append($('<option>', {
|
||||||
insured_id : item.insured_id,
|
insured_id : item.insured_id,
|
||||||
value: it.id,
|
value: it.id,
|
||||||
text : item.insured_id+' - '+it.lastname +' '+(it.firstname || '')
|
text : item.insured_id+' - '+it.lastname +' '+(it.firstname || '') + (item.state === 'SUSPENDED' ? " - <?= $this->lang->line('SUSPENDED') ?>" : ''),
|
||||||
|
disabled : item.state === 'SUSPENDED'
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -760,13 +760,15 @@ $careRequests = [];
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group" id="div-unit-value">
|
<div id="div-amounts">
|
||||||
<label class="col-form-label"><?= $this->lang->line('unit_value'); ?></label>
|
<div class="form-group" id="div-unit-value">
|
||||||
<input type="text" class="form-control input-lg" name="unit_value">
|
<label class="col-form-label"><?= $this->lang->line('unit_value'); ?></label>
|
||||||
</div>
|
<input type="text" class="form-control input-lg" name="unit_value">
|
||||||
<div class="form-group">
|
</div>
|
||||||
<label class="col-form-label"><?= $this->lang->line('Montant'); ?></label>
|
<div class="form-group">
|
||||||
<input type="number" min="0" step="1" class="form-control input-lg" name="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>
|
</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>
|
||||||
|
@ -1088,7 +1090,7 @@ $careRequests = [];
|
||||||
let unit_value = $("input[name='unit_value']",this).val()
|
let unit_value = $("input[name='unit_value']",this).val()
|
||||||
if(type === "CONSULTATION" && billing_type === "UNIT_PRICE") {
|
if(type === "CONSULTATION" && billing_type === "UNIT_PRICE") {
|
||||||
toastr.error("<?= $this->lang->line('consultation_cannot_have_unit_price')?>", "<?= $this->lang->line('management_rule')?>");
|
toastr.error("<?= $this->lang->line('consultation_cannot_have_unit_price')?>", "<?= $this->lang->line('management_rule')?>");
|
||||||
}else if(billing_type === "UNIT_PRICE" && isNaN(amount)) {
|
}else if( ['UNIT_PRICE','PACKAGE'].includes(billing_type) && isNaN(amount)) {
|
||||||
toastr.error("<?= $this->lang->line('amount_required')?>", "<?= $this->lang->line('management_rule')?>");
|
toastr.error("<?= $this->lang->line('amount_required')?>", "<?= $this->lang->line('management_rule')?>");
|
||||||
}else if(billing_type === "UNIT_PRICE" && unit_value.length === 0) {
|
}else if(billing_type === "UNIT_PRICE" && unit_value.length === 0) {
|
||||||
toastr.error("<?= $this->lang->line('unit_value_required')?>", "<?= $this->lang->line('management_rule')?>");
|
toastr.error("<?= $this->lang->line('unit_value_required')?>", "<?= $this->lang->line('management_rule')?>");
|
||||||
|
@ -1106,7 +1108,7 @@ $careRequests = [];
|
||||||
"billing_type": billing_type,
|
"billing_type": billing_type,
|
||||||
"authorization_type": $("select[name='authorization_type'] :selected",this).val(),
|
"authorization_type": $("select[name='authorization_type'] :selected",this).val(),
|
||||||
"unit_value": $("input[name='unit_value']",this).val(),
|
"unit_value": $("input[name='unit_value']",this).val(),
|
||||||
"amount" : isNaN(amount) ? null : amount
|
"amount" : billing_type === 'FREE' ? null : amount
|
||||||
},
|
},
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
if (data.code === 200) {
|
if (data.code === 200) {
|
||||||
|
@ -1132,10 +1134,15 @@ $careRequests = [];
|
||||||
});
|
});
|
||||||
|
|
||||||
function hideOrShowUnitValueDiv(billing_type){
|
function hideOrShowUnitValueDiv(billing_type){
|
||||||
if(billing_type === 'PACKAGE'){
|
if(billing_type === 'FREE'){
|
||||||
$("#actForm div[id='div-unit-value']").hide()
|
$("#actForm div[id='div-amounts']").hide()
|
||||||
}else{
|
}else{
|
||||||
$("#actForm div[id='div-unit-value']").show()
|
$("#actForm div[id='div-amounts']").show()
|
||||||
|
if(billing_type === 'PACKAGE'){
|
||||||
|
$("#actForm div[id='div-unit-value']").hide()
|
||||||
|
}else{
|
||||||
|
$("#actForm div[id='div-unit-value']").show()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1162,7 +1169,7 @@ $careRequests = [];
|
||||||
$("#modal-act h3").html("<?=$this->lang->line('add_act')?>");
|
$("#modal-act h3").html("<?=$this->lang->line('add_act')?>");
|
||||||
$("#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='type']").prop('selectedIndex',0);
|
$("#actForm select[name='type']").prop('selectedIndex',0);
|
||||||
$("#actForm select[name='billing_type']").prop('selectedIndex',0);
|
$("#actForm select[name='billing_type']").prop('selectedIndex',0);
|
||||||
$("#actForm input[name='amount']").val(null);
|
$("#actForm input[name='amount']").val(null);
|
||||||
$("#actForm input[name='unit_value']").val(null);
|
$("#actForm input[name='unit_value']").val(null);
|
||||||
|
|
|
@ -308,8 +308,8 @@
|
||||||
<th>#</th>
|
<th>#</th>
|
||||||
<th><?= $this->lang->line('exam_class'); ?></th>
|
<th><?= $this->lang->line('exam_class'); ?></th>
|
||||||
<th><?= $this->lang->line('exam_description'); ?></th>
|
<th><?= $this->lang->line('exam_description'); ?></th>
|
||||||
<th><?= $this->lang->line('quantity'); ?></th>
|
|
||||||
<?php if($health_care_sheet->type == 'EXECUTION') { ?>
|
<?php if($health_care_sheet->type == 'EXECUTION') { ?>
|
||||||
|
<th><?= $this->lang->line('quantity'); ?></th>
|
||||||
<th><?= $this->lang->line('UNIT_PRICE'); ?></th>
|
<th><?= $this->lang->line('UNIT_PRICE'); ?></th>
|
||||||
<th><?= $this->lang->line('percentage_insured'); ?></th>
|
<th><?= $this->lang->line('percentage_insured'); ?></th>
|
||||||
<th><?= $this->lang->line('percentage_insurer'); ?></th>
|
<th><?= $this->lang->line('percentage_insurer'); ?></th>
|
||||||
|
@ -327,10 +327,12 @@
|
||||||
echo "<tr>
|
echo "<tr>
|
||||||
<td>" . ($i+1) . "</td>
|
<td>" . ($i+1) . "</td>
|
||||||
<td>" . $row->act_name . "</td>
|
<td>" . $row->act_name . "</td>
|
||||||
<td>" . $row->description . "</td>
|
<td>" . $row->description . "</td>";
|
||||||
<td>" . $row->quantity. "</td>";
|
if($health_care_sheet->type == 'EXECUTION') {
|
||||||
if($health_care_sheet->type == 'EXECUTION') { ?>
|
$unit_quantity = !empty($row->unit_quantity) ? "$row->unit_quantity $row->act_unit_value x " : '';
|
||||||
<td><?= $unit_price ?></td>
|
?>
|
||||||
|
<td><?= $row->quantity ?></td>
|
||||||
|
<td><?= $unit_quantity.$unit_price ?></td>
|
||||||
<td><?= $insured_part ?></td>
|
<td><?= $insured_part ?></td>
|
||||||
<td><?= $insurance_part ?></td>
|
<td><?= $insurance_part ?></td>
|
||||||
<?php }
|
<?php }
|
||||||
|
|
Loading…
Reference in New Issue