@extends('layouts.app') @section('title', 'Product Reports') @section('content')
@if($report==='sales')
@endif
@if($report==='sales' && $salesSummary)
Invoices

{{ $salesSummary->invoices }}

Subtotal

{{ number_format($salesSummary->subtotal, 2) }}

Discount

{{ number_format($salesSummary->discount, 2) }}

Grand Total

{{ number_format($salesSummary->grand, 2) }}

@endif
@if($report==='sales') @forelse($rows as $s) @empty @endforelse @elseif($report==='top_sold') @forelse($rows as $p) @empty @endforelse @else {{-- stock / out_of_stock --}} @if($report==='stock')@endif @forelse($rows as $p) @if($report==='stock')@endif @empty @endforelse @endif
InvoiceDateItemsSubtotalDiscountGrand Total
{{ $s->invoice_number }} {{ $s->sale_date->format('d M Y') }} {{ $s->items->count() }} {{ number_format($s->subtotal, 2) }} {{ number_format($s->discount_amount, 2) }} {{ number_format($s->grand_total, 2) }}
No sales in this range.
ProductCategoryTotal SoldCurrent Stock
{{ $p->name }}{{ $p->category->name ?? '—' }}{{ (int) ($p->total_sold ?? 0) }}{{ $p->quantity_stock }}
No products.
ProductCategorySale PriceStockTotal SoldStatus
{{ $p->name }} {{ $p->category->name ?? '—' }} {{ number_format($p->sale_price, 2) }} {{ $p->quantity_stock }}{{ (int) ($p->total_sold ?? 0) }}@if($p->isOutOfStock())Out@elseif($p->isLowStock())Low@elseOK@endif
No products.
Total records: {{ $rows->count() }}
@endsection