@extends('layouts.app') @section('title', 'Reports') @section('content')

Reports

@if($reportType == 'sales')
Total Orders

{{ $data['total_orders'] ?? 0 }}

Total Revenue

${{ number_format($data['total_revenue'] ?? 0, 2) }}

@forelse($data['orders'] ?? [] as $order) @empty @endforelse
Order ID Date Branch Total Status
#{{ $order->id }} {{ $order->created_at->format('Y-m-d H:i') }} {{ $order->branch->name_ar ?? $order->branch->name_en ?? 'N/A' }} ${{ number_format($order->total_price, 2) }} {{ $order->status }}
No orders found
@elseif($reportType == 'products')
Total Products

{{ $data['total_products'] ?? 0 }}

@forelse($data['products'] ?? [] as $product) @empty @endforelse
Product Category Base Price Total Stock
{{ $product->name_ar ?? $product->name_en }} {{ $product->category->name_ar ?? $product->category->name_en ?? 'N/A' }} ${{ number_format($product->base_purchase_price, 2) }} {{ $product->branchPrices->sum('stock_quantity') }}
No products found
@elseif($reportType == 'inventory')
Total Stock

{{ $data['total_stock'] ?? 0 }}

Low Stock Items

{{ $data['low_stock_items'] ?? 0 }}

@forelse($data['inventory'] ?? [] as $item) @empty @endforelse
Product Branch Stock Qty Price Status
{{ $item->product->name_ar ?? $item->product->name_en }} {{ $item->branch->name_ar ?? $item->branch->name_en }} {{ $item->stock_quantity ?? 0 }} ${{ number_format($item->price ?? 0, 2) }} @if(($item->stock_quantity ?? 0) < 10) Low Stock @else In Stock @endif
No inventory data found
@endif
@endsection