
<?php $__env->startSection('title', 'Employee Payroll'); ?>
<?php $__env->startPush('plugin-styles'); ?>
<link rel="stylesheet" href="<?php echo e(asset('theme/vendors/datatables.net-bs5/dataTables.bootstrap5.css')); ?>">
<?php $__env->stopPush(); ?>
<?php $__env->startSection('content'); ?>
<div class="card">
    <div class="card-body">
        <div class="d-flex justify-content-between align-items-center mb-3">
            <h6 class="card-title">Employee Payroll</h6>
            <a href="<?php echo e(route('employee-payroll.create')); ?>" class="btn btn-primary">
                <i class="fas fa-plus me-2"></i>Calculate Payroll
            </a>
        </div>

        <div class="table-responsive">
            <table id="payrollTable" class="table table-striped">
                <thead>
                    <tr>
                        <th>Code</th>
                        <th>Employee</th>
                        <th>Pay Type</th>
                        <th>Period</th>
                        <th>Net Salary</th>
                        <th>Status</th>
                    </tr>
                </thead>
            </table>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php $__env->startPush('plugin-scripts'); ?>
<script src="<?php echo e(asset('theme/vendors/jquery/jquery.min.js')); ?>"></script>
<script src="<?php echo e(asset('theme/vendors/datatables.net/dataTables.js')); ?>"></script>
<script src="<?php echo e(asset('theme/vendors/datatables.net-bs5/dataTables.bootstrap5.js')); ?>"></script>
<script>
$(document).ready(function() {
    $('#payrollTable').DataTable({
        processing: true,
        serverSide: true,
        ajax: "<?php echo e(route('employee-payroll.index')); ?>",
        columns: [
            { data: 'payroll_code', name: 'payroll_code' },
            { data: 'employee_name', name: 'employee.name' },
            { data: 'pay_type', name: 'pay_type' },
            {
                data: null,
                name: null,
                searchable: false,
                orderable: false,
                // name: 'period',
                render: function(data) {
                    return data.period_start + ' to ' + data.period_end;
                }
            },
            { data: 'net_salary_formatted', name: 'net_salary' },
            { data: 'status', name: 'status', orderable: false }
        ],
        order: [[0, 'desc']]
    });
});
</script>
<?php $__env->stopPush(); ?>

<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\laragon\www\habibcables-ERP\resources\views\employee-payroll\index.blade.php ENDPATH**/ ?>