@section('styles') @endsection @php $beginDate = get_carbon($booking->BeginDate); $endDate = get_carbon($booking->EndDate); $bookingId = $booking->BookingId; //expecting that a typical character will take //7.5 pixels so we will calculate the character //count by dividing cellwidth with 7.5. $charCount = floor($cellWidth / 7.5); @endphp {{-- Booking Cell START --}} @if($isCalendar)
@if(strlen($booking->BookerFullName) > $charCount) {{str_limit($booking->BookerFullName, ($charCount - 3))}} @else {{$booking->BookerFullName}} @endif @if($booking->_Nights > 1 && $cellWidth > 80)
{{$beginDate->format('d M')}} to {{$endDate->format('d M')}} @endif
@php $bookingBalance = $booking->folios->keyBy('FolioDetailId')->sortBy('FolioDetailId')[1]->Balance; @endphp @php $folios = \App\Folio::where('BookingId', $bookingId)->where(function($query) { $query->where('FolioStatus', '=', 1) ->orWhere('FolioStatus', '=' ,2); } ) ->where('AccommodationId', App\Helpers\CurrentAccommodation::id())->get(); $allFoliosBalance = 0; foreach ($folios as $folio) { if($folio->FolioStatus == 1 || $folio->FolioStatus == 2) { if($folio->Operator == '+' || $folio->Operator == '') { $allFoliosBalance += $folio->Amount; } else { $allFoliosBalance -= $folio->Amount; } } } @endphp @if(strlen('Total: '.$bookingBalance.'.00') > $charCount)
Due: {{str_limit($allFoliosBalance.'.00', ($charCount - 7))}}
@else
Due: {{$allFoliosBalance}}.00
@endif
@endif {{-- Booking Cell END --}} {{-- Booking Details Modal START --}} {{-- Booking Folio Modals START --}} @if(count($booking->folios)) {{-- @dd($booking->folios) --}} @php $folios = $booking->folios->keyBy('FolioDetailId')->sortBy('FolioDetailId'); $firstFolio = $folios[1]; $folioDetailId = $firstFolio->FolioDetailId; @endphp @endif {{-- Booking Folio Modals END --}}