Fix bugs while execution

This commit is contained in:
Djery-Tom 2022-04-12 11:25:26 +01:00
parent dbea781ac6
commit 5b3923557a
1 changed files with 1 additions and 1 deletions

View File

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