diff --git a/app/Traits/Helper.php b/app/Traits/Helper.php index 342ccf5..77ae44b 100644 --- a/app/Traits/Helper.php +++ b/app/Traits/Helper.php @@ -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)) {