@extends('layouts.layoutapp') @section('content')
@csrf
Edit Purchase — {{ $purchase->purchase_code }}

Changing quantities adjusts material stock automatically.

Back
@if (session('error'))
{{ session('error') }}
@endif @if ($errors->any())
    @foreach ($errors->all() as $error)
  • {{ $error }}
  • @endforeach
@endif @if ($paidSoFar > 0)
{{ number_format($paidSoFar, 2) }} has already been paid against this purchase. The new total cannot be lower than that. Payments themselves are edited from the Product Payments screen.
@endif {{-- HEADER --}}
{{-- MATERIAL ROWS --}}
@foreach ($purchase->productDetails as $i => $line) @endforeach
# Material Quantity Buying Amount Amount
{{ $i + 1 }} 0.00
Total 0.00
{{-- SUMMARY --}}
Materials 0

New Total 0.00
Already Paid {{ number_format($paidSoFar, 2) }}

Balance 0.00
Cancel
@endsection @push('scripts') @php $productOptions = $products->map(function ($p) { $useNative = $p->branch && $p->branch->native_name_flag == 'A' && $p->native_name; return [ 'id' => $p->id, 'label' => $useNative ? $p->native_name : $p->name, 'code' => $p->code, 'rate' => (float) ($p->margin_price ?? 0), ]; })->values()->toJson(); @endphp @endpush