IMMREX7

aku nok ndi : /home/spdtg/www/schoolmis/storage/framework/views/
File Up :
aku nok ndi : /home/spdtg/www/schoolmis/storage/framework/views/97067bc3c99e53e792028d98a48c6646906363ac.php

<?php $__env->startSection('content'); ?>
<div role="tabpanel" class="tab-pane in active" id="details" aria-expanded="true">
    <div class="card" id="details">
        <div class="body">                                
            <div class="row">
                <div class="col-sm-6 col-sm-offset-1">
                    <address>
                        <strong> Student Name : </strong><?php echo e($student->firstName); ?> <?php echo e($student->middleName); ?> <?php echo e($student->lastName); ?><br>
                        <strong> Father Name : </strong><?php echo e($student->father_fname); ?> <?php echo e(isset($student->father_lname) ? $student->father_lname : ''); ?><br>
                        <strong> Mobile : </strong><?php echo e($student->father_mobile); ?><br>
                        <strong> Class : </strong><?php echo e($student->classM->className); ?><br>
                        <strong> Section : </strong><?php echo e($student->section->sectionName); ?><br>
                        <strong> Ec No. : </strong><?php echo e($student->ecNo); ?><br>
                    </address>

                    <?php if(session('status')): ?>
                    <?php if(session('status') == 'Payment is successful download the receipt from below'): ?> 
                    <div class="alert alert-success">
                        <?php echo e(session('status')); ?>

                    </div>
                    <?php else: ?>

                    <div class="alert alert-warning">
                        <?php echo e(session('status')); ?>

                    </div>
                    <?php endif; ?>
                    <?php endif; ?>
                </div>
            </div>
            <div class="mt-40"></div>
            <div class="row">

                <div class="col-md-7">
                    <div class="table-responsive">
                        <form action="<?php echo e(url('gateway/busdesk.php')); ?>" method="post" id="feesubmission">
                            <input type="hidden" name="_token" id="token" value="<?php echo e(csrf_token()); ?>">
                            <?php
                            $transactionID = "B" . Carbon\Carbon::now()->timestamp . "ON" . $student->idStudent;
                            ?>
                            <input type="hidden" name="TypeField1" value="R">
                            <input type="hidden" name="TypeField2" value="F">
                            <input type="hidden" name="Message" value="NA">
                            <input type="hidden" name="CustomerID" value="<?php echo e($transactionID); ?>"/>
                            <input type="hidden" name="SecurityID" value="aspcstfee"/>
                            <input type="hidden" name="CurrencyType" value="INR"/>
                            <input type="hidden" name="RU" value='<?php echo e(url('student/busfeesreturn')); ?>'/>
                            <input type="hidden" name="txtadditional1" value="<?php echo e($student->idStudent); ?>">
                            <input type="hidden" name="txtadditional2" value="<?php echo e($student->idFinancialYear); ?>">
                            <input type="hidden" name="txtadditional3" value="NA">
                            <input type="hidden" name="txtadditional4" value="NA">
                            <input type="hidden" name="txtadditional5" value="NA">
                            <input type="hidden" name="txtadditional6" value="NA">
                            <input type="hidden" name="txtadditional7" value="NA">
                            <input type="hidden" name="idStudent" value="<?php echo e($student->idStudent); ?>">
                            <input type="hidden" name="idFinancialYear" value="<?php echo e($student->idFinancialYear); ?>">
                            <table class="table table-hover">
                                <thead>
                                    <tr>
                                        <th></th>
                                        <th style="width:60px;">Due Date</th>
                                        <th>Particular</th>
                                        <th>Amount</th>
                                        <th>Discount</th>
                                        <th>Fine</th>
                                        <th>Status</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php $totalFine=0;$totalFee=0;$totalDis=0;?>
                               <?php 
                                    $flatfine=0;
                                     $perDay=array();
                                     foreach($fineheads as $fine){
                                         if($fine->isFlat==1)
                                          $flatfine=$fine->amount;
                                         else{
                                            array_push($perDay,$fine); 
                                         } 
                                     }
                                     
                                     $chqbounce = \App\BusTransaction::where('idStudent', '=', $student->idStudent)
                                    ->where('idFinancialYear', '=', $student->idFinancialYear)
                                    ->where('status', '=', 'Bounced')
                                    ->where('chqFineStatus', '=', '0')
                                    ->get();
                            
                                    if (isset($chqbounce)) {
                                        foreach ($chqbounce as $chqFine)
                                            $totalFine=$totalFine+$chqFine->chequeBounceCharge;
                                    }
                               ?>
                               
                               <?php $__currentLoopData = $feeheads; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $fee): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                               <tr>
                                   <?php
                                    $k=0;
                                    $feedetails = \App\NorthFeeHead::where('isParent','=',$fee->idFeehead)->get();
                                    
                                    $date = Carbon\Carbon::parse($fee->toDate);
                                    $startDate = Carbon\Carbon::parse($fee->fromDate);
                                    $now = Carbon\Carbon::now();
                                    
                                    $diff = $date->diffInDays($now,false);
                                    
                                    $std_trdet = \App\BusTransactionDetail::where('idStudent','=',$student->idStudent)
                                               ->whereIn('idBusFeehead',$feedetails->pluck('idFeehead'))->where(function($query) {
                                                    $query->whereNull('status');
                                                  $query->orWhere('status', '=', 'Cleared');
                                                    $query->orWhere('status', '=', 'In-Process');
                                                    $query->orWhere('status', '=', 'Success');
                                                })
                                               ->select(DB::raw('amountPaid as amount'),DB::raw('discount as discount'),DB::raw('fine as fine'),'status')->latest()->first();
                                    
                                    $std_ledet=DB::table('bus_lesser_transaction_details')
                                    ->where('idStudent','=',$student->idStudent)
                                               ->whereIn('idBusFeehead',$feedetails->pluck('idFeehead'))
                                        ->where(function($query) {
                                                    $query->whereNull('status');
                                                  $query->orWhere('status', '=', 'Cleared');
                                                    $query->orWhere('status', '=', 'In-Process');
                                                    $query->orWhere('status', '=', 'Success');
                                                })       
                                               ->select(DB::raw('SUM(amountPaid) as amount'),DB::raw('SUM(discount) as discount'),DB::raw('fine as fine'),'status')->latest()->first();
                                    
                                   ?>
                                   <td>
                                       <?php if(isset($std_ledet->amount)): ?>
                                        <div></div>
                                       <?php elseif($std_trdet['amount'] != null && ($std_trdet['status'] == null || $std_trdet['status'] == 'Cleared')): ?>
                                       <div></div>
                                       <?php elseif(isset($std_ledet->amount)): ?>
                                           <?php if( ($std_ledet->amount+$std_ledet->discount) == $fee->amount && ($std_ledet->status == null || $std_ledet->status == 'Cleared')): ?>
                                           <div></div>
                                           <?php else: ?>
                                           <div class="checkbox-inline" style="padding-left:10px;"><input type="checkbox" name="selectedHeaders[]" value="<?php echo e($fee->idFeehead); ?>" class="feeclass" checked="checked" onclick="return false;"></div>
                                           <?php endif; ?>
                                       <?php else: ?>
                                        <div class="checkbox-inline" style="padding-left:10px;"><input type="checkbox" name="selectedHeaders[]" value="<?php echo e($fee->idFeehead); ?>" class="feeclass" checked="checked" onclick="return false;"></div>
                                        <?php endif; ?>
                                        
                                    </td>
                                   <td><?php echo e(Carbon\Carbon::parse($fee->toDate)->format('d-m-Y')); ?></td>
                                   <td>
                                       <?php echo e($fee->demandName); ?>

                                       <i class="zmdi zmdi-chevron-down" style="padding-right: 10px;
