@extends('master.app') @section('title','Edit Return Bill') @section('body')
@include('general.valert') {{-- ===== Bill Header Edit ===== --}}
Edit Return Bill #{{ $bill->invoice_number }}
Status: @if((int)$bill->status===1) Final @else Draft @endif
@csrf @method('PUT')
@if($bill->scan_file) Current: {{ $bill->scan_file }} @endif
{{-- ===== Items Add (only if Draft or even allow in Final if you want) ===== --}}
Return Items
@if((int)$bill->status===1)
This bill is Final. If you add/delete items, you should re-finalize or adjust logic as your policy.
@endif
@csrf

{{-- Items Table --}}
@php($sum = 0) @forelse($bill_items as $i=>$it) @php($sum += (float)$it->total) @empty @endforelse
# Cat Sub Unit Weight Type To Stock Price Qty Total Action
{{ $i+1 }} {{ $it->category->title_ps ?? $it->cat_id }} {{ $it->sub_category->title_ps ?? $it->sub_cat_id }} {{ $it->unit->title_ps ?? $it->unit_id }} {{ $it->weight->title_ps ?? $it->weight_id }} {{ $it->reason_type }} @if((int)$it->to_stock===1) YES @else NO @endif {{ number_format($it->price,2) }} {{ number_format($it->qty,2) }} {{ number_format($it->total,2) }} Del
No items
Grand Total {{ number_format($sum,2) }}
{{-- Finalize (Optional here) --}} @if((int)$bill->status!==1)
@csrf
@endif
@endsection