Folio # {{$firstFolio->FolioId}}
Room: #{{$booking_details[0]->bookingDetails[0]->room->RoomName}}
Guest Name: {{$booking_details[0]->BookerFullName}}
Folio Date: {{get_carbon($firstFolio->FolioDate)->format('d-m-Y')}}
#
Date
Description
Quantity
Transaction Type
Amount
GST
{{-- Calculting the sum of all folios --}}
{{-- @php $foliBalanceSum = 0; @endphp --}}
@forelse($folios as $folio)
@php
$existingFolioDate = '2021-11-17';
$todayDate = now()->toDateString();
$perDate = $folio->PerDate;
@endphp
@if ($perDate > $existingFolioDate)
@if ($todayDate >= $perDate)
@if($folio->FolioStatus == 1 || $folio->FolioStatus == 2)
{{-- {{ 'I am charge type of '.$folio->chargeType ? print_r($folio->chargeType[0]): '' }} --}}
{{$folio->FolioDetailId}}
{{get_carbon($folio->FolioDate)->format('d-m-Y')}}
{{$folio->Description ?: '-'}}
{{$folio->ChargeTypeId ? $folio->Quantity : '-'}}
@php
if($folio->Operator == '' || $folio->Operator == '+'){
echo 'Debit';
}
else {
echo 'Credit';
}
@endphp
{{round($folio->Amount/1.16, 2) ?: '-'}}
-
@endif
@elseif ($todayDate <= $perDate)
@if($folio->FolioStatus == 1 || $folio->FolioStatus == 2)
{{$folio->FolioDetailId}}
{{get_carbon($folio->FolioDate)->format('d-m-Y')}}
{{$folio->Description ?: '-'}}
{{$folio->ChargeTypeId ? $folio->Quantity : '-'}}
@php
if($folio->Operator == '' || $folio->Operator == '+'){
echo 'Debit';
}
else {
echo 'Credit';
}
@endphp
{{$folio->Amount ? $folio->Amount/1.16: '-'}}
-
@endif
@endif
@else
{{$folio->FolioDetailId}}
{{get_carbon($folio->FolioDate)->format('d-m-Y')}}
{{$folio->Description ?: '-'}}
{{$folio->ChargeTypeId ? $folio->Quantity : '-'}}
@php
if($folio->Operator == '' || $folio->Operator == '+'){
echo 'Debit';
}
else {
echo 'Credit';
}
@endphp
@if($folio->Operator == '' || $folio->Operator == '+')
{{$folio->Amount ? $folio->Amount/1.16: '-'}}
-
@else
{{$folio->Amount ? $folio->Amount: '-'}}
{{'-'}}
@endif
@endif
@empty
No Payments Yet!
@endforelse
{{--
{{ $firstFolio->BookingId }}
--}}
@php
$folios = \App\Folio::where('BookingId', $booking_details[0]->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
Total Balance: {{ number_format((float)$allFoliosBalance, 2, '.', '') }}