Improve method get health care sheet v3

This commit is contained in:
Djery-Tom 2022-01-04 12:19:11 +01:00
parent 7f3d6ef598
commit d2074d4e21
1 changed files with 7 additions and 12 deletions

View File

@ -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) {