
<?php $__env->startSection('title', 'BOM Details'); ?>

<?php $__env->startSection('content'); ?>
<div class="card">
  <div class="card-body">
    <div class="d-flex justify-content-between align-items-center mb-3">
      <h6 class="card-title mb-0">BOM for <?php echo e($bom->product->name ?? 'N/A'); ?> (v<?php echo e($bom->version); ?>)</h6>
      <div class="d-flex gap-2">
        <a href="<?php echo e(route('boms.edit', $bom)); ?>" class="btn btn-primary">Edit</a>
        <a href="<?php echo e(route('boms.index')); ?>" class="btn btn-secondary">Back</a>
      </div>
    </div>

    <div class="row g-3 mb-3">
      <div class="col-md-3">
        <label class="form-label fw-bold">Product</label>
        <div><?php echo e($bom->product->name ?? '-'); ?></div>
      </div>
      <div class="col-md-2">
        <label class="form-label fw-bold">Version</label>
        <div><?php echo e($bom->version); ?></div>
      </div>
      <div class="col-md-2">
        <label class="form-label fw-bold">Status</label>
        <div><?php echo $bom->is_active ? '<span class="badge bg-success">Active</span>' : '<span class="badge bg-danger">Inactive</span>'; ?></div>
      </div>
      <div class="col-md-5">
        <label class="form-label fw-bold">Description</label>
        <div><?php echo e($bom->description ?? '-'); ?></div>
      </div>
    </div>

    <h6 class="mt-3">Components</h6>
    <div class="table-responsive">
      <table class="table table-striped">
        <thead>
          <tr>
            <th>#</th>
            <th>Component</th>
            <th>Qty per</th>
            <th>Scrap %</th>
            <th>Effective Qty</th>
          </tr>
        </thead>
        <tbody>
          <?php $__empty_1 = true; $__currentLoopData = $bom->bomItems; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $i => $bi): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
          <tr>
            <td><?php echo e($i+1); ?></td>
            <td><?php echo e($bi->component->name ?? '-'); ?></td>
            <td><?php echo e($bi->formatted_qty_per); ?></td>
            <td><?php echo e($bi->formatted_scrap_pct); ?></td>
            <td><?php echo e(number_format($bi->effective_qty, 6)); ?></td>
          </tr>
          <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
          <tr><td colspan="5" class="text-center">No components</td></tr>
          <?php endif; ?>
        </tbody>
      </table>
    </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:\laragon\www\habibcables-ERP\resources\views\boms\show.blade.php ENDPATH**/ ?>