<?php $__env->startSection('title',$product->name_en); ?>
<?php $__env->startSection('content'); ?>
<div class="page-head"><div><div class="d-flex align-items-center gap-2"><h1><?php echo e($product->name_en); ?></h1><span class="badge status-<?php echo e($product->status); ?>"><?php echo e(strtoupper($product->status)); ?></span></div><p dir="rtl" class="text-start"><?php echo e($product->name_ar); ?></p></div><div class="d-flex gap-2"><a class="btn btn-light border" href="<?php echo e(route('products.barcodes.print',['product_id'=>$product->id])); ?>">Barcode label</a><a class="btn btn-primary" href="<?php echo e(route('products.edit',$product)); ?>">Edit product</a></div></div>
<div class="row g-2"><div class="col-lg-8"><div class="card-erp"><div class="card-erp-header">Product master</div><div class="card-erp-body"><div class="row g-3"><?php $__currentLoopData = [['Product code',$product->product_code],['SKU',$product->sku],['Barcode',$product->barcode],['Category',$product->category?->name_en],['Brand',$product->brand?->name_en],['Pack size',$product->pack_size],['Packing',$product->packing_desc_en],['VAT',$product->vat_rate.'%'],['Price mode',$product->price_mode],['Rack / shelf',trim($product->rack_number.' / '.$product->shelf_number,' /')]]; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as [$l,$v]): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><div class="col-6 col-md-4"><small class="text-muted d-block"><?php echo e($l); ?></small><strong><?php echo e($v?:'—'); ?></strong></div><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?></div></div></div><div class="card-erp"><div class="card-erp-header">Multiple units</div><div class="table-responsive"><table class="table table-dense"><thead><tr><th>Unit</th><th class="text-end">Conversion to base</th><th class="text-end">Purchase</th><th class="text-end">Selling</th><th>Usage</th></tr></thead><tbody><?php $__currentLoopData = $product->productUnits; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $u): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><tr><td><?php echo e($u->unit?->code); ?></td><td class="text-end"><?php echo e(number_format((float)$u->conversion_factor,4)); ?></td><td class="text-end"><?php echo e(number_format((float)$u->purchase_price,2)); ?></td><td class="text-end"><?php echo e(number_format((float)$u->selling_price,2)); ?></td><td><?php if($u->is_base_unit): ?><span class="badge bg-accent-soft text-accent">BASE</span><?php endif; ?> <?php if($u->is_purchase_unit): ?><span class="badge bg-light text-dark">PURCHASE</span><?php endif; ?> <?php if($u->is_sales_unit): ?><span class="badge bg-light text-dark">SALES</span><?php endif; ?></td></tr><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?></tbody></table></div></div></div><div class="col-lg-4"><div class="card-erp"><div class="card-erp-header">Pricing & cost</div><div class="card-erp-body"><?php $__currentLoopData = [['Purchase price',$product->cost_price,4],['Average base cost',$product->avg_cost,4],['Last base cost',$product->last_purchase_cost,4],['Selling price',$product->sale_price,2],['Wholesale price',$product->wholesale_price,2],['Retail price',$product->retail_price,2],['Minimum selling',$product->min_sale_price,2]]; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as [$l,$v,$d]): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><div class="d-flex justify-content-between py-1"><span><?php echo e($l); ?></span><b><?php echo e(number_format((float)$v,$d)); ?></b></div><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?></div></div><div class="card-erp"><div class="card-erp-header">Warehouse stock</div><div class="table-responsive"><table class="table table-dense"><tbody><?php $__empty_1 = true; $__currentLoopData = $product->warehouseStocks; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $s): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?><tr><td><?php echo e($s->warehouse?->code); ?></td><td class="text-end fw-bold"><?php echo e(number_format((float)$s->qty,4)); ?></td><td class="text-end">SAR <?php echo e(number_format((float)$s->qty*(float)$s->avg_cost,2)); ?></td></tr><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?><tr><td class="text-muted">No stock.</td></tr><?php endif; ?></tbody></table></div></div></div></div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\xampp\htdocs\saudi\resources\views\products\show.blade.php ENDPATH**/ ?>