@extends('admin.include.main') @section('content')
| {{$student->name}} | {{$student['standard']['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 |
| Admit no. | --}}S.no | Fees Category | {{--Gender | --}}Rate Per month | {{--Address | --}}Due Month | Advance Paid Month | Amount | {{--Balance (Cr.) | --}}Status |
|---|---|---|---|---|---|---|---|---|---|---|
| {{ $key }} | {{ $feetype->name }} | {{ $feetype->pivot->amount }} |
{{-- {{ $student->created_at->diffForHumans() }} --}}
@php
// $demo = $student->payments->paymentDetails
// ->where('feet_type_id', $feetype->id)
// // ->where('payment_id', $payment->id)
// // ->get();
// ->count();
// dd($demo);
$sum = 0;
$count = 0;
foreach($student->payments as $key => $payment)
{
// i have to asked project manager
// foreach ($payment->paymentDetails as $paymentdetail) {
// // dd($feetype->id);
// // dd($paymentdetail->feet_type_id);
// if ($paymentdetail->feet_type_id == $feetype->id ) :
// $sum = $sum+$paymentdetail->amount;
// endif ;
// }
// dd($student->payments[1]);
// echo "paid id ".$payment->id ." "; $sum = $sum + $payment->paymentDetails ->where('feet_type_id', $feetype->id) ->where('payment_id', $payment->id) ->sum('amount'); // dd($sum); $count = $count + $payment->paymentDetails ->where('feet_type_id', $feetype->id) ->where('payment_id', $payment->id) // ->get(); ->count(); // dd($count); // echo $feetype->name .' count '. $count ." "; } @endphp {{-- {{ $student->created_at->diff(Carbon\Carbon::now())->format('%m') }} --}} {{ $student->created_at->diff(Carbon\Carbon::now())->format('%m') - $count> 0 ?$student->created_at->diff(Carbon\Carbon::now())->format('%m') - $count : null }} {{-- --}} |
@php $startmonth = $student->created_at->startOfMonth(); $endmonth = Carbon\Carbon::now(); $diff = $startmonth->diffInMonths($endmonth); // ->format('%m'); // dd($diff); @endphp {{-- {{$student->created_at->diff(Carbon\Carbon::now())->format('%m') - $count < 0}} --}} {{ $student->created_at->diff(Carbon\Carbon::now())->format('%m') - $count < 0 ? abs( $student->created_at->diff(Carbon\Carbon::now())->format('%m') - $count) : null }} | @php $average = $average+$student->created_at->diff(Carbon\Carbon::now())->format('%m') * $feetype->pivot->amount - $sum; @endphp {{ abs($student->created_at->diff(Carbon\Carbon::now())->format('%m') * $feetype->pivot->amount - $sum) }} | {{ $student->created_at->diff(Carbon\Carbon::now())->format('%m') * $feetype->pivot->amount - $sum <=0 ? 'Paid' : 'Unpaid' }} | ||||
| Total | Rs. {{ abs($average) }} | |||||||||
| Advance Amount | @php $advance = $student->advances->sum('advance_amount'); @endphp Rs. {{ $advance }} | |||||||||
| Total Payable | Rs. {{ $average - $advance }} |