

<?php $__env->startSection('title', 'My Finance'); ?>
<?php $__env->startSection('heading', 'My Finance'); ?>

<?php $__env->startSection('content'); ?>
<?php $currency = config('app.currency_symbol', '₹'); ?>

<?php echo $__env->make('finance.top-submenu', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>

<div class="mb-5 flex flex-wrap items-center justify-between gap-3">
    <p class="text-sm text-slate-600">Your expense claims and salary advance repayments.</p>
    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('create', App\Models\Expense::class)): ?>
        <a href="<?php echo e(route('expenses.create')); ?>" class="inline-flex items-center gap-1.5 rounded-lg bg-primary px-4 py-2 text-sm font-medium text-white hover:bg-primary-hover">
            <i class="bi bi-plus-lg"></i> Submit claim
        </a>
    <?php endif; ?>
</div>

<div class="mb-6 grid gap-4 sm:grid-cols-2 xl:grid-cols-4">
    <div class="relative overflow-hidden rounded-2xl border border-slate-200/70 bg-white p-5 pl-6 shadow-sm">
        <span class="absolute inset-y-0 left-0 w-1.5 rounded-l-2xl bg-amber-500" aria-hidden="true"></span>
        <p class="text-xs font-semibold uppercase tracking-wider text-slate-500">Pending claims</p>
        <p class="mt-2 text-xl font-bold text-amber-700"><?php echo e($stats['pending_claims']); ?></p>
        <p class="mt-1 text-xs text-slate-500"><?php echo e($currency); ?><?php echo e(number_format($stats['pending_claims_amount'], 2)); ?> awaiting review</p>
    </div>
    <div class="relative overflow-hidden rounded-2xl border border-slate-200/70 bg-white p-5 pl-6 shadow-sm">
        <span class="absolute inset-y-0 left-0 w-1.5 rounded-l-2xl bg-emerald-500" aria-hidden="true"></span>
        <p class="text-xs font-semibold uppercase tracking-wider text-slate-500">Approved this month</p>
        <p class="mt-2 text-xl font-bold text-emerald-700"><?php echo e($currency); ?><?php echo e(number_format($stats['approved_mtd'], 2)); ?></p>
    </div>
    <div class="relative overflow-hidden rounded-2xl border border-slate-200/70 bg-white p-5 pl-6 shadow-sm">
        <span class="absolute inset-y-0 left-0 w-1.5 rounded-l-2xl bg-sky-500" aria-hidden="true"></span>
        <p class="text-xs font-semibold uppercase tracking-wider text-slate-500">Outstanding advance</p>
        <p class="mt-2 text-xl font-bold text-slate-900"><?php echo e($currency); ?><?php echo e(number_format($stats['outstanding_advance'], 2)); ?></p>
        <a href="<?php echo e(route('finance.my-advances')); ?>" class="mt-1 inline-block text-xs text-primary hover:underline">View schedule</a>
    </div>
    <div class="relative overflow-hidden rounded-2xl border border-slate-200/70 bg-white p-5 pl-6 shadow-sm">
        <span class="absolute inset-y-0 left-0 w-1.5 rounded-l-2xl bg-violet-500" aria-hidden="true"></span>
        <p class="text-xs font-semibold uppercase tracking-wider text-slate-500">Next payroll deduction</p>
        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($stats['next_deduction']): ?>
            <p class="mt-2 text-xl font-bold text-slate-900"><?php echo e($currency); ?><?php echo e(number_format((float) $stats['next_deduction']->amount, 2)); ?></p>
            <p class="mt-1 text-xs text-slate-500"><?php echo e(date('M Y', mktime(0, 0, 0, $stats['next_deduction']->month, 1, $stats['next_deduction']->year))); ?></p>
        <?php else: ?>
            <p class="mt-2 text-lg font-medium text-slate-500">None scheduled</p>
        <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
    </div>
</div>

<?php if (isset($component)) { $__componentOriginal53747ceb358d30c0105769f8471417f6 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal53747ceb358d30c0105769f8471417f6 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.card','data' => []] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('card'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
    <div class="mb-4 flex items-center justify-between">
        <h2 class="text-sm font-semibold text-slate-800">Recent claims</h2>
        <a href="<?php echo e(route('expenses.index', ['scope' => 'self'])); ?>" class="inline-flex items-center gap-1 text-sm font-medium text-primary hover:underline">
            View all <i class="bi bi-chevron-right text-[10px]"></i>
        </a>
    </div>
    <?php if (isset($component)) { $__componentOriginal163c8ba6efb795223894d5ffef5034f5 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal163c8ba6efb795223894d5ffef5034f5 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.table','data' => []] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('table'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
         <?php $__env->slot('head', null, []); ?> 
            <tr>
                <th class="px-4 py-3 text-left text-xs font-medium uppercase text-slate-500">Category</th>
                <th class="px-4 py-3 text-left text-xs font-medium uppercase text-slate-500">Amount</th>
                <th class="px-4 py-3 text-left text-xs font-medium uppercase text-slate-500">Date</th>
                <th class="px-4 py-3 text-left text-xs font-medium uppercase text-slate-500">Status</th>
            </tr>
         <?php $__env->endSlot(); ?>
        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__empty_1 = true; $__currentLoopData = $stats['recent_claims']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $claim): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
            <tr>
                <td class="px-4 py-3 text-sm text-slate-900"><?php echo e($claim->category); ?></td>
                <td class="px-4 py-3 text-sm font-medium text-slate-900"><?php echo e($currency); ?><?php echo e(number_format((float) $claim->amount, 2)); ?></td>
                <td class="px-4 py-3 text-sm text-slate-600"><?php echo e($claim->date?->format('d M Y')); ?></td>
                <td class="px-4 py-3 text-sm capitalize"><?php echo e($claim->status); ?></td>
            </tr>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
            <tr><td colspan="4" class="p-0">
                <?php echo $__env->make('finance.partials.empty-state', [
                    'title' => 'No claims yet',
                    'description' => 'Your submitted expense claims will appear here.',
                    'actionUrl' => auth()->user()?->can('create', App\Models\Expense::class) ? route('expenses.create') : null,
                    'actionLabel' => 'Submit claim',
                    'icon' => 'bi-receipt',
                ], array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
            </td></tr>
        <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
     <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal163c8ba6efb795223894d5ffef5034f5)): ?>
<?php $attributes = $__attributesOriginal163c8ba6efb795223894d5ffef5034f5; ?>
<?php unset($__attributesOriginal163c8ba6efb795223894d5ffef5034f5); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal163c8ba6efb795223894d5ffef5034f5)): ?>
<?php $component = $__componentOriginal163c8ba6efb795223894d5ffef5034f5; ?>
<?php unset($__componentOriginal163c8ba6efb795223894d5ffef5034f5); ?>
<?php endif; ?>
 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal53747ceb358d30c0105769f8471417f6)): ?>
<?php $attributes = $__attributesOriginal53747ceb358d30c0105769f8471417f6; ?>
<?php unset($__attributesOriginal53747ceb358d30c0105769f8471417f6); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal53747ceb358d30c0105769f8471417f6)): ?>
<?php $component = $__componentOriginal53747ceb358d30c0105769f8471417f6; ?>
<?php unset($__componentOriginal53747ceb358d30c0105769f8471417f6); ?>
<?php endif; ?>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/kiyohr/v2_version/resources/views/finance/self.blade.php ENDPATH**/ ?>