@if($voucherType=='PATHOLOGY_LAB_BILLING' || $voucherType=='PATHOLOGY' || $voucherType=='IPD_ADMISSION' || $voucherType=='SALES')
Invoice No :
{!! $sale_invoice->main_invoice_no ?? '' !!}
Date :
{!! $sale_invoice->invoice_date ? formatedDate($sale_invoice->invoice_date) : '' !!}
Batch No. : {!! $sale_invoice->invoice_batch_no ?? '' !!}
@elseif($voucherType=='CONTRA' || $voucherType=='JOURNAL')
Voucher No : {!! $sale_invoice->voucher_no ?? '' !!}
Date : {!! ($sale_invoice->transaction_date ? formatedDate($sale_invoice->transaction_date) : '') !!}
Reff No. : {!! $sale_invoice->reference !!}
@elseif($voucherType=='OPD_BOOKING')
Invoice No : {!! $sale_invoice->booking_no ?? '' !!}
Date : {!! $sale_invoice->booking_date_time ? formatedDate($sale_invoice->booking_date_time) : '' !!}
Serial No. : {!! $sale_invoice->appointment_serial_no ?? '' !!}
Appointment Date : {!! ($sale_invoice->appointment_date_time ? formatedDate($sale_invoice->appointment_date_time) : '') !!}
Time : {!! ($sale_invoice->appointment_date_time ? date('h:i A',strtotime($sale_invoice->appointment_date_time)) : '') !!}
Ref. : {!! 'Walk In' !!}
@endif
@if($voucherType=='PATHOLOGY_LAB_BILLING' || $voucherType=='PATHOLOGY' || $voucherType=='IPD_ADMISSION' || $voucherType=='SALES' || $voucherType=='OPD_BOOKING')
@php
$patient = $sale_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();
if($voucherType=='OPD_BOOKING')
{
$ref_doctor = $sale_invoice->getDoctorAccount ? ucfirst(@$sale_invoice->getDoctorAccount->name) : 'Self';
$doctorTitle = $sale_invoice->getDoctorAccount->account_title??null;
$doctorQualification = $sale_invoice->getDoctorAccount->account_contact??null;
$generatorPNG = new Picqer\Barcode\BarcodeGeneratorPNG();
$mainInvoiceNo = $sale_invoice->booking_no ?? $sale_invoice->main_invoice_no;
$collectionAgent = $sale_invoice->getCollectionAgent? ucfirst(@$sale_invoice->getCollectionAgent->name):'';
$collectionAgentTitle = $sale_invoice->getCollectionAgent->account_title??null;
$referralLab = $sale_invoice->getRefferalLab?ucfirst(@$sale_invoice->getRefferalLab->name):'';
$referralLabTitle = $sale_invoice->getRefferalLab->account_title??null;
}
else
{
$ref_doctor = $sale_invoice->getDoctor ? ucfirst(@$sale_invoice->getDoctor->name) : 'Self';
$doctorTitle = $sale_invoice->getDoctor->account_title??null;
$doctorQualification = $sale_invoice->getDoctor->account_contact??null;
$collectionAgent = $sale_invoice->getCollectionAgent? ucfirst(@$sale_invoice->getCollectionAgent->name):'';
$collectionAgentTitle = $sale_invoice->getCollectionAgent->account_title??null;
$referralLab = $sale_invoice->getRefferalLab?ucfirst(@$sale_invoice->getRefferalLab->name):'';
$referralLabTitle = $sale_invoice->getRefferalLab->account_title??null;
$mainInvoiceNo = $sale_invoice->voucher_type_invoice_no ?? '';
}
$barcodeData = base64_encode($generatorPNG->getBarcode($mainInvoiceNo, $generatorPNG::TYPE_CODE_128));
@endphp