@if($appointment->patient)
@else
@endif
{{-- accept client and supplier invoice --}}
@if(in_array($appointment->payment_method, [1,2]))
@endif
{{ __('patientappo.pay status') }}
{{-- for invoice payment for client and supplier--}}
@if(in_array($appointment->payment_method, [1,2]))
@if ($appointment->status == 0)
@php
$msg_invoice_debtor = __('basic.not paid');
$text_color_invoice_debtor = 'cancel-color-btn';
@endphp
@elseif ($appointment->status == 1)
@php
$text_color_invoice_debtor = 'pend-color-btn';
$msg_invoice_debtor = __('basic.pending');
@endphp
@elseif ($appointment->status == 2)
@php
$text_color_invoice_debtor = 'prog-color-btn';
$msg_invoice_debtor = __('basic.installment');
@endphp
@elseif ($appointment->status == 3)
@php
$text_color_invoice_debtor = 'done-color-btn';
$msg_invoice_debtor = __('basic.paid');
@endphp
@elseif ($appointment->status == 4)
@php
$msg_invoice_debtor = __('basic.refund');
$text_color_invoice_debtor = 'cancel-color-btn';
@endphp
@endif
@if($appointment->invoice)
{{
$msg_invoice_debtor }}
@endif
@else
{{ __('basic.no invoice') }}
@endif
@if($appointment->sell_debtor)
{{ __('basic.sell to') }}
{{ $appointment->sell_debtor->company_name }}
@endif
{{ __('basic.creator') }}
{{ $appointment->creator->full_name }}
{!! QrCode::color(68, 95,
129)->size(60)->style('round')->eye('circle')->generate($appointment->code) !!}
{{ $appointment->code }}
@php
$total_buy = 0;
$total_sell = 0;
@endphp
{{-- Hotels --}}
@if(count($appointment->hotel) > 0)
{{ __('basic.hotels') }}
@foreach ($appointment->hotel as $item)
@if($item->offer_room)
 }})
@else
 }})
