init project

This commit is contained in:
2026-05-25 11:08:52 +07:00
parent a388c619b5
commit 895fdd9b83
1437 changed files with 384844 additions and 27 deletions

View File

@@ -0,0 +1,499 @@
<div class="modal fade" id="print_invoice_modal" style="padding-top: 40px; background: rgba(0, 0, 0, 0.54); overflow: auto; padding-left: 17px;">
<div class="print-preview-header">
<div class="presult-pagination d-none">
<input type="text" class="page-number" value="1" onfocus="this.select()"> /
<span class="page-count">1</span>
</div>
<ul>
<li style="display: inline-block;" class="print">
<a href="javascript:void(0)" onclick="printJS('presult-1', 'html')" id="doPrinting"><i class="fa fa-print"></i>&nbsp;<b>{{__('invoice.print')}}</b></a>
</li>
</ul>
<span class="close-preview" data-dismiss="modal" title="Close"><i class="fa fa-times"></i></span>
</div>
<div class="modal-dialog modal-xxl A4-portrait">
<div class="psample-result active" id="presult-1">
<title>Result</title>
<meta name="viewport" content="width=device-width, initial-scale=.5, maximum-scale=12.0, minimum-scale=.25, user-scalable=yes">
<style>
table td, table th{
padding: 3px !important; font-size:10pt !important;
}
@font-face {
font-family: 'KhmerOS_muollight';
src: url('{{url(env("APP_URL").'storage/assets/fonts/KhmerOS_muollight.ttf')}}');
font-display: swap;
}
.KhmerMoulLight {
font-family: 'SourceSerifPro-Regular', 'KhmerOS_muollight', 'serif';
}
page[size="A4"] {
background: white;
/*width: 21cm;*/
width: 297mm;
display: block;
margin: 10px auto;
box-shadow: 0 0 0.5cm rgba(0,0,0,0.5);
padding: 1mm;
font-family: 'SourceSerifPro-Regular', 'Noto Sans Khmer', 'serif';
font-size: 8pt;
line-height: 10px;
page-break-after: always;
}
table th, table td {
text-align: left;
padding-left: 5px !important;
padding-right: 5px !important;
}
table td {
font-weight: normal;
}
table.patient-info, table.department-sample-info {
border: 1px solid #7a7a7a;
line-height: 18px;
padding: 3px;
}
table.patient-info td, table.patient-info th {
vertical-align: top;
}
.text-center {
text-align: center;
}
.text-left {
text-align: left;
}
.text-right {
text-align: right;
}
.text-top {
vertical-align: top;
}
.text-no-wrap {
white-space: nowrap;
}
table.test-result {
line-height: 16px;
}
#footer {
line-height: 17px;
}
#footer .laboratory-address td {
border-top: 1px solid black;
padding-top: 10px;
}
#footer .result-footer-signature td {
vertical-align: top;
padding-bottom: 60px;
}
@page {
margin: 0.5cm;
}
@media print {
body,
page[size="A4"] {
box-shadow: none;
background-color: #fff;
}
@page {
size: A4 landscape;
margin: 0.5cm 0.5cm 0;
padding: 0;
}
@page {
size: 210mm 297mm landscape;
margin: 0.5cm 0.5cm 0;
padding: 0;
}
@page {
size: 11.7in 16.5in landscape;
margin: 0.5cm 0.5cm 0;
padding: 0;
}
tbody.sample-result {
page-break-inside: avoid;
}
#footer {
display: block;
position: fixed;
bottom: 0;
}
.font-changable{
/*font-family: "{{(App::isLocale('en') ? 'Times New Roman' : 'Khmer OS Siemreap')}}";*/
font-family: "{{(App::isLocale('en') ? (empty($fontNameHeader) ? 'Times New Roman':$fontNameHeader) : 'Khmer OS Siemreap')}}";
}
#print_invoice_modal .table-inv th, .table-inv td {
padding: 3px !important;
}
}
#print_invoice_modal .table-inv th, .table-inv td {
border: 1px solid black;
border-collapse: collapse;
padding: 3px !important;
}
.bg-light{
background: #e8e8e8 !important;
}
.border-0{
border:none !important;
}
.font-changable{
/*font-family: "{{(App::isLocale('en') ? 'Times New Roman' : 'Khmer OS Siemreap')}}";*/
font-family: "{{(App::isLocale('en') ? (empty($fontNameHeader) ? 'Times New Roman':$fontNameHeader) : 'Khmer OS Siemreap')}}";
}
</style>
<page size="A4">
<div style="width: 297mm; padding: 0px; background-image: linear-gradient(#fafafa, #fafafa); background-size: 1px 100%; background-repeat: no-repeat; background-position: 49.6% center;">
<div style="width: 49%; display: inline-block; clear: both; /*border-right: 1px dashed #eee;*/ vertical-align: top; margin-right:1% !important">
<table border="0" width="100%" style="font-size: 8pt !important;">
<thead>
<tr>
<td style="width:100%; text-align: center">
@if(!empty($sample->physician->logo))
<img width="100%" class="rounded-0" src="{{url(env("APP_URL").'storage/images/physician/'.$sample->physician->logo)}}" />
@else
<table width="100%">
<tr>
<td style="width:70px; vertical-align: top;" class="text-center">
<img src="{{url(env("APP_URL").'storage/images/avatars/labs/'.$labSettings->logo)}}" alt="Logo" style="width: 70px;">
</td>
<td class="text-center">
<p style="line-height: 13px !important; font-size: 10pt; font-weight: bold;" class="KhmerMoulLight ">{{$labSettings->name_kh}}</p>
<p style="line-height: 13px !important; font-size: 9pt; font-weight: bold;" class="text-uppercase ">{{$labSettings->name_en}}</p>
<p class="font-changable" style="line-height: 20px !important;">{{ app()->getLocale()=='kh' ? $labSettings->address_kh : $labSettings->address_en}} </p>
<p style="line-height: 9px !important;">{{$labSettings->phone_number}} {{$labSettings->email}}</p>
</td>
<td style="width:80px; vertical-align: bottom;" >
<div class="visible-print text-center">
@if($labSettings->shareable_lab_result==1)
{!! QrCode::size(60)->generate(url('/shared/lab-result/'.$sample_id)); !!}
@endif
</div>
</td>
</tr>
</table>
@endif
</td>
</tr>
<tr>
<td class="text-top text-center">
<div style="font-size: 11.5pt; font-family: {{(App::isLocale('en') ? 'Times New Roman' : 'Khmer OS Siemreap')}}; font-weight: 700;">{{__('invoice.tittle')}}</div>
</td>
</tr>
<tr>
<th class="p-0">
<table width="100%" class="patient-info font-changable" style="line-height: 15px !important;">
<tbody>
<tr>
<td class="text-left" style="font-size:11pt !important;" width="20%">{{__('invoice.form_invoice_number')}}</td>
<td class="text-left" style="font-size:11pt !important;" width="30%">: {{$invoice->invoice_code}}</td>
<td class="text-left" style="font-size:11pt !important;" width="20%">{{__('sample.table_sample_number')}}</td>
<td class="text-left" style="font-size:11pt !important;" width="30%">: {{$sample->sample_number}}</td>
</tr>
<tr>
<td style="font-size:11pt !important;" class="text-left text-no-wrap">{{__('invoice.table_patient_name')}}</td>
<td style="font-size:11pt !important;" class="text-left ">: {{$sample->patient->name_en}}</td>
<td style="font-size:11pt !important;" class="text-left text-no-wrap">{{__('patient.form_age')}}</td>
<td style="font-size:11pt !important;" class="text-no-wrap text-left">
: {{\App\Helpers\Helpers::getAge($sample->patient->dob, $sample->admission_date)}}, {{__('sample.form_patient_gender')}}: {{\App\Helpers\Helpers::getGender($sample->patient->gender)}}
</td>
</tr>
<tr>
<td style="font-size:11pt !important;" class="text-left text-no-wrap">{{__('patient.table_phon')}}</td>
<td style="font-size:11pt !important;" class="text-left ">: {{$sample->patient->phone_number}} </td>
<td style="font-size:11pt !important;" class="text-left text-no-wrap">{{__('sample.physician_name')}}</td>
<td style="font-size:11pt !important;" class="text-left ">: {{$sample->physician->name_en}}</td>
</tr>
</tbody>
</table>
</th>
</tr>
</thead>
<tfoot>
<tr>
<td width="100%">
<table width="100%" border="0">
<tbody>
<tr>
<td colspan="4" style="height: 20px;">&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tfoot>
<tbody>
<tr>
<td class="p-0">
<table width="100%" class="table-inv" style="border-collapse: collapse; !important; font-size:10pt !important;">
<tbody>
<tr class="bg-light font-changable">
<td width="8%" class="text-center">{{__('invoice.table_no')}}</td>
<td class="text-center">{{__('invoice.form_description')}}</td>
<td width="15%" class="text-center" style="width:110px !important;">{{__('invoice.form_qty')}}</td>
<td width="15%" class="text-center" style="width:110px !important;">{{__('invoice.form_unit_price')}}</td>
</tr>
<?php $total = 0;?>
@foreach($invoice->invoiceDetail as $k=>$invItem)
<?php $total++;?>
<tr>
<td class=" text-center">{{$k+1}}</td>
<td>{{$invItem->test_name}}</td>
<td class="text-right ">{{$invItem->qty}}</td>
<td class="text-right "> {{$invItem->unit_price}}</td>
</tr>
@endforeach
@for($i=$total; $i<=11; $i++)
<tr>
<td class=" text-center font-changable" style="padding:0 5px;">{{$i+1}}</td>
<td style="padding:0 5px;" class="font-changable"></td>
<td style="padding:0 5px;" class="text-right font-changable"></td>
<td style="padding:0 5px;" class="text-right font-changable"></td>
</tr>
@endfor
<tr class="font-changable">
<td class="text-left " colspan="4"><span style="padding-left: 10px !important;">{{$invoice->invoice_note}}</span></td>
</tr>
<tr class="font-changable">
<td class="text-left border-0" colspan="2"><span style="padding-left: 30px !important;">{{__('invoice.table_invoice_date')}}: {{date('d-m-Y',strtotime($invoice->invoice_date))}}</span></td>
<td class="text-right border-0">{{__('invoice.table_total_cost')}} () :</td>
<td class="text-right bg-light"> {{number_format($invoice->total,2)}}</td>
</tr>
<tr class="font-changable">
<td class="text-left border-0" colspan="2"></td>
<td class="text-right border-0">{{__('invoice.table_discount')}} ({{$labSettings->discount_type==1? '%' : '៛'}}) :</td>
<td class="text-right bg-light"> {{ ($invoice->discount_type==1 ? $invoice->discount : number_format($invoice->discount,2))}}</td>
<!--<td class="text-right bg-light"> {{ ($invoice->discount_type==1 ? ($invoice->discount > 0? number_format($invoice->total * (1-($invoice->discount/100))) : 0) : number_format($invoice->discount,2))}}</td>-->
</tr>
<tr class="font-changable">
<td class="text-left border-0" colspan="2"></td>
<td class="text-right border-0">{{__('Total (៛)')}} :</td>
<td class="text-right bg-light"> {{number_format(($invoice->total - $invoice->discount) ,2)}}</td>
</tr>
<tr class="font-changable">
<td class="text-left border-0" colspan="2"><span style="padding-left: 70px !important;">{{__('invoice.received_by')}}</span></td>
<td class="text-right border-0">{{__('invoice.table_net_cost')}} :</td>
<td class="text-right bg-light"> {{number_format((($invoice->gross_total)/$labSettings->exchange_rate),2)}}</td>
</tr>
</tbody>
</table>
</td>
</tr>
<!-- Comment -->
</tbody>
<!-- Note -->
</table>
<table id="footer" width="100%" border="0" style="padding: 0 10px !important;">
<tbody>
<tr>
<td class="text-center text-no-wrap" style="width: 3cm">
</td>
<td style="width: 4cm"></td>
<td class="text-center text-no-wrap" style="width: 4cm; padding-left: 20px"></td>
</tr>
<tr>
<td colspan="3" style="padding-top: 15px; !important;">&nbsp;</td>
</tr>
<tr class="result-footer-signature">
<td class="text-center text-no-wrap" style="padding: 0 10px !important;">
</td>
<td class="text-center text-no-wrap"></td>
<td class="text-center text-no-wrap"></td>
</tr>
</tbody>
</table>
</div>
<div style="width: 49%; display: inline-block; clear: both; vertical-align: top;">
<table border="0" width="100%" style="font-size: 8pt !important;">
<thead>
<tr>
<td style="width:100%; text-align: center">
@if(!empty($sample->physician->logo))
<img width="100%" class="rounded-0" src="{{url(env("APP_URL").'storage/images/physician/'.$sample->physician->logo)}}" />
@else
<table width="100%">
<tr>
<td style="width:70px; vertical-align: top;" class="text-center">
<img src="{{url(env("APP_URL").'storage/images/avatars/labs/'.$labSettings->logo)}}" alt="Logo" style="width: 70px;">
</td>
<td class="text-center">
<p style="line-height: 13px !important; font-size: 10pt; font-weight: bold;" class="KhmerMoulLight ">{{$labSettings->name_kh}}</p>
<p style="line-height: 13px !important; font-size: 9pt; font-weight: bold;" class="text-uppercase ">{{$labSettings->name_en}}</p>
<p class="font-changable" style="line-height: 20px !important;">{{ app()->getLocale()=='kh' ? $labSettings->address_kh : $labSettings->address_en}} </p>
<p style="line-height: 9px !important;">{{$labSettings->phone_number}} {{$labSettings->email}}</p>
</td>
<td style="width:80px; vertical-align: bottom;" >
<div class="visible-print text-center">
@if($labSettings->shareable_lab_result==1)
{!! QrCode::size(60)->generate(url('/shared/lab-result/'.$sample_id)); !!}
@endif
</div>
</td>
</tr>
</table>
@endif
</td>
</tr>
<tr>
<td class="text-top text-center">
<div style="font-size: 11.5pt; font-family: {{(App::isLocale('en') ? 'Times New Roman' : 'Khmer OS Siemreap')}}; font-weight: 700;">{{__('invoice.tittle')}}</div>
</td>
</tr>
<tr>
<th class="p-0">
<table width="100%" class="patient-info font-changable" style="line-height: 15px !important;">
<tbody>
<tr>
<td class="text-left" style="font-size:11pt !important;" width="20%">{{__('invoice.form_invoice_number')}}</td>
<td class="text-left" style="font-size:11pt !important;" width="30%">: {{$invoice->invoice_code}}</td>
<td class="text-left" style="font-size:11pt !important;" width="20%">{{__('sample.table_sample_number')}}</td>
<td class="text-left" style="font-size:11pt !important;" width="30%">: {{$sample->sample_number}}</td>
</tr>
<tr>
<td style="font-size:11pt !important;" class="text-left text-no-wrap">{{__('invoice.table_patient_name')}}</td>
<td style="font-size:11pt !important;" class="text-left ">: {{$sample->patient->name_en}}</td>
<td style="font-size:11pt !important;" class="text-left text-no-wrap">{{__('patient.form_age')}}</td>
<td style="font-size:11pt !important;" class="text-no-wrap text-left">
: {{\App\Helpers\Helpers::getAge($sample->patient->dob, $sample->admission_date)}}, {{__('sample.form_patient_gender')}}: {{\App\Helpers\Helpers::getGender($sample->patient->gender)}}
</td>
</tr>
<tr>
<td style="font-size:11pt !important;" class="text-left text-no-wrap">{{__('patient.table_phon')}}</td>
<td style="font-size:11pt !important;" class="text-left ">: {{$sample->patient->phone_number}} </td>
<td style="font-size:11pt !important;" class="text-left text-no-wrap">{{__('sample.physician_name')}}</td>
<td style="font-size:11pt !important;" class="text-left ">: {{$sample->physician->name_en}}</td>
</tr>
</tbody>
</table>
</th>
</tr>
</thead>
<tfoot>
<tr>
<td width="100%">
<table width="100%" border="0">
<tbody>
<tr>
<td colspan="4" style="height: 20px;">&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tfoot>
<tbody>
<tr>
<td class="p-0">
<table width="100%" class="table-inv" style="border-collapse: collapse; !important; font-size:10pt !important;">
<tbody>
<tr class="bg-light font-changable">
<td width="8%" class="text-center">{{__('invoice.table_no')}}</td>
<td class="text-center">{{__('invoice.form_description')}}</td>
<td width="15%" class="text-center" style="width:110px !important;">{{__('invoice.form_qty')}}</td>
<td width="15%" class="text-center" style="width:110px !important;">{{__('invoice.form_unit_price')}}</td>
</tr>
@foreach($invoice->invoiceDetail as $k=>$invItem)
<tr>
<td class=" text-center">{{$k+1}}</td>
<td>{{$invItem->test_name}}</td>
<td class="text-right ">{{$invItem->qty}}</td>
<td class="text-right "> {{$invItem->unit_price}}</td>
</tr>
@endforeach
@for($i=$total; $i<=11; $i++)
<tr>
<td class=" text-center font-changable" style="padding:0 5px;">{{$i+1}}</td>
<td style="padding:0 5px;" class="font-changable"></td>
<td style="padding:0 5px;" class="text-right font-changable"></td>
<td style="padding:0 5px;" class="text-right font-changable"></td>
</tr>
@endfor
<tr class="font-changable">
<td class="text-left " colspan="4"><span style="padding-left: 10px !important;">{{$invoice->invoice_note}}</span></td>
</tr>
<tr class="font-changable">
<td class="text-left border-0" colspan="2"><span style="padding-left: 30px !important;">{{__('invoice.table_invoice_date')}}: {{date('d-m-Y',strtotime($invoice->invoice_date))}}</span></td>
<td class="text-right border-0">{{__('invoice.table_total_cost')}} () :</td>
<td class="text-right bg-light"> {{number_format($invoice->total,2)}}</td>
</tr>
@if($invoice->is_hide_discount == 0)
<tr class="font-changable">
<td class="text-left border-0" colspan="2"></td>
<td class="text-right border-0">{{__('invoice.table_discount')}} ({{$labSettings->discount_type==1? '%' : '៛'}}) :</td>
<td class="text-right bg-light"> {{ ($invoice->discount_type==1 ? $invoice->discount : number_format($invoice->discount,2))}}</td>
<!--<td class="text-right bg-light"> {{ ($invoice->discount_type==1 ? ($invoice->discount > 0? number_format($invoice->total * (1-($invoice->discount/100))) : 0) : number_format($invoice->discount,2))}}</td>-->
</tr>
<tr class="font-changable">
<td class="text-left border-0" colspan="2"></td>
<td class="text-right border-0">{{__('Total (៛)')}} :</td>
<td class="text-right bg-light"> {{number_format(($invoice->total - $invoice->discount) ,2)}}</td>
</tr>
<tr class="font-changable">
<td class="text-left border-0" colspan="2"><span style="padding-left: 70px !important;">{{__('invoice.received_by')}}</span></td>
<td class="text-right border-0">{{__('invoice.table_net_cost')}} :</td>
<td class="text-right bg-light"> {{number_format((($invoice->total - $invoice->discount)/$labSettings->exchange_rate),2)}}</td>
</tr>
@else
<tr class="font-changable">
<td class="text-left border-0" colspan="2"></td>
<td class="text-right border-0">{{__('Total (៛)')}} :</td>
<td class="text-right bg-light"> {{number_format(($invoice->total) ,2)}}</td>
</tr>
<tr class="font-changable">
<td class="text-left border-0" colspan="2"><span style="padding-left: 70px !important;">{{__('invoice.received_by')}}</span></td>
<td class="text-right border-0">{{__('invoice.table_net_cost')}} :</td>
<td class="text-right bg-light"> {{number_format((($invoice->total)/$labSettings->exchange_rate),2)}}</td>
</tr>
@endif
</tbody>
</table>
</td>
</tr>
<!-- Comment -->
</tbody>
<!-- Note -->
</table>
<table id="footer" width="100%" border="0" style="padding: 0 10px !important;">
<tbody>
<tr>
<td class="text-center text-no-wrap" style="width: 3cm">
</td>
<td style="width: 4cm"></td>
<td class="text-center text-no-wrap" style="width: 4cm; padding-left: 20px"></td>
</tr>
<tr>
<td colspan="3" style="padding-top: 15px; !important;">&nbsp;</td>
</tr>
<tr class="result-footer-signature">
<td class="text-center text-no-wrap" style="padding: 0 10px !important;">
</td>
<td class="text-center text-no-wrap"></td>
<td class="text-center text-no-wrap"></td>
</tr>
</tbody>
</table>
</div>
</div>
</page>
</div>
</div>
</div>

