@php $si=0; @endphp @foreach ($ArHouse as $key => $House) @php // Joining Date $DTs=""; $TotMonth = 0; $Amount = 0; $OpeningBalance = 0; $Payable = 0; $Payed = 0; $AdBal = 0; if ($House->house_subscription) { $DTs = date('Y-m-d', strtotime($House->house_subscription->date)); $TodayDate = date('Y-m-d'); if (strtotime($DTs) < strtotime($TodayDate)) { $NOW = Carbon\Carbon::now(); $NOWDate = date('m', strtotime($NOW)); $month1 = Carbon\Carbon::parse($House->house_subscription->date); $month2 = Carbon\Carbon::parse($NOW); $TotMonth = $month1->diffInMonths($month2); } $Amount = $House->house_subscription->subscriptionpackage->amount; // $OpeningBalance = $House->house_subscription->openingbalance; if ($House->house_subscription->DRorCR == 'Dr') { $OpeningBalance = $House->house_subscription->openingbalance; } elseif ($House->house_subscription->DRorCR == 'Cr') { $OpeningBalance = -1 * $House->house_subscription->openingbalance; } } // Payable Caliculation if (is_numeric($TotMonth)) { if ($OpeningBalance > 0) { $Payable = $TotMonth * $Amount + $OpeningBalance; } else { $Payable = $TotMonth * $Amount; } } // Payed Caliculation foreach ($House->subscriptions as $Subscription) { if ($Subscription->isCancelled != 1) { $Payed += $Subscription->amount; } } // Advance Or Balance Caliculation if ($OpeningBalance < 0) { $AdBal = $Payable - $Payed + $OpeningBalance; } else { $AdBal = $Payable - $Payed; } @endphp @foreach ($House->members as $Member) @if ($Member->member_relation_id == App\Extra\General\DBFixedValues::AUTHORITY) @endif @endforeach @endforeach
{{ __('lng.SiNo') }} {{ __('lng.Authority') }} {{ __('lng.Reg.No.') }} {{ __('lng.Place') }} {{ __('lng.SubscriptionDateOfJoin') }} {{ __('lng.OpeningBalance') }}
{{ __('lng.Pending') }}/{{ __('lng.Advance') }}
{{ __('lng.Amount') }} {{ __('lng.Month') }} {{ __('lng.Payable') }} {{ __('lng.Payed') }} {{ __('lng.Balance') }}/{{ __('lng.Advance') }}
{{ ++$si }}{{ $House->name }} - {{ $Member->name }}{{ $House['registernumber'] }} {{ $House['place'] }} {{ $DTs }} @if ($OpeningBalance < 0) @currency($OpeningBalance * -1) @elseif($OpeningBalance > 0) @currency($OpeningBalance) @else @currency($OpeningBalance) @endif @currency($House->house_subscription->subscriptionpackage->amount ?? '0') @currency( $TotMonth ) @currency( $Payable ) @currency( $Payed ) @if ($AdBal < 0) @currency( $AdBal * -1) @elseif($AdBal > 0) @currency( $AdBal ) @else @currency( $AdBal ) @endif