@php $si=0; @endphp @foreach ($HouseSubscriptions as $HouseSubscription) @php // Joining Date $DTs = ''; $TotMonth = 0; $Amount = 0; $OpeningBalance = 0; $Payable = 0; $Payed = 0; $AdBal = 0; // if (App\Models\House::find($House->HouseID)->house_subscription) { $DTs = date('Y-m-d', strtotime($HouseSubscription->Date)); $TodayDate = date('Y-m-d'); if (strtotime($DTs) < strtotime($TodayDate)) { $NOW = Carbon\Carbon::now(); $NOWDate = date('m', strtotime($NOW)); $month1 = Carbon\Carbon::parse($HouseSubscription->Date); $month2 = Carbon\Carbon::parse($NOW); $TotMonth = $month1->diffInMonths($month2); } $Amount = App\Models\SubscriptionPackage::find($HouseSubscription->SubscriptionPackageID) ->amount; if ($HouseSubscription->DRorCR == 'Dr') { $OpeningBalance = $HouseSubscription->OB; } elseif ($HouseSubscription->DRorCR == 'Cr') { $OpeningBalance = -1 * $HouseSubscription->OB; } // } // Payable Caliculation if (is_numeric($TotMonth)) { if ($OpeningBalance > 0) { $Payable = $TotMonth * $Amount + $OpeningBalance; } else { $Payable = $TotMonth * $Amount; } } // Payed Caliculation foreach ( App\Models\House::find($HouseSubscription->HouseID)->subscriptions as $Subscriptionpay ) { if ($Subscriptionpay->isCancelled != 1) { $Payed += $Subscriptionpay->amount; } } // Advance Or Balance Caliculation if ($OpeningBalance < 0) { $AdBal = $Payable - $Payed + $OpeningBalance; } else { $AdBal = $Payable - $Payed; } @endphp @foreach (App\Models\House::find($HouseSubscription->HouseID)->members as $Member) @if ($Member->member_relation_id == App\Extra\General\DBFixedValues::AUTHORITY) @if ($Member->photo) @else @endif @endif @endforeach @endforeach
{{ __('lng.SiNo') }} {{ __('lng.Action') }} {{ __('lng.Authority') }} {{ __('lng.Contact') }} {{ __('lng.Reg.No.') }} {{ __('lng.Subscription') }}
{{ __('lng.Pending') }} / {{ __('lng.Advance') }}
{{ __('lng.Amount') }} {{ __('lng.Month') }} {{ __('lng.Payable') }} {{ __('lng.Payed') }} {{ __('lng.Balance') }} / {{ __('lng.Advance') }}
{{ ++$si }} {{ $HouseSubscription->HouseName }} - {{ $Member->name }} {{ $Member->contact }}{{ $HouseSubscription->HouseNo }} @if ($OpeningBalance < 0) @currency($OpeningBalance * -1) @elseif($OpeningBalance > 0) @currency($OpeningBalance) @else @currency($OpeningBalance) @endif @currency(App\Models\SubscriptionPackage::find($HouseSubscription->SubscriptionPackageID)->amount ?? '0') {{ $TotMonth }} {{ $Payable }} {{ $Payed }} @if ($AdBal < 0) @currency($AdBal * -1) @elseif($AdBal > 0) @currency($AdBal) @else @currency($AdBal) @endif

{{ __('lng.Showing') }} {{ $HouseSubscriptions->count() }} {{ __('lng.Items') }}