View File

@@ -0,0 +1,580 @@
<div class="modal fade" id="print_invoice_modal" style="padding-top: 40px; background: rgba(0, 0, 0, 0.54); overflow: auto; padding-left: 17px;">
<div class="print-preview-header">
<div class="presult-pagination d-none">
<input type="text" class="page-number" value="1" onfocus="this.select()"> /
<span class="page-count">1</span>
</div>
<ul>
<li style="display: inline-block;" class="print">
<a href="javascript:void(0)" onclick="printJS('presult-1', 'html')" id="doPrinting"><i class="fa fa-print"></i>&nbsp;<b>{{__('invoice.print')}}</b></a>
</li>
@if(!empty($labSettings->alternative_logo))
<li style="display: inline-block;" class="print" title="Print with alternative logo">
<a href="javascript:void(0)" id="change_logo_print"><i class="fa fa-print"></i>&nbsp;<b>{{__('Print Alt-Logo')}}</b></a>
</li>
@endif
</ul>
<span class="close-preview" data-dismiss="modal" title="Close"><i class="fa fa-times"></i></span>
</div>
<div class="modal-dialog modal-xxl A4-portrait">
<div class="psample-result active" id="presult-1">
<title>Result</title>
<meta name="viewport" content="width=device-width, initial-scale=.5, maximum-scale=12.0, minimum-scale=.25, user-scalable=yes">
<style>
@php
$configures = collect($labConfigures);
$fontNameHeader = ($configures->where('atrribute_code', 'FONT_NAME_FOR_RESULT_HEADER')->pluck('assigned_attribute_value')->first());
$fontSizeHeader = ($configures->where('atrribute_code', 'FONT_SIZE_FOR_RESULT_HEADER')->pluck('assigned_attribute_value')->first());
$resultColorHeader = ($configures->where('atrribute_code', 'COLOR_FOR_RESULT_HEADER')->pluck('assigned_attribute_value')->first());
$fontName = ($configures->where('atrribute_code', 'FONT_NAME_FOR_RESULT')->pluck('assigned_attribute_value')->first());
$fontSize = ($configures->where('atrribute_code', 'FONT_SIZE_FOR_RESULT')->pluck('assigned_attribute_value')->first());
$resultColor = ($configures->where('atrribute_code', 'COLOR_FOR_RESULT')->pluck('assigned_attribute_value')->first());
@endphp
.patient-info tr td{
/*font-family: '{{(empty($fontNameHeader) ? 'Times New Roman':$fontNameHeader)}}' !important;*/
font-family: "{{(App::isLocale('en') ? (empty($fontNameHeader) ? 'Times New Roman':$fontNameHeader) : 'Khmer OS Siemreap')}}";
font-size:10px !important;
}
.font-changeable{
/*font-family: '{{(empty($fontName) ? 'Times New Roman':$fontName)}}' !important;*/
font-family: "{{(App::isLocale('en') ? (empty($fontNameHeader) ? 'Times New Roman':$fontNameHeader) : 'Khmer OS Siemreap')}}";
}
table td, table th{
padding: 3px !important; font-size:10pt !important;
}
@font-face {
font-family: 'KhmerOS_muollight';
src: url('{{url(env("APP_URL").'storage/assets/fonts/KhmerOS_muollight.ttf')}}');
font-display: swap;
}
.KhmerMoulLight {
font-family: 'SourceSerifPro-Regular', 'KhmerOS_muollight', 'serif';
}
page[size="A4"] {
background: white;
/*width: 21cm;*/
width: 297mm;
display: block;
margin: 10px auto;
box-shadow: 0 0 0.5cm rgba(0,0,0,0.5);
padding: 1mm;
font-family: 'SourceSerifPro-Regular', 'Noto Sans Khmer', 'serif';*/
/*font-family: '{{(empty($fontNameHeader) ? 'Times New Roman':$fontNameHeader)}}' !important;*/
font-size: 8pt;
line-height: 10px;
page-break-after: always;
}
table th, table td {
text-align: left;
padding-left: 5px !important;
padding-right: 5px !important;
}
table td {
font-weight: normal;
}
table.patient-info, table.department-sample-info {
border: 1px solid #7a7a7a;
line-height: 18px;
padding: 3px;
}
table.patient-info td, table.patient-info th {
vertical-align: top;
}
.text-center {
text-align: center;
}
.text-left {
text-align: left;
}
.text-right {
text-align: right;
}
.text-top {
vertical-align: top;
}
.text-no-wrap {
white-space: nowrap;
}
table.test-result {
line-height: 16px;
}
#footer {
line-height: 17px;
}
#footer .laboratory-address td {
border-top: 1px solid black;
padding-top: 10px;
}
#footer .result-footer-signature td {
vertical-align: top;
padding-bottom: 60px;
}
@page {
margin: 0.5cm;
}
@media print {
body,
page[size="A4"] {
box-shadow: none;
background-color: #fff;
}
@page {
size: A4 landscape;
margin: 0.5cm 0.5cm 0;
padding: 0;
}
@page {
size: 210mm 297mm landscape;
margin: 0.5cm 0.5cm 0;
padding: 0;
}
@page {
size: 11.7in 16.5in landscape;
margin: 0.5cm 0.5cm 0;
padding: 0;
}
tbody.sample-result {
page-break-inside: avoid;
}
#footer {
display: block;
position: fixed;
bottom: 0;
}
.font-changable{
/*font-family: "{{(App::isLocale('en') ? 'Times New Roman' : 'Khmer OS Siemreap')}}";*/
/*font-family: '{{(empty($fontNameHeader) ? 'Times New Roman':$fontNameHeader)}}' !important;*/
font-family: "{{(App::isLocale('en') ? (empty($fontNameHeader) ? 'Times New Roman':$fontNameHeader) : 'Khmer OS Siemreap')}}";
}
#print_invoice_modal .table-inv th, .table-inv td {
padding: 3px !important;
}
}
#print_invoice_modal .table-inv th, .table-inv td {
border: 1px solid black;
border-collapse: collapse;
padding: 3px !important;
}
.bg-light{
background: #e8e8e8 !important;
}
.border-0{
border:none !important;
}
.font-changable{
/*font-family: "{{(App::isLocale('en') ? 'Times New Roman' : 'Khmer OS Siemreap')}}";*/
/*font-family: '{{(empty($fontNameHeader) ? 'Times New Roman':$fontNameHeader)}}' !important;*/
font-family: "{{(App::isLocale('en') ? (empty($fontNameHeader) ? 'Times New Roman':$fontNameHeader) : 'Khmer OS Siemreap')}}";
}
.table-inv tr td{
font-size:11px !important;
}
</style>
<page size="A4">
<div style="width: 297mm; padding: 0px; background-image: linear-gradient(#fafafa, #fafafa); background-size: 1px 100%; background-repeat: no-repeat; background-position: 49.6% center;">
<div style="width: 49%; display: inline-block; clear: both; /*border-right: 1px dashed #eee;*/ vertical-align: top; margin-right:1% !important">
<table border="0" width="100%" style="font-size: 8pt !important;">
<thead>
<tr id="def-logo">
<td style="width:100%; text-align: center">
@if(!empty($sample->physician->logo))
<img width="100%" class="rounded-0" src="{{url(env("APP_URL").'storage/images/physician/'.$sample->physician->logo)}}" />
@else
<table width="100%">
<tr>
<td style="width:70px; vertical-align: top;" class="text-center">
<img src="{{url(env("APP_URL").'storage/images/avatars/labs/'.$labSettings->logo)}}" alt="Logo" style="width: 70px;">
</td>
<td class="text-center">
<p style="line-height: 13px !important; font-size: 10pt; font-weight: bold;" class="KhmerMoulLight ">{{$labSettings->name_kh}}</p>
<p style="line-height: 13px !important; font-size: 9pt; font-weight: bold;" class="text-uppercase ">{{$labSettings->name_en}}</p>
<p class="font-changeable" style="line-height: 20px !important;">{{ app()->getLocale()=='kh' ? $labSettings->address_kh : $labSettings->address_en}} </p>
<p style="line-height: 9px !important;">{{$labSettings->phone_number}} </p>
</td>
<td style="width:80px; vertical-align: bottom;" >
<div class="visible-print text-center">
@if($labSettings->shareable_lab_result==1)
{!! QrCode::size(60)->generate(url('/shared/lab-result/'.$sample_id)); !!}
@endif
</div>
</td>
</tr>
</table>
@endif
</td>
</tr>
<tr id="dyn-logo" style="display:none;">
<th style="width:100%" class="text-center">
@if(!empty($labSettings->alternative_logo))
<img width="100%" class="rounded-0" src="{{ url(env("APP_URL").'storage/images/avatars/labs/alternative_logo/'.$labSettings->alternative_logo) }}" />
@endif
</th>
</tr>
<tr>
<td class="text-top text-center">
<div style="font-size: 11.5pt; font-weight: 700;" class="font-changeable">{{$sample->lab_id != 21 ? __('invoice.tittle') : 'Laboratory' }}</div>
</td>
</tr>
<tr>
<th class="p-0">
<table width="100%" class="patient-info font-changable" style="line-height: 15px !important;">
<tbody>
<tr>
<td class="text-left" style="font-size:10pt !important;" width="20%">{{$sample->lab_id != 21 ? __('invoice.form_invoice_number') : 'Reference No' }}</td>
<td class="text-left" style="font-size:10pt !important;" width="30%">: {{$invoice->invoice_code}}</td>
<td class="text-left" style="font-size:10pt !important;" width="20%">{{__('sample.table_sample_number')}}</td>
<td class="text-left" style="font-size:10pt !important;" width="30%">: {{$sample->sample_number}}</td>
</tr>
<tr>
<td style="font-size:10pt !important;" class="text-left text-no-wrap">{{__('invoice.table_patient_name')}}</td>
<td style="font-size:10pt !important;" class="text-left ">: {{$sample->patient->name_en}}</td>
<td style="font-size:10pt !important;" class="text-left text-no-wrap">{{__('patient.form_age')}}</td>
<td style="font-size:10pt !important;" class="text-no-wrap text-left">
: {{\App\Helpers\Helpers::getAge($sample->patient->dob, $sample->admission_date)}}, {{__('sample.form_patient_gender')}}: {{\App\Helpers\Helpers::getGender($sample->patient->gender)}}
</td>
</tr>
<tr>
<td style="font-size:10pt !important;" class="text-left text-no-wrap">{{__('patient.table_phon')}}</td>
<td style="font-size:10pt !important;" class="text-left ">: {{$sample->patient->phone_number}} </td>
<td style="font-size:10pt !important;" class="text-left text-no-wrap">{{__('sample.physician_name')}}</td>
<td style="font-size:10pt !important;" class="text-left ">: {!!$sample->physician->name_en!!}</td>
</tr>
</tbody>
</table>
</th>
</tr>
</thead>
<tfoot>
<tr>
<td width="100%">
<table width="100%" border="0">
<tbody>
<tr>
<td colspan="4" style="height: 20px;">&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tfoot>
<tbody>
<tr>
<td class="p-0">
<table width="100%" class="table-inv" style="border-collapse: collapse; !important; font-size:10pt !important;">
<tbody>
<tr class="bg-light font-changable">
<td width="8%" class="text-center">{{__('invoice.table_no')}}</td>
<td class="text-center">{{__('invoice.form_description')}}</td>
<td width="15%" class="text-center" style="width:110px !important;">{{__('invoice.form_qty')}}</td>
<td width="15%" class="text-center" style="width:110px !important;">{{__('invoice.form_unit_price')}}</td>
</tr>
<?php $total = 0;?>
@foreach($invoice->invoiceDetail->sortBy('weight') as $k=>$invItem)
<?php $total++;?>
<tr>
<td class=" text-center font-changable" style="padding:0 5px;">{{$k+1}}</td>
<td style="padding:0 5px;" class="font-changable">{{$invItem->test_name}}</td>
<td style="padding:0 5px;" class="text-right font-changable">{{$invItem->qty}}</td>
<td style="padding:0 5px;" class="text-right font-changable">$ {{$invItem->unit_price}}</td>
</tr>
@endforeach
@for($i=$total; $i<=11; $i++)
<tr>
<td class=" text-center font-changable" style="padding:0 5px;">{{$i+1}}</td>
<td style="padding:0 5px;" class="font-changable"></td>
<td style="padding:0 5px;" class="text-right font-changable"></td>
<td style="padding:0 5px;" class="text-right font-changable"></td>
</tr>
@endfor
<tr class="font-changable">
<td class="text-left " colspan="4"><span style="padding-left: 10px !important;">{{$invoice->invoice_note}}</span></td>
</tr>
<tr class="font-changable">
<td class="text-left border-0" colspan="2"><span style="padding-left: 30px !important;">{{__('invoice.table_invoice_date')}}: {{date('d-m-Y',strtotime($invoice->invoice_date))}}</span></td>
<td class="text-right border-0">{{__('invoice.table_total_cost')}} ($) :</td>
<td class="text-right bg-light"> {{number_format($invoice->total,2)}}</td>
</tr>
<tr class="font-changable">
<td class="text-left border-0" colspan="2"></td>
<td class="text-right border-0">{{__('invoice.table_discount')}} ({{$labSettings->discount_type==1? '%' : '$'}}):</td>
<td class="text-right bg-light"> {{ ($invoice->discount_type==1 ? $invoice->discount : number_format($invoice->discount,2))}}</td>
<!--<td class="text-right bg-light"> {{ ($invoice->discount_type==1 ? ($invoice->discount > 0? number_format($invoice->total * (1-($invoice->discount/100))) : 0) : number_format($invoice->discount,2))}}</td>-->
</tr>
<tr class="font-changable">
<td class="text-left border-0" colspan="2"></td>
<td class="text-right border-0">{{__('invoice.table_net_cost')}} :</td>
<td class="text-right bg-light"> {{number_format(($invoice->gross_total) ,2)}}</td>
</tr>
<tr class="font-changable">
<td class="text-left border-0" colspan="2">
<span style="padding-left: {{ $sample->lab_id != 21 ? '70px' : '45px' }} !important;">
{{ $sample->lab_id != 21 ? __('invoice.received_by') : 'Lab. Tech' }}
</span>
</td>
<td class="text-right border-0">{{__('invoice.table_net_cost_riel')}} :</td>
<td class="text-right bg-light"> {{number_format((($invoice->gross_total) * ($invoice->exchange_rate <=0 ? $labSettings->exchange_rate : $invoice->exchange_rate)),2)}}</td>
</tr>
</tbody>
</table>
</td>
</tr>
<!-- Comment -->
</tbody>
<!-- Note -->
</table>
<table id="footer" width="100%" border="0" style="padding: 0 10px !important;">
<tbody>
<tr>
<td class="text-center text-no-wrap" style="width: 3cm">
</td>
<td style="width: 4cm"></td>
<td class="text-center text-no-wrap" style="width: 4cm; padding-left: 20px"></td>
</tr>
<tr>
<td colspan="3" style="padding-top: 15px; !important;">&nbsp;</td>
</tr>
<tr class="result-footer-signature">
<td class="text-center text-no-wrap" style="padding: 0 10px !important;">
</td>
<td class="text-center text-no-wrap"></td>
<td class="text-center text-no-wrap"></td>
</tr>
</tbody>
</table>
</div>
<div style="width: 49%; display: inline-block; clear: both; vertical-align: top;">
<table border="0" width="100%" style="font-size: 8pt !important;">
<thead>
<tr id="def-logo-2">
<td style="width:100%; text-align: center">
@if(!empty($sample->physician->logo))
<img width="100%" class="rounded-0" src="{{url(env("APP_URL").'storage/images/physician/'.$sample->physician->logo)}}" />
@else
<table width="100%">
<tr>
<td style="width:70px; vertical-align: top;" class="text-center">
<img src="{{url(env("APP_URL").'storage/images/avatars/labs/'.$labSettings->logo)}}" alt="Logo" style="width: 70px;">
</td>
<td class="text-center">
<p style="line-height: 13px !important; font-size: 10pt; font-weight: bold;" class="KhmerMoulLight ">{{$labSettings->name_kh}}</p>
<p style="line-height: 13px !important; font-size: 9pt; font-weight: bold;" class="text-uppercase ">{{$labSettings->name_en}}</p>
<p class="font-changeable" style="line-height: 20px !important;">{{ app()->getLocale()=='kh' ? $labSettings->address_kh : $labSettings->address_en}} </p>
<p style="line-height: 9px !important;">{{$labSettings->phone_number}}</p>
</td>
<td style="width:80px; vertical-align: bottom;" >
<div class="visible-print text-center">
@if($labSettings->shareable_lab_result==1)
{!! QrCode::size(60)->generate(url('/shared/lab-result/'.$sample_id)); !!}
@endif
</div>
</td>
</tr>
</table>
@endif
</td>
</tr>
<tr id="dyn-logo-2" style="display:none;">
<th style="width:100%" class="text-center">
@if(!empty($labSettings->alternative_logo))
<img width="100%" class="rounded-0" src="{{ url(env("APP_URL").'storage/images/avatars/labs/alternative_logo/'.$labSettings->alternative_logo) }}" />
@endif
</th>
</tr>
<tr>
<td class="text-top text-center">
<div style="font-size: 11.5pt; font-weight: 700;" class="font-changeable">{{$sample->lab_id != 21 ? __('invoice.tittle') : 'Laboratory' }}</div>
</td>
</tr>
<tr>
<th class="p-0">
<table width="100%" class="patient-info font-changable" style="line-height: 15px !important;">
<tbody>
<tr>
<td class="text-left" style="font-size:10pt !important;" width="20%">{{$sample->lab_id != 21 ? __('invoice.form_invoice_number') : 'Reference No' }}</td>
<td class="text-left" style="font-size:10pt !important;" width="30%">: {{$invoice->invoice_code}}</td>
<td class="text-left" style="font-size:10pt !important;" width="20%">{{__('sample.table_sample_number')}}</td>
<td class="text-left" style="font-size:10pt !important;" width="30%">: {{$sample->sample_number}}</td>
</tr>
<tr>
<td style="font-size:10pt !important;" class="text-left text-no-wrap">{{__('invoice.table_patient_name')}}</td>
<td style="font-size:10pt !important;" class="text-left ">: {{$sample->patient->name_en}}</td>
<td style="font-size:10pt !important;" class="text-left text-no-wrap">{{__('patient.form_age')}}</td>
<td style="font-size:10pt !important;" class="text-no-wrap text-left">
: {{\App\Helpers\Helpers::getAge($sample->patient->dob, $sample->admission_date)}}, {{__('sample.form_patient_gender')}}: {{\App\Helpers\Helpers::getGender($sample->patient->gender)}}
</td>
</tr>
<tr>
<td style="font-size:10pt !important;" class="text-left text-no-wrap">{{__('patient.table_phon')}}</td>
<td style="font-size:10pt !important;" class="text-left ">: {{$sample->patient->phone_number}} </td>
<td style="font-size:10pt !important;" class="text-left text-no-wrap">{{__('sample.physician_name')}}</td>
<td style="font-size:10pt !important;" class="text-left ">: {!!$sample->physician->name_en!!}</td>
</tr>
</tbody>
</table>
</th>
</tr>
</thead>
<tfoot>
<tr>
<td width="100%">
<table width="100%" border="0">
<tbody>
<tr>
<td colspan="4" style="height: 20px;">&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tfoot>
<tbody>
<tr>
<td class="p-0">
<table width="100%" class="table-inv" style="border-collapse: collapse; !important; font-size:10pt !important;">
<tbody>
<tr class="bg-light font-changable">
<td width="8%" class="text-center">{{__('invoice.table_no')}}</td>
<td class="text-center">{{__('invoice.form_description')}}</td>
<td width="15%" class="text-center" style="width:110px !important;">{{__('invoice.form_qty')}}</td>
<td width="15%" class="text-center" style="width:110px !important;">{{__('invoice.form_unit_price')}}</td>
</tr>
@foreach($invoice->invoiceDetail->sortBy('weight') as $k=>$invItem)
<tr>
<td class=" text-center font-changable">{{$k+1}}</td>
<td class="font-changable">{{$invItem->test_name}}</td>
<td class="text-right font-changable">{{$invItem->qty}}</td>
<td class="text-right font-changable">$ {{$invItem->unit_price}}</td>
</tr>
@endforeach
@for($i=$total; $i<=11; $i++)
<tr>
<td class=" text-center font-changable" style="padding:0 5px;">{{$i+1}}</td>
<td style="padding:0 5px;" class="font-changable"></td>
<td style="padding:0 5px;" class="text-right font-changable"></td>
<td style="padding:0 5px;" class="text-right font-changable"></td>
</tr>
@endfor
<tr class="font-changable">
<td class="text-left " colspan="4"><span style="padding-left: 10px !important;">{{$invoice->invoice_note}}</span></td>
</tr>
<tr class="font-changable">
<td class="text-left border-0" colspan="2"><span style="padding-left: 30px !important;">{{__('invoice.table_invoice_date')}}: {{date('d-m-Y',strtotime($invoice->invoice_date))}}</span></td>
<td class="text-right border-0">{{__('invoice.table_total_cost')}} ($) :</td>
<td class="text-right bg-light"> {{number_format($invoice->total,2)}}</td>
</tr>
@if($invoice->is_hide_discount == 0)
<tr class="font-changable">
<td class="text-left border-0" colspan="2"></td>
<td class="text-right border-0">{{__('invoice.table_discount')}} ({{$labSettings->discount_type==1? '%' : '$'}}):</td>
<td class="text-right bg-light"> {{ ($invoice->discount_type==1 ? $invoice->discount : number_format($invoice->discount,2))}}</td>
<!--<td class="text-right bg-light"> {{ ($invoice->discount_type==1 ? ($invoice->discount > 0? number_format($invoice->total * (1-($invoice->discount/100))) : 0) : number_format($invoice->discount,2))}}</td>-->
</tr>
<tr class="font-changable">
<td class="text-left border-0" colspan="2"></td>
<td class="text-right border-0">{{__('invoice.table_net_cost')}} :</td>
<td class="text-right bg-light"> {{number_format(($invoice->gross_total) ,2)}}</td>
</tr>
<tr class="font-changable">
<td class="text-left border-0" colspan="2">
<span style="padding-left: {{ $sample->lab_id != 21 ? '70px' : '45px' }} !important;">
{{ $sample->lab_id != 21 ? __('invoice.received_by') : 'Lab. Tech' }}
</span>
</td>
<td class="text-right border-0">{{__('invoice.table_net_cost_riel')}} :</td>
<td class="text-right bg-light"> {{number_format((($invoice->gross_total) * ($invoice->exchange_rate <=0 ? $labSettings->exchange_rate : $invoice->exchange_rate)),2)}}</td>
</tr>
@else
<tr class="font-changable">
<td class="text-left border-0" colspan="2"></td>
<td class="text-right border-0">{{__('invoice.table_net_cost')}} :</td>
<td class="text-right bg-light"> {{number_format(($invoice->total) ,2)}}</td>
</tr>
<tr class="font-changable">
<td class="text-left border-0" colspan="2"><span style="padding-left: 70px !important;">{{__('invoice.received_by')}}</span></td>
<td class="text-right border-0">{{__('invoice.table_net_cost_riel')}} :</td>
<td class="text-right bg-light"> {{number_format((($invoice->total) * ($invoice->exchange_rate <=0 ? $labSettings->exchange_rate : $invoice->exchange_rate)),2)}}</td>
</tr>
@endif
</tbody>
</table>
</td>
</tr>
<!-- Comment -->
</tbody>
<!-- Note -->
</table>
<table id="footer" width="100%" border="0" style="padding: 0 10px !important;">
<tbody>
<tr>
<td class="text-center text-no-wrap" style="width: 3cm">
</td>
<td style="width: 4cm"></td>
<td class="text-center text-no-wrap" style="width: 4cm; padding-left: 20px"></td>
</tr>
<tr>
<td colspan="3" style="padding-top: 15px; !important;">&nbsp;</td>
</tr>
<tr class="result-footer-signature">
<td class="text-center text-no-wrap" style="padding: 0 10px !important;">
</td>
<td class="text-center text-no-wrap"></td>
<td class="text-center text-no-wrap"></td>
</tr>
</tbody>
</table>
</div>
</div>
</page>
</div>
</div>
</div>
<script>
function changeLogoAndPrint(){
$('#dyn-logo, #def-logo').toggle();
$('#dyn-logo-2, #def-logo-2').toggle();
printJS({
printable: "presult-1",
type: "html"
});
setTimeout(function(){ window.location.href=sample_base_url }, 10000)
}
@if(!empty($labSettings->alternative_logo))
document.getElementById("change_logo_print").addEventListener("click", changeLogoAndPrint);
@endif
</script>

