@extends('backend.partials.master') @section('title') Sale Invoice @endsection @section('maincontent')

Sale Invoice

@csrf @if(!empty($invoices)) @method('PUT') @endif
@error('date') {{ $message }} @enderror
@error('invoice_no') {{ $message }} @enderror
@error('customer_id') {{ $message }} @enderror
{{-- --}} @php $i = 0; @endphp @if(!empty($invoicesdetails)) @foreach($invoicesdetails as $detail) @php $i++; @endphp @php // $productId = $detail->product_id; // $purchased = \App\Models\Backend\PurchaseDetail::where('product_id', $productId)->sum('quantity'); // $totalSold = \App\Models\Backend\SaleInvoieDetail::where('product_id', $productId)->sum('quantity'); // $currentInvoiceSold = \App\Models\Backend\SaleInvoieDetail::where('product_id', $productId) // ->where('parent_id', $invoices->id) // ->sum('quantity'); // $stockForEdit = $purchased - ($totalSold - $currentInvoiceSold); @endphp @if($errors->has('product_'.$i)) {{ $errors->first('lot_'.$i) }} @endif @endforeach @endif
Lot No * Product * HSN Stock * Quantity *Serial No(s) MAC Id(s)GST (%) Rate Total *
@error('lot_'.$i) {{ $message }} @enderror @error('quantity_'.$i) {{ $message }} @enderror

Cancel
@endsection {{---------------------------------------- my new code--------------------- --}}