padding-left: 10px;" onclick="openDemand(<?php echo e($fee->idFeehead); ?>)"></i><br>
                                        
                                        <?php if(isset($std_ledet->amount)): ?>
                                        <?php if(($std_ledet->amount+ $std_ledet->discount ) != $fee->amount && ($std_ledet->status == null || $std_ledet->status == 'Cleared')): ?>
                                        <span  class="badge badge-info" style="font-size:12px;"> Paid :  <?php echo e($std_ledet->amount); ?></span>
                                        <?php endif; ?>
                                        <?php endif; ?>
                                    </td>
                                   <td class='amt'>
                                       <?php echo e($fee->amount); ?>

                                       <?php $totalFee=$totalFee+$fee->amount; ?>
                                       <input type="hidden" name='feeheads[<?php echo e($fee->idFeehead); ?>][famount]' value="<?php echo e($fee->amount); ?>">
                                   </td>
                                   <?
                                   $discounts = \App\NorthFeeHead::where('isParent','=',$fee->idFeehead)->select(DB::raw('SUM(discount) as total_discount'))->first();
                                   $fineAmount=0;
                                   ?>
                                   <td class="discount">
                                         <?php echo e($discounts->total_discount); ?>

                                         <?php $totalDis=$totalDis+$discounts->total_discount;?>
                                   </td>
                                   <td class="fine">
                                       <?php if(isset($std_ledet->amount)): ?>
                                       <?php echo e($fineAmount); ?>

                                       <?php elseif($fee->fine == 'flat' && $diff > 0): ?>
                                       <?php echo e($flatfine); ?>

                                       <?php $fineAmount=$flatfine;?>
                                       <?php elseif($fee->fine == 'per' && $diff > 0): ?>
                                       <?php
                                         if($diff > 0){
                                             foreach($perDay as $per){
                                                if($per->days <= $diff){
                                                    $fineAmount=$per->amount;
                                                    break;
                                                } 
                                             }
                                         }
                                         
                                       ?>
                                       <?php echo e($fineAmount); ?>

                                       <?php else: ?>
                                       <?php echo e($fineAmount); ?>

                                       <?php endif; ?>
                                       <input type="hidden" id="fine_<?php echo e($fee->idFeehead); ?>" value=" <?php echo e($fineAmount); ?>"/>
                                   </td>
                                   <td>
                                       
                                       <?php if(isset($std_ledet->amount)): ?>
                                        <?php if(($std_ledet->amount+ $std_ledet->discount ) == $fee->amount && ($std_ledet->status == null || $std_ledet->status == 'Cleared')): ?>
                                         <span class="badge badge-success">Paid </span>
                                        <?php else: ?>
                                        <span class="badge badge-info">Partial-Paid</span>
                                        <?php endif; ?>
                                        <?php elseif($std_trdet['amount'] != null && ($std_trdet['status'] == null || $std_trdet['status'] == 'Cleared')): ?>
                                            <span class="badge badge-success">Paid </span>
                                            <?php elseif( $std_trdet['status'] == 'In-Process'): ?>
                                            <span class="badge badge-info">In-Process </span>
                                            <?php elseif( ($startDate->diffInDays($now,false)) > 0): ?>
                                            <span class="badge badge-danger">DUE</span>
                                            <?php else: ?>
                                            <span class="badge badge-info">UPCOMING</span>
                                            <?php endif; ?>
                                   </td>
                               </tr>
                               <tr class="header_table_<?php echo e($fee->idFeehead); ?>" style="display:none;">
                                <td></td>   
                                <td></td>   
                                <td colspan="5">
                                    <table class="table"  style=" border: none;">
                                        <tbody  id="optional_list">
                                            
                                          <?php $__currentLoopData = $feedetails; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $headers): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <tr>
                                                <th style="border:0;"><?php echo e($headers->header->headerName); ?>

                                        <input type="hidden" name="subhead[<?php echo e($fee->idFeehead); ?>][<?php echo e($k); ?>][id]" value="<?php echo e($headers->idFeehead); ?>" form="feesubmission"/>         </th>
                                                <th style="border:0;"><input class="form-control" type="number" name="subhead[<?php echo e($fee->idFeehead); ?>][<?php echo e($k); ?>][headerAmount]" required="required" id="amount_<?php echo e($k); ?>" value="<?php echo e($headers->amount); ?>" readonly></th>
                                                <th style="border:0;"><input class="form-control" type="number" name="subhead[<?php echo e($fee->idFeehead); ?>][<?php echo e($k); ?>][headerDiscount]" required="required" id="discount_<?php echo e($k); ?>" value="<?php echo e($headers->discount); ?>" readonly><span id="amounterror<?php echo e($k); ?>"></span></th>
                                                <th style="border:0;"><input class="form-control" type="number" name="subhead[<?php echo e($fee->idFeehead); ?>][<?php echo e($k); ?>][headeraid]" required="required" id="paidamount_<?php echo e($fee->idFeehead.$k); ?>" value="<?php echo e($headers->amount - $headers->discount); ?>" onkeyup="calculateAmt(<?php echo e($fee->idFeehead); ?>) " readonly><span id="amounterror<?php echo e($k); ?>"></span></th>
                                      
                                            </tr>
                                        <?php $k++; ?>    
                                         <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>  
                                         <input type="hidden" id="total_row_<?php echo e($fee->idFeehead); ?>" value="<?php echo e($k); ?>"/>
                                        </tbody>
                                    </table>      
                                </td>
                               </tr>
                               <?php $totalFine=$totalFine+$fineAmount;?>
                               <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                <input name="fineAmount" type="hidden" value="<?php echo e($totalFine); ?>"/>
                           </tbody>
                       </table>
                   </div>
                </div>
                <div class="col-sm-5">
                    <div class="table-responsive">
                        <table class="table table-hover">
                               <thead>
                                   <tr>
                                       <th>Date</th>
                                       <th>Amount</th>
                                       <!--<th>Balance</th>-->
                                       <th>Payment Mode</th>
                                       <th>Print</th>
                                   </tr>
                               </thead>
                               <tbody>
                                   <?php $__currentLoopData = $paidfees; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $var): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <tr>
                                       <td><?php echo e($var->paymentDate); ?></td>
                                       <td><?php echo e($var->totalPaid); ?></td>
                                       <!--<td></td>-->
                                       <td><?php echo e($var->paymentMode); ?></td>
                                       <?php if($var->status == 'Cleared' || $var->status == null || $var->status == 'Success'): ?>
                                       <td><td><a href="<?php echo e(url('student/north/stdfees/bus/'.$var->idBusTransaction.'/print')); ?>" target="_blank" class="btn btn-sm btn-info">Print</a></td>
                               
                                       <?php endif; ?>
                                   </tr>
                                   <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </tbody>
                        </table>
                    </div>
                    <br>
                    <h5>Lesser Paid Receipt</h5>
                    <div class="table-responsive">
                        <table class="table table-hover">
                               <thead>
                                   <tr>
                                       <th>Date</th>
                                       <th>Amount</th>
                                       <!--<th>Balance</th>-->
                                       <th>Payment Mode</th>
                                       <th>Print</th>
                                   </tr>
                               </thead>
                               <tbody>
                                    <?php $__currentLoopData = $lesserfees; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $var): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <tr>
                                       <td><?php echo e($var->paymentDate); ?></td>
                                       <td><?php echo e($var->totalPaid); ?></td>
                                       <!--<td></td>-->
                                       <td><?php echo e($var->paymentMode); ?></td>
                                       <?php if($var->status == 'Cleared' || $var->status == null ): ?>
                                       <td><a href="<?php echo e(url('student/north/lessamt/bus/'.$var->idBusLesserTransaction.'/print')); ?>" target="_blank" class="btn btn-sm btn-info">Print</a></td>
                                       
                                       <?php endif; ?>
                                   </tr>
                                   <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </tbody>
                        </table>
                    </div>
                </div>
               
                
            </div>
            <hr>
            <div class="row">
                <div class="col-md-5">
                        <div class="row clearfix">
                            <div class="col-sm-5 form-control-label">
                                <label for="classname">Payable Amount</label>
                            </div>
                            <div class="col-sm-6">
                                <div class="form-group">
                                    <input type="text" name="payableAmount" class="form-control payableAmount" readonly="readonly"  style="color: black;font-size: 1.2em;">
                                    <input type="hidden" name="TxnAmount"/>
                                    <span id="payableerror"></span>
                                </div>
                            </div>
                        </div>
                       
                        
                       

                </div>
                <div class="col-md-6 text-right">
                    <p class="m-b-0"><b>Fee Total: </b>
                    <span  id='total_fee'><?php echo e($totalFee); ?></span>
                        <input type="hidden" name="feeTotal" id="feetotal">
                    </p>
                    <p class="m-b-0">
                        <b>Discount: </b>
                        <span  id='total_discount'><?php echo e($totalDis); ?></span>
                        <input type="hidden" name="discount" id="discounttotal">
                    </p>     
                    <?php 
                    
                    $std_tr = \App\BusTransaction::where('idStudent','=',$student->idStudent)->where(function($query) {
                            $query->whereNull('status');
                          $query->orWhere('status', '=', 'Cleared');
                            $query->orWhere('status', '=', 'In-Process');
                            $query->orWhere('status', '=', 'Success');
                        })->select(DB::raw('SUM(totalPaid) as amount'),DB::raw('SUM(discount) as discount'),DB::raw('SUM(fine) as fine'))->latest()->first();
                                    
                    $std_le=DB::table('bus_lesser_transaction')
                                    ->where('idStudent','=',$student->idStudent)
                                     ->where(function($query) {
                                                $query->whereNull('bus_lesser_transaction.status');
                                                $query->orWhere('bus_lesser_transaction.status', '=', 'Cleared');
                                                $query->orWhere('bus_lesser_transaction.status', '=', 'In-Process');
                                                $query->orWhere('bus_lesser_transaction.status', '=', 'Success');
                                            })
                                               ->select(DB::raw('SUM(totalPaid) as amount'),DB::raw('SUM(discount) as discount'),DB::raw('SUM(fine) as fine'))->latest()->first();
                    $totalFinePaid=0;
                    $totalAmountPaid=0;
                    
                    if(isset($std_le->fine))
                    $totalFinePaid=$totalFinePaid+$std_le->fine;
                    if(isset($std_tr->fine))
                    $totalFinePaid=$totalFinePaid+$std_tr->fine;
                    
                    if(isset($std_le->amount))
                    $totalAmountPaid=$totalAmountPaid+$std_le->amount;
                    if(isset($std_tr->amount))
                    $totalAmountPaid=$totalAmountPaid+$std_tr->amount;
                    
                    
                    
                    
                    ?>
                    <p class="m-b-0">
                        <b>Fine: </b>
                        <span id='total_fine'><?php echo e($totalFinePaid); ?></span>
                        <input type="hidden" name="fine" id="finetotal">
                    </p>
                    <p class="m-b-0">
                        <b>Cheque Bounce Penalty: </b>
                        <span id="penaltyAmt"></span>
                         <?php $chqbounce = \App\BusTransaction::where('idStudent','=',$student->idStudent)
                                ->where('idFinancialYear','=',$student->idFinancialYear)
                                ->where('status','=','Bounced')
                                ->get();
                                
                                $chqPenaltyAmount=0;
                                $chqPenaltyPaid=0;
                                $chqPenaltyUnPaid=0;
                                if(isset($chqbounce)){
                                foreach($chqbounce as $chqFine)
                                    {
                                        if($chqFine->chqFineStatus == 1)
                                        $chqPenaltyPaid=$chqPenaltyPaid+$chqFine->chequeBounceCharge;
                                        else
                                        $chqPenaltyUnPaid=$chqPenaltyUnPaid+$chqFine->chequeBounceCharge;
                                        
                                        $chqPenaltyAmount=$chqPenaltyAmount+$chqFine->chequeBounceCharge;
                                    }
                                }
                            ?>
                            <?php if(isset($chqbounce)): ?>
                            <?php echo e($chqPenaltyAmount); ?>

                            <?php if($chqPenaltyAmount==0): ?>
                            <span></span>
                            <?php elseif($chqPenaltyAmount > $chqPenaltyPaid): ?>
                            <span style="color:red"> | <?php echo e($chqPenaltyUnPaid); ?>(Unpaid)</span>
                            <?php else: ?>
                            <span style="color:green">(Paid)</span>
                            <?php endif; ?>
                            <?php else: ?>
                            <span>0.00</span>
                            <?php endif; ?>
                    </p>
                    <p class="m-b-0"><b>Excess Amount : </b>
                    <span>0.00</span>
                    </p>
                   
                    <p class="m-b-0"><b>Total Amount : </b>
                    <?php
                        $totalAmount=$totalFee+$totalFinePaid-$totalDis;
                        echo'<span>'.$totalAmount.'<span>';
                    ?>
                    </p> 
                    <p class="m-b-0"><b>Total Paid: </b>
                    <span><?php echo e($totalAmountPaid); ?></span>
                    </p>
                    <p class="m-b-0"><b>Balance Amount: </b>
                     <?php
                        $totalBalance= ( $totalFee+$totalFinePaid-$totalDis ) - $totalAmountPaid;
                        echo'<span>'.$totalBalance.'<span>';
                    ?>     
                    </p>
                </div>
            </div>
            <!--<hr>-->

            <hr>
            <div class="hidden-print col-md-12 text-right">
                <input class="btn btn-primary btn-round" type="submit" name="payable" value="Submit" id="submit-btn"/>
                </form>
            </div>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('script'); ?>
