@push('title') Edit Product @endpush Products / Edit Details @can('view_product_management') @endcan Update Product @csrf @method('PUT') {{-- SECTION 1: Basic Information --}} Basic Information Product Name * Product Code * Brand* Select Brand @foreach($brands as $brand) brand_id) == $brand->id ? 'selected' : '' }}> {{ $brand->name }} @endforeach Category * Select Category @foreach($categories as $category) product_category_id) == $category->id ? 'selected' : '' }}> {{ $category->name }} @endforeach Product Type * Select Product Type product_type) == App\Models\Product::SINGLE ? 'selected' : '' }}>Single product_type) == App\Models\Product::VARIATION ? 'selected' : '' }}> Variation Select Variation * Select Variation (e.g. Size, Color) @foreach($variations as $variation) variation_id == $variation->id ? 'selected' : '' }}>{{ $variation->name }} @endforeach {{-- Merged Stock & Variation Section --}} Inventory & Batch Management — All active batches {{-- Export Button --}} Export CSV {{-- Import Button triggers modal --}} Import CSV Variation Type Barcode Batch No Cost Price (LKR) Retail Price (LKR) Wholesale Price (LKR) Current Stock @php $allBatches = $product->variations->flatMap->batches->where('status', 'active'); $groupedBatches = $allBatches->groupBy('batch_no'); @endphp @foreach($groupedBatches as $batchNo => $batches) @foreach($batches as $batch) @php $pv = $batch->productVariation; @endphp {{ $pv->variation_id ? ($pv->variationType->name ?? 'N/A') : 'Default' }} @endforeach @endforeach @if($allBatches->count() == 0) No active inventory batches found. Select a variation above to add stock. @endif {{-- SECTION 2: Units --}} Units of Measure Base Unit * Select Base Unit @foreach($baseUnits as $baseUnit) base_unit_id) == $baseUnit->id ? 'selected' : '' }}>{{ $baseUnit->name }} @endforeach Sale Unit * Select Sale Unit @foreach($units as $unit) sale_unit_id) == $unit->id ? 'selected' : '' }}> {{ $unit->name }} @endforeach Purchase Unit * Select Purchase Unit @foreach($units as $unit) purchase_unit_id) == $unit->id ? 'selected' : '' }}> {{ $unit->name }} @endforeach {{-- SECTION 3: Stock & Sourcing --}} Stock & Sourcing Warehouse * Select Warehouse @foreach($warehouses as $warehouse) warehouse_id) == $warehouse->id ? 'selected' : '' }}>{{ $warehouse->name }} @endforeach Supplier * Select Supplier @foreach($suppliers as $supplier) supplier_id) == $supplier->id ? 'selected' : '' }}>{{ $supplier->name }} @endforeach Status * Select Status status) == App\Models\Product::PENDING ? 'selected' : '' }}>Pending status) == App\Models\Product::ORDERED ? 'selected' : '' }}>Ordered status) == App\Models\Product::RECEIVED ? 'selected' : '' }}>Received Note (optional) {{ old('note', $product->note) }} {{-- Actions --}} Update Cancel {{-- Import Batch CSV Modal --}} @csrf Import Batch Prices via CSV Instructions: First, click Export CSV to download the template with current data. Open the file in Excel or Google Sheets. Edit only: cost_price, retail_price, wholesale_price. Do NOT edit batch_id or batch_no. Save as CSV and upload below. Select CSV File Only .csv files are accepted. Max size: 2MB.
cost_price
retail_price
wholesale_price
batch_id
batch_no