{{ $business_name ?? config('app.name') }}
Supplier Monthly Sales Report
@if(isset($year)) Year: {{ $year }} @endif @if(isset($filters) && !empty($filters)) @if(!empty($filters['supplier_name'])) | Supplier: {{ $filters['supplier_name'] }} @endif @if(!empty($filters['location_name'])) | Location: {{ $filters['location_name'] }} @endif @endif
Generated on {{ date('F j, Y \a\t g:i A') }} | Page
@if(isset($summary))
Total Suppliers
{{ number_format($summary['total_suppliers'] ?? 0) }}
Total Transactions
{{ number_format($summary['total_transactions'] ?? 0) }}
Total Sales
${{ number_format($summary['total_sales'] ?? 0, 2) }}
Total Quantity
{{ number_format($summary['total_quantity'] ?? 0, 2) }}
Total Profit
${{ number_format($summary['total_profit'] ?? 0, 2) }}
@endif
@if(isset($supplierData) && count($supplierData) > 0) @php $monthTotals = [ 'jan' => 0, 'feb' => 0, 'mar' => 0, 'apr' => 0, 'may' => 0, 'jun' => 0, 'jul' => 0, 'aug' => 0, 'sep' => 0, 'oct' => 0, 'nov' => 0, 'dec' => 0 ]; $grandTotalSales = 0; $grandTotalQuantity = 0; $grandTotalProfit = 0; @endphp @foreach($supplierData as $supplier) @php $totalSales = $supplier['total_sales'] ?? 0; $totalCost = $supplier['total_cost'] ?? 0; $totalQuantity = $supplier['total_quantity'] ?? 0; $grossProfit = $totalSales - $totalCost; $profitPercent = $totalSales > 0 ? ($grossProfit / $totalSales) * 100 : 0; // Add to grand totals $grandTotalSales += $totalSales; $grandTotalQuantity += $totalQuantity; $grandTotalProfit += $grossProfit; // Add to month totals foreach(['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'] as $month) { $monthTotals[$month] += $supplier[$month] ?? 0; } @endphp @endforeach
Supplier Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec Total Sales Total Qty Gross Profit Profit %
{{ $supplier['supplier_name'] ?? 'No Supplier' }} ${{ number_format($supplier['jan'] ?? 0, 2) }} ${{ number_format($supplier['feb'] ?? 0, 2) }} ${{ number_format($supplier['mar'] ?? 0, 2) }} ${{ number_format($supplier['apr'] ?? 0, 2) }} ${{ number_format($supplier['may'] ?? 0, 2) }} ${{ number_format($supplier['jun'] ?? 0, 2) }} ${{ number_format($supplier['jul'] ?? 0, 2) }} ${{ number_format($supplier['aug'] ?? 0, 2) }} ${{ number_format($supplier['sep'] ?? 0, 2) }} ${{ number_format($supplier['oct'] ?? 0, 2) }} ${{ number_format($supplier['nov'] ?? 0, 2) }} ${{ number_format($supplier['dec'] ?? 0, 2) }} ${{ number_format($totalSales, 2) }} {{ number_format($totalQuantity, 2) }} ${{ number_format($grossProfit, 2) }} {{ number_format($profitPercent, 2) }}%
TOTAL: ${{ number_format($monthTotals['jan'], 2) }} ${{ number_format($monthTotals['feb'], 2) }} ${{ number_format($monthTotals['mar'], 2) }} ${{ number_format($monthTotals['apr'], 2) }} ${{ number_format($monthTotals['may'], 2) }} ${{ number_format($monthTotals['jun'], 2) }} ${{ number_format($monthTotals['jul'], 2) }} ${{ number_format($monthTotals['aug'], 2) }} ${{ number_format($monthTotals['sep'], 2) }} ${{ number_format($monthTotals['oct'], 2) }} ${{ number_format($monthTotals['nov'], 2) }} ${{ number_format($monthTotals['dec'], 2) }} ${{ number_format($grandTotalSales, 2) }} {{ number_format($grandTotalQuantity, 2) }} ${{ number_format($grandTotalProfit, 2) }} {{ $grandTotalSales > 0 ? number_format(($grandTotalProfit / $grandTotalSales) * 100, 2) : 0 }}%
@else

No Data Available

No supplier sales data found for the selected criteria.

@endif
{{ $business_name ?? config('app.name') }}
Generated by Advanced Reports Module
Report Date: {{ date('F j, Y') }}
Time: {{ date('g:i A') }}