@extends('admin.layouts.app') @section('title', 'Product Wise Sale') @push('styles') @endpush @section('container')

Product Wise Sale

@if (session('success'))
{{ session('success') }}
@endif @if (session('error'))
{{ session('error') }}
@endif
@error('product')

{{ $message }}

@enderror
@error('start_date')

{{ $message }}

@enderror
@error('end_date')

{{ $message }}

@enderror
@if(count($stocks) > 0)

{{ config('app.name') }}

{{ config('app.address') }}

Product: {{ $productName }}

Date: {{ date('d-m-Y',strtotime(request('start_date'))) }} to {{ date('d-m-Y',strtotime(request('end_date'))) }}

@endif @if(count($stocks) > 0) @php $total_stock_out = 0; @endphp @foreach($stocks as $index => $stock) @php $unit_id = \App\Models\Product::find($stock->product_id)->unit_id??0; $unit = \App\Models\Unit::find($unit_id); $total_stock_out += $stock->total_stock; @endphp @endforeach
SL. Product Type Product Sub Type Product Unit InQty OutQty NetAmount
{{ $index+1 }} {{ $stock->product_category_name }} {{ $stock->product_sub_category_name }} {{ $stock->product_name }} {{ $unit->name }} 0.00 {{ number_format($stock->total_stock,2) }} {{ number_format($stock->total_amount,2) }}
Total 0.00 {{ number_format($total_stock_out,2) }} {{ number_format($stocks->sum('total_amount'),2) }}
@endif
@endsection @push('scripts') @endpush