IMMREX7
<?php $__env->startSection('content'); ?>
<div class="row clearfix">
<div class="col-sm-12">
<div class="card">
<div class="header">
<h2><strong>Due Data</strong></h2>
</div>
<?php
$class_feeheads = \DB::table('feeheads')->where('idClass', '=', $student->idClass)
->where('idSection', '=', $student->idSection)
->where('studentCategory', '=', $student->studentType)
->whereNull('idStudent');
// ->get();
$allcat_feeheads = \DB::table('feeheads')->where('idClass', '=', $student->idClass)
->where('idSection', '=', $student->idSection)
->where('studentCategory', '=', 'All')
->whereNull('idStudent');
// ->get();
$feeheads = \DB::table('feeheads')->where('idStudent', '=', $student->idStudent)
->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><?php echo e($student->ecNo); ?></td>
<td><?php echo e($student->firstName); ?> <?php echo e($student->middleName); ?> <?php echo e($student->lastName); ?></td>
<td><?php echo e($student->father_fname); ?> <?php echo e($student->father_lname); ?></td>
<td><?php echo e($student->father_mobile); ?></td>
<td><?php echo e($student->classM->className); ?></td>
<td><?php echo e($student->section->sectionName); ?></td>
<td><?php echo e($feetotal); ?></td>
<td>
<?php if($transaction->totalPaid!=null): ?>
<?php echo e($transaction->totalPaid); ?>
<?php else: ?>
0.00
<?php endif; ?>
</td>
<td>
<?php if($transaction->discount!=null): ?>
<?php echo e($transaction->discount); ?>
<?php else: ?>
0.00
<?php endif; ?>
</td>
<td>
<?php if($transaction->fine!=null || $transaction->fine!=null): ?>
<?php echo e($transaction->fine +$transaction->penaltyAmount); ?>
<?php else: ?>
0.00
<?php endif; ?>
</td>
<td>
<?php $b = $feetotal + $transaction->fine + $transaction->penaltyAmount - $transaction->discount - $transaction->totalPaid; ?> <?php echo e($b); ?>
</td>
<td>
<?php
$datewise_feeclass = \App\FeeHead::where('idClass', '=', $student->idClass)
->where('idSection', '=', $student->idSection)
->where('studentCategory', '=', 'All')
->whereNull('idStudent')
->whereDate('toDate', '>=', today_date())
->select(DB::raw('SUM(amount) as feetotal'))
->first();
$datewise_catwise = \App\FeeHead::where('idClass', '=', $student->idClass)
->where('idSection', '=', $student->idSection)
->where('studentCategory', '=', $student->studentType)
->whereDate('toDate', '>=', today_date())
->select(DB::raw('SUM(amount) as feetotalcat'))
->first();
$datewise_std = \App\FeeHead::where('idClass', '=', $student->idClass)
->where('idSection', '=', $student->idSection)
->where('idStudent', '=', $student->idStudent)
->whereDate('toDate', '>=', today_date())
->select(DB::raw('SUM(amount) as feetotalstd'))
->first();
$unpaid = $datewise_feeclass->feeTotal + $datewise_catwise->feetotalcat + $datewise_std->feetotalstd;
$unpaiddue = $unpaid - $transaction->totalPaid;
?>
<?php echo e($unpaiddue); ?>
</td>
</tr>
</tbody>
</table>
</form>
</div>
</div>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('students.student_layout', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
Copyright © 2021 -