@extends('backend.layouts.app') @section('title') {{ __($module_title) }} @endsection @section('content')
@php use Carbon\Carbon; @endphp

{{ __('messages.invoice_id') }}: #{{ $billing['encounter_id'] ?? '--' }}

{{ __('messages.payment_status') }} @if ($billing['payment_status'] == 1) {{ __('messages.paid') }} @elseif(optional(optional(optional($billing->patientencounter)->appointmentdetail)->appointmenttransaction)->advance_payment_status) {{ __('appointment.advance_paid') }} @elseif(optional(optional(optional($billing->patientencounter)->appointmentdetail)->appointmenttransaction) == null) {{ __('appointment.failed') }} @else {{ __('messages.unpaid') }} @endif

{{ __('messages.date') }}: {{ isset($billing['created_at']) ? Carbon::parse($billing['created_at'])->timezone($timezone)->format($dateformate) . ' At ' . Carbon::parse($billing['created_at'])->timezone($timezone)->format($timeformate) : '-- At --' }}

Clinic Info
image
{{ $billing['clinic']['name'] ?? '--' }}
{{ $billing['clinic']['email'] ?? '--' }}
{{ $billing['clinic']['address'] ?? '--' }}
{{ $billing['clinic']['contact_number'] ?? '--' }}
{{ __('messages.doctor_details') }}
image
Dr. {{ $billing['doctor']['full_name'] ?? '--' }}
{{ $billing['doctor']['email'] ?? '--' }}
{{ $billing['doctor']['mobile'] ?? '--' }}
{{ __('messages.patient_detail') }}
image
{{ $billing['user']['first_name'] . '' . $billing['user']['last_name'] ?? '--' }}
@if ($billing['user']['gender'] !== null)
{{ $billing['user']['gender'] ?? '--' }}
@endif @if ($billing['user']['date_of_birth'] !== null)
{{ date($dateformate, strtotime($billing['user']['date_of_birth'])) ?? '--' }}
@endif
{{ __('messages.service') }}
{{ __('messages.service_name') }} {{ $billing['clinicservice']['name'] ?? '--' }}
{{ __('messages.price') }} {{ Currency::format($billing['service_amount']) ?? '--' }}

@if (!empty($billing['billingItem']) && $billing['billingItem']->isNotEmpty())
{{ __('messages.service') }}
@php $index = 1 @endphp @foreach ($billing['billingItem'] as $item) @if ($item->discount_type === 'percentage') @else @endif @php $index++ @endphp @endforeach
{{ __('messages.sr_no') }} {{ __('messages.service_name') }} {{ __('messages.price') }} {{ __('messages.discount') }} {{ __('service.inclusive_tax') }} {{ __('messages.total') }}
{{ $index }} {{ $item->item_name ?? '--' }} {{ Currency::format($item->service_amount) . ' * ' . $item->quantity ?? '--' }} {{ $item->discount_value ?? '--' }}% {{ Currency::format($item->discount_value) ?? '--' }}{{ Currency::format($item->inclusive_tax_amount) ?? '--' }} {{ Currency::format($item->total_amount) ?? '--' }}
@else

{{ __('messages.no_record_found') }}

@endif @if ($billing['tax_data'] !== null) @php $tax = $billing['tax_data']; $taxData = json_decode($tax, true); $total_amount = 0; // $total_amount = $billing['service_amount'] ?? 0; @endphp @foreach ($billing['billingItem'] as $item) @php $total_amount += $item->total_amount; // Sum up service amounts @endphp @endforeach
{{ __('report.lbl_taxes') }}
{{ __('messages.total') }}
{{ Currency::format($total_amount) }}
@php $amount_total = 0; // $discount_total = $billing['discount_value'] ?? 0; // $discount_amount = $billing['discount_amount'] ?? 0; $discount_total = $billing['final_discount_value'] ?? 0; if ($billing['final_discount_type'] == 'percentage') { $discount_amount = $total_amount * ($billing['final_discount_value'] / 100); } else { $discount_amount = $billing['final_discount_value']; } // $discount_amount = $billing['discount_amount'] ?? 0; $amount_due = $total_amount - $discount_amount ?? 0; $subtotal = $total_amount - $discount_amount ?? 0; @endphp @foreach ($taxData as $taxPercentage) @php //$percentagetax = ($billing['service_amount'] - $billing['discount_amount']) * $taxPercentage['value'] / 100; $percentagetax = ($subtotal * $taxPercentage['value']) / 100; $amount_total += $taxPercentage['type'] == 'fixed' ? $taxPercentage['value'] : $percentagetax; $amount_due = $subtotal + $amount_total; @endphp @endforeach
{{ __('messages.discount') }} (@if ($billing['final_discount_type'] === 'percentage') {{ $discount_total ?? '--' }}% @else {{ Currency::format($discount_total) ?? '--' }} @endif) - {{ Currency::format($discount_amount) ?? '--' }}
{{ __('booking.sub_total') }}
{{ Currency::format($subtotal) }}
@foreach ($taxData as $taxPercentage) @php $taxTitle = $taxPercentage['title']; $percentagetax = ($subtotal * $taxPercentage['value']) / 100; $taxAmount = $taxPercentage['type'] == 'fixed' ? Currency::format($taxPercentage['value']) : $percentagetax; @endphp
@if ($taxPercentage['type'] == 'fixed') {{ $taxTitle }} ({{ $taxAmount ?? '--' }}) @else {{ $taxTitle }} ({{ $taxPercentage['value'] ?? '--' }}%) @endif
@if ($taxPercentage['type'] == 'fixed') {{ $taxAmount ?? '--' }} @else {{ Currency::format($taxAmount) ?? '--' }} @endif
@endforeach @if ($billing['final_total_amount'] == null)
{{ __('messages.grand_total') }}
{{ Currency::format(optional(optional($billing->patientencounter)->appointmentdetail)->total_amount) ?? '--' }}
@else
{{ __('messages.grand_total') }}
{{ Currency::format($billing['final_total_amount']) ?? '--' }}
@endif @php $advance_paid_amount = optional(optional($billing->patientencounter)->appointmentdetail)->advance_paid_amount; $remaining_payable_amount = $amount_due - $advance_paid_amount; @endphp @if (optional(optional(optional($billing->patientencounter)->appointmentdetail)->appointmenttransaction)->advance_payment_status == 1)
{{ __('service.advance_payment_amount') }}({{ optional(optional($billing->patientencounter)->appointmentdetail)->advance_payment_amount }}%)
{{ Currency::format(optional(optional($billing->patientencounter)->appointmentdetail)->advance_paid_amount) ?? '--' }}
@if (optional(optional(optional($billing->patientencounter)->appointmentdetail)->appointmenttransaction)->advance_payment_status == 1 && optional(optional($billing->patientencounter)->appointmentdetail)->status == 'checkout')
  • {{ __('service.remaining_amount') }}{{ __('appointment.paid') }} {{ Currency::format($remaining_payable_amount) ?? '--' }}
  • @endif @endif
    @endif
    @endsection @push('after-styles') @endpush @push('after-scripts') @endpush