@extends('layouts.app') @section('title', $sale_invoice->main_invoice_no . ' - '. ($sale_invoice->invoice_date ? formatedDate($sale_invoice->invoice_date) : '') . ' - ' . ($sale_invoice->getPatient->name ?? '')) @section('pages')
@include('layouts.partials.nav-menu')
Invoice Number : {{ $sale_invoice->voucher_type_invoice_no }}
{{--
--}}
Patient Details

{{-- @dd($sale_invoice); --}} @php $date_of_birth = $sale_invoice->getPatient->account_contact->date_of_birth ?? ''; $age = $date_of_birth != '' ? age($sale_invoice->getPatient->account_contact->date_of_birth) : 0; @endphp
Admission No: {!! $sale_invoice->admission_no ?? '' !!}
Admission DT: {!! $sale_invoice->admission_date_time ?? '' !!}
Patient Name {!! $sale_invoice->getPatient->account_title->name ?? '' !!}{!! $sale_invoice->getPatient->name ?? '' !!} - {!! $sale_invoice->getPatient->code ?? '' !!}
Sex/Age {!! $sale_invoice->getPatient->account_contact->gender->name ?? '' !!}/{!! $age !!} Years
Address {!! $sale_invoice->getPatient->first_account_address->address_line1 ?? '' !!}
State Name {!! $sale_invoice->getPatient->first_account_address->state->name ?? '' !!}
Bed No: {!! $sale_invoice->bed_name ?? '' !!}
@if(isset($sale_invoice->getDoctor))
Doctor Details

Doctor Name {{ ucfirst($sale_invoice->getDoctor->name) }}
Address {{$sale_invoice->getDoctor->first_account_address->address_line1 ?? ''}}
Email {{$sale_invoice->getDoctor->account_contact->email ?? ''}}
Phone No {{$sale_invoice->getDoctor->account_contact->phone_no ?? ''}}
@endif @if(isset($sale_invoice->getCollectionAgent))
Collection Agent Details

Collection Agent Name {{ ucfirst($sale_invoice->getCollectionAgent->name) }}
Address {{$sale_invoice->getCollectionAgent->first_account_address->address_line1 ?? ''}}
Email {{$sale_invoice->getCollectionAgent->account_contact->email ?? ''}}
Phone No {{$sale_invoice->getCollectionAgent->account_contact->phone_no ?? ''}}
@endif @if(isset($sale_invoice->getRefferalLab))
Refferal Lab Details

Refferal Laboratory {{ ucfirst($sale_invoice->getRefferalLab->name) }}
Address {{$sale_invoice->getRefferalLab->first_account_address->address_line1 ?? ''}}
Email {{$sale_invoice->getRefferalLab->account_contact->email ?? ''}}
Phone No {{$sale_invoice->getRefferalLab->account_contact->phone_no ?? ''}}
@endif
@php $total_gst_amount = 0; $IGST = $CGST = $SGST = 0; @endphp @foreach($sale_invoice->getSaleInvoiceDetails as $key => $value) @php $gst = $value->getProduct->getTaxMaster->total_percentage ?? 0; $gst_amount = ($gst > 0 ? (($gst / 100) * $value->total_amount) : 00); $total_gst_amount +=$gst_amount @endphp @php if (isset($value->getProduct->getTaxMaster->getTaxMasterSub)) { foreach($value->getProduct->getTaxMaster->getTaxMasterSub as $tax) { if ($tax->name == 'IGST') { $IGST = $tax->percentage ?? 0; } else if ($tax->name == 'CGST') { $CGST = $tax->percentage ?? 0; } else if ($tax->name == 'SGST') { $SGST = $tax->percentage ?? 0; } } } @endphp @endforeach
Sl.No ITEM NAME & DETAILS HSN/SAC MRP QTY Dis(%) PRICE GST% IGST CGST SGST CESS BASIC TOTAL
{!! $key + 1 !!} {!! $value->getProduct->name ?? '' !!} {!! $value->getProduct->hsncode ?? '' !!} {!! isset($value->getProduct->getProductPrice->mrp) ? convertDecimelPoint($value->getProduct->getProductPrice->mrp) : '' !!} {!! isset($value->main_qty) ? convertDecimelPoint($value->main_qty) : '' !!} {!! isset($value->discount_amount) ? convertDecimelPoint($value->discount_amount) : '' !!} ({!! $value->discount_percentage ?? '' !!}) {!! convertDecimelPoint($value->basic_amount) !!}{!! $gst !!}% ({!! convertDecimelPoint($gst_amount) !!}){!! $IGST !!}% {!! $CGST !!}% {!! $SGST !!}% {!! convertDecimelPoint($value->tax_cess_amount) ?? '' !!} {!! convertDecimelPoint($value->total_amount) ?? '' !!} {!! convertDecimelPoint($value->total_amount + $gst_amount) ?? '' !!}
@foreach($sale_invoice->getSaleInvoiceSubDetail as $key => $value) @php $created_at = $value->getTestPackage->created_at ?? ''; $report_delivery_tat = $value->getTestPackage->report_delivery_tat ?? ''; $report_delivery_date = reportDeliveryDate($created_at,$report_delivery_tat); @endphp @endforeach
Sl.No Test Package Created Date Report Delivery Date
{!! $key + 1 !!} {!! $value->getTestPackage->name ?? '' !!} {!! formatedDate($value->getTestPackage->created_at ?? '') !!} {!! $report_delivery_date ?? '' !!}
@endsection @section('js') @endsection