<script>
    // Saving form data
var isValid=0;     
$('#feesubmission').on('submit',function(e){
    $('input[name="TxnAmount"]').val($('input[name="payableAmount"]').val());
    
    {
     var formData =  new FormData($('#feesubmission')[0]);
      $.ajaxSetup({
        header:$('meta[name="_token"]').attr('content')
        });
      if(isValid==0){
      $.ajax({
        type:"POST",
        url: "<?php echo e(url('student/transaction')); ?>",
        processData: false,
        contentType: false,
        "_token": "<?php echo e(csrf_token()); ?>",
        data:formData,
        dataType: 'json',
        success:function(data){
           if(data[Object.keys(data)[0]] === 'SUCCESS')
           {
              isValid=1;
              $('#feesubmission').submit();
           }
           else{
                $("#submit-btn").prop('disabled', true);
                alert("Please select any fee header");
                return false;
           }
        },
        error: function(data){
            //$("#submit-btn").prop('disabled', true);
            alert("Please select any fee header");
            return false;
        }}
      );
      }
      if(isValid==1) return true;
      else return false;
     
    }
});
$(document).ready(function(){
 $('.otherpaymode').hide(); 
 var feeheaderIds = [];
        $("input:checkbox[name='selectedHeaders[]']:checked").each(function () {
                feeheaderIds.push($(this).val());
        });
        var totalPayable=0;
        
        if(feeheaderIds.length>0)
        {
            $.each(feeheaderIds, function( index, value ) {
              var i;
                for (i = 0; i < $('#total_row_'+value).val(); i++) { 
                    var amount=$('#paidamount_'+value+i).val();
                    if( amount!='NaN')    
                     totalPayable = totalPayable+parseInt(amount);
                     
                }
            });
            totalPayable=totalPayable+<?php echo $totalFine?>;
            $('input[type=text].payableAmount').val(totalPayable);    
            
        }
    else    $('input[name="payableAmount"]').val(" ");     
});
function openDemand(id){
     $('.header_table_'+id).toggle();
}
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('students.student_layout', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

Copyright © 2021 - 2025 IMMREX7