Folio # {{$firstFolio->FolioId}}
Room: #{{$booking->_RoomName}}
Guest Name: {{$booking->BookerFullName}}
Folio Date: {{get_carbon($firstFolio->FolioDate)->format('d-m-Y')}}
{{-- @php
$paidCharges = 0;
$unPaidCharges = 0;
$folios = \App\Folio::where('BookingId', $bookingId)->where('AccommodationId', \App\Helpers\CurrentAccommodation::id())->get();
foreach ($folios as $folio) {
if($folio->FolioStatus == 1)
{
$paidCharges += $folio->PerDateRate;
}
else if($folio->FolioStatus == 0) {
$unPaidCharges += $folio->PerDateRate;
}
}
@endphp --}}
{{--
Paid Room Rent: {{ $paidCharges }}
Unpaid Room Rent: {{ $unPaidCharges }}
--}}
#
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', $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, '.', '') }}