Files
hpt_inventory/resources/views/modal/preview_vaccination_invoice.blade.php
2026-06-10 16:42:20 +07:00

481 lines
30 KiB
PHP

<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;
}
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') ? (empty($fontNameHeader) ? 'Times New Roman':$fontNameHeader) : 'Khmer OS Siemreap')}}";
}
}
#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') ? (empty($fontNameHeader) ? 'Times New Roman':$fontNameHeader) : 'Khmer OS Siemreap')}}";
}
.font-header{
font-family: "{{(App::isLocale('en') ? 'Times New Roman': 'Khmer OS Siemreap')}}";
}
.font-changeable{
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">
<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-header" style="line-height: 20px !important;">{{ app()->getLocale()=='kh' ? $labSettings->address_kh : $labSettings->address_en}} </p>
<p style="line-height: 9px !important; font-size:9pt !important;">{{$labSettings->phone_number}} {{$labSettings->email}}</p>
</td>
<td style="width:70px; vertical-align: top;" class="text-center">
&nbsp;
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="text-top text-center">
<div style="font-size: 11.5pt; font-weight: 700;" class="font-changeable">{{__('vaccination.invoice_title')}}</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:9pt !important;" width="30%">: {{$vaccinations->invoice_code}}</td>
<td class="text-left" style="font-size:10pt !important;" width="20%">{{__('Date')}}</td>
<td class="text-left" style="font-size:10pt !important;" width="30%">: {{date('d-m-Y',strtotime($vaccinations->vaccination_date))}}</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 ">: {{$vaccinations->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($vaccinations->patient->dob, $vaccinations->vaccination_date)}}, {{__('sample.form_patient_gender')}}: {{\App\Helpers\Helpers::getGender($vaccinations->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 ">: {{$vaccinations->patient->phone_number}} </td>
<td style="font-size:10pt !important;" class="text-left text-no-wrap">{{__('Next Visit')}}</td>
<td style="font-size:10pt !important;" class="text-left ">: {{date('d-m-Y',strtotime($vaccinations->next_visit_date))}}</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="8%" class="text-center" style="width:90px !important;">{{__('invoice.form_unit_price')}}</td>
</tr>
<?php $total = 0;?>
@foreach($vaccinations->vaccinationDetail as $k=>$invItem)
<?php $total+= $invItem->unit_price;?>
<tr>
<td class=" text-center">{{$k+1}}</td>
<td class="font-changable" style="font-size:12px !important;">{{@$invItem->vaccineItem->medicine->name}}</td>
<td class="text-right ">{{$invItem->qty}}</td>
<td class="text-right ">$ {{$invItem->unit_price}}</td>
</tr>
@endforeach
<tr class="font-changable">
<td class="text-left " colspan="4"><span style="padding-left: 10px !important;"></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($vaccinations->vaccination_date))}}</span></td>
<td class="text-right border-0">{{__('invoice.table_total_cost')}} ($) :</td>
<td class="text-right bg-light"> {{number_format($vaccinations->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')}} (%) :</td>
<td class="text-right bg-light"> {{number_format($vaccinations->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($vaccinations->gross_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((($vaccinations->gross_total) * ($vaccinations->exchange_rate <=0 ? $labSettings->exchange_rate : $vaccinations->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>
<p style="line-height: 13px !important; font-size: 9pt; font-weight: bold;" class="text-uppercase ">{{$labSettings->name_en}}</p>
<p class="font-header" style="line-height: 20px !important;">{{ app()->getLocale()=='kh' ? $labSettings->address_kh : $labSettings->address_en}} </p>
<p style="line-height: 9px !important; font-size:9pt !important;">{{$labSettings->phone_number}} {{$labSettings->email}}</p>
</td>
<td style="width:70px; vertical-align: top;" class="text-center">
&nbsp;
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="text-top text-center">
<div style="font-size: 11.5pt; font-weight: 700;" class="font-changeable">{{__('vaccination.invoice_title')}}</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:9pt !important;" width="30%">: {{$vaccinations->invoice_code}}</td>
<td class="text-left" style="font-size:10pt !important;" width="20%">{{__('Date')}}</td>
<td class="text-left" style="font-size:10pt !important;" width="30%">: {{date('d-m-Y',strtotime($vaccinations->vaccination_date))}}</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 ">: {{$vaccinations->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($vaccinations->patient->dob, $vaccinations->vaccination_date)}}, {{__('sample.form_patient_gender')}}: {{\App\Helpers\Helpers::getGender($vaccinations->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 ">: {{$vaccinations->patient->phone_number}} </td>
<td style="font-size:10pt !important;" class="text-left text-no-wrap">{{__('Next Visit')}}</td>
<td style="font-size:10pt !important;" class="text-left ">: {{date('d-m-Y',strtotime($vaccinations->next_visit_date))}}</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="0%" class="text-center" style="width:90px !important;">{{__('invoice.form_unit_price')}}</td>
</tr>
<?php $total = 0;?>
@foreach($vaccinations->vaccinationDetail as $k=>$invItem)
<?php $total+= $invItem->unit_price;?>
<tr>
<td class=" text-center">{{$k+1}}</td>
<td class="font-changable" style="font-size:12px !important;">{{@$invItem->vaccineItem->medicine->name}}</td>
<td class="text-right ">{{$invItem->qty}}</td>
<td class="text-right ">$ {{$invItem->unit_price}}</td>
</tr>
@endforeach
<tr class="font-changable">
<td class="text-left " colspan="4"><span style="padding-left: 10px !important;"></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($vaccinations->vaccination_date))}}</span></td>
<td class="text-right border-0">{{__('invoice.table_total_cost')}} ($) :</td>
<td class="text-right bg-light"> {{number_format($vaccinations->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')}} (%) :</td>
<td class="text-right bg-light"> {{number_format($vaccinations->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($vaccinations->gross_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((($vaccinations->gross_total) * ($vaccinations->exchange_rate <=0 ? $labSettings->exchange_rate : $vaccinations->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>