@if ($appointment->patientEncounter == null)
@endif
@if (
$appointment->patientEncounter !== null &&
optional(optional($appointment->patientEncounter)->billingrecord)->billingItem != null)
@foreach (optional(optional($appointment->patientEncounter)->billingrecord)->billingItem as $billingItem)
{{ optional($billingItem->clinicservice)->name }}
{{ optional($billingItem->clinicservice)->description ?? ' ' }}
@php
if ($billingItem->discount_type === 'percentage') {
$payable_Amount =
$billingItem->service_amount -
$billingItem->service_amount * ($billingItem->discount_value / 100);
} else {
$payable_Amount = $billingItem->service_amount - $billingItem->discount_value;
}
@endphp
@if ($billingItem->discount_value > 0)
{{ Currency::format($billingItem->total_amount) }} *
{{ $billingItem->quantity }} =
{{ Currency::format($billingItem->total_amount * $billingItem->quantity) }}
@if ($billingItem->discount_type === 'percentage')
({{ $billingItem->discount_value ?? '--' }}% off)
@else
({{ Currency::format($billingItem->discount_value) ?? '--' }}
off)
@endif
@if($billingItem->inclusive_tax_amount > 0)
{{ __('messages.lbl_with_inclusive_tax') }}
@endif
{{ Currency::format($billingItem->service_amount * $billingItem->quantity) }}
@else
{{ Currency::format($billingItem->total_amount) }} *
{{ $billingItem->quantity }} =
{{ Currency::format($billingItem->total_amount * $billingItem->quantity) }}
@if($billingItem->inclusive_tax_amount > 0)
{{ __('messages.lbl_with_inclusive_tax') }}
@endif
@endif
{{-- @if (!empty($billingItem->clinicservice->inclusive_tax_price))
@php
$quantity = $billingItem->quantity;
$inclusive_tax_price_per_unit = $billingItem->clinicservice->inclusive_tax_price;
$inclusive_tax_price = $inclusive_tax_price_per_unit * $quantity;
$inclusive_tax_data = json_decode($billingItem->clinicservice->inclusive_tax, true);
$service_total = $payable_Amount * $quantity;
$item_subtotal = ($payable_Amount + $inclusive_tax_price_per_unit) * $quantity;
$total_item_tax = 0;
@endphp
-
{{ __('appointment.service_price') }}
{{ Currency::format($service_total) }}
@if (!empty($inclusive_tax_data))
@foreach ($inclusive_tax_data as $t)
@if ($t['type'] == 'percent')
@php
$tax_per_unit = $payable_Amount * $t['value'] / 100 ;
$tax_total = $tax_per_unit * $quantity;
$total_item_tax += $tax_total;
@endphp
-
{{ $t['title'] }} ({{ $t['value'] }}% of {{ Currency::format($payable_Amount) }} × {{ $quantity }})
{{ Currency::format($tax_total) }}
@elseif ($t['type'] == 'fixed')
@php
$tax_total = $t['value'] * $quantity;
$total_item_tax += $tax_total;
@endphp
-
{{ $t['title'] }} ({{ Currency::format($t['value']) }} × {{ $quantity }})
{{ Currency::format($tax_total) }}
@endif
@endforeach
-
{{ __('appointment.sub_total') }}
{{ Currency::format($item_subtotal) }}
@endif
@endif --}}
@endforeach
@endif