This commit is contained in:
2024-05-02 11:33:13 +07:00
parent 9f55783508
commit 8cb30ddedd

View File

@@ -160,8 +160,10 @@ class PrescriptionController extends Controller
foreach($medicine as $key => $value){
$drugData = Drug::where('id', $value['drug_id'])->first();
$drug = '';
$drugCode = '';
if ($drugData){
$drug = $drugData->name;
$drugCode = $drugData->code;
}
$unitData = Unit::where('id', $value['unit_id'])->first();
$unit = '';
@@ -181,6 +183,8 @@ class PrescriptionController extends Controller
$data = [
'nIDPrescription' => $prescription->nID,
'sItemName' => $drug,
'sItemCode' => $drug,
'sOriginCode' => $drugCode,
'nQty' => $value['qty'],
'sSatuan' => $unit,
'sSigna' => $value['signa'],