@extends('layouts.adminapp') @section('title') {{ __('lng.AnnualMemberSubscriptionPayment') }} @endsection @section('active_transactions', 'active') @section('open_transactions', 'open') @section('open_annual_subscription', 'open') @section('active_annual_subscription', 'active') @section('active_annual_member_subscription_index', 'active') @section('content')

{{ __('lng.AnnualMemberSubscriptionPayment') }}

{{ __('lng.AnnualMemberSubscriptionPaymentTable') }}
@if ($SearchResult) @php echo $SearchResult @endphp @else
@php $si=0; @endphp @foreach ($AnnualMemberSubscriptions as $MemberSubscription) @php // Joining Date $DTs = ''; $TotYears = 0; $Amount = 0; $OpeningBalance = 0; $Payable = 0; $Payed = 0; $AdBal = 0; $DTs = date('Y-m-d', strtotime($MemberSubscription->date)); $TodayDate = date('Y-m-d'); if (strtotime($DTs) < strtotime($TodayDate)) { $NOW = Carbon\Carbon::now(); $year1 = Carbon\Carbon::parse($MemberSubscription->date); $year2 = Carbon\Carbon::parse($NOW); // Calculate the difference in years $TotYears = $year1->diffInYears($year2); } $Amount = $MemberSubscription->subscriptionpackage->amount; if ($MemberSubscription->DRorCR == 'Dr') { $OpeningBalance = $MemberSubscription->openingbalance; } elseif ($MemberSubscription->DRorCR == 'Cr') { $OpeningBalance = -1 * $MemberSubscription->openingbalance; } // Payable Caliculation if (is_numeric($TotYears)) { if ($OpeningBalance > 0) { $Payable = $TotYears * $Amount + $OpeningBalance; } else { $Payable = $TotYears * $Amount; } } // Payed Caliculation foreach ( $MemberSubscription->AnnualMemberSubscriptionPayment->where( 'isCancelled', 0, ) 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 @if ($MemberSubscription->member->photo) @else @endif @endforeach
{{ __('lng.SiNo') }} {{ __('lng.Action') }} {{ __('lng.Member') }} {{ __('lng.Contact') }} {{ __('lng.HouseName') }} {{ __('lng.Reg.No.') }} {{ __('lng.OpeningBalance') }}
{{ __('lng.Pending') }}/{{ __('lng.Advance') }}
{{ __('lng.Amount') }} {{ __('lng.Year') }} {{ __('lng.Payable') }} {{ __('lng.Payed') }} {{ __('lng.Balance') }}/{{ __('lng.Advance') }}
{{ ++$si }} {{ $MemberSubscription->member->name }} {{ $MemberSubscription->member->contact }} {{ $MemberSubscription->member->house->name }} {{ $MemberSubscription->member->house->registernumber }} @if ($OpeningBalance < 0) @currency($OpeningBalance * -1) @elseif($OpeningBalance > 0) @currency($OpeningBalance) @else @currency($OpeningBalance) @endif @currency($MemberSubscription->subscriptionpackage->amount ?? '0') {{ $TotYears }} {{ $Payable }} {{ $Payed }} @if ($AdBal < 0) @currency($AdBal * -1) @elseif($AdBal > 0) @currency($AdBal) @else @currency($AdBal) @endif

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

@endif
@endsection