@endif
{{ $item->hotel->name }}
{{ __('basic.room type') . ':'}} {{
$item->room_type->name }}
{{ __('basic.room meal') . ':'}} {{
$item->room_meal->name }}
{{ __('basic.room view') . ':'}} {{
$item->room_view->name }}
{{ __('basic.check in') }}
{{ date('d M Y', strtotime($item->start_at)) }}
{{ __('basic.check out') }}
{{ date('d M Y', strtotime($item->end_at)) }}
{{ __('basic.nights number') }}
{{ $item->nights . ' ' . __('basic.nights') }}
{{ __('basic.quantity') }}
{{ $item->quantity . ' ' . __('basic.rooms') }}
{{-- for invoice payment for client and supplier--}}
@if(in_array($item->payment_method, [1,2]) && $item->invoice_item->invoice_id !== 0)
{{-- for cost wallet --}}
@if($item->cost)
{{-- for cost invoice --}}
@php
$total_buy += $item->cost->final_price;
$buying_price = $item->cost->final_price;
@endphp
@else
@php
$total_buy += 0;
$buying_price = 0;
@endphp
@endif
@php
$total_sell += $item->invoice_item->subtotal;
$selling_price = $item->invoice_item->subtotal;
@endphp
{{-- for no invoice --}}
@else
{{-- for cost wallet --}}
@if($item->cost)
@php
$total_buy += $item->cost->final_price;
$buying_price = $item->cost->final_price;
@endphp
@else
@php
$total_buy += 0;
$buying_price = 0;
@endphp
@endif
@php
$total_sell += $item->invoice_item->subtotal;
$selling_price = $item->invoice_item->subtotal;
@endphp
@endif
{{ __('basic.purchasing price') }}
{{ $buying_price }}
{{ __('basic.selling price') }}
{{ $selling_price }}
{{ __('basic.hotel booking code') }}
{{ $item->code }}
@if ($item->debtor)
{{ __('basic.broker') }}
{{ $item->debtor->company_name }}
@php
$debtor_ur_wa = route('booking_print', $appointment->code);
@endphp
@endif
@if($item->customer_name)
{{ __('basic.traveler name') . ':'}} {{
$item->customer_name }}
{{ __('basic.traveler phone') . ':'}} {{
$item->customer_phone }}
@endif
{{-- for change status --}}
@role('Super-admin|Branch-manager')
@endrole
@endforeach
@endif
{{-- transporation --}}
@if(count($appointment->transportation) > 0)
{{ __('basic.transportations') }}
@foreach ($appointment->transportation as $item)
@if($item->bus_trip)
{{ $item->bus_trip->name }}
@else
{{ $item->vehicle->name }}
@endif
@if($item->fromable)
@php
$from_transp = $item->fromable->name;
@endphp
{{ __('basic.from') . ':'}} {{
$item->fromable->name }}
@else
@php
$from_transp = "";
@endphp
@endif
@if($item->toable)
@php
$to_transp = $item->toable->name;
@endphp
{{ __('basic.to') . ':'}} {{
$item->toable->name }}
@else
@php
$to_transp = "";
@endphp
@endif
{{ __('basic.vehicle') . ':'}} {{
$item->vehicle->name }}
{{ __('basic.check in') }}
{{ date('d M Y h:i A', strtotime($item->start_at)) }}
{{ __('basic.check out') }}
{{ date('d M Y h:i A', strtotime($item->end_at))
}}
@if($item->cat == 1)
{{ __('basic.days number') }}
{{ $item->days . ' ' . __('basic.days') }}
@else
{{ __('basic.tickets') }}
{{ $item->qty . ' ' . __('basic.tickets') }}
{{ __('basic.seat numbers') }}
@foreach ($item->seats as $item_seat)
{{ $item_seat->seat }}
@endforeach
{{ __('basic.numbers') }}
@endif
{{-- accept client and supplier invoice --}}
@if(in_array($item->payment_method, [1,2]) && $item->invoice_item->invoice_id !== 0)
{{-- for cost wallet --}}
@if($item->cost)
{{-- for cost invoice --}}
@php
$total_buy += $item->cost->final_price;
$buying_price = $item->cost->final_price;
@endphp
@else
@php
$total_buy += $item->buy;
$buying_price = $item->buy;
@endphp
@endif
@php
$total_sell += $item->invoice_item->subtotal;
$selling_price = $item->invoice_item->subtotal;
@endphp
{{-- for no invoice --}}
@else
{{-- for cost wallet --}}
@if($item->cost)
@php
$total_buy += $item->cost->final_price;
$buying_price = $item->cost->final_price;
@endphp
@else
@php
$total_buy += $item->buy;
$buying_price = $item->buy;
@endphp
@endif
@php
$total_sell += $item->invoice_item->subtotal;
$selling_price = $item->invoice_item->subtotal;
@endphp
@endif
{{ __('basic.purchasing price') }}
{{ $buying_price }}
{{ __('basic.selling price') }}
{{ $selling_price }}
{{ __('basic.transport booking code') }}
{{ $item->code }}
@if ($item->debtor)
{{ __('basic.broker') }}
{{ $item->debtor->company_name }}
@if($item->cost)
@endif
@php
$debtor_ur_wa = route('booking_print', $appointment->code);
@endphp
@endif
@if($item->customer_name)
{{ __('basic.traveler name') . ':'}} {{
$item->customer_name }}
{{ __('basic.traveler phone') . ':'}} {{
$item->customer_phone }}
@endif
@endforeach
@endif
{{-- visa --}}
@if(count($appointment->visa) > 0)
{{ __('basic.visas') }}
@foreach ($appointment->visa as $item)
{{ __('basic.arrival date') }}
{{ date('d M Y h:i A', strtotime($item->start_at)) }}
{{ __('basic.duration') }}
{{ $item->duration . ' ' . __('basic.days') }}
{{-- accept client and supplier invoice --}}
@if(in_array($item->payment_method, [1,2]) && $item->invoice_item->invoice_id !== 0)
{{-- for cost wallet --}}
@if($item->cost)
{{-- for cost invoice --}}
@php
$total_buy += $item->cost->final_price;
$buying_price = $item->cost->final_price;
@endphp
@else
@php
$total_buy += 0;
$buying_price = 0;
@endphp
@endif
@php
$total_sell += $item->invoice_item->subtotal;
$selling_price = $item->invoice_item->subtotal;
@endphp
{{-- for no invoice --}}
@else
{{-- for cost wallet --}}
@if($item->cost)
@php
$total_buy += $item->cost->final_price;
$buying_price = $item->cost->final_price;
@endphp
@else
@php
$total_buy += 0;
$buying_price = 0;
@endphp
@endif
@php
$total_sell += $item->invoice_item->subtotal;
$selling_price = $item->invoice_item->subtotal;
@endphp
@endif
{{ __('basic.purchasing price') }}
{{ $buying_price }}
{{ __('basic.selling price') }}
{{ $selling_price }}
{{ __('basic.transport booking code') }}
{{ $item->code }}
@if ($item->debtor)
{{ __('basic.broker') }}
{{ $item->debtor->company_name }}
@if($item->cost)
@endif
@php
$debtor_ur_wa = route('booking_print', $appointment->code);
@endphp
@endif
@if($item->first_name)
{{ __('basic.traveler name') . ':'}} {{
$item->first_name }}
{{ __('basic.traveler phone') . ':'}} {{
$item->second_name }}
@endif
@endforeach
@endif
{{-- trip --}}
@if(count($appointment->trip) > 0)
{{ __('basic.trips') }}
@foreach ($appointment->trip as $item)
{{ __('basic.start date') }}
{{ date('d M Y h:i A', strtotime($item->start_at)) }}
{{ __('basic.quantity') }}
{{ $item->qty . ' ' . __('basic.people') }}
{{-- accept client and supplier invoice --}}
@if(in_array($item->payment_method, [1,2]) && $item->invoice_item->invoice_id !== 0)
{{-- for cost wallet --}}
@if($item->cost)
{{-- for cost invoice --}}
@php
$total_buy += $item->cost->final_price;
$buying_price = $item->cost->final_price;
@endphp
@else
@php
$total_buy += 0;
$buying_price = 0;
@endphp
@endif
@php
$total_sell += $item->invoice_item->subtotal;
$selling_price = $item->invoice_item->subtotal;
@endphp
{{-- for no invoice --}}
@else
{{-- for cost wallet --}}
@if($item->cost)
@php
$total_buy += $item->cost->final_price;
$buying_price = $item->cost->final_price;
@endphp
@else
@php
$total_buy += 0;
$buying_price = 0;
@endphp
@endif
@php
$total_sell += $item->invoice_item->subtotal;
$selling_price = $item->invoice_item->subtotal;
@endphp
@endif
{{ __('basic.purchasing price') }}
{{ $buying_price }}
{{ __('basic.selling price') }}
{{ $selling_price }}
{{ __('basic.transport booking code') }}
{{ $item->code }}
@if ($item->debtor)
{{ __('basic.broker') }}
{{ $item->debtor->company_name }}
@if($item->cost)
@endif
@php
$debtor_ur_wa = route('booking_print', $appointment->code);
@endphp
@endif
@if($item->customer_name)
{{ __('basic.traveler name') . ':'}} {{
$item->customer_name }}
{{ __('basic.traveler phone') . ':'}} {{
$item->customer_phone }}
@endif
@endforeach
@endif
{{-- airline --}}
@if(count($appointment->airline) > 0)
{{ __('basic.airline') }}
@foreach ($appointment->airline as $item)
{{ $item->name }}
{{ __('basic.from') . ':'}} {{
$item->from->name }}
{{ __('basic.to') . ':'}} {{
$item->to->name }}
{{ __('basic.start date') }}
{{ date('d M Y h:i A', strtotime($item->start_at)) }}
{{ __('basic.end date') }}
{{ date('d M Y h:i A', strtotime($item->end_at)) }}
{{ __('basic.quantity') }}
{{ $item->qty . ' ' . __('basic.people') }}
{{-- accept client and supplier invoice --}}
@if(in_array($item->payment_method, [1,2]) && $item->invoice_item->invoice_id !== 0)
{{-- for cost wallet --}}
@if($item->cost)
{{-- for cost invoice --}}
@php
$total_buy += $item->cost->final_price;
$buying_price = $item->cost->final_price;
@endphp
@else
@php
$total_buy += 0;
$buying_price = 0;
@endphp
@endif
@php
$total_sell += $item->invoice_item->subtotal;
$selling_price = $item->invoice_item->subtotal;
@endphp
{{-- for no invoice --}}
@else
{{-- for cost wallet --}}
@if($item->cost)
@php
$total_buy += $item->cost->final_price;
$buying_price = $item->cost->final_price;
@endphp
@else
@php
$total_buy += 0;
$buying_price = 0;
@endphp
@endif
@php
$total_sell += $item->wallet_serviceable->amount;
$selling_price = $item->wallet_serviceable->amount;
@endphp
@endif
{{ __('basic.purchasing price') }}
{{ $buying_price }}
{{ __('basic.selling price') }}
{{ $selling_price }}
{{ __('basic.transport booking code') }}
{{ $item->code }}
@if ($item->debtor)
{{ __('basic.broker') }}
{{ $item->debtor->company_name }}
@if($item->cost)
@endif
@php
$debtor_ur_wa = route('booking_print', $appointment->code);
@endphp
@endif
@if($item->customer_name)
{{ __('basic.traveler name') . ':'}} {{
$item->customer_name }}
{{ __('basic.traveler phone') . ':'}} {{
$item->customer_phone }}
@endif
@endforeach
@endif
{{-- package --}}
@if(count($appointment->package) > 0)
{{ __('basic.packages') }}
@foreach ($appointment->package as $item)
{{ $item->package->name }}
{{ __('basic.type') . ':'}} {{
$item->type_qty . " " . __('basic.trip') }}
{{ __('basic.type') . ':'}}
@if($item->type == 1)
@php
$package_type = __('basic.customized');
@endphp
@elseif ($item->type == 2)
@php
$package_type = __('basic.commission');
@endphp
@endif
{{ $package_type }}
{{ __('basic.start date') }}
{{ date('d M Y h:i A', strtotime($item->start_at)) }}
{{ __('basic.end date') }}
{{ date('d M Y h:i A', strtotime($item->end_at)) }}
{{ __('basic.capacity') }}
{{ $item->qty . ' ' . __('basic.people') }}
{{-- accept client and supplier invoice --}}
@if(in_array($item->payment_method, [1,2]) && $item->invoice_item->invoice_id !== 0)
{{-- for cost wallet --}}
@if($item->cost)
{{-- for cost invoice --}}
@php
$total_buy += $item->buy;
$buying_price = $item->buy_pp;
@endphp
@else
@php
$total_buy += 0;
$buying_price = 0;
@endphp
@endif
@php
$total_sell += $item->invoice_item->subtotal;
$selling_price = $item->invoice_item->subtotal;
@endphp
{{-- for no invoice --}}
@else
{{-- for cost wallet --}}
@if($item->buy)
@php
$total_buy += $item->buy;
$buying_price = $item->buy_pp;
@endphp
@else
@php
$total_buy += 0;
$buying_price = 0;
@endphp
@endif
@php
$total_sell += $item->sell;
$selling_price = $item->sell_pp;
@endphp
@endif
{{ __('basic.purchasing price pp') }}
{{ $buying_price }}
{{ __('basic.selling price pp') }}
{{ $selling_price }}
{{ __('basic.purchasing price') }}
{{ $item->buy }}
{{ __('basic.selling price') }}
{{ $item->sell }}
{{ __('basic.transport booking code') }}
{{ $item->code }}
@if($item->debtor)
{{ __('basic.broker') }}
{{ $item->debtor->company_name }}
@if($item->cost)
@endif
@php
$debtor_ur_wa = route('booking_print', $appointment->code);
@endphp
@endif
@if($item->customer_name)
{{ __('basic.traveler name') . ':'}} {{
$item->customer_name }}
{{ __('basic.traveler phone') . ':'}} {{
$item->customer_phone }}
@endif
{{-- if it is customized --}}
@if ($item->type == 1)
{{ __('basic.itinerary') }}
@endif
@endforeach
@endif
{{ __('basic.subtotal') }}
{{ $appointment->total_sell_price }}
{{ $appointment->invoice->currency->code }}
{{ __('basic.discount') }}
@if ($appointment->invoice)
@if (!empty($appointment->invoice->discount))
{{ $appointment->invoice->discount }}
{{ $appointment->invoice->currency->code }}
@else
0
@endif
@else
{{ __('basic.no discount') }}
@endif
{{ __('basic.tax') }}
@if ($appointment->invoice)
@if (!empty($appointment->invoice->total_tax))
{{ $appointment->invoice->total_tax }}
{{ $appointment->invoice->currency->code }}
@else
0
@endif
@else
{{ __('basic.no tax') }}
@endif
{{ __('basic.final price') }}
{{ $appointment->final_sell_price }}
{{ $appointment->invoice->currency->code }}
@unlessrole('Sales-manager|Sales-worker')
{{ __('basic.total cost') }}
{{ $appointment->total_buy_price}}
{{ $appointment->invoice->currency->code }}
{{ __('basic.net income') }}
@php
$final_price_booking = $appointment->final_sell_price - $appointment->total_buy_price;
@endphp
{{ number_format($final_price_booking, 2, '.', '') }}
{{ $appointment->invoice->currency->code }}
@endunlessrole
{{ $appointment->note }}
@error('appointment_note')
{{ $message }}
@enderror
{{ __('patientappo.come before 15 msg') }}
{{ __('basic.final price') }}
{{ $appointment->final_sell_price }}
{{ $appointment->invoice->currency->code }}
{{ date('d M Y', strtotime($appointment->created_at)) }}