From d2074d4e212f90ffd3043a0741ae62e596e6a44d Mon Sep 17 00:00:00 2001 From: Djery-Tom Date: Tue, 4 Jan 2022 12:19:11 +0100 Subject: [PATCH] Improve method get health care sheet v3 --- .../Controllers/HealthCareSheetController.php | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/app/Http/Controllers/HealthCareSheetController.php b/app/Http/Controllers/HealthCareSheetController.php index 3272e8d..0ba7446 100755 --- a/app/Http/Controllers/HealthCareSheetController.php +++ b/app/Http/Controllers/HealthCareSheetController.php @@ -1126,12 +1126,9 @@ class HealthCareSheetController extends Controller private function formatExamAndPrescriptionAmounts($e, $sheet): void { - $e->unit_price_non_formatted = $e->unit_price; - $e->insured_paid_amount_non_formatted = $e->insured_paid_amount; - $e->insurer_paid_amount_non_formatted = $e->insurer_paid_amount; - $e->unit_price = isset($e->unit_price) ? $this->toMoneyWithCurrencyCode($e->unit_price, $sheet->currency_code) : null; - $e->insured_paid_amount = isset($e->insured_paid_amount) ? $this->toMoneyWithCurrencyCode($e->insured_paid_amount, $sheet->currency_code) : null; - $e->insurer_paid_amount = isset($e->insurer_paid_amount) ? $this->toMoneyWithCurrencyCode($e->insurer_paid_amount, $sheet->currency_code) : null; + $e->unit_price_formatted = isset($e->unit_price) ? $this->toMoneyWithCurrencyCode($e->unit_price, $sheet->currency_code) : null; + $e->insured_paid_amount_formatted = isset($e->insured_paid_amount) ? $this->toMoneyWithCurrencyCode($e->insured_paid_amount, $sheet->currency_code) : null; + $e->insurer_paid_amount_formatted = isset($e->insurer_paid_amount) ? $this->toMoneyWithCurrencyCode($e->insurer_paid_amount, $sheet->currency_code) : null; } /** @@ -1704,12 +1701,10 @@ class HealthCareSheetController extends Controller $sheet->patient_situation = trans('states.' . $sheet->patient_situation); $sheet->care_condition = trans('states.' . $sheet->care_condition); foreach ($sheet->performances as $p) { - $p->amount_non_formatted = $p->amount; - $p->amount = $this->toMoneyWithCurrencyCode($p->amount, $sheet->currency_code); - $p->moderator_ticket = $this->toMoneyWithCurrencyCode($p->moderator_ticket, $sheet->currency_code); - $p->insurance_amount = $this->toMoneyWithCurrencyCode($p->insurance_amount, $sheet->currency_code); - $p->home_visit_fees_non_formatted = $p->home_visit_fees; - $p->home_visit_fees = isset($p->home_visit_fees) ? $this->toMoneyWithCurrencyCode($p->home_visit_fees, $sheet->currency_code) : null; + $p->amount_formatted = $this->toMoneyWithCurrencyCode($p->amount, $sheet->currency_code); + $p->moderator_ticket_formatted = $this->toMoneyWithCurrencyCode($p->moderator_ticket, $sheet->currency_code); + $p->insurance_amount_formatted = $this->toMoneyWithCurrencyCode($p->insurance_amount, $sheet->currency_code); + $p->home_visit_fees_formatted = isset($p->home_visit_fees) ? $this->toMoneyWithCurrencyCode($p->home_visit_fees, $sheet->currency_code) : null; } foreach ($sheet->exams as $e) {