X
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
@if(App\Helpers\CurrentAccommodation::name() == 'Marco Polo Resort Skardu')
{{$folio->Amount ? round($folio->Amount,0): '-'}}
-
@elseif(App\Helpers\CurrentAccommodation::name() == 'Orangeloft Attabad Lake')
{{$folio->Amount ? round($folio->Amount,0): '-'}}
-
@elseif(App\Helpers\CurrentAccommodation::name() == 'Cherry Inn Skardu')
{{$folio->Amount ? round($folio->Amount,0): '-'}}
-
@elseif(App\Helpers\CurrentAccommodation::name() == 'Orangeloft Lower Kachura Lake')
{{$folio->Amount ? round($folio->Amount,0): '-'}}
-
@elseif(App\Helpers\CurrentAccommodation::name() == 'Marco Polo Resort Kaghan')
{{$folio->Amount ? ceil($folio->Amount/1.15): '-'}}
-
@elseif(App\Helpers\CurrentAccommodation::name() == 'Orangeloft Frontier')
{{$folio->Amount ? ceil($folio->Amount/1.15): '-'}}
-
@elseif(App\Helpers\CurrentAccommodation::name() == 'Orangeloft Mahodand Lake')
{{$folio->Amount ? ceil($folio->Amount/1.15): '-'}}
-
@elseif(App\Helpers\CurrentAccommodation::name() == 'Orangeloft Shogran')
{{$folio->Amount ? ceil($folio->Amount/1.15): '-'}}
-
@elseif(App\Helpers\CurrentAccommodation::name() == 'Orangeloft Naraan')
{{$folio->Amount ? ceil($folio->Amount/1.15): '-'}}
-
@elseif(App\Helpers\CurrentAccommodation::name() == 'Orangeloft Wild Life Camping')
{{$folio->Amount ? ceil($folio->Amount/1.15): '-'}}
-
@elseif(App\Helpers\CurrentAccommodation::name() == 'Orangeloft Mushkpuri')
{{$folio->Amount ? ceil($folio->Amount/1.15): '-'}}
-
@else
{{$folio->Amount ? round($folio->Amount/1.16,0): '-'}}
-
@endif
@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
@if(App\Helpers\CurrentAccommodation::name() == 'Marco Polo Resort Skardu')
{{$folio->Amount ? round($folio->Amount,0): '-'}}
-
@elseif(App\Helpers\CurrentAccommodation::name() == 'Orangeloft Attabad Lake')
{{$folio->Amount ? round($folio->Amount,0): '-'}}
-
@elseif(App\Helpers\CurrentAccommodation::name() == 'Cherry Inn Skardu')
{{$folio->Amount ? round($folio->Amount,0): '-'}}
-
@elseif(App\Helpers\CurrentAccommodation::name() == 'Orangeloft Lower Kachura Lake')
{{$folio->Amount ? round($folio->Amount,0): '-'}}
-
@elseif(App\Helpers\CurrentAccommodation::name() == 'Marco Polo Resort Kaghan')
{{$folio->Amount ? ceil($folio->Amount/1.15): '-'}}
-
@elseif(App\Helpers\CurrentAccommodation::name() == 'Orangeloft Frontier')
{{$folio->Amount ? ceil($folio->Amount/1.15): '-'}}
-
@elseif(App\Helpers\CurrentAccommodation::name() == 'Orangeloft Mahodand Lake')
{{$folio->Amount ? ceil($folio->Amount/1.15): '-'}}
-
@elseif(App\Helpers\CurrentAccommodation::name() == 'Orangeloft Shogran')
{{$folio->Amount ? ceil($folio->Amount/1.15): '-'}}
-
@elseif(App\Helpers\CurrentAccommodation::name() == 'Orangeloft Naraan')
{{$folio->Amount ? ceil($folio->Amount/1.15): '-'}}
-
@elseif(App\Helpers\CurrentAccommodation::name() == 'Orangeloft Wild Life Camping')
{{$folio->Amount ? ceil($folio->Amount/1.15): '-'}}
-
@elseif(App\Helpers\CurrentAccommodation::name() == 'Orangeloft Mushkpuri')
{{$folio->Amount ? ceil($folio->Amount/1.15): '-'}}
-
@else
{{$folio->Amount ? round($folio->Amount/1.16,0): '-'}}
-
@endif
@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 == '+')
@if(App\Helpers\CurrentAccommodation::name() == 'Marco Polo Resort Skardu')
{{$folio->Amount ? round($folio->Amount,2): '-'}}
-
@elseif(App\Helpers\CurrentAccommodation::name() == 'Orangeloft Attabad Lake')
{{$folio->Amount ? round($folio->Amount,2): '-'}}
-
@elseif(App\Helpers\CurrentAccommodation::name() == 'Cherry Inn Skardu')
{{$folio->Amount ? round($folio->Amount,2): '-'}}
-
@elseif(App\Helpers\CurrentAccommodation::name() == 'Orangeloft Lower Kachura Lake')
{{$folio->Amount ? round($folio->Amount,2): '-'}}
-
@elseif(App\Helpers\CurrentAccommodation::name() == 'Marco Polo Resort Kaghan')
{{$folio->Amount ? ceil($folio->Amount/1.15): '-'}}
-
@elseif(App\Helpers\CurrentAccommodation::name() == 'Orangeloft Frontier')
{{$folio->Amount ? ceil($folio->Amount/1.15): '-'}}
-
@elseif(App\Helpers\CurrentAccommodation::name() == 'Orangeloft Mahodand Lake')
{{$folio->Amount ? ceil($folio->Amount/1.15): '-'}}
-
@elseif(App\Helpers\CurrentAccommodation::name() == 'Orangeloft Shogran')
{{$folio->Amount ? ceil($folio->Amount/1.15): '-'}}
-
@elseif(App\Helpers\CurrentAccommodation::name() == 'Orangeloft Naraan')
{{$folio->Amount ? ceil($folio->Amount/1.15): '-'}}
-
@elseif(App\Helpers\CurrentAccommodation::name() == 'Orangeloft Wild Life Camping')
{{$folio->Amount ? ceil($folio->Amount/1.15): '-'}}
-
@elseif(App\Helpers\CurrentAccommodation::name() == 'Orangeloft Mushkpuri')
{{$folio->Amount ? ceil($folio->Amount/1.15): '-'}}
-
@else
{{$folio->Amount ? round($folio->Amount/1.16,0): '-'}}
-
@endif
@else
{{$folio->Amount ? round($folio->Amount,0): '-'}}
{{'-'}}
@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, '.', '') }}