From 5b3923557ad444951091c9008b2a0b0d9469fd4c Mon Sep 17 00:00:00 2001 From: Djery-Tom Date: Tue, 12 Apr 2022 11:25:26 +0100 Subject: [PATCH] Fix bugs while execution --- app/Http/Controllers/HealthCareSheetController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/HealthCareSheetController.php b/app/Http/Controllers/HealthCareSheetController.php index 3191b39..f0baf9b 100755 --- a/app/Http/Controllers/HealthCareSheetController.php +++ b/app/Http/Controllers/HealthCareSheetController.php @@ -1022,6 +1022,7 @@ class HealthCareSheetController extends Controller $i->billed_quantity += $item->quantity; } $item->unit_price = $prescriptions[$itemIndex]['unit_price']; + $item->billed_quantity = null; } if ($relation == 'exams') { @@ -1058,7 +1059,6 @@ class HealthCareSheetController extends Controller $item->insurer_paid_amount = $parts->insurer_part * $item->unit_price * ($item->quantity ?? 1) * ($item->unit_quantity ?? 1); $item->created_at = $item->updated_at = $datetime; $item->billed = true; - $item->billed_quantity = null; $item->push(); if (!empty($i->billed_quantity) && $i->billed_quantity != $i->quantity) {