Invoice No :
{!! $purchase_invoice->supplier_invoice_number ?? '' !!}
Date :
{!! $purchase_invoice->invoice_date ? formatedDate($purchase_invoice->invoice_date) : '' !!}
Reff No. : {!! $purchase_invoice->main_invoice_no ?? '' !!}
@php
$patient = $purchase_invoice->getPatient;
$patientContact = $patient->account_contact ?? null;
$patientTitle = $patient->account_title??null;
$patientAddress = $patient->first_account_address ?? null;
$dateOfBirth = $patientContact->date_of_birth ?? '';
$age = $dateOfBirth != '' ? age($dateOfBirth) : 0;
$generatorPNG = new Picqer\Barcode\BarcodeGeneratorPNG();
$ref_doctor = $purchase_invoice->getDoctor ? ucfirst(@$purchase_invoice->getDoctor->name) : 'Self';
$doctorTitle = $purchase_invoice->getDoctor->account_title??null;
$doctorQualification = $purchase_invoice->getDoctor->account_contact??null;
$collectionAgent = $purchase_invoice->getCollectionAgent? ucfirst(@$purchase_invoice->getCollectionAgent->name):'';
$collectionAgentTitle = $purchase_invoice->getCollectionAgent->account_title??null;
$referralLab = $purchase_invoice->getRefferalLab?ucfirst(@$purchase_invoice->getRefferalLab->name):'';
$referralLabTitle = $purchase_invoice->getRefferalLab->account_title??null;
$mainInvoiceNo = $purchase_invoice->main_invoice_no ?? '';
$barcodeData = base64_encode($generatorPNG->getBarcode($mainInvoiceNo, $generatorPNG::TYPE_CODE_128));
@endphp