Add insurance_amount and insured_amount while get health care sheets details

This commit is contained in:
Djery-Tom 2022-01-31 10:35:58 +01:00
parent 8d783be3a8
commit 026e21dc33
1 changed files with 5 additions and 1 deletions

View File

@ -1193,7 +1193,7 @@ class HealthCareSheetController extends Controller
public function getOneHealthCareSheets($id) public function getOneHealthCareSheets($id)
{ {
$sheet = NhInfosHealthCareSheets::with(['performances.act:id,code,name', 'exams.act:id,code,name', 'prescriptions.drug_or_device:id,name'])->where('id', $id)->first(); $sheet = NhInfosHealthCareSheets::with(['performances.act:id,code,name', 'exams.act:id,code,name', 'prescriptions.drug_or_device:id,name'])->where('id', $id)->firstOrFail();
$this->formalizeHealthCareSheet($sheet); $this->formalizeHealthCareSheet($sheet);
return $this->successResponse($sheet); return $this->successResponse($sheet);
} }
@ -1779,6 +1779,10 @@ class HealthCareSheetController extends Controller
$sheet->patient_situation = trans('states.' . $sheet->patient_situation); $sheet->patient_situation = trans('states.' . $sheet->patient_situation);
$sheet->_care_condition = $sheet->care_condition; $sheet->_care_condition = $sheet->care_condition;
$sheet->care_condition = trans('states.' . $sheet->care_condition); $sheet->care_condition = trans('states.' . $sheet->care_condition);
$this->fetchHealthCareSheetAmounts($sheet);
$sheet->insurance_amount = $this->toMoneyWithCurrencyCode($sheet->insurer_amount, $sheet->currency_code);
$sheet->insured_amount = $this->toMoneyWithCurrencyCode($sheet->insured_amount, $sheet->currency_code);
unset($sheet->insurer_amount);
foreach ($sheet->performances as $p) { foreach ($sheet->performances as $p) {
$p->amount_formatted = $this->toMoneyWithCurrencyCode($p->amount, $sheet->currency_code); $p->amount_formatted = $this->toMoneyWithCurrencyCode($p->amount, $sheet->currency_code);
$p->moderator_ticket_formatted = $this->toMoneyWithCurrencyCode($p->moderator_ticket, $sheet->currency_code); $p->moderator_ticket_formatted = $this->toMoneyWithCurrencyCode($p->moderator_ticket, $sheet->currency_code);