<?php $__env->startSection('page-title', __('Low') . ' ' . __('Stock')); ?>
<?php $__env->startPush('page-css'); ?>
<?php $__env->stopPush(); ?>
<?php $__env->startSection('page-content'); ?>
<div class="container-xxl flex-grow-1 container-p-y">
    <!-- Low Stock Header -->
    <div class="d-flex flex-column flex-md-row justify-content-between align-items-start align-items-md-center mb-6 row-gap-4">
        <div class="d-flex flex-column justify-content-center">
            <h4 class="mb-0"><?php echo e(__('Low')); ?> <?php echo e(__('Stock')); ?></h4>
        </div>
        <?php echo $__env->make('backend.components.breadcrumb', [
            'breadcrumbs' => [
                [
                    'label' => '<i class="ti tabler-home"></i>',
                    'link' => '#'
                ],
                [
                    'label' => __('Item') . ' & ' . __('Stock'),
                    'link' => '#'
                ],
                [
                    'label' => __('Low') . ' ' . __('Stock'),
                    'active' => true
                ]
            ]
        ], array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
    </div>

    <?php if(session('success')): ?>
        <?php echo insertSuccess(session('success')); ?>

    <?php endif; ?>
    <?php if(session('error')): ?>
        <?php echo insertFailed(session('error')); ?>

    <?php endif; ?>

    <!-- Filter Section -->
    <div class="card mb-4" id="filterSection" style="display: none;">
        <div class="card-body">
            <form id="filterForm" onsubmit="event.preventDefault(); return false;" action="javascript:void(0);">
                <div class="row">
                    <div class="col-md-3">
                        <label class="form-label"><?php echo e(__('Code')); ?></label>
                        <select class="form-select select2" name="item_code" id="item_code_f">
                            <option value=""><?php echo e(__('All Codes')); ?></option>
                            <?php $__currentLoopData = $items; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <option value="<?php echo e($value->code); ?>" <?php echo e(request('item_code') == $value->code ? 'selected' : ''); ?>>
                                    <?php echo e($value->code); ?>

                                </option>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </select>
                    </div>
                    <div class="col-md-3">
                        <label class="form-label"><?php echo e(__('Category')); ?></label>
                        <select class="form-select select2" name="category_id" id="category_id_f">
                            <option value=""><?php echo e(__('All Categories')); ?></option>
                            <?php $__currentLoopData = $item_categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <option value="<?php echo e($value->id); ?>" <?php echo e(request('category_id') == $value->id ? 'selected' : ''); ?>>
                                    <?php echo e($value->name); ?>

                                </option>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </select>
                    </div>
                    <div class="col-md-3">
                        <label class="form-label"><?php echo e(__('Brand')); ?></label>
                        <select class="form-select select2" name="brand_id" id="brand_id_f">
                            <option value=""><?php echo e(__('All Brands')); ?></option>
                            <?php $__currentLoopData = $brands; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <option value="<?php echo e($value->id); ?>" <?php echo e(request('brand_id') == $value->id ? 'selected' : ''); ?>>
                                    <?php echo e($value->name); ?>

                                </option>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </select>
                    </div>
                    <div class="col-md-3">
                        <label class="form-label"><?php echo e(__('Item')); ?></label>
                        <select class="form-select select2" name="item_id" id="item_id_f">
                            <option value=""><?php echo e(__('All Items')); ?></option>
                            <?php $__currentLoopData = $items; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <option value="<?php echo e($value->id); ?>" <?php echo e(request('item_id') == $value->id ? 'selected' : ''); ?>>
                                    <?php if($value->parent_id): ?>
                                        <?php echo e(\Modules\Stock\Models\Item::find($value->parent_id)->name ?? ''); ?>

                                    <?php endif; ?>
                                    <?php echo e($value->name); ?>(<?php echo e($value->code); ?>)
                                </option>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </select>
                    </div>
                    <div class="col-md-3 mt-3">
                        <label class="form-label"><?php echo e(__('Generic')); ?> <?php echo e(__('Name')); ?></label>
                        <input id="generic_name_f" type="text" class="form-control" name="generic_name" 
                               placeholder="<?php echo e(__('Generic')); ?> <?php echo e(__('Name')); ?>" 
                               value="<?php echo e(request('generic_name')); ?>">
                    </div>
                    <div class="col-md-3 mt-3">
                        <label class="form-label"><?php echo e(__('Supplier')); ?></label>
                        <select class="form-select select2" id="supplier_id_f" name="supplier_id">
                            <option value=""><?php echo e(__('All Suppliers')); ?></option>
                            <?php $__currentLoopData = $suppliers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $splr): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <option value="<?php echo e($splr->id); ?>" <?php echo e(request('supplier_id') == $splr->id ? 'selected' : ''); ?>>
                                    <?php echo e($splr->name); ?>

                                </option>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </select>
                    </div>
                    <div class="col-md-12 mt-3">
                        <button type="button" class="btn btn-primary me-2" id="applyFilter">
                            <i class="ti tabler-filter me-1"></i><?php echo e(__('Apply Filter')); ?>

                        </button>
                    </div>
                </div>
            </form>
        </div>
    </div>

    <!-- Low Stock Table -->
    <div class="row">
        <div class="col-12">
            <div class="card">
                <div class="card-datatable table-responsive pt-0">
                    <table class="datatables-basic table">
                        <thead>
                            <tr>
                                <th><?php echo e(__('SN')); ?></th>
                                <th><?php echo e(__('Item')); ?>(<?php echo e(__('Code')); ?>)</th>
                                <th><?php echo e(__('Category')); ?></th>
                                <th><?php echo e(__('Stock')); ?> <?php echo e(__('Details')); ?></th>
                                <th><?php echo e(__('Total')); ?> <?php echo e(__('Stock')); ?> <?php echo e(__('Quantity')); ?></th>
                                <th>
                                    <?php echo e(__('LPP')); ?>/<?php echo e(__('PP')); ?>

                                    <i data-tippy-content="<?php echo e(__('LPP_PP')); ?>" class="ti tabler-info-circle tippyBtnCall font-16 theme-color"></i>
                                </th>
                                <th class="text-right" style="text-align: right;"><?php echo e(__('Total')); ?></th>
                            </tr>
                        </thead>
                        <tbody>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- Stock Segmentation Modal -->
<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-xl">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title stock_segment_title"><?php echo e(__('Stock')); ?> <?php echo e(__('Details')); ?></h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
            
            <div class="modal-body stock_modal_print_btn">
                <div class="box-wrapper">
                    <div class="table-box">
                        <div class="table-responsive">
                            <!-- IMEI/Serial Table -->
                            <table id="datatable2" class="table table-bordered table-striped datatable2" style="display: none;">
                                <thead>
                                    <tr class="imeiHeading">
                                        <th class="w-5 text-left"><?php echo e(__('SN')); ?></th>
                                        <th class="w-30"><?php echo e(__('IMEI')); ?>/<?php echo e(__('Serial')); ?> <?php echo e(__('Number')); ?></th>
                                    </tr>
                                </thead>
                                <tbody>
                                </tbody>
                            </table>
                            
                            <!-- Expiry Date Table -->
                            <table id="datatable3" class="table table-bordered table-striped datatable3" style="display: none;">
                                <thead>
                                    <tr>
                                        <th class="w-5 text-left"><?php echo e(__('SN')); ?></th>
                                        <th class="w-30"><?php echo e(__('Expiry')); ?> <?php echo e(__('Date')); ?></th>
                                        <th class="w-30"><?php echo e(__('Quantity')); ?></th>
                                    </tr>
                                </thead>
                                <tbody>
                                </tbody>
                            </table>
                            
                            <!-- Variation Table -->
                            <table id="datatable4" class="table table-bordered table-striped datatable4" style="display: none;">
                                <thead>
                                    <tr>
                                        <th class="w-5 text-left"><?php echo e(__('SN')); ?></th>
                                        <th class="w-30"><?php echo e(__('Items')); ?></th>
                                        <th class="w-30"><?php echo e(__('Quantity')); ?></th>
                                        <th class="w-30">
                                            <?php echo e(__('LPP')); ?>/<?php echo e(__('PP')); ?>

                                            <i data-tippy-content="<?php echo e(__('LPP_PP')); ?>" class="ti tabler-info-circle tippyBtnCall font-16 theme-color"></i>
                                        </th>
                                        <th class="w-30"><?php echo e(__('Total')); ?></th>
                                    </tr>
                                </thead>
                                <tbody>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn bg-blue-btn" data-bs-dismiss="modal"><?php echo e(__('Close')); ?></button>
            </div>
        </div>
    </div>
</div>

<?php $__env->stopSection(); ?>
<?php $__env->startPush('page-js'); ?>
<?php echo app('Tighten\Ziggy\BladeRouteGenerator')->generate(); ?>
<script src="<?php echo e(asset('public/backend_assets/js/stock/low-stock.js')); ?>"></script>
<?php $__env->stopPush(); ?>

<?php echo $__env->make('backend.backend_layout', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH D:\xampp-8.2\htdocs\off_pos_laravel\Modules/Stock\resources/views/stock/low-stock.blade.php ENDPATH**/ ?>