[Client Portal] - tambah feild item benefit di service monitoring (tb fajri)
This commit is contained in:
@@ -22,6 +22,30 @@ class DataServiceMonitoring extends JsonResource
|
||||
} else {
|
||||
$serviceName = $this->service_cod;
|
||||
}
|
||||
|
||||
$itemBenefits = $this->requestLogBenefits;
|
||||
$dataBenefit = [];
|
||||
if (count($itemBenefits)> 0){
|
||||
$totalIncurred = 0;
|
||||
$totalApprove = 0;
|
||||
$totalNotApporve = 0;
|
||||
$totalExcess = 0;
|
||||
foreach($itemBenefits as $itemBenefit){
|
||||
$totalIncurred += $itemBenefit->amount_incurred;
|
||||
$totalApprove += $itemBenefit->amount_approved;
|
||||
$totalNotApporve += $itemBenefit->amount_not_approved;
|
||||
$totalExcess += $itemBenefit->excess_paid;
|
||||
|
||||
}
|
||||
// array_push($dataBenefit, $itemBenefits);
|
||||
|
||||
$dataBenefit['total_incurred'] = $totalIncurred;
|
||||
$dataBenefit['total_approve'] = $totalApprove;
|
||||
$dataBenefit['total_not_approve'] = $totalNotApporve;
|
||||
$dataBenefit['total_excess'] = $totalExcess;
|
||||
|
||||
}
|
||||
|
||||
return [
|
||||
'companyName' => $this->member->currentCorporate->name ?? null,
|
||||
'memberId' => $this->member->member_id ?? null,
|
||||
@@ -32,7 +56,8 @@ class DataServiceMonitoring extends JsonResource
|
||||
'email' => $this->member->email ?? ($this->member->person->email ?? null),
|
||||
'serviceName' => $serviceName,
|
||||
'benefitName' => $this->requestLogBenefit->benefit->description ?? null,
|
||||
'benefit' => $this->requestLogBenefit ?? null,
|
||||
'benefit' => $itemBenefits ?? null,
|
||||
'benefitTotal' => $dataBenefit ?? null,
|
||||
'hospital' => $this->organization->name ?? null,
|
||||
'admissionDate' => $this->submission_date ?? null,
|
||||
'dischargeDate' => $this->discharge_date ?? null,
|
||||
|
||||
Reference in New Issue
Block a user