<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Pay Sllip</title>
    <?php echo $__env->make('backend.pdf.layouts.feebill_css', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
</head>
<style>
    </style>

<body onload="window.print();">
<main >
    <div class="row" style="padding: 0px;margin: 0px;">
        <div class="col-md-12" style="padding: 0px;margin: 0px;">
            <div style="padding: 0px;">
                <table cellpadding="0" cellspacing="0">
                    <tr class="top">
                        <td colspan="2">
                            <table>
                                <tr>
                                    <td style="width: 60%;" align="center">
                                       
                                        <br>
                                        <!--
                                        <img src="<?php echo e(get_department_logo(@$department->id,'school_logo')); ?>" style="width:100%;"> 
                                        -->
                                         <center><img src="<?php echo e(get_logo()); ?>" style="width:100px;height:80px;">  </center>
                                        <b><h2 class="pm-0"><?php echo e(get_option("school_name")); ?></h2></b>
                                        <small><?php echo e(get_option("address")); ?>

                                        <?php echo e(_lang('Ph')." : ".get_option("phone")); ?></small>
                                       
                                        <br/>

                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2"><h2 class="pm-0" align="center"><?php echo e(_lang('Pay Slip')); ?></h2></td>
                    </tr>
                    <?php //dd($transaction, $invoice, $studentpayment); ?>
                    <tr>
                        <td colspan="2" class="text-center pt-3"><span class="pm-0"><?php echo e(@$department->department_name); ?></span></td>
                    </tr>
                    <tr class="brk-10">
                        <td colspan="2"></td>
                    </tr>
                    <tr>
                        <?php $__currentLoopData = $receipt_no; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $receipt): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <td class="pt-3 pb-3" ><b class="pm-0"><?php echo e(_lang('Receipt No')); ?>:</b> 
                        <span>
                            <?php echo e($receipt->receipt_no); ?>

                        </span>
                        </td>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        <td class="pt-3 pb-3" colspan="2"><b class="pm-0"><?php echo e(_lang("Name")); ?>:</b><strong> <?php echo e($invoice->first_name." ".$invoice->last_name); ?></strong></td>
                    </tr>
                    
                    <tr>
                        <td class="pt-3 pb-3" class="text-left" width="50%"><b class="pm-0"> <?php echo e(_lang("Floor")); ?>:</b> <strong><?php echo e($invoice->class_name); ?></strong></td>
                        <td class="pt-3 pb-3" class="text-left" width="50%"><b class="pm-0"> <?php echo e(_lang("Room")); ?>:</b> <strong><?php echo e($invoice->section_name); ?></strong></td>
                    </tr>

                    <tr class="brk-10">
                        <td colspan="2"></td>
                    </tr>
                </table>
                <div style="margin-top: 10px;"> 
                    <fieldset>
                        <legend>Fee Details:</legend>
                        <?php if(!empty($invoice)): ?>
                        <b><?php echo e(_lang('Periods')); ?>:</b> 
                        <span>
                            <?php echo e($invoice->title); ?>

                        </span>
                        <table class="table-data" style="margin-top: 5px;margin-bottom: 5px;">
                            <tbody>    
                                   <small><?php //dd($invoiceItems); ?></small>

                                <?php $__currentLoopData = $invoiceItems; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                   <tr>
                                     <td class="text-left" width="70%"><b><?php echo e(@$item->account_name); ?></b></td>
                                     <td class="text-right"><?php echo e($currency." ".decimalPlace($item->amount-$item->discount)); ?></td>
                                   </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </tbody>
                        </table>
                        <hr/>
                        <p class="text-right" style="margin: 3px;"> 
                        <b>
                            <?php echo e(_lang('Current Payslip Total')); ?>: <?php echo e($currency." ".decimalPlace(@$invoiceItemsSum)); ?>

                        </b>

                       <p class="text-right" style="margin: 3px;"> 
                        <b>
                            <?php echo e(_lang('Previous Balance')); ?>: <?php echo e($currency." ".decimalPlace(@$total_previous_balance)); ?>

                        </b>
                        </p>

                        <p class="text-right" style="margin: 3px;"> 
                        <b>
                            <?php echo e(_lang('Total Pending Dues')); ?>: <?php echo e($currency." ".decimalPlace(@$total_previous_balance + @$invoiceItemsSum)); ?>

                        </b>
                        </p>

                        <hr/>
                        <hr/>
                        <p class="text-right" style="margin: 3px;"> 
                        <b>
                            <?php echo e(_lang('Paid Amount')); ?>: <?php echo e($currency." ".decimalPlace($invoice->paid)); ?>

                        </b>
                        </p>

                        <p class="text-right" style="margin: 3px;"> 
                        <b><?php if($total_balance>0): ?>
                            <?php echo e(_lang('Remaining Balance')); ?>: <?php echo e($currency." ".decimalPlace(@$total_balance)); ?>

                        
                        <?php endif; ?>
                        </b>
                        </p>
                        <hr/>
                        
                        <?php if($invoice->payment_date): ?>
                        <b><?php echo e(_lang('Payment Date')); ?>:</b> 
                        <span>
                            <?php echo e(date('l, F d, Y',strtotime($invoice->payment_date))); ?>

                        </span>
                        <?php endif; ?>
                        <?php endif; ?>
                    </fieldset>
                    <p style="margin-top: 20px;">Powered by http://logic-consultants.com</p>
                </div>
            </div>
        </div>        
    </div>
</main>

</body>
</html>
<script>
    window.onload = function() {
        window.print();
    };

    window.onafterprint = function () {
    window.location.href = "/invoices"; // replace with the correct route if needed
};

    </script>
<?php /**PATH D:\Projects\hms_fatima\hms_fatima\resources\views/backend/pdf/invoices/paysllip.blade.php ENDPATH**/ ?>