IMMREX7
@extends('students.student_layout')
@section('content')
<div class="row clearfix">
<div class="col-sm-12">
<div class="card">
<div class="header">
<h2><strong>Due Data</strong></h2>
</div>
<form action="{{url('/student/feepending')}}" method= "get">
<div class="row">
<div class="col-sm-5">
<div class="row clearfix">
<div class="col-sm-4 form-control-label">
<label for="classname"><strong>Payable Mode</strong></label>
</div>
<div class="col-sm-6">
<div class="form-group">
<input type="radio" id="paymode1" name="paymode" value="full" @if($isFull == 'full') checked @endif>
<label for="paymode1">Plan A (Full Payment)</label><br>
<input type="radio" id="paymode2" name="paymode" value="installments" @if($isFull == 'installments') checked @endif>
<label for="paymode2">Plan B (Installment)</label><br>
</div>
</div>
<div class="col-sm-2">
<input class="btn btn-primary btn-round" type="submit" value="Change Now" style="background-color:black;color:white;"/>
</div>
</div>
</div>
</form>
<?php
if ($isFull == "full") {
$class_feeheads = \DB::table('feeheads')->where('idClass', '=', $student->idClass)
->where('idSection', '=', $student->idSection)
->where('idFinancialYear', '=', $student->idFinancialYear)
->where('studentCategory', '=', $student->studentType)
->where('feeheadName', 'LIKE', '%(Full Payment)')
->whereNull('idStudent');
// ->get();
$allcat_feeheads = \DB::table('feeheads')->where('idClass', '=', $student->idClass)
->where('idSection', '=', $student->idSection)
->where('studentCategory', '=', 'All')
->where('idFinancialYear', '=', $student->idFinancialYear)
->where('feeheadName', 'LIKE', '%(Full Payment)')
->whereNull('idStudent');
// ->get();
$feeheads = \DB::table('feeheads')->where('idStudent', '=', $student->idStudent)
->where('idFinancialYear', '=', $student->idFinancialYear)
->where('feeheadName', 'LIKE', '%(Full Payment)')
->union($class_feeheads)
->union($allcat_feeheads)
->orderBy('toDate')
->get();
$feetotal = $feeheads->sum('amount');
} else {
$class_feeheads = \DB::table('feeheads')->where('idClass', '=', $student->idClass)
->where('idSection', '=', $student->idSection)
->where('idFinancialYear', '=', $student->idFinancialYear)
->where('studentCategory', '=', $student->studentType)
->where('feeheadName', 'LIKE', '%Installment)')
->whereNull('idStudent');
// ->get();
$allcat_feeheads = \DB::table('feeheads')->where('idClass', '=', $student->idClass)
->where('idSection', '=', $student->idSection)
->where('studentCategory', '=', 'All')
->where('idFinancialYear', '=', $student->idFinancialYear)
->where('feeheadName', 'LIKE', '%Installment)')
->whereNull('idStudent');
// ->get();
$feeheads = \DB::table('feeheads')->where('idStudent', '=', $student->idStudent)
->where('idFinancialYear', '=', $student->idFinancialYear)
->where('feeheadName', 'LIKE', '%Installment)')
->union($class_feeheads)
->union($allcat_feeheads)
->orderBy('toDate')
->get();
$feetotal = $feeheads->sum('amount');
}
$transaction = \App\StudentTransaction::where('idStudent', '=', $student->idStudent)
->select(DB::raw('SUM(excessAmountUsed) as excessAmount'), DB::raw('SUM(totalPaid) as totalPaid'), DB::raw('SUM(discount) as discount'), DB::raw('SUM(fine) as fine'), DB::raw('SUM(penaltyAmount) as penaltyAmount'))
->first();
?>
<div class="body table-responsive">
<table class="table table-bordered table-striped table-hover">
<thead>
<tr>
<th>Ec No.</th>
<th>Name</th>
<th>Father </th>
<th>Mobile</th>
<th>Class</th>
<th>Section</th>
<th>Total Fee</th>
<th>Paid</th>
<th>Discount</th>
<th>Penalty</th>
<th>Total Due</th>
<th>Unpaid Due</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{$student->ecNo}}</td>
<td>{{$student->firstName}} {{$student->middleName}} {{$student->lastName}}</td>
<td>{{$student->father_fname}} {{$student->father_lname}}</td>
<td>{{$student->father_mobile}}</td>
<td>{{$student->classM->className}}</td>
<td>{{$student->section->sectionName}}</td>
<td>{{$feetotal}}</td>
<td>
@if($transaction->totalPaid!=null)
{{$transaction->totalPaid}}
@else
0.00
@endif
</td>
<td>
@if($transaction->discount!=null)
{{$transaction->discount}}
@else
0.00
@endif
</td>
<td>
@if($transaction->fine!=null || $transaction->fine!=null)
{{$transaction->fine +$transaction->penaltyAmount }}
@else
0.00
@endif
</td>
<td>
<?php $b = $feetotal + $transaction->fine + $transaction->penaltyAmount - $transaction->discount - $transaction->totalPaid; ?> {{$b}}
</td>
<td>
{{$b}}
</td>
</tr>
</tbody>
</table>
</form>
</div>
</div>
</div>
</div>
@stop
Copyright © 2021 -