<?php $__env->startSection('page-title', __('Compensation Outcomes')); ?>

<?php $__env->startSection('breadcrumb'); ?>
    <li class="breadcrumb-item"><a href="<?php echo e(route('dashboard')); ?>"><?php echo e(__('Home')); ?></a></li>
    <li class="breadcrumb-item"><?php echo e(__('Compensation Outcomes')); ?></li>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('action-button'); ?>
    <div class="d-flex">
        <a href="<?php echo e(route('compensation_outcomes.export')); ?>" class="btn btn-sm btn-primary me-2">
            <i class="ti ti-download"></i> <?php echo e(__('Export Outcomes')); ?>

        </a>
    </div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
    <div class="row">
        <div class="col-12">
            <div class="card">
                <div class="card-body table-border-style table-responsive w-100">
                    <table class="table datatable">
                        <thead>
                            <tr>
                                <th><?php echo e(__('Employee')); ?></th>
                                <th><?php echo e(__('Appraisal ID')); ?></th>
                                <th><?php echo e(__('Final Score')); ?></th>
                                <th><?php echo e(__('Action Type')); ?></th>
                                <th><?php echo e(__('Action Details')); ?></th>
                                <th><?php echo e(__('New Salary')); ?></th>
                                <th><?php echo e(__('Bonus Multiplier')); ?></th>
                                <th><?php echo e(__('New Equity')); ?></th>
                                <th><?php echo e(__('Promotion Level')); ?></th>
                                <th><?php echo e(__('Retention Grant')); ?></th>
                                <th><?php echo e(__('Appraisal Date')); ?></th>
                                <th><?php echo e(__('Status')); ?></th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php $__empty_1 = true; $__currentLoopData = $outcomes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $outcome): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                                <tr>
                                    <td><?php echo e(optional($outcome->appraisal_review->employee)->name ?? '-'); ?></td>
                                    <td><?php echo e($outcome->appraisal_review_id); ?></td>
                                    <td><?php echo e(number_format($outcome->final_score ?? 0, 2)); ?></td>
                                    <td><?php echo e(ucfirst(str_replace('_', ' ', $outcome->action_type))); ?></td>
                                    <td>
                                        <?php if(is_string($outcome->action_details) && \Illuminate\Support\Str::startsWith($outcome->action_details, '{')): ?>
                                            <?php echo e(json_decode($outcome->action_details)->notes ?? $outcome->action_details); ?>

                                        <?php else: ?>
                                            <?php echo e($outcome->action_details ?? '-'); ?>

                                        <?php endif; ?>
                                    </td>
                                    <td><?php echo e($outcome->new_salary !== null ? number_format($outcome->new_salary, 2) : '-'); ?></td>
                                    <td><?php echo e($outcome->bonus_multiplier !== null ? $outcome->bonus_multiplier : '-'); ?></td>
                                    <td><?php echo e($outcome->new_equity ?? '-'); ?></td>
                                    <td><?php echo e($outcome->promotion_level ?? '-'); ?></td>
                                    <td><?php echo e($outcome->retention_grant !== null ? number_format($outcome->retention_grant, 2) : '-'); ?>

                                    </td>
                                    <td><?php echo e($outcome->appraisal_review->appraisal_date ? \Carbon\Carbon::parse($outcome->appraisal_review->appraisal_date)->format('Y-m-d') : '-'); ?>

                                    </td>
                                    <td><?php echo e(ucfirst($outcome->appraisal_review->status ?? '-')); ?></td>
                                </tr>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                                <tr>
                                    <td colspan="12" class="text-center"><?php echo e(__('No outcomes found.')); ?></td>
                                </tr>
                            <?php endif; ?>
                        </tbody>
                    </table>

                    <div class="mt-3">
                        <?php if(method_exists($outcomes, 'links')): ?>
                            <?php echo e($outcomes->links()); ?>

                        <?php endif; ?>
                    </div>
                </div>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.admin', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/payraty/hris/resources/views/appraisal_reviews/outcomes.blade.php ENDPATH**/ ?>