Fix bug while store consultation
This commit is contained in:
parent
9017ac9609
commit
1fbeafbeba
|
@ -700,7 +700,7 @@ class HealthCareSheetController extends Controller
|
||||||
// Verification de la limite de couverture
|
// Verification de la limite de couverture
|
||||||
$this->verifyInsuranceCoverageAmount($nhConfig, $insurance, $healthCareSheet, $beneficiary ?? null);
|
$this->verifyInsuranceCoverageAmount($nhConfig, $insurance, $healthCareSheet, $beneficiary ?? null);
|
||||||
// Mettre à jour la couverture d'assurance de l'assuré
|
// Mettre à jour la couverture d'assurance de l'assuré
|
||||||
$this->updateInsuranceCoverageAmount($healthCareSheet, $insurance, $beneficiary ?? null, $datetime);
|
$this->updateInsuranceCoverageAmount($healthCareSheet, $insurance, $datetime, $beneficiary ?? null);
|
||||||
|
|
||||||
foreach ($request->input('prescriptions', []) as $p) {
|
foreach ($request->input('prescriptions', []) as $p) {
|
||||||
$prescription = NhMedicalPrescription::create($p);
|
$prescription = NhMedicalPrescription::create($p);
|
||||||
|
@ -802,8 +802,8 @@ class HealthCareSheetController extends Controller
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function updateInsuranceCoverageAmount(NhHealthCareSheet $sheet, NhInsurance $insurance, NhHavingRight $beneficiary,
|
private function updateInsuranceCoverageAmount(NhHealthCareSheet $sheet, NhInsurance $insurance, $datetime,
|
||||||
$datetime, $currentInsuranceAmount = 0): void
|
NhHavingRight $beneficiary = null, $currentInsuranceAmount = 0): void
|
||||||
{ // Current Insurance Amount en cas de mise à jour de la feuille de soins pour ne pas prendre en compte la couverture deja affecté)
|
{ // Current Insurance Amount en cas de mise à jour de la feuille de soins pour ne pas prendre en compte la couverture deja affecté)
|
||||||
$sheet->insurance_consumed_at = $datetime;
|
$sheet->insurance_consumed_at = $datetime;
|
||||||
if (!empty($beneficiary)) {
|
if (!empty($beneficiary)) {
|
||||||
|
@ -1048,7 +1048,7 @@ class HealthCareSheetController extends Controller
|
||||||
// Verification de la limite de couverture
|
// Verification de la limite de couverture
|
||||||
$this->verifyInsuranceCoverageAmount($nhConfig, $sheet->insurance, $healthCareSheet, $sheet->beneficiary);
|
$this->verifyInsuranceCoverageAmount($nhConfig, $sheet->insurance, $healthCareSheet, $sheet->beneficiary);
|
||||||
// Mettre à jour la couverture d'assurance de l'assuré
|
// Mettre à jour la couverture d'assurance de l'assuré
|
||||||
$this->updateInsuranceCoverageAmount($healthCareSheet, $sheet->insurance, $sheet->beneficiary, $datetime);
|
$this->updateInsuranceCoverageAmount($healthCareSheet, $sheet->insurance, $datetime, $sheet->beneficiary,);
|
||||||
|
|
||||||
|
|
||||||
#Clone pivots
|
#Clone pivots
|
||||||
|
@ -1935,7 +1935,7 @@ class HealthCareSheetController extends Controller
|
||||||
// Verification de la limite de couverture
|
// Verification de la limite de couverture
|
||||||
$this->verifyInsuranceCoverageAmount($nhConfig, $sheet->insurance, $sheet, $sheet->beneficiary, $currentInsuranceAmount);
|
$this->verifyInsuranceCoverageAmount($nhConfig, $sheet->insurance, $sheet, $sheet->beneficiary, $currentInsuranceAmount);
|
||||||
// Mettre à jour la couverture d'assurance de l'assuré
|
// Mettre à jour la couverture d'assurance de l'assuré
|
||||||
$this->updateInsuranceCoverageAmount($sheet, $sheet->insurance, $sheet->beneficiary, $datetime, $currentInsuranceAmount);
|
$this->updateInsuranceCoverageAmount($sheet, $sheet->insurance, $datetime, $sheet->beneficiary, $currentInsuranceAmount);
|
||||||
|
|
||||||
$sheet->save();
|
$sheet->save();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue