<?php $__env->startSection('title','Edit Product'); ?>
<?php $__env->startSection('content'); ?>
<form method="POST" action="<?php echo e(route('products.update',$product)); ?>"><?php echo csrf_field(); ?> <?php echo method_field('PUT'); ?><div class="page-head"><div><h1>Edit product</h1><p><?php echo e($product->product_code); ?> · Historical invoices retain their saved product snapshots.</p></div><a href="<?php echo e(route('products.show',$product)); ?>" class="btn btn-light border">Back to product</a></div><div class="card-erp"><div class="card-erp-body"><div class="row g-2"><div class="col-md-2"><label class="form-label">Product code</label><input name="product_code" class="form-control" value="<?php echo e($product->product_code); ?>" required></div><div class="col-md-5"><label class="form-label">English name</label><input name="name_en" class="form-control" value="<?php echo e($product->name_en); ?>" required></div><div class="col-md-5"><label class="form-label">Arabic name</label><input name="name_ar" dir="rtl" class="form-control" value="<?php echo e($product->name_ar); ?>" required></div><div class="col-md-3"><label class="form-label">Category</label><select name="category_id" class="form-select"><?php $__currentLoopData = $categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $c): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><option value="<?php echo e($c->id); ?>" <?php if($product->category_id===$c->id): echo 'selected'; endif; ?>><?php echo e($c->name_en); ?></option><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?></select></div><div class="col-md-3"><label class="form-label">Base unit</label><select name="base_unit_id" class="form-select"><?php $__currentLoopData = $units; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $u): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><option value="<?php echo e($u->id); ?>" <?php if($product->base_unit_id===$u->id): echo 'selected'; endif; ?>><?php echo e($u->code); ?></option><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?></select></div><div class="col-md-2"><label class="form-label">Purchase price</label><input type="number" name="cost_price" class="form-control" value="<?php echo e($product->cost_price); ?>" min="0" step=".0001"></div><div class="col-md-2"><label class="form-label">Selling price</label><input type="number" name="sale_price" class="form-control" value="<?php echo e($product->sale_price); ?>" min="0" step=".01"></div><div class="col-md-2"><label class="form-label">VAT rate</label><input type="number" name="vat_rate" class="form-control" value="<?php echo e($product->vat_rate); ?>" min="0" max="100"></div><div class="col-md-2"><label class="form-label">VAT applicable</label><select name="vat_applicable" class="form-select"><option value="1" <?php if($product->vat_applicable): echo 'selected'; endif; ?>>Yes</option><option value="0" <?php if(!$product->vat_applicable): echo 'selected'; endif; ?>>No</option></select></div><div class="col-md-2"><label class="form-label">Price mode</label><select name="price_mode" class="form-select"><option <?php if($product->price_mode==='Exclusive VAT'): echo 'selected'; endif; ?>>Exclusive VAT</option><option <?php if($product->price_mode==='Inclusive VAT'): echo 'selected'; endif; ?>>Inclusive VAT</option></select></div><?php $__currentLoopData = [['track_stock','Track stock'],['allow_negative_stock','Allow negative'],['track_batch','Track batch'],['track_expiry','Track expiry'],['track_serial','Track serial']]; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as [$field,$label]): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><div class="col-md-2"><label class="form-label"><?php echo e($label); ?></label><select name="<?php echo e($field); ?>" class="form-select"><option value="1" <?php if($product->$field): echo 'selected'; endif; ?>>Yes</option><option value="0" <?php if(!$product->$field): echo 'selected'; endif; ?>>No</option></select></div><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><div class="col-md-2"><label class="form-label">Status</label><select name="status" class="form-select"><option <?php if($product->status==='active'): echo 'selected'; endif; ?>>active</option><option <?php if($product->status==='inactive'): echo 'selected'; endif; ?>>inactive</option></select></div></div></div></div><div class="sticky-actions d-flex justify-content-end"><button class="btn btn-primary">Update product</button></div></form>
<?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\edit.blade.php ENDPATH**/ ?>