@extends('layouts.adminapp') @section('content') {{-- Company --}} {{--

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

--}}
@csrf
{{__('lng.ClassUpgrade')}}
@php $sl=0; @endphp @foreach ($Classes as $Class) @endforeach
{{__('lng.SiNo')}}. {{__('lng.Class')}} {{__('lng.Upgrade')}} {{__('lng.Action')}}
{{ ++$sl }} {{ $Class->title }}
@foreach ($Class->Student->where('isCancelled',0) as $Student) @php $VehicleBalance=$SetVehicleFeeAmounts=$PayedVehicleAmounts=0; $DOB = date("F-d-Y",strtotime($Student->dob)); //STUDENT FEE CALCULATION $SetFeeAmount=App\Models\SetFee::where('class_id',$Student->class_id) ->where('batch_year',$Student->batch_year) ->where(function($query) { $query->where('isCancelled',0) ->orWhere('isCancelled',NULL); })->sum('amount'); $SetFeeAdditional=App\Models\SetFee::where('class_id',$Student->class_id) ->where('batch_year',$Student->batch_year) ->where(function($query) { $query->where('isCancelled',0) ->orWhere('isCancelled',NULL); })->sum('additional_charge'); $PayedAmount=App\Models\PayFee::where('student_id',$Student->id) ->where('batch_year',$Student->batch_year) ->where(function($query) { $query->where('isCancelled',0) ->orWhere('isCancelled',NULL); })->sum('amount'); //STUDENT VEHICLE FEE CALCULATION $StudentVehicleRouteAssign=App\Models\StudentVehicleRouteAssign::where('student_id',$Student->id) ->where(function($query) { $query->where('isCancelled',0) ->orWhere('isCancelled',NULL); })->first(); if($StudentVehicleRouteAssign){ $SetVehicleFeeAmounts=App\Models\StudentVehicleSetFee::where('student_vehicle_route_id',$StudentVehicleRouteAssign->id) ->where('batch_year',$Student->batch_year) ->where(function($query) { $query->where('isCancelled',0) ->orWhere('isCancelled',NULL); })->sum('total_amount'); $PayedVehicleAmounts=App\Models\StudentVehiclePayFee::where('student_id',$Student->id) ->where('batch_year',$Student->batch_year) ->where(function($query) { $query->where('isCancelled',0) ->orWhere('isCancelled',NULL); })->sum('amount'); $VehicleBalance=$SetVehicleFeeAmounts - $PayedVehicleAmounts; } $Balance=($SetFeeAmount + $SetFeeAdditional - $PayedAmount) + $VehicleBalance; if($Student->DRorCR){ if($Student->DRorCR == 'Dr'){ $Balance +=$Student->openingbalance; } else{ $Balance -=$Student->openingbalance; } } @endphp @endforeach
{{ __('lng.Name') }} {{ __('lng.DOB') }} {{ __('lng.Gender') }} {{ __('lng.HouseName') }} {{ __('lng.PaidAmount') }} {{__('lng.Pending')}} / {{__('lng.Advance')}} {{__('lng.Amount')}} {{ __('lng.Passed') }}
{{$Student->name}} {{$DOB}} {{$Student->gender}} {{$Student->housename}} @amount($PayedAmount+$PayedVehicleAmounts) @if ($Balance < 0) @amount(abs($Balance)) @else @amount(abs($Balance)) @endif
@endsection