<div class="employee-deductions-section">

    
    <div class="employee-deductions-header mb-4 d-flex justify-content-between align-items-center">
        <div class="row align-items-center">
            <div class="col">
              <h5 class="employee-deductions-title mb-1">Employee Deductions</h5>
            <small class="text-muted">
                Manage salary deductions for this employee
            </small>
            </div>
            <div class="col-auto">
            <button type="button"
                class="btn btn-sm btn-outline-primary"
                id="addDeductionRow">
            <i class="bi bi-plus"></i> Add Deduction
        </button>
            </div>
        </div>     
    </div>

    
    <div class="employee-deductions-body">

        <div class="table-responsive">
            <table class="table table-bordered align-middle deductions-table"
                   id="deductionsTable">

                <thead class="table-light">
                    <tr>
                        <th style="min-width: 220px;">
                            Deduction <span class="text-danger">*</span>
                        </th>
                        <th style="min-width: 180px;">Calculation Type</th>
                        <th style="min-width: 150px;">Amount</th>
                        <th style="min-width: 130px;">Status</th>
                        <th class="text-center" style="width: 50px;"></th>
                    </tr>
                </thead>

                <tbody>

                
                <?php if(isset($employee) && $employee->deductions->count()): ?>
                    <?php $__currentLoopData = $employee->deductions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $i => $ea): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <tr>

                            <td>
                                <select name="deductions[<?php echo e($i); ?>][addition_id]"
                                        class="form-control addition-select"
                                        required>
                                    <option value="">-- Select --</option>
                                    <?php $__currentLoopData = $deductions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $add): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($add->id); ?>"
                                            <?php if($ea->deduction_id == $add->id): echo 'selected'; endif; ?>>
                                            <?php echo e($add->name); ?>

                                        </option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                            </td>

                            <td>
                                <input type="text"
                                       name="deductions[<?php echo e($i); ?>][calculation_type]"
                                       class="form-control calculation-type"
                                       value="<?php echo e($ea->calculation_type); ?>"
                                       readonly>
                            </td>

                            <td>
                                <input type="number"
                                       name="deductions[<?php echo e($i); ?>][amount]"
                                       class="form-control amount"
                                       value="<?php echo e($ea->amount); ?>"
                                       <?php echo e($ea->calculation_type != 'both' ? 'readonly' : ''); ?>>
                            </td>

                            <td>
                                <select name="deductions[<?php echo e($i); ?>][status]"
                                        class="form-control">
                                    <option value="1" <?php if($ea->status == 1): echo 'selected'; endif; ?>>Active</option>
                                    <option value="0" <?php if($ea->status == 0): echo 'selected'; endif; ?>>Inactive</option>
                                </select>
                            </td>

                            <td class="text-center">
                                <button type="button"
                                        class="btn btn-sm btn-outline-danger remove-row"
                                        title="Remove">
                                    <i class="fas fa-trash"></i>
                                </button>
                            </td>

                        </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                <?php endif; ?>

                </tbody>

            </table>
        </div>

    </div>

</div>
<?php /**PATH /home/codeproh/va.laraoffice.com/app/Modules/HR/Core/Providers/../Views/employees/partials/deductions.blade.php ENDPATH**/ ?>