@extends('Admin.layout') @section('content') @php $goldItems = $purchase->goldItems ?? $purchase->goldItems()->get(); @endphp

Edit Gold Purchase

Update purchase details, gold items, images and payment information.
@csrf
Purchase Details
Gold Details
@foreach($goldItems as $index => $item) @php $storedImages = $item->image ?? []; if (is_string($storedImages)) { $storedImages = json_decode($storedImages, true) ?: []; } if (!is_array($storedImages)) { $storedImages = $storedImages ? [$storedImages] : []; } $storedImages = array_values(array_filter($storedImages)); @endphp @endforeach
S.No Gold Name * Purity * Gross Weight (g) * Net Weight (g) * Amount Per Gram (₹) * Total Amount (₹) Gold Images (Max 4) Remarks Action
{{ $index + 1 }} gold_name) }}" class="form-control text-white border-secondary border-opacity-50 rounded-3 py-2 px-3 fs-7" style="min-width:130px" required> gross_weight) }}" class="form-control text-white border-secondary border-opacity-50 rounded-3 py-2 px-3 fs-7 gp-gross" style="min-width:120px" required> netweight) }}" class="form-control text-white border-secondary border-opacity-50 rounded-3 py-2 px-3 fs-7 gp-net" style="min-width:120px" required> amount_per_gram) }}" class="form-control text-white border-secondary border-opacity-50 rounded-3 py-2 px-3 fs-7 gp-rate" style="min-width:120px" required>
@foreach($storedImages as $imageIndex => $imagePath)
Existing gold image
@endforeach
0/4 new
Total Gross Weight 0.000 g
Total Net Weight 0.000 g
Total Purchase Amount ₹0.00
Average Rate Per Gram ₹0.00
Payment Details
@if($purchase->recipt) Receipt @else No receipt image @endif
Cancel
@endsection