Fix bugs while fetchHealthCareSheetAmount
This commit is contained in:
parent
ffe159720b
commit
df2d442492
|
@ -170,7 +170,7 @@ trait Helper
|
|||
$insuredAmount = 0;
|
||||
|
||||
$sum = $sheet->performances()->selectRaw('SUM(moderator_ticket) as moderator_ticket , SUM(insurance_amount) as insurance_amount')
|
||||
->groupBy('nh_health_care_sheets_performances.id')->first();
|
||||
->groupBy('nh_health_care_sheets_performances.id')->groupBy('nh_health_care_sheets_performances.sheet_id')->first();
|
||||
|
||||
if (isset($sum)) {
|
||||
$insurerAmount += $sum->moderator_ticket;
|
||||
|
@ -179,7 +179,7 @@ trait Helper
|
|||
|
||||
|
||||
$sum = $sheet->prescriptions()->selectRaw('SUM(insured_paid_amount) as insured_paid_amount , SUM(insurer_paid_amount) as insurer_paid_amount')
|
||||
->groupBy('nh_health_care_sheets_prescriptions.id')->first();
|
||||
->groupBy('nh_health_care_sheets_prescriptions.id')->groupBy('nh_health_care_sheets_prescriptions.sheet_id')->first();
|
||||
|
||||
if (isset($sum)) {
|
||||
$insurerAmount += $sum->insured_paid_amount;
|
||||
|
@ -187,7 +187,7 @@ trait Helper
|
|||
}
|
||||
|
||||
$sum = $sheet->exams()->selectRaw('SUM(insured_paid_amount) as insured_paid_amount , SUM(insurer_paid_amount) as insurer_paid_amount')
|
||||
->groupBy('nh_health_care_sheets_exams.id')->first();
|
||||
->groupBy('nh_health_care_sheets_exams.id')->groupBy('nh_health_care_sheets_exams.sheet_id')->first();
|
||||
|
||||
|
||||
if (isset($sum)) {
|
||||
|
|
Loading…
Reference in New Issue