@extends('admin.include.main') @section('content')

Billing For Students

{{$student->name}} {{$student['class']['class_name']}} - {{$student['section']['section_name']}}
{{$student['guardian']['father_name']}} {{$student['phone_no']}}
{{$student['admit_no']}} {{$student['roll_no']}}
{{$student['dob']}} {{$student['address']}}
{{$student['email']}} @if ($student['status'] == 0) Inactive @else Active @endif

Select the options


image
@csrf
@php $montharray = array(1 => 'Jan.', 2 => 'Feb.', 3 => 'Mar.', 4 => 'Apr.', 5 => 'May', 6 => 'Jun.', 7 => 'Jul.', 8 => 'Aug.', 9 => 'Sep.', 10 => 'Oct.', 11 => 'Nov.', 12 => 'Dec.'); @endphp {{-- --}} @php $totalpayable =0; $advance = $student->advances->sum('advance_amount'); @endphp @forelse($student->class->fees as $key => $feetype) @php $sum = 0; $count = 0; foreach($student->payments as $payment) { $sum = $sum + $payment->paymentDetails ->where('feet_type_id', $feetype->id) ->where('payment_id', $payment->id) ->sum('amount'); $count = $count + $payment->paymentDetails ->where('feet_type_id', $feetype->id) ->where('payment_id', $payment->id) // ->get(); ->count(); } @endphp @empty @endforelse {{-- --}} @php // dd($student); $olddeu = $student->olddues->isNotEmpty() ? $student->olddues->first()->due_amount : 0 ; // dd($olddeu) @endphp @if($student->olddues->isNotEmpty()) {{-- --}} @elseif($student->olddues->isEmpty()) @endif @php // dd($student); $advan = $student->advances->isNotEmpty() ? $student->advances->first()->advance_amount : 0 ; // dd($olddeu) @endphp @if($student->advances->isNotEmpty()) {{-- --}} {{-- --}} @elseif($student->advances->isEmpty()) @endif {{-- --}}
S.no Action Fees Category Rate Per month Due Month Advance Month Paid month Amount Receive Reamining
{{ $key+1 }} created_at->diff(Carbon\Carbon::now()->endOfMonth())->format('%m') - $count > 0) checked @endif null : checked}}> {{ $feetype->name }} {{ $feetype->pivot->amount }} @php // dd(Carbon\Carbon::now()->endOfMonth()); $month = $student->created_at->diff(Carbon\Carbon::now()->endOfMonth())->format('%m') - $count > 0 ? abs( $student->created_at->diff(Carbon\Carbon::now()->endOfMonth())->format('%m') - $count) : null; // $student->created_at // ->diff(Carbon\Carbon::now()->endOfMonth())->format('%m') ; $array_month = []; // $i ; for($i = $month; $i>0; $i--) { $array_month[] = Carbon\Carbon::now()->endOfMonth()->subMonthsNoOverflow($i-1)->format('F'); // echo $array_month; // $array_deu[] = $array_month; } // var_dump($array_month); // dd($array_month); @endphp {{-- {{ $student->created_at->diff(Carbon\Carbon::now()->endOfMonth())->format('%m') }} --}} {{ $student->created_at->diff(Carbon\Carbon::now()->endOfMonth())->format('%m') - $count > 0 ? abs( $student->created_at->diff(Carbon\Carbon::now()->endOfMonth())->format('%m') - $count) : null }} @php // dd(Carbon\Carbon::now()->endOfMonth()); $admonth = $student->created_at->diff(Carbon\Carbon::now()->endOfMonth())->format('%m') - $count < 0 ? abs( $student->created_at->diff(Carbon\Carbon::now()->endOfMonth())->format('%m') - $count) : null; // $student->created_at // ->diff(Carbon\Carbon::now()->endOfMonth())->format('%m') ; $adv_month = []; // $i ; for($i = $admonth; $i>0; $i--) { $adv_month[] = Carbon\Carbon::now()->endOfMonth()->addMonthsNoOverflow($i)->format('F'); // echo $array_month; // $array_deu[] = $array_month; } // var_dump($adv_month); // dd($array_month); @endphp {{ $student->created_at->diff(Carbon\Carbon::now()->endOfMonth())->format('%m') - $count < 0 ? abs( $student->created_at->diff(Carbon\Carbon::now()->endOfMonth())->format('%m') - $count) : null }} {{-- --}} {{ $student->created_at->diff(Carbon\Carbon::now()->endOfMonth())->format('%m') *$feetype->pivot->amount - $sum > 0 ? $student->created_at->diff(Carbon\Carbon::now()->endOfMonth())->format('%m') *$feetype->pivot->amount - $sum : null }} @php if($student->created_at->diff(Carbon\Carbon::now()->endOfMonth())->format('%m') *$feetype->pivot->amount - $sum > 0) { $totalpayable = $totalpayable +$student->created_at->diff(Carbon\Carbon::now()->endOfMonth())->format('%m') * $feetype->pivot->amount - $sum; } @endphp
Total {{ abs($totalpayable) }}
Old Due {{ $olddeu }}
Advance {{ $advan }}
Total Amount {{ abs($totalpayable + $olddeu - $advan) }}
{{--

Advanced deposit: Rs. {{ $advance }}

--}} Custom Calculation
Amount to Pay:
Discount:
Fine:
{{--
Total Payable: Rs.
Advance Remains: Rs.
Dues Remains: Rs. 10000
--}}
Deposited By:
Account Number:
Reference number:
{{--
--}} {{--
--}} {{--
--}} {{--
--}}

{{-- --}} {{-- --}} {{-- --}}
Admit no.S.no Fees CategoryGenderRate Per monthAddressDue Month Balance (Dr.) Balance (Cr.) Status
@endsection @section('script') @stop