View File

@@ -0,0 +1,444 @@
<div class="modal fade" id="print_invoice_modal" style="padding-top: 40px; background: rgba(0, 0, 0, 0.54); overflow: auto; padding-left: 17px;">
<div class="print-preview-header">
<div class="presult-pagination d-none">
<input type="text" class="page-number" value="1" onfocus="this.select()"> /
<span class="page-count">1</span>
</div>
<ul>
<li style="display: inline-block;" class="print">
<a href="javascript:void(0)" onclick="printJS('presult-1', 'html')" id="doPrinting"><i class="fa fa-print"></i>&nbsp;<b>{{__('invoice.print')}}</b></a>
</li>
</ul>
<span class="close-preview" data-dismiss="modal" title="Close"><i class="fa fa-times"></i></span>
</div>
<div class="modal-dialog modal-xxl A4-portrait">
<div class="psample-result active" id="presult-1">
<title>Result</title>
<meta name="viewport" content="width=device-width, initial-scale=.5, maximum-scale=12.0, minimum-scale=.25, user-scalable=yes">
<style>
@php
$configures = collect($labConfigures);
$fontNameHeader = ($configures->where('atrribute_code', 'FONT_NAME_FOR_RESULT_HEADER')->pluck('assigned_attribute_value')->first());
$fontSizeHeader = ($configures->where('atrribute_code', 'FONT_SIZE_FOR_RESULT_HEADER')->pluck('assigned_attribute_value')->first());
$resultColorHeader = ($configures->where('atrribute_code', 'COLOR_FOR_RESULT_HEADER')->pluck('assigned_attribute_value')->first());
$fontName = ($configures->where('atrribute_code', 'FONT_NAME_FOR_RESULT')->pluck('assigned_attribute_value')->first());
$fontSize = ($configures->where('atrribute_code', 'FONT_SIZE_FOR_RESULT')->pluck('assigned_attribute_value')->first());
$resultColor = ($configures->where('atrribute_code', 'COLOR_FOR_RESULT')->pluck('assigned_attribute_value')->first());
@endphp
.patient-info tr td{
/*font-family: '{{(empty($fontNameHeader) ? 'Times New Roman':$fontNameHeader)}}' !important;*/
font-family: "{{(App::isLocale('en') ? (empty($fontNameHeader) ? 'Times New Roman':$fontNameHeader) : 'Khmer OS Siemreap')}}";
font-size:10px !important;
}
.font-changeable{
/*font-family: '{{(empty($fontName) ? 'Times New Roman':$fontName)}}' !important;*/
font-family: "{{(App::isLocale('en') ? (empty($fontNameHeader) ? 'Times New Roman':$fontNameHeader) : 'Khmer OS Siemreap')}}";
}
table td, table th{
padding: 3px !important; font-size:10pt !important;
}
@font-face {
font-family: 'KhmerOS_muollight';
src: url('{{url(env("APP_URL").'storage/assets/fonts/KhmerOS_muollight.ttf')}}');
font-display: swap;
}
.KhmerMoulLight {
font-family: 'SourceSerifPro-Regular', 'KhmerOS_muollight', 'serif';
}
page[size="A4"] {
background: white;
/*width: 21cm;*/
width: 297mm;
display: block;
margin: 10px auto;
box-shadow: 0 0 0.5cm rgba(0,0,0,0.5);
padding: 1mm;
font-family: 'SourceSerifPro-Regular', 'Noto Sans Khmer', 'serif';*/
/*font-family: '{{(empty($fontNameHeader) ? 'Times New Roman':$fontNameHeader)}}' !important;*/
font-size: 8pt;
line-height: 10px;
page-break-after: always;
}
table th, table td {
text-align: left;
padding-left: 5px !important;
padding-right: 5px !important;
}
table td {
font-weight: normal;
}
table.patient-info, table.department-sample-info {
border: 1px solid #7a7a7a;
line-height: 18px;
padding: 3px;
}
table.patient-info td, table.patient-info th {
vertical-align: top;
}
.text-center {
text-align: center;
}
.text-left {
text-align: left;
}
.text-right {
text-align: right;
}
.text-top {
vertical-align: top;
}
.text-no-wrap {
white-space: nowrap;
}
table.test-result {
line-height: 16px;
}
#footer {
line-height: 17px;
}
#footer .laboratory-address td {
border-top: 1px solid black;
padding-top: 10px;
}
#footer .result-footer-signature td {
vertical-align: top;
padding-bottom: 60px;
}
@page {
margin: 0.5cm;
}
@media print {
body,
page[size="A4"] {
box-shadow: none;
background-color: #fff;
}
@page {
size: A4 landscape;
margin: 0.5cm 0.5cm 0;
padding: 0;
}
@page {
size: 210mm 297mm landscape;
margin: 0.5cm 0.5cm 0;
padding: 0;
}
@page {
size: 11.7in 16.5in landscape;
margin: 0.5cm 0.5cm 0;
padding: 0;
}
tbody.sample-result {
page-break-inside: avoid;
}
#footer {
display: block;
position: fixed;
bottom: 0;
}
.font-changable{
/*font-family: "{{(App::isLocale('en') ? 'Times New Roman' : 'Khmer OS Siemreap')}}";*/
/*font-family: '{{(empty($fontNameHeader) ? 'Times New Roman':$fontNameHeader)}}' !important;*/
font-family: "{{(App::isLocale('en') ? (empty($fontNameHeader) ? 'Times New Roman':$fontNameHeader) : 'Khmer OS Siemreap')}}";
}
#print_invoice_modal .table-inv th, .table-inv td {
padding: 3px !important;
}
}
#print_invoice_modal .table-inv th, .table-inv td {
border: 1px solid black;
border-collapse: collapse;
padding: 3px !important;
}
.bg-light{
background: #e8e8e8 !important;
}
.border-0{
border:none !important;
}
.font-changable{
/*font-family: "{{(App::isLocale('en') ? 'Times New Roman' : 'Khmer OS Siemreap')}}";*/
/*font-family: '{{(empty($fontNameHeader) ? 'Times New Roman':$fontNameHeader)}}' !important;*/
font-family: "{{(App::isLocale('en') ? (empty($fontNameHeader) ? 'Times New Roman':$fontNameHeader) : 'Khmer OS Siemreap')}}";
}
.table-inv tr td{
font-size:11px !important;
}
</style>
<page size="A4">
<div style="width: 297mm; padding: 0px; background-image: linear-gradient(#fafafa, #fafafa); background-size: 1px 100%; background-repeat: no-repeat; background-position: 49.6% center;">
<div style="width: 49%; display: inline-block; clear: both; /*border-right: 1px dashed #eee;*/ vertical-align: top; margin-right:1% !important">
<table border="0" width="100%" style="font-size: 8pt !important;">
<thead>
<tr>
<td style="width:100%; text-align: center">
@if(!empty($sample->physician->logo))
<img width="100%" class="rounded-0" src="{{url(env("APP_URL").'storage/images/physician/'.$sample->physician->logo)}}" />
@else
<table width="100%">
<tr>
<td style="width:70px; vertical-align: top;" class="text-center">
<img src="{{url(env("APP_URL").'storage/images/avatars/labs/'.$labSettings->logo)}}" alt="Logo" style="width: 70px;">
</td>
<td class="text-center">
<p style="line-height: 13px !important; font-size: 10pt; font-weight: bold;" class="KhmerMoulLight ">{{$labSettings->name_kh}}</p>
<p style="line-height: 13px !important; font-size: 9pt; font-weight: bold;" class="text-uppercase ">{{$labSettings->name_en}}</p>
<p class="font-changeable" style="line-height: 20px !important; font-size: 8pt;">{{ app()->getLocale()=='kh' ? $labSettings->address_kh : $labSettings->address_en}} </p>
<p style="line-height: 9px !important; font-size: 8pt;">{{$labSettings->phone_number}} </p>
</td>
<td style="width:80px; vertical-align: bottom;" >
<div class="visible-print text-center">
@if($labSettings->shareable_lab_result==1)
{!! QrCode::size(60)->generate(url('/shared/lab-result/'.$sample_id)); !!}
@endif
</div>
</td>
</tr>
</table>
@endif
</td>
</tr>
<tr>
<td class="text-top text-center">
<div style="font-size: 11.5pt; font-weight: 700;" class="font-changeable">{{__('invoice.tittle')}}</div>
</td>
</tr>
<tr>
<th class="p-0">
<table width="100%" class="patient-info font-changable" style="line-height: 15px !important;">
<tbody>
<tr>
<td class="text-left" style="font-size:10pt !important;" width="20%">{{__('invoice.form_invoice_number')}}</td>
<td class="text-left" style="font-size:10pt !important;" width="30%">: {{$invoice->invoice_code}}</td>
<td class="text-left" style="font-size:10pt !important;" width="20%">{{__('sample.table_sample_number')}}</td>
<td class="text-left" style="font-size:10pt !important;" width="30%">: {{$sample->sample_number}}</td>
</tr>
<tr>
<td style="font-size:10pt !important;" class="text-left text-no-wrap">{{__('invoice.table_patient_name')}}</td>
<td style="font-size:10pt !important;" class="text-left ">: {{$sample->patient->name_en}}</td>
<td style="font-size:10pt !important;" class="text-left text-no-wrap">{{__('patient.form_age')}}</td>
<td style="font-size:10pt !important;" class="text-no-wrap text-left">
: {{\App\Helpers\Helpers::getAge($sample->patient->dob, $sample->admission_date)}}, {{__('sample.form_patient_gender')}}: {{\App\Helpers\Helpers::getGender($sample->patient->gender)}}
</td>
</tr>
<tr>
<td style="font-size:10pt !important;" class="text-left text-no-wrap">{{__('patient.table_phon')}}</td>
<td style="font-size:10pt !important;" class="text-left ">: {{$sample->patient->phone_number}} </td>
<td style="font-size:10pt !important;" class="text-left text-no-wrap">{{__('sample.physician_name')}}</td>
<td style="font-size:10pt !important;" class="text-left ">: {{$sample->physician->name_en}}</td>
</tr>
</tbody>
</table>
</th>
</tr>
</thead>
<tbody height=100%>
<tr>
<td>
<table width="100%" border=0>
<?php $total = 0;?>
@foreach($invoice->invoiceDetail as $k=>$invItem)
<?php $total+= $invItem->unit_price;?>
@endforeach
<tr style="height:70px"><td>&nbsp;</td><td>&nbsp;</td></tr>
<tr>
<td class="text-center" style="font-size: 12pt; font-weight: bold;">Laboratory Analysis Fee - សេវាវិភាគមន្ទីរពិសោធន៍</td>
<td style="font-size: 14pt; font-weight: bold;">US Dollar: {{number_format($invoice->total,2)}}</td>
</tr>
<tr>
<td>&nbsp;</td>
<td style="font-size: 14pt; font-weight: bold;">Khmer Riel: {{number_format((($invoice->gross_total) * ($invoice->exchange_rate <=0 ? $labSettings->exchange_rate : $invoice->exchange_rate)),0)}}</td>
</tr>
<tr style="height:80px">
<td class="text-center" colspan="2" style="font-size:16pt; font-weight: bold;">{{$invoice->invoice_note}}</td>
</tr>
<tr class="font-changable" style="height:150px">
<td class="text-left border-0" colspan="2"><span style="padding-left: 30px !important;">{{__('invoice.table_invoice_date')}}: {{date('d-m-Y',strtotime($invoice->invoice_date))}}</span></td>
</tr>
<tr class="font-changable" style="height:70px">
<td class="text-left border-0" colspan="2"><span style="padding-left: 70px !important;">{{__('invoice.received_by')}}</span></td>
</tr>
</table>
</td>
</tr>
<!-- Comment -->
</tbody>
<!-- Note -->
</table>
<table id="footer" width="100%" border="0" style="padding: 0 10px !important;">
<tbody>
<tr>
<td class="text-center text-no-wrap" style="width: 3cm">
</td>
<td style="width: 4cm"></td>
<td class="text-center text-no-wrap" style="width: 4cm; padding-left: 20px"></td>
</tr>
<tr>
<td colspan="3" style="padding-top: 15px; !important;">&nbsp;</td>
</tr>
<tr class="result-footer-signature">
<td class="text-center text-no-wrap" style="padding: 0 10px !important;">
</td>
<td class="text-center text-no-wrap"></td>
<td class="text-center text-no-wrap"></td>
</tr>
</tbody>
</table>
</div>
<div style="width: 49%; display: inline-block; clear: both; vertical-align: top;">
<table border="0" width="100%" style="font-size: 8pt !important;">
<thead>
<tr>
<td style="width:100%; text-align: center">
@if(!empty($sample->physician->logo))
<img width="100%" class="rounded-0" src="{{url(env("APP_URL").'storage/images/physician/'.$sample->physician->logo)}}" />
@else
<table width="100%">
<tr>
<td style="width:70px; vertical-align: top;" class="text-center">
<img src="{{url(env("APP_URL").'storage/images/avatars/labs/'.$labSettings->logo)}}" alt="Logo" style="width: 70px;">
</td>
<td class="text-center">
<p style="line-height: 13px !important; font-size: 10pt; font-weight: bold;" class="KhmerMoulLight ">{{$labSettings->name_kh}}</p>
<p style="line-height: 13px !important; font-size: 9pt; font-weight: bold;" class="text-uppercase ">{{$labSettings->name_en}}</p>
<p class="font-changeable" style="line-height: 20px !important; font-size: 8pt;">{{ app()->getLocale()=='kh' ? $labSettings->address_kh : $labSettings->address_en}} </p>
<p style="line-height: 9px !important; font-size: 8pt;">{{$labSettings->phone_number}} </p>
</td>
<td style="width:80px; vertical-align: bottom;" >
<div class="visible-print text-center">
@if($labSettings->shareable_lab_result==1)
{!! QrCode::size(60)->generate(url('/shared/lab-result/'.$sample_id)); !!}
@endif
</div>
</td>
</tr>
</table>
@endif
</td>
</tr>
<tr>
<td class="text-top text-center">
<div style="font-size: 11.5pt; font-weight: 700;" class="font-changeable">{{__('invoice.tittle')}}</div>
</td>
</tr>
<tr>
<th class="p-0">
<table width="100%" class="patient-info font-changable" style="line-height: 15px !important;">
<tbody>
<tr>
<td class="text-left" style="font-size:10pt !important;" width="20%">{{__('invoice.form_invoice_number')}}</td>
<td class="text-left" style="font-size:10pt !important;" width="30%">: {{$invoice->invoice_code}}</td>
<td class="text-left" style="font-size:10pt !important;" width="20%">{{__('sample.table_sample_number')}}</td>
<td class="text-left" style="font-size:10pt !important;" width="30%">: {{$sample->sample_number}}</td>
</tr>
<tr>
<td style="font-size:10pt !important;" class="text-left text-no-wrap">{{__('invoice.table_patient_name')}}</td>
<td style="font-size:10pt !important;" class="text-left ">: {{$sample->patient->name_en}}</td>
<td style="font-size:10pt !important;" class="text-left text-no-wrap">{{__('patient.form_age')}}</td>
<td style="font-size:10pt !important;" class="text-no-wrap text-left">
: {{\App\Helpers\Helpers::getAge($sample->patient->dob, $sample->admission_date)}}, {{__('sample.form_patient_gender')}}: {{\App\Helpers\Helpers::getGender($sample->patient->gender)}}
</td>
</tr>
<tr>
<td style="font-size:10pt !important;" class="text-left text-no-wrap">{{__('patient.table_phon')}}</td>
<td style="font-size:10pt !important;" class="text-left ">: {{$sample->patient->phone_number}} </td>
<td style="font-size:10pt !important;" class="text-left text-no-wrap">{{__('sample.physician_name')}}</td>
<td style="font-size:10pt !important;" class="text-left ">: {{$sample->physician->name_en}}</td>
</tr>
</tbody>
</table>
</th>
</tr>
</thead>
<tfoot>
<tr>
<td width="100%">
<table width="100%" border="0">
<tbody>
<tr>
<td colspan="4" style="height: 20px;">&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tfoot>
<tbody>
<tr>
<td>
<table width="100%" border=0>
<?php $total = 0;?>
@foreach($invoice->invoiceDetail as $k=>$invItem)
<?php $total+= $invItem->unit_price;?>
@endforeach
<tr style="height:70px"><td>&nbsp;</td><td>&nbsp;</td></tr>
<tr>
<td class="text-center" style="font-size: 12pt; font-weight: bold;">Laboratory Analysis Fee - សេវាវិភាគមន្ទីរពិសោធន៍</td>
<td style="font-size: 16pt; font-weight: bold;">US Dollar: {{number_format($invoice->total,2)}}</td>
</tr>
<tr>
<td>&nbsp;</td>
<td style="font-size: 16pt; font-weight: bold;">Khmer Riel: {{number_format((($invoice->gross_total) * ($invoice->exchange_rate <=0 ? $labSettings->exchange_rate : $invoice->exchange_rate)),0)}}</td>
</tr>
<tr class="font-changable" style="height:80px">
<td class="text-center " colspan="2" style="font-size: 16pt; font-weight: bold;"><span style="padding-left: 10px !important;">{{$invoice->invoice_note}}</span></td>
</tr>
<tr class="font-changable" style="height:150px">
<td class="text-left border-0" colspan="2"><span style="padding-left: 30px !important;">{{__('invoice.table_invoice_date')}}: {{date('d-m-Y',strtotime($invoice->invoice_date))}}</span></td>
</tr>
<tr class="font-changable" style="height:70px">
<td class="text-left border-0" colspan="2"><span style="padding-left: 70px !important;">{{__('invoice.received_by')}}</span></td>
</tr>
</table>
</td>
</tr>
<!-- Comment -->
</tbody>
<!-- Note -->
</table>
<table id="footer" width="100%" border="0" style="padding: 0 10px !important;">
<tbody>
<tr>
<td class="text-center text-no-wrap" style="width: 3cm">
</td>
<td style="width: 4cm"></td>
<td class="text-center text-no-wrap" style="width: 4cm; padding-left: 20px"></td>
</tr>
<tr>
<td colspan="3" style="padding-top: 15px; !important;">&nbsp;</td>
</tr>
<tr class="result-footer-signature">
<td class="text-center text-no-wrap" style="padding: 0 10px !important;">
</td>
<td class="text-center text-no-wrap"></td>
<td class="text-center text-no-wrap"></td>
</tr>
</tbody>
</table>
</div>
</div>
</page>
</div>
</div>
</div>

View File

@@ -0,0 +1,591 @@
<div class="modal fade" id="print_invoice_modal" style="padding-top: 40px; background: rgba(0, 0, 0, 0.54); overflow: auto; padding-left: 17px;">
<div class="print-preview-header">
<div class="presult-pagination d-none">
<input type="text" class="page-number" value="1" onfocus="this.select()"> /
<span class="page-count">1</span>
</div>
<ul>
<li style="display: inline-block;" class="print">
<a href="javascript:void(0)" onclick="printJS('presult-1', 'html')" id="doPrinting"><i class="fa fa-print"></i>&nbsp;<b>{{__('invoice.print')}}</b></a>
</li>
<li style="display: inline-block;" class="print">
<a href="javascript:void(0);" onclick="$('.btn-print-invoice-a4').click()"><i class="fa fa-print"></i>&nbsp;<b>{{__('invoice.print')}} A4</b></a>
</li>
</ul>
<span class="close-preview" data-dismiss="modal" title="Close"><i class="fa fa-times"></i></span>
</div>
<div class="modal-dialog modal-xxl A4-portrait">
<div class="psample-result active" id="presult-1">
<title>Result</title>
<meta name="viewport" content="width=device-width, initial-scale=.5, maximum-scale=12.0, minimum-scale=.25, user-scalable=yes">
<style>
@php
$configures = collect($labConfigures);
$fontNameHeader = ($configures->where('atrribute_code', 'FONT_NAME_FOR_RESULT_HEADER')->pluck('assigned_attribute_value')->first());
$fontSizeHeader = ($configures->where('atrribute_code', 'FONT_SIZE_FOR_RESULT_HEADER')->pluck('assigned_attribute_value')->first());
$resultColorHeader = ($configures->where('atrribute_code', 'COLOR_FOR_RESULT_HEADER')->pluck('assigned_attribute_value')->first());
$fontName = ($configures->where('atrribute_code', 'FONT_NAME_FOR_RESULT')->pluck('assigned_attribute_value')->first());
$fontSize = ($configures->where('atrribute_code', 'FONT_SIZE_FOR_RESULT')->pluck('assigned_attribute_value')->first());
$resultColor = ($configures->where('atrribute_code', 'COLOR_FOR_RESULT')->pluck('assigned_attribute_value')->first());
@endphp
.patient-info tr td{
/*font-family: '{{(empty($fontNameHeader) ? 'Times New Roman':$fontNameHeader)}}' !important;*/
font-family: "{{(App::isLocale('en') ? (empty($fontNameHeader) ? 'Times New Roman':$fontNameHeader) : 'Khmer OS Siemreap')}}";
font-size:10px !important;
}
.font-changeable{
/*font-family: '{{(empty($fontName) ? 'Times New Roman':$fontName)}}' !important;*/
font-family: "{{(App::isLocale('en') ? (empty($fontNameHeader) ? 'Times New Roman':$fontNameHeader) : 'Khmer OS Siemreap')}}";
}
table td, table th{
padding: 3px !important; font-size:10pt !important;
}
@font-face {
font-family: 'KhmerOS_muollight';
src: url('{{url(env("APP_URL").'storage/assets/fonts/KhmerOS_muollight.ttf')}}');
font-display: swap;
}
.KhmerMoulLight {
font-family: 'SourceSerifPro-Regular', 'KhmerOS_muollight', 'serif';
}
page[size="A4"] {
background: white;
/*width: 21cm;*/
width: 297mm;
display: block;
margin: 10px auto;
box-shadow: 0 0 0.5cm rgba(0,0,0,0.5);
padding: 1mm;
font-family: 'SourceSerifPro-Regular', 'Noto Sans Khmer', 'serif';*/
/*font-family: '{{(empty($fontNameHeader) ? 'Times New Roman':$fontNameHeader)}}' !important;*/
font-size: 8pt;
line-height: 10px;
page-break-after: always;
}
p.value-pair {
position: relative;
width: 100%;
margin: 0;
line-height: 0.7rem !important;
}
p.value-pair:before {
content: '';
display: block;
position: absolute;
width: 100%;
/*bottom: .25rem;*/
bottom: -0.6rem !important;
height: 0;
line-height: 0;
border-bottom: 2px dotted #858585;
}
table th, table td {
text-align: left;
padding-left: 5px !important;
padding-right: 5px !important;
}
table td {
font-weight: normal;
}
table.patient-info, table.department-sample-info {
border: 1px solid #7a7a7a;
line-height: 18px;
padding: 3px;
}
table.patient-info td, table.patient-info th {
vertical-align: top;
}
.text-center {
text-align: center;
}
.text-left {
text-align: left;
}
.text-right {
text-align: right;
}
.text-top {
vertical-align: top;
}
.text-no-wrap {
white-space: nowrap;
}
table.test-result {
line-height: 16px;
}
#footer {
line-height: 17px;
}
#footer .laboratory-address td {
border-top: 1px solid black;
padding-top: 10px;
}
#footer .result-footer-signature td {
vertical-align: top;
padding-bottom: 60px;
}
@page {
margin: 0.5cm;
}
@media print {
body,
page[size="A4"] {
box-shadow: none;
background-color: #fff;
}
@page {
size: A4 landscape;
margin: 0.5cm 0.5cm 0;
padding: 0;
}
@page {
size: 210mm 297mm landscape;
margin: 0.5cm 0.5cm 0;
padding: 0;
}
@page {
size: 11.7in 16.5in landscape;
margin: 0.5cm 0.5cm 0;
padding: 0;
}
tbody.sample-result {
page-break-inside: avoid;
}
#footer {
display: block;
position: fixed;
bottom: 0;
}
.font-changable{
/*font-family: "{{(App::isLocale('en') ? 'Times New Roman' : 'Khmer OS Siemreap')}}";*/
/*font-family: '{{(empty($fontNameHeader) ? 'Times New Roman':$fontNameHeader)}}' !important;*/
font-family: "{{(App::isLocale('en') ? (empty($fontNameHeader) ? 'Times New Roman':$fontNameHeader) : 'Khmer OS Siemreap')}}";
}
#print_invoice_modal .table-inv th, .table-inv td {
padding: 3px !important;
}
}
#print_invoice_modal .table-inv th, .table-inv td {
border: 1px solid black;
border-collapse: collapse;
padding: 3px !important;
}
.bg-light{
background: #e8e8e8 !important;
}
.border-0{
border:none !important;
}
.border-1{
border: 1px solid #ffffff !important;
}
.font-changable{
/*font-family: "{{(App::isLocale('en') ? 'Times New Roman' : 'Khmer OS Siemreap')}}";*/
/*font-family: '{{(empty($fontNameHeader) ? 'Times New Roman':$fontNameHeader)}}' !important;*/
font-family: "{{(App::isLocale('en') ? (empty($fontNameHeader) ? 'Times New Roman':$fontNameHeader) : 'Khmer OS Siemreap')}}";
}
.table-inv tr td{
font-size:11px !important;
}
</style>
<page size="A4">
<div style="width: 297mm; padding: 0px; background-image: linear-gradient(#fafafa, #fafafa); background-size: 1px 100%; background-repeat: no-repeat; background-position: 49.6% center;">
<?php
$grouped = [];
foreach($invoice->invoiceDetail->sortBy('weight') as $r=>$d)
{
$departmentId = $d->testSample->sample->department->name_en;
$sampleTypeId = $d->testSample->sample->name_en;
if (!isset($grouped[$departmentId])) {
$grouped[$departmentId] = [];
}
if (!isset($grouped[$departmentId][$sampleTypeId])) {
$grouped[$departmentId][$sampleTypeId] = [];
}
// Add the item to the appropriate group
$grouped[$departmentId][$sampleTypeId][] = $d->toArray();
}
?>
<div style="width: 49%; display: inline-block; clear: both; /*border-right: 1px dashed #eee;*/ vertical-align: top; margin-right:1% !important">
<table border="0" width="100%" style="font-size: 8pt !important;">
<thead>
<tr>
<td style="width:100%; text-align: center">
<table width="100%">
<tr>
<td style="width:70px; vertical-align: top;" class="text-center">
<img src="{{url(env("APP_URL").'storage/images/avatars/labs/'.$labSettings->logo)}}" alt="Logo" style="width: 70px;">
</td>
<td class="text-center">
<p style="line-height: 13px !important; font-size: 12pt; font-weight: bold;" class="KhmerMoulLight ">{{$labSettings->name_kh}}</p>
<font style="line-height: 13px !important; font-size: 9pt; font-weight: bold;" class="text-uppercase ">{{$labSettings->name_en}}</font><br>
<font class="font-changeable" style="line-height: 20px !important;font-size: 8pt;">{{ app()->getLocale()=='kh' ? $labSettings->address_kh : $labSettings->address_en}} </font>
<br><font style="line-height: 9px !important;font-size: 8pt;">{{$labSettings->phone_number}}<br>{{$labSettings->email}}</font>
</td>
<td style="width:80px; vertical-align: bottom;" >
<div class="visible-print text-center">
@if($labSettings->shareable_lab_result==1)
{!! QrCode::size(60)->generate(url('/shared/lab-result/'.$sample_id)); !!}
@endif
</div>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="text-top text-center">
<div style="font-size: 11.5pt; font-weight: 700;" class="font-changeable">{{__('invoice.tittle')}}</div>
</td>
</tr>
<tr>
<th class="p-0">
<table width="100%" class="patient-info font-changable" style="line-height: 15px !important;">
<tbody>
<tr>
<td class="text-left" style="font-size:10pt !important;" width="20%">{{__('invoice.form_invoice_number')}}</td>
<td class="text-left" style="font-size:10pt !important;" width="30%">: {{$invoice->invoice_code}}</td>
<td class="text-left" style="font-size:10pt !important;" width="20%">{{__('sample.table_sample_number')}}</td>
<td class="text-left" style="font-size:10pt !important;" width="30%">: {{$sample->sample_number}}</td>
</tr>
<tr>
<td style="font-size:10pt !important;" class="text-left text-no-wrap">{{__('invoice.table_patient_name')}}</td>
<td style="font-size:10pt !important;" class="text-left ">: {{$sample->patient->name_en}}</td>
<td style="font-size:10pt !important;" class="text-left text-no-wrap">{{__('patient.form_age')}}</td>
<td style="font-size:10pt !important;" class="text-no-wrap text-left">
: {{\App\Helpers\Helpers::getAge($sample->patient->dob, $sample->admission_date)}}, {{__('sample.form_patient_gender')}}: {{\App\Helpers\Helpers::getGender($sample->patient->gender)}}
</td>
</tr>
<tr>
<td style="font-size:10pt !important;" class="text-left text-no-wrap">{{__('patient.table_phon')}}</td>
<td style="font-size:10pt !important;" class="text-left ">: {{$sample->patient->phone_number}} </td>
<td style="font-size:10pt !important;" class="text-left text-no-wrap">{{__('sample.physician_name')}}</td>
<td style="font-size:10pt !important;" class="text-left ">: {{$sample->physician->name_en}}</td>
</tr>
</tbody>
</table>
</th>
</tr>
</thead>
<tfoot>
<tr>
<td width="100%">
<table width="100%" border="0">
<tbody>
<tr>
<td colspan="4" style="height: 20px;">&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tfoot>
<tbody>
<tr>
<td class="p-0">
<table width="100%" class="table-inv" style="border-collapse: collapse; !important; font-size:10pt !important;">
<tbody>
<tr class="bg-light font-changable">
<!--<td width="8%" class="text-center">{{__('invoice.table_no')}}</td>-->
<td class="text-center">{{__('invoice.form_description')}}</td>
<td width="15%" class="text-center" style="width:110px !important;">{{__('invoice.form_qty')}}</td>
<td width="15%" class="text-center" style="width:110px !important;">{{__('invoice.form_unit_price')}}</td>
</tr>
<?php $total = 0;?>
@foreach($grouped as $k=>$testSample)
@foreach($testSample as $l=>$ts)
<tr>
<td style="padding:0 5px; font-weight:bold; font-size:13px !important;" colspan="3" class="font-changable border-1">{{$l}}</td>
</tr>
@foreach($ts as $r=>$v)
<?php $total++;?>
<tr>
<td style="padding:0 5px; padding-left:15px !important;" class="font-changable border-1"><p class="value-pair line-height"></p><span style="background:#fff; position: relative;">{{$v['test_name']}}</span></td>
<td style="padding:0 5px;" class="text-center font-changable border-1">{{(int)$v['qty']}}</td>
<td style="padding:0 5px;" class="text-right font-changable border-1">{{$v['unit_price']}}</td>
</tr>
@endforeach
@endforeach
@endforeach
@for($i=$total; $i<=19; $i++)
<tr>
<td style="padding:0 5px; padding-left:15px !important;" class="font-changable border-1"><i style="position: absolute;">&nbsp;</td>
<td style="padding:0 5px;" class="text-center font-changable border-1"></td>
<td style="padding:0 5px;" class="text-right font-changable border-1"></td>
</tr>
@endfor
<tr class="font-changable" style="border-bottom: 1pt solid black" >
<td class="text-left" colspan="3" style="border-left: 0px; border-right:0px;"><span style="padding-left: 10px !important;">{{$invoice->invoice_note}}</span></td>
</tr>
<tr class="font-changable">
<td class="text-left border-0" height="20px"><span style="padding-left: 30px !important;">{{__('invoice.table_invoice_date')}}: {{date('d-m-Y',strtotime($invoice->invoice_date))." ".date('H:i:s')}}</span></td>
<td class="text-right border-0">{{__('invoice.table_total_cost')}} ($) :</td>
<td class="text-right bg-light"> {{number_format($invoice->total,2)}}</td>
</tr>
<tr class="font-changable">
<td class="text-left border-0"></td>
<td class="text-right border-0">{{__('invoice.table_discount')}} ({{$labSettings->discount_type==1? '%' : '$'}}):</td>
<td class="text-right bg-light"> {{ ($invoice->discount_type==1 ? $invoice->discount : number_format($invoice->discount,2))}}</td>
<!--<td class="text-right bg-light"> {{ ($invoice->discount_type==1 ? ($invoice->discount > 0? number_format($invoice->total * (1-($invoice->discount/100))) : 0) : number_format($invoice->discount,2))}}</td>-->
</tr>
<tr class="font-changable">
<td class="text-left border-0"></td>
<td class="text-right border-0">{{__('invoice.table_net_cost')}} :</td>
<td class="text-right bg-light"> {{number_format(($invoice->gross_total) ,2)}}</td>
</tr>
<tr class="font-changable">
<td class="text-left border-0"><span style="padding-left: 70px !important;">{{__('invoice.received_by')}}</span></td>
<td class="text-right border-0">{{__('invoice.table_net_cost_riel')}} :</td>
<td class="text-right bg-light"> {{number_format((($invoice->gross_total) * ($invoice->exchange_rate <=0 ? $labSettings->exchange_rate : $invoice->exchange_rate)),2)}}</td>
</tr>
</tbody>
</table>
</td>
</tr>
<!-- Comment -->
</tbody>
<!-- Note -->
</table>
<table id="footer" width="100%" border="0" style="padding: 0 10px !important;">
<tbody>
<tr>
<td class="text-center text-no-wrap" style="width: 3cm">
</td>
<td style="width: 4cm"></td>
<td class="text-center text-no-wrap" style="width: 4cm; padding-left: 20px"></td>
</tr>
<tr>
<td colspan="3" style="padding-top: 15px; !important;">&nbsp;</td>
</tr>
<tr class="result-footer-signature">
<td class="text-center text-no-wrap" style="padding: 0 10px !important;">
</td>
<td class="text-center text-no-wrap"></td>
<td class="text-center text-no-wrap"></td>
</tr>
</tbody>
</table>
</div>
<div style="width: 49%; display: inline-block; clear: both; vertical-align: top;">
<table border="0" width="100%" style="font-size: 8pt !important;">
<thead>
<tr>
<td style="width:100%; text-align: center">
<table width="100%">
<tr>
<td style="width:70px; vertical-align: top;" class="text-center">
<img src="{{url(env("APP_URL").'storage/images/avatars/labs/'.$labSettings->logo)}}" alt="Logo" style="width: 70px;">
</td>
<td class="text-center">
<p style="line-height: 13px !important; font-size: 10pt; font-weight: bold;" class="KhmerMoulLight ">{{$labSettings->name_kh}}</p>
<font style="line-height: 13px !important; font-size: 9pt; font-weight: bold;" class="text-uppercase ">{{$labSettings->name_en}}</font><br>
<font class="font-changeable" style="line-height: 20px !important;font-size: 8pt;">{{ app()->getLocale()=='kh' ? $labSettings->address_kh : $labSettings->address_en}} </font>
<br><font style="line-height: 9px !important;font-size: 8pt;">{{$labSettings->phone_number}}<br>{{$labSettings->email}}</font>
</td>
<td style="width:80px; vertical-align: bottom;" >
<div class="visible-print text-center">
@if($labSettings->shareable_lab_result==1)
{!! QrCode::size(60)->generate(url('/shared/lab-result/'.$sample_id)); !!}
@endif
</div>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="text-top text-center">
<div style="font-size: 11.5pt; font-weight: 700;" class="font-changeable">{{__('invoice.tittle')}}</div>
</td>
</tr>
<tr>
<th class="p-0">
<table width="100%" class="patient-info font-changable" style="line-height: 15px !important;">
<tbody>
<tr>
<td class="text-left" style="font-size:10pt !important;" width="20%">{{__('invoice.form_invoice_number')}}</td>
<td class="text-left" style="font-size:10pt !important;" width="30%">: {{$invoice->invoice_code}}</td>
<td class="text-left" style="font-size:10pt !important;" width="20%">{{__('sample.table_sample_number')}}</td>
<td class="text-left" style="font-size:10pt !important;" width="30%">: {{$sample->sample_number}}</td>
</tr>
<tr>
<td style="font-size:10pt !important;" class="text-left text-no-wrap">{{__('invoice.table_patient_name')}}</td>
<td style="font-size:10pt !important;" class="text-left ">: {{$sample->patient->name_en}}</td>
<td style="font-size:10pt !important;" class="text-left text-no-wrap">{{__('patient.form_age')}}</td>
<td style="font-size:10pt !important;" class="text-no-wrap text-left">
: {{\App\Helpers\Helpers::getAge($sample->patient->dob, $sample->admission_date)}}, {{__('sample.form_patient_gender')}}: {{\App\Helpers\Helpers::getGender($sample->patient->gender)}}
</td>
</tr>
<tr>
<td style="font-size:10pt !important;" class="text-left text-no-wrap">{{__('patient.table_phon')}}</td>
<td style="font-size:10pt !important;" class="text-left ">: {{$sample->patient->phone_number}} </td>
<td style="font-size:10pt !important;" class="text-left text-no-wrap">{{__('sample.physician_name')}}</td>
<td style="font-size:10pt !important;" class="text-left ">: {{$sample->physician->name_en}}</td>
</tr>
</tbody>
</table>
</th>
</tr>
</thead>
<tfoot>
<tr>
<td width="100%">
<table width="100%" border="0">
<tbody>
<tr>
<td colspan="4" style="height: 20px;">&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tfoot>
<tbody>
<tr>
<td class="p-0">
<table width="100%" class="table-inv" style="border-collapse: collapse; !important; font-size:10pt !important;">
<tbody>
<tr class="bg-light font-changable">
<!--<td width="8%" class="text-center">{{__('invoice.table_no')}}</td>-->
<td class="text-center">{{__('invoice.form_description')}}</td>
<td width="15%" class="text-center" style="width:110px !important;">{{__('invoice.form_qty')}}</td>
<td width="15%" class="text-center" style="width:110px !important;">{{__('invoice.form_unit_price')}}</td>
</tr>
@foreach($grouped as $k=>$testSample)
@foreach($testSample as $l=>$ts)
<tr>
<td style="padding:0 5px; font-weight:bold; font-size:13px !important;" colspan="3" class="font-changable border-1">{{$l}}</td>
</tr>
@foreach($ts as $r=>$v)
<tr>
<td style="padding:0 5px; padding-left:15px !important;" class="font-changable border-1"><p class="value-pair line-height"></p><span style="background:#fff; position: relative;">{{$v['test_name']}}</span></td>
<td style="padding:0 5px;" class="text-center font-changable border-1">{{(int)$v['qty']}}</td>
<td style="padding:0 5px;" class="text-right font-changable border-1">{{$v['unit_price']}}</td>
</tr>
@endforeach
@endforeach
@endforeach
@for($i=$total; $i<=19; $i++)
<tr>
<td style="padding:0 5px; padding-left:15px !important;" class="font-changable border-1"><i style="position: absolute;">&nbsp;</td>
<td style="padding:0 5px;" class="text-center font-changable border-1"></td>
<td style="padding:0 5px;" class="text-right font-changable border-1"></td>
</tr>
@endfor
<tr class="font-changable">
<td class="text-left " colspan="3" style="border-left: 0px; border-right:0px;"><span style="padding-left: 10px !important;">{{$invoice->invoice_note}}</span></td>
</tr>
<tr class="font-changable">
<td class="text-left border-0" height="20px"><span style="padding-left: 30px !important;">{{__('invoice.table_invoice_date')}}: {{date('d-m-Y',strtotime($invoice->invoice_date))." ".date('H:i:s')}}</span></td>
<td class="text-right border-0">{{__('invoice.table_total_cost')}} ($) :</td>
<td class="text-right bg-light"> {{number_format($invoice->total,2)}}</td>
</tr>
@if($invoice->is_hide_discount == 0)
<tr class="font-changable">
<td class="text-left border-0"></td>
<td class="text-right border-0">{{__('invoice.table_discount')}} ({{$labSettings->discount_type==1? '%' : '$'}}):</td>
<td class="text-right bg-light"> {{ ($invoice->discount_type==1 ? $invoice->discount : number_format($invoice->discount,2))}}</td>
<!--<td class="text-right bg-light"> {{ ($invoice->discount_type==1 ? ($invoice->discount > 0? number_format($invoice->total * (1-($invoice->discount/100))) : 0) : number_format($invoice->discount,2))}}</td>-->
</tr>
<tr class="font-changable">
<td class="text-left border-0"></td>
<td class="text-right border-0">{{__('invoice.table_net_cost')}} :</td>
<td class="text-right bg-light"> {{number_format(($invoice->gross_total) ,2)}}</td>
</tr>
<tr class="font-changable">
<td class="text-left border-0"><span style="padding-left: 70px !important;">{{__('invoice.received_by')}}</span></td>
<td class="text-right border-0">{{__('invoice.table_net_cost_riel')}} :</td>
<td class="text-right bg-light"> {{number_format((($invoice->gross_total) * ($invoice->exchange_rate <=0 ? $labSettings->exchange_rate : $invoice->exchange_rate)),2)}}</td>
</tr>
@else
<tr class="font-changable">
<td class="text-left border-0"></td>
<td class="text-right border-0">{{__('invoice.table_net_cost')}} :</td>
<td class="text-right bg-light"> {{number_format(($invoice->total) ,2)}}</td>
</tr>
<tr class="font-changable">
<td class="text-left border-0"><span style="padding-left: 70px !important;">{{__('invoice.received_by')}}</span></td>
<td class="text-right border-0">{{__('invoice.table_net_cost_riel')}} :</td>
<td class="text-right bg-light"> {{number_format((($invoice->total) * ($invoice->exchange_rate <=0 ? $labSettings->exchange_rate : $invoice->exchange_rate)),2)}}</td>
</tr>
@endif
</tbody>
</table>
</td>
</tr>
<!-- Comment -->
</tbody>
<!-- Note -->
</table>
<table id="footer" width="100%" border="0" style="padding: 0 10px !important;">
<tbody>
<tr>
<td class="text-center text-no-wrap" style="width: 3cm">
</td>
<td style="width: 4cm"></td>
<td class="text-center text-no-wrap" style="width: 4cm; padding-left: 20px"></td>
</tr>
<tr>
<td colspan="3" style="padding-top: 15px; !important;">&nbsp;</td>
</tr>
<tr class="result-footer-signature">
<td class="text-center text-no-wrap" style="padding: 0 10px !important;">
</td>
<td class="text-center text-no-wrap"></td>
<td class="text-center text-no-wrap"></td>
</tr>
</tbody>
</table>
</div>
</div>
</page>
</div>
</div>
</div>

View File

@@ -0,0 +1,408 @@
<div class="modal fade" id="print_invoice_modal_a4" style="padding-top: 40px; background: rgba(0, 0, 0, 0.54); overflow: auto; padding-left: 17px;">
<div class="print-preview-header">
<div class="presult-pagination d-none">
<input type="text" class="page-number" value="1" onfocus="this.select()"> /
<span class="page-count">1</span>
</div>
<ul>
<li style="display: inline-block;" class="print">
<a href="javascript:void(0)" onclick="printJS('presult-a4', 'html')" id="doPrinting"><i class="fa fa-print"></i>&nbsp;<b>{{__('invoice.print')}}</b></a>
</li>
</ul>
<span class="close-preview" data-dismiss="modal" title="Close"><i class="fa fa-times"></i></span>
</div>
<div class="modal-dialog modal-xxl A4-portrait">
<div class="psample-result active" id="presult-a4">
<title>Result</title>
<meta name="viewport" content="width=device-width, initial-scale=.5, maximum-scale=12.0, minimum-scale=.25, user-scalable=yes">
<style>
@php
$configures = collect($labConfigures);
$fontNameHeader = ($configures->where('atrribute_code', 'FONT_NAME_FOR_RESULT_HEADER')->pluck('assigned_attribute_value')->first());
$fontSizeHeader = ($configures->where('atrribute_code', 'FONT_SIZE_FOR_RESULT_HEADER')->pluck('assigned_attribute_value')->first());
$resultColorHeader = ($configures->where('atrribute_code', 'COLOR_FOR_RESULT_HEADER')->pluck('assigned_attribute_value')->first());
$fontName = ($configures->where('atrribute_code', 'FONT_NAME_FOR_RESULT')->pluck('assigned_attribute_value')->first());
$fontSize = ($configures->where('atrribute_code', 'FONT_SIZE_FOR_RESULT')->pluck('assigned_attribute_value')->first());
$resultColor = ($configures->where('atrribute_code', 'COLOR_FOR_RESULT')->pluck('assigned_attribute_value')->first());
@endphp
.patient-info tr td{
/*font-family: '{{(empty($fontNameHeader) ? 'Times New Roman':$fontNameHeader)}}' !important;*/
font-family: "{{(App::isLocale('en') ? (empty($fontNameHeader) ? 'Times New Roman':$fontNameHeader) : 'Khmer OS Siemreap')}}";
font-size:10px !important;
}
#print_invoice_modal_a4 .font-changeable{
/*font-family: '{{(empty($fontName) ? 'Times New Roman':$fontName)}}' !important;*/
font-family: "{{(App::isLocale('en') ? (empty($fontNameHeader) ? 'Times New Roman':$fontNameHeader) : 'Khmer OS Siemreap')}}";
}
#print_invoice_modal_a4 table td, #print_invoice_modal_a4 table th{
padding: 3px !important; font-size:10pt !important;
}
@font-face {
font-family: 'KhmerOS_muollight';
src: url('{{url(env("APP_URL").'storage/assets/fonts/KhmerOS_muollight.ttf')}}');
font-display: swap;
}
.KhmerMoulLight {
font-family: 'SourceSerifPro-Regular', 'KhmerOS_muollight', 'serif';
}
#print_invoice_modal_a4 page[size="A4"] {
background: white;
width: 21cm;
/*width: 297mm;*/
display: block;
margin: 10px auto;
box-shadow: 0 0 0.5cm rgba(0,0,0,0.5);
padding: 1mm;
font-family: 'SourceSerifPro-Regular', 'Noto Sans Khmer', 'serif';*/
/*font-family: '{{(empty($fontNameHeader) ? 'Times New Roman':$fontNameHeader)}}' !important;*/
font-size: 8pt;
line-height: 10px;
page-break-after: always;
}
#print_invoice_modal_a4 table th, #print_invoice_modal_a4 table td {
text-align: left;
padding-left: 5px !important;
padding-right: 5px !important;
}
#print_invoice_modal_a4 table td {
font-weight: normal;
}
table.patient-info, table.department-sample-info {
border: 1px solid #7a7a7a;
line-height: 18px;
padding: 3px;
}
#print_invoice_modal_a4 table.patient-info td, #print_invoice_modal_a4 table.patient-info th {
vertical-align: top;
}
.text-center {
text-align: center;
}
.text-left {
text-align: left;
}
.text-right {
text-align: right;
}
#print_invoice_modal_a4 .text-top {
vertical-align: top;
}
#print_invoice_modal_a4 .text-no-wrap {
white-space: nowrap;
}
#print_invoice_modal_a4 table.test-result {
line-height: 16px;
}
#footer {
line-height: 17px;
}
#footer .laboratory-address td {
border-top: 1px solid black;
padding-top: 10px;
}
#footer .result-footer-signature td {
vertical-align: top;
padding-bottom: 60px;
}
#print_invoice_modal_a4 @page {
margin: 0.5cm;
}
#print_invoice_modal_a4 @media print {
body,
page[size="A4"] {
box-shadow: none;
background-color: #fff;
}
#print_invoice_modal_a4 @page {
size: A4 portrait;
margin: 0.5cm 0.5cm 0;
padding: 0;
}
#print_invoice_modal_a4 @page {
size: 297mm 210mm portrait;
margin: 0.5cm 0.5cm 0;
padding: 0;
}
#print_invoice_modal_a4 @page {
size: 16.5in 11.7in portrait;
margin: 0.5cm 0.5cm 0;
padding: 0;
}
#print_invoice_modal_a4 tbody.sample-result {
page-break-inside: avoid;
}
#print_invoice_modal_a4 #footer {
display: block;
position: fixed;
bottom: 0;
}
.font-changable{
/*font-family: "{{(App::isLocale('en') ? 'Times New Roman' : 'Khmer OS Siemreap')}}";*/
/*font-family: '{{(empty($fontNameHeader) ? 'Times New Roman':$fontNameHeader)}}' !important;*/
font-family: "{{(App::isLocale('en') ? (empty($fontNameHeader) ? 'Times New Roman':$fontNameHeader) : 'Khmer OS Siemreap')}}";
}
#print_invoice_modal_a4 .table-inv th, #print_invoice_modal_a4 .table-inv td {
padding: 3px !important;
}
}
#print_invoice_modal_a4 .table-inv th, #print_invoice_modal_a4 .table-inv td {
border: 1px solid black;
border-collapse: collapse;
padding: 3px !important;
}
.bg-light{
background: #e8e8e8 !important;
}
.border-0{
border:none !important;
}
.border-1{
border: 1px solid #ffffff !important;
}
.font-changable{
/*font-family: "{{(App::isLocale('en') ? 'Times New Roman' : 'Khmer OS Siemreap')}}";*/
/*font-family: '{{(empty($fontNameHeader) ? 'Times New Roman':$fontNameHeader)}}' !important;*/
font-family: "{{(App::isLocale('en') ? (empty($fontNameHeader) ? 'Times New Roman':$fontNameHeader) : 'Khmer OS Siemreap')}}";
}
#print_invoice_modal_a4 .table-inv tr td{
font-size:11px !important;
}
p.value-pair {
position: relative;
width: 100%;
margin: 0;
line-height: 0.7rem !important;
}
p.value-pair:before {
content: '';
display: block;
position: absolute;
width: 100%;
/*bottom: .25rem;*/
bottom: -0.6rem !important;
height: 0;
line-height: 0;
border-bottom: 2px dotted #858585;
}
</style>
<page size="A4">
<div style="width: 21cm; padding: 0px; background-image: linear-gradient(#fafafa, #fafafa); background-size: 1px 100%; background-repeat: no-repeat; background-position: 49.6% center;">
<?php
$grouped = [];
foreach($invoice->invoiceDetail->sortBy('weight') as $r=>$d)
{
$departmentId = $d->testSample->sample->department->name_en;
$sampleTypeId = $d->testSample->sample->name_en;
if (!isset($grouped[$departmentId])) {
$grouped[$departmentId] = [];
}
if (!isset($grouped[$departmentId][$sampleTypeId])) {
$grouped[$departmentId][$sampleTypeId] = [];
}
// Add the item to the appropriate group
$grouped[$departmentId][$sampleTypeId][] = $d->toArray();
}
?>
<div style="width: 100%; display: inline-block; clear: both; vertical-align: top;">
<table border="0" width="100%" style="font-size: 8pt !important;">
<thead>
<tr>
<td style="width:100%; text-align: center">
@if((!empty($sample->physician->logo)) && ($sample->lab_id!=22))
<img width="100%" class="rounded-0" src="{{url(env("APP_URL").'storage/images/physician/'.$sample->physician->logo)}}" />
@else
<table width="100%">
<tr>
<td style="width:70px; vertical-align: top;" class="text-center">
<img src="{{url(env("APP_URL").'storage/images/avatars/labs/'.$labSettings->logo)}}" alt="Logo" style="width: 70px;">
</td>
<td class="text-center">
<p style="line-height: 13px !important; font-size: 12pt; font-weight: bold;" class="KhmerMoulLight ">{{$labSettings->name_kh}}</p>
<font style="line-height: 13px !important; font-size: 9pt; font-weight: bold;" class="text-uppercase ">{{$labSettings->name_en}}</font><br>
<font class="font-changeable" style="line-height: 20px !important;font-size: 8pt;">{{ app()->getLocale()=='kh' ? $labSettings->address_kh : $labSettings->address_en}} </font>
<br><font style="line-height: 9px !important;font-size: 8pt;">{{$labSettings->phone_number}}<br>{{$labSettings->email}}</font>
</td>
<td style="width:80px; vertical-align: bottom;" >
<div class="visible-print text-center">
@if($labSettings->shareable_lab_result==1)
{!! QrCode::size(60)->generate(url('/shared/lab-result/'.$sample_id)); !!}
@endif
</div>
</td>
</tr>
</table>
@endif
</td>
</tr>
<tr>
<td class="text-top text-center">
<div style="font-size: 11.5pt; font-weight: 700;" class="font-changeable">{{__('invoice.tittle')}}</div>
</td>
</tr>
<tr>
<th class="p-0">
<table width="100%" class="patient-info font-changable" style="line-height: 15px !important;">
<tbody>
<tr>
<td class="text-left" style="font-size:10pt !important;" width="20%">{{__('invoice.form_invoice_number')}}</td>
<td class="text-left" style="font-size:10pt !important;" width="30%">: {{$invoice->invoice_code}}</td>
<td class="text-left" style="font-size:10pt !important;" width="20%">{{__('sample.table_sample_number')}}</td>
<td class="text-left" style="font-size:10pt !important;" width="30%">: {{$sample->sample_number}}</td>
</tr>
<tr>
<td style="font-size:10pt !important;" class="text-left text-no-wrap">{{__('invoice.table_patient_name')}}</td>
<td style="font-size:10pt !important;" class="text-left ">: {{$sample->patient->name_en}}</td>
<td style="font-size:10pt !important;" class="text-left text-no-wrap">{{__('patient.form_age')}}</td>
<td style="font-size:10pt !important;" class="text-no-wrap text-left">
: {{\App\Helpers\Helpers::getAge($sample->patient->dob, $sample->admission_date)}}, {{__('sample.form_patient_gender')}}: {{\App\Helpers\Helpers::getGender($sample->patient->gender)}}
</td>
</tr>
<tr>
<td style="font-size:10pt !important;" class="text-left text-no-wrap">{{__('patient.table_phon')}}</td>
<td style="font-size:10pt !important;" class="text-left ">: {{$sample->patient->phone_number}} </td>
<td style="font-size:10pt !important;" class="text-left text-no-wrap">{{__('sample.physician_name')}}</td>
<td style="font-size:10pt !important;" class="text-left ">: {!!$sample->physician->name_en!!}</td>
</tr>
</tbody>
</table>
</th>
</tr>
</thead>
<tfoot>
<tr>
<td width="100%">
<table width="100%" border="0">
<tbody>
<tr>
<td colspan="4" style="height: 20px;">&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tfoot>
<tbody>
<tr>
<td class="p-0">
<table width="100%" class="table-inv" style="border-collapse: collapse; !important; font-size:10pt !important;">
<tbody>
<tr class="bg-light font-changable">
<!--<td width="8%" class="text-center">{{__('invoice.table_no')}}</td>-->
<td class="text-center">{{__('invoice.form_description')}}</td>
<td width="17%" class="text-center" style="width:120px !important;">{{__('invoice.form_qty')}}</td>
<td width="17%" class="text-center" style="width:115px !important;">{{__('invoice.form_unit_price')}}</td>
</tr>
<?php $total = 0;?>
@foreach($grouped as $k=>$testSample)
@foreach($testSample as $l=>$ts)
<tr>
<td style="padding:0 5px; font-weight:bold; font-size:13px !important;" colspan="3" class="font-changable border-1">{{$l}}</td>
</tr>
@foreach($ts as $r=>$v)
<?php $total++;?>
<tr>
<td style="padding:0 5px; padding-left:15px !important;" class="font-changable border-1"><p class="value-pair line-height"></p><span style="background:#fff; position: relative;">{{$v['test_name']}}</span></td>
<td style="padding:0 5px;" class="text-center font-changable border-1">{{(int)$v['qty']}}</td>
<td style="padding:0 5px;" class="text-right font-changable border-1">{{$v['unit_price']}}</td>
</tr>
@endforeach
@endforeach
@endforeach
@for($i=$total; $i<=19; $i++)
<tr>
<td style="padding:0 5px; padding-left:15px !important;" class="font-changable border-1"><i style="position: absolute;">&nbsp;</td>
<td style="padding:0 5px;" class="text-center font-changable border-1"></td>
<td style="padding:0 5px;" class="text-right font-changable border-1"></td>
</tr>
@endfor
<tr class="font-changable" style="border-bottom: 1pt solid black" >
<td class="text-left" colspan="3" style="border-left: 0px; border-right:0px;"><span style="padding-left: 10px !important;">{{$invoice->invoice_note}}</span></td>
</tr>
<tr class="font-changable">
<td class="text-left border-0" height="20px"><span style="padding-left: 30px !important;">{{__('invoice.table_invoice_date')}}: {{date('d-m-Y',strtotime($invoice->invoice_date))." ".date('H:i:s')}}</span></td>
<td class="text-right border-0">{{__('invoice.table_total_cost')}} ($):</td>
<td class="text-right bg-light"> {{number_format($invoice->total,2)}}</td>
</tr>
<tr class="font-changable">
<td class="text-left border-0"></td>
<td class="text-right border-0">{{__('invoice.table_discount')}} ({{$labSettings->discount_type==1? '%' : '$'}}):</td>
<td class="text-right bg-light"> {{ ($invoice->discount_type==1 ? $invoice->discount : number_format($invoice->discount,2))}}</td>
<!--<td class="text-right bg-light"> {{ ($invoice->discount_type==1 ? ($invoice->discount > 0? number_format($invoice->total * (1-($invoice->discount/100))) : 0) : number_format($invoice->discount,2))}}</td>-->
</tr>
<tr class="font-changable">
<td class="text-left border-0"></td>
<td class="text-right border-0">{{__('invoice.table_net_cost')}}:</td>
<td class="text-right bg-light"> {{number_format(($invoice->gross_total) ,2)}}</td>
</tr>
<tr class="font-changable">
<td class="text-left border-0"><span style="padding-left: 70px !important;">{{__('invoice.received_by')}}</span></td>
<td class="text-right border-0">{{__('invoice.table_net_cost_riel')}}:</td>
<td class="text-right bg-light"> {{number_format((($invoice->gross_total) * ($invoice->exchange_rate <=0 ? $labSettings->exchange_rate : $invoice->exchange_rate)),2)}}</td>
</tr>
</tbody>
</table>
</td>
</tr>
<!-- Comment -->
</tbody>
<!-- Note -->
</table>
<table id="footer" width="100%" border="0" style="padding: 0 10px !important;">
<tbody>
<tr>
<td class="text-center text-no-wrap" style="width: 3cm">
</td>
<td style="width: 4cm"></td>
<td class="text-center text-no-wrap" style="width: 4cm; padding-left: 20px"></td>
</tr>
<tr>
<td colspan="3" style="padding-top: 15px; !important;">&nbsp;</td>
</tr>
<tr class="result-footer-signature">
<td class="text-center text-no-wrap" style="padding: 0 10px !important;">
</td>
<td class="text-center text-no-wrap"></td>
<td class="text-center text-no-wrap"></td>
</tr>
</tbody>
</table>
</div>
</div>
</page>
</div>
</div>
</div>