<?php $__env->startSection('title', 'Products List'); ?>

<?php $__env->startSection('content'); ?>
    <div class="page-header">
        <div class="page-title">
            <h4>Products List</h4>
            <h6>Manage your Products</h6>
        </div>
        <?php if(auth()->user()->hasPermission('Product Variation Create')): ?>
        <div class="page-btn">
            <a href="<?php echo e(route('product-variations.create')); ?>" class="btn btn-added">
                <img src="<?php echo e(asset('assets/img/icons/plus.svg')); ?>" alt="img" class="me-1">Add Product
            </a>
        </div>
        <?php endif; ?>
    </div>

    <div class="card">
        <div class="card-body">
            <div class="table-top">
                <div class="search-set">
                    <div class="search-input">
                        <a class="btn btn-searchset">
                            <img src="<?php echo e(asset('assets/img/icons/search-white.svg')); ?>" alt="img">
                        </a>
                    </div>
                </div>
            </div>
            <div class="table-responsive">
                <table class="table datanew dataTable no-footer table-striped">
                    <thead>
                        <tr>
                            <th>#</th>
                            <th>DOC NO</th>
                            <?php if(auth()->user()->hasPermission('Product Variation Update')): ?>
                            <th>Action</th>
                            <?php endif; ?>
                            <th>Reg. No.</th>
                            <th>Product</th>
                            <th>Strength</th>
                            <th>Dosage Forms</th>
                            
                            <th>Packing Types</th>
                            <th>Pack Sizes</th>
                            
                            <th>Category</th>
                            <th>Chart Of Accounts</th>
                            <th>Trade Price</th>
                            <th>Our MRP</th>
                            <th>Drap MRP</th>
                            <th>Min. Level</th>
                            <th>Max. Level</th>
                            <?php if (\Illuminate\Support\Facades\Blade::check('role', 'Superadmin')): ?>
                            <th>Company</th>
                            <?php endif; ?>
                        </tr>
                    </thead>
                    <tbody>
                        <?php $__currentLoopData = $productVariations; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $productVariation): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <tr>
                                <td><?php echo e($loop->iteration); ?></td>
                                <td><a class="link-primary" href="<?php echo e(route('product-variations.show', $productVariation->id)); ?>"><?php echo e($productVariation->code ?? 'N/A'); ?></a></td>
                                <?php if(auth()->user()->hasPermission('Product Variation Update')): ?>
                                <td>            
                                    <a class="me-3" href="<?php echo e(route('product-variations.edit', $productVariation->id)); ?>">
                                        <img src="<?php echo e(asset('assets/img/icons/edit.svg')); ?>" alt="Edit">
                                    </a>
                                </td>
                                <?php endif; ?>
                                <td><?php echo e($productVariation->reg_no ?? 'N/A'); ?></td>
                                <td><?php echo e($productVariation->product->brand_name ?? 'N/A'); ?></td>
                                <td><?php echo e($productVariation->strength ?? 'N/A'); ?></td>
                                <td><?php echo e($productVariation->dosageForm->name ?? 'N/A'); ?></td>
                                
                                <td><?php echo e($productVariation->packingType->name ?? 'N/A'); ?></td>
                                <td><?php echo e($productVariation->packSize->name ?? 'N/A'); ?></td>
                                
                                <td>
                                    <span class="badge bg-primary"><?php echo e(optional($productVariation->category)->name); ?></span>
                                    <?php if($productVariation->subCategory): ?>
                                        <span class="badge bg-info"><?php echo e($productVariation->subCategory->name); ?></span>
                                    <?php endif; ?>
                                </td>
                                <td>
                                    <span class="badge bg-primary"><?php echo e($productVariation->chart_of_account->particular ?? 'N/A'); ?></span>
                                    <?php if($productVariation->sub_chart_of_account): ?>
                                        <span class="badge bg-info"><?php echo e($productVariation->sub_chart_of_account->name); ?></span>
                                    <?php endif; ?>
                                </td>
                                <td><?php echo e($productVariation->trade_price ?? 'N/A'); ?></td>
                                <td><?php echo e($productVariation->our_mrp ?? 'N/A'); ?></td>
                                <td><?php echo e($productVariation->drap_mrp ?? 'N/A'); ?></td>
                                <td><?php echo e($productVariation->min_level ?? 'N/A'); ?></td>
                                <td><?php echo e($productVariation->max_level ?? 'N/A'); ?></td>
                                <?php if (\Illuminate\Support\Facades\Blade::check('role', 'Superadmin')): ?>
                                <td><?php echo e($productVariation->company->name ?? 'N/A'); ?></td>
                                <?php endif; ?>
                               
                            </tr>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin.layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/aligkrwp/public_html/resources/views/admin/product-variations/index.blade.php ENDPATH**/ ?>