{{ $isPurchaseReport ? 'Total Purchases' : 'Total Sales' }}
{{ \App\Models\SystemSetting::formatMoney($totals->total_amount) }}
Total Paid
{{ \App\Models\SystemSetting::formatMoney($totals->total_paid) }}
{{ $isPurchaseReport ? 'Unpaid Balance' : 'Uncleared' }}
{{ \App\Models\SystemSetting::formatMoney($totals->pending_balance) }}
Entries
{{ number_format($totals->entries) }}
@if($report === 'purchase_summary')
| Date | Purchase No | Supplier | Branch | Status | Total | Paid | Balance | Added By |
@forelse($purchases as $purchase)
| {{ $purchase->purchase_date?->format('Y-m-d H:i') }} |
{{ $purchase->purchase_no }} |
{{ $purchase->supplier_name ?: '-' }} |
{{ $purchase->branch?->name ?: '-' }} |
{{ ucfirst($purchase->payment_status) }} |
{{ \App\Models\SystemSetting::formatMoney($purchase->total_amount) }} |
{{ \App\Models\SystemSetting::formatMoney($purchase->paid_amount) }} |
{{ \App\Models\SystemSetting::formatMoney($purchase->balance_amount) }} |
{{ $purchase->user?->name ?: '-' }} |
@empty
| No records found. |
@endforelse
| Totals |
{{ \App\Models\SystemSetting::formatMoney($purchases->sum('total_amount')) }} |
{{ \App\Models\SystemSetting::formatMoney($purchases->sum('paid_amount')) }} |
{{ \App\Models\SystemSetting::formatMoney($purchases->sum('balance_amount')) }} |
|
@elseif($report === 'purchase_detailed')
| Date | Purchase No | Supplier | Barcode | Product | Category | Qty | Cost | Total | Added By |
@forelse($purchaseItems as $item)
| {{ \Carbon\Carbon::parse($item->purchase_date)->format('Y-m-d H:i') }} |
{{ $item->purchase_no }} |
{{ $item->supplier_name ?: '-' }} |
{{ $item->product_barcode ?: '-' }} |
{{ $item->product_name }} |
{{ $item->category_name }} |
{{ number_format($item->quantity, 2) }} |
{{ \App\Models\SystemSetting::formatMoney($item->unit_cost) }} |
{{ \App\Models\SystemSetting::formatMoney($item->line_total) }} |
{{ $item->added_by }} |
@empty
| No records found. |
@endforelse
| Totals |
{{ number_format($purchaseItems->sum('quantity'), 2) }} |
|
{{ \App\Models\SystemSetting::formatMoney($purchaseItems->sum('line_total')) }} |
|
@elseif($report === 'purchases_by_product')
| Barcode | Product | Qty | Total Amount |
@forelse($purchaseProductRows as $row)
| {{ $row->barcode ?: '-' }} | {{ $row->product_name }} | {{ number_format($row->quantity, 2) }} | {{ \App\Models\SystemSetting::formatMoney($row->total_amount) }} |
@empty
| No records found. |
@endforelse
| Totals | {{ number_format($purchaseProductRows->sum('quantity'), 2) }} | {{ \App\Models\SystemSetting::formatMoney($purchaseProductRows->sum('total_amount')) }} |
@elseif($report === 'purchases_by_category')
| Category | Qty | Total Amount |
@forelse($purchaseCategoryRows as $row)
| {{ $row->category_name }} | {{ number_format($row->quantity, 2) }} | {{ \App\Models\SystemSetting::formatMoney($row->total_amount) }} |
@empty
| No records found. |
@endforelse
| Totals | {{ number_format($purchaseCategoryRows->sum('quantity'), 2) }} | {{ \App\Models\SystemSetting::formatMoney($purchaseCategoryRows->sum('total_amount')) }} |
@elseif($report === 'purchases_by_supplier')
@if(($filters['report_type'] ?? 'summarised') === 'detailed')
| Date | Purchase No | Supplier | Barcode | Product | Category | Qty | Cost | Total | Added By |
@forelse($purchaseItems as $item)
| {{ \Carbon\Carbon::parse($item->purchase_date)->format('Y-m-d H:i') }} |
{{ $item->purchase_no }} |
{{ $item->supplier_name ?: '-' }} |
{{ $item->product_barcode ?: '-' }} |
{{ $item->product_name }} |
{{ $item->category_name }} |
{{ number_format($item->quantity, 2) }} |
{{ \App\Models\SystemSetting::formatMoney($item->unit_cost) }} |
{{ \App\Models\SystemSetting::formatMoney($item->line_total) }} |
{{ $item->added_by }} |
@empty
| No records found. |
@endforelse
| Totals |
{{ number_format($purchaseItems->sum('quantity'), 2) }} |
|
{{ \App\Models\SystemSetting::formatMoney($purchaseItems->sum('line_total')) }} |
|
@else
| Supplier | Entries | Total | Paid | Balance |
@forelse($purchaseSupplierRows as $row)
| {{ $row->supplier_label }} | {{ number_format($row->entries) }} | {{ \App\Models\SystemSetting::formatMoney($row->total_amount) }} | {{ \App\Models\SystemSetting::formatMoney($row->paid_amount) }} | {{ \App\Models\SystemSetting::formatMoney($row->balance_amount) }} |
@empty
| No records found. |
@endforelse
| Totals | {{ \App\Models\SystemSetting::formatMoney($purchaseSupplierRows->sum('total_amount')) }} | {{ \App\Models\SystemSetting::formatMoney($purchaseSupplierRows->sum('paid_amount')) }} | {{ \App\Models\SystemSetting::formatMoney($purchaseSupplierRows->sum('balance_amount')) }} |
@endif
@elseif($report === 'purchases_by_user')
| Added By | Entries | Total | Paid | Balance |
@forelse($purchaseUserRows as $row)
| {{ $row->user?->name ?: '-' }} | {{ number_format($row->entries) }} | {{ \App\Models\SystemSetting::formatMoney($row->total_amount) }} | {{ \App\Models\SystemSetting::formatMoney($row->paid_amount) }} | {{ \App\Models\SystemSetting::formatMoney($row->balance_amount) }} |
@empty
| No records found. |
@endforelse
| Totals | {{ \App\Models\SystemSetting::formatMoney($purchaseUserRows->sum('total_amount')) }} | {{ \App\Models\SystemSetting::formatMoney($purchaseUserRows->sum('paid_amount')) }} | {{ \App\Models\SystemSetting::formatMoney($purchaseUserRows->sum('balance_amount')) }} |
@elseif($report === 'purchases_by_payment')
| Payment Method | Entries | Total Amount |
@forelse($purchasePaymentRows as $row)
| {{ $row->paymentMethod?->name ?: '-' }} | {{ number_format($row->entries) }} | {{ \App\Models\SystemSetting::formatMoney($row->total_amount) }} |
@empty
| No records found. |
@endforelse
| Total Amount | {{ \App\Models\SystemSetting::formatMoney($purchasePaymentRows->sum('total_amount')) }} |
@elseif($report === 'sales_by_product' || $report === 'stock_movement')
@if($report === 'sales_by_product' && ($filters['display_type'] ?? 'grouped') === 'grouped')
| Barcode |
Product |
Qty Sold |
Average S.Price |
Total Cost |
Total Sales |
@forelse($productRows as $row)
| {{ $row->barcode ?: '-' }} |
{{ $row->product_name }} |
{{ number_format($row->quantity, 2) }} |
{{ \App\Models\SystemSetting::formatMoney($row->selling_price) }} |
{{ \App\Models\SystemSetting::formatMoney($row->total_buying) }} |
{{ \App\Models\SystemSetting::formatMoney($row->line_total) }} |
@empty
| No sales found for the selected period. |
@endforelse
| Totals |
{{ number_format($productTotals->quantity, 2) }} |
|
{{ \App\Models\SystemSetting::formatMoney($productTotals->total_buying) }} |
{{ \App\Models\SystemSetting::formatMoney($productTotals->total_selling) }} |
@else
| Barcode |
Name |
B.Price |
S.Price |
W.Price |
QTY |
Stock Before |
Stock After |
TT.B.Price |
TT.S.Price |
Movement |
Customer |
Date |
Added By |
@forelse($productRows as $row)
| {{ $row->barcode ?: '-' }} |
{{ $row->product_name }} |
{{ \App\Models\SystemSetting::formatMoney($row->buying_price) }} |
{{ \App\Models\SystemSetting::formatMoney($row->selling_price) }} |
{{ \App\Models\SystemSetting::formatMoney($row->wholesale_price) }} |
{{ number_format($row->quantity, 2) }} |
{{ $row->stock_before === null ? '-' : number_format($row->stock_before, 2) }} |
{{ $row->stock_after === null ? '-' : number_format($row->stock_after, 2) }} |
{{ \App\Models\SystemSetting::formatMoney($row->total_buying) }} |
{{ \App\Models\SystemSetting::formatMoney($row->line_total) }} |
{{ $row->movement_type }} |
{{ $row->customer_name ?: '-' }} |
{{ $row->movement_date?->format('Y-m-d H:i') }} |
{{ $row->added_by ?: '-' }} |
@empty
| No records found. |
@endforelse
| Totals |
{{ number_format($productTotals->quantity, 2) }} |
|
|
{{ \App\Models\SystemSetting::formatMoney($productTotals->total_buying) }} |
{{ \App\Models\SystemSetting::formatMoney($productTotals->total_selling) }} |
|
@endif
@elseif($report === 'fast_moving_products' || $report === 'slow_moving_products')
| Barcode | Product | Qty Sold | Total Amount |
@forelse($movingProductRows as $row)
| {{ $row->barcode ?: '-' }} | {{ $row->product_name }} | {{ number_format($row->quantity, 2) }} | {{ \App\Models\SystemSetting::formatMoney($row->total_amount) }} |
@empty
| No records found. |
@endforelse
| Totals |
{{ number_format($movingProductRows->sum('quantity'), 2) }} |
{{ \App\Models\SystemSetting::formatMoney($movingProductRows->sum('total_amount')) }} |
@elseif($report === 'dead_stock')
| Barcode |
Product |
Category |
Current Stock |
Buying Price |
Stock Value |
Last Sold Date |
Days Not Sold |
@forelse($deadStockRows as $row)
| {{ $row->barcode ?: '-' }} |
{{ $row->name }} |
{{ $row->category?->name ?: '-' }} |
{{ number_format($row->stock_quantity, 2) }} |
{{ \App\Models\SystemSetting::formatMoney($row->buying_price) }} |
{{ \App\Models\SystemSetting::formatMoney($row->stock_value) }} |
{{ $row->last_sold_date ?: 'Never sold' }} |
{{ $row->days_not_sold === null ? '-' : number_format($row->days_not_sold) }} |
@empty
| No dead stock found. |
@endforelse
| Totals |
{{ number_format($deadStockRows->sum('stock_quantity'), 2) }} |
|
{{ \App\Models\SystemSetting::formatMoney($deadStockRows->sum('stock_value')) }} |
|
@elseif($report === 'sales_by_category')
| Category | Qty | Total Amount |
@forelse($categoryRows as $row)
| {{ $row->category_name }} | {{ number_format($row->quantity, 2) }} | {{ \App\Models\SystemSetting::formatMoney($row->total_amount) }} |
@empty
| No records found. |
@endforelse
| Total Amount |
|
{{ \App\Models\SystemSetting::formatMoney($categoryRows->sum('total_amount')) }} |
@elseif($report === 'sales_by_person')
@if(($filters['display_type'] ?? 'summary') === 'products')
| Sales Person | Barcode | Product | Category | Qty Sold | Total Sales |
@forelse($salesPersonProductRows as $row)
| {{ $row->sales_person }} |
{{ $row->barcode ?: '-' }} |
{{ $row->product_name }} |
{{ $row->category_name }} |
{{ number_format($row->quantity, 2) }} |
{{ \App\Models\SystemSetting::formatMoney($row->total_amount) }} |
@empty
| No products sold for the selected period. |
@endforelse
| Totals | {{ number_format($salesPersonProductRows->sum('quantity'), 2) }} | {{ \App\Models\SystemSetting::formatMoney($salesPersonProductRows->sum('total_amount')) }} |
@else
| Sales Person | Total Sales | Cleared Sales | Uncleared Sales |
@forelse($salesPersonRows as $row)
| {{ $row->user?->name ?: '-' }} | {{ \App\Models\SystemSetting::formatMoney($row->total_sales) }} | {{ \App\Models\SystemSetting::formatMoney($row->cleared_sales) }} | {{ \App\Models\SystemSetting::formatMoney($row->uncleared_sales) }} |
@empty
| No records found. |
@endforelse
| Totals | {{ \App\Models\SystemSetting::formatMoney($salesPersonRows->sum('total_sales')) }} | {{ \App\Models\SystemSetting::formatMoney($salesPersonRows->sum('cleared_sales')) }} | {{ \App\Models\SystemSetting::formatMoney($salesPersonRows->sum('uncleared_sales')) }} |
@endif
@elseif($report === 'end_shift')
@if(($filters['report_type'] ?? 'summary') === 'detailed')
| Product | Category | Qty | S.Price | Total |
@forelse($endShiftItemRows as $row)
| {{ $row->product_name }} | {{ $row->category_name }} | {{ number_format($row->quantity, 2) }} | {{ \App\Models\SystemSetting::formatMoney($row->unit_price) }} | {{ \App\Models\SystemSetting::formatMoney($row->total_amount) }} |
@empty
| No item records found. |
@endforelse
| Totals |
{{ number_format($endShiftItemRows->sum('quantity'), 2) }} |
|
{{ \App\Models\SystemSetting::formatMoney($endShiftItemRows->sum('total_amount')) }} |
@else
| Sales Person | Total Sales | Cleared Sales | Uncleared Sales |
@forelse($salesPersonRows as $row)
| {{ $row->user?->name ?: '-' }} | {{ \App\Models\SystemSetting::formatMoney($row->total_sales) }} | {{ \App\Models\SystemSetting::formatMoney($row->cleared_sales) }} | {{ \App\Models\SystemSetting::formatMoney($row->uncleared_sales) }} |
@empty
| No records found. |
@endforelse
@endif
@elseif($report === 'sales_by_customer')
| Customer | Entries | Total Sales |
@forelse($customerRows as $row)
| {{ $row->customer_name }} | {{ number_format($row->entries) }} | {{ \App\Models\SystemSetting::formatMoney($row->total_sales) }} |
@empty
| No records found. |
@endforelse
@elseif($report === 'sales_by_payment')
| Payment Method | Entries | Total Amount |
@forelse($paymentRows as $row)
| {{ $row->paymentMethod?->name ?: '-' }} | {{ number_format($row->entries) }} | {{ \App\Models\SystemSetting::formatMoney($row->total_amount) }} |
@empty
| No records found. |
@endforelse
| Total Amount |
{{ \App\Models\SystemSetting::formatMoney($paymentRows->sum('total_amount')) }} |
@elseif($report === 'uncleared_bills')
| Date | Invoice | Customer | Sale Type | Status | Total | Paid | Balance | Sales Person |
@forelse($sales as $sale)
| {{ $sale->sale_date?->format('Y-m-d H:i') }} |
{{ $sale->invoice_no }} |
{{ $sale->customer_name ?: '-' }} |
{{ ucfirst($sale->sale_mode) }} |
{{ $sale->sale_status === 'voided' || $sale->payment_status === 'voided' ? 'Voided' : ($sale->payment_status === 'paid' ? 'Paid' : 'Pending') }} |
{{ number_format($sale->total_amount, 2) }} |
{{ number_format($sale->paid_amount, 2) }} |
{{ number_format($sale->balance_amount, 2) }} |
{{ $sale->user?->name ?: '-' }} |
@empty
| No records found. |
@endforelse
| Totals |
{{ number_format($sales->sum('total_amount'), 2) }} |
{{ number_format($sales->sum('paid_amount'), 2) }} |
{{ number_format($sales->sum('balance_amount'), 2) }} |
|
@else
| Date | Invoice | Customer | Sale Type | Status | Total | Paid | Balance | Sales Person |
@forelse($sales as $sale)
| {{ $sale->sale_date?->format('Y-m-d H:i') }} |
{{ $sale->invoice_no }} |
{{ $sale->customer_name ?: '-' }} |
{{ ucfirst($sale->sale_mode) }} |
{{ $sale->sale_status === 'voided' || $sale->payment_status === 'voided' ? 'Voided' : ($sale->payment_status === 'paid' ? 'Paid' : 'Pending') }} |
{{ \App\Models\SystemSetting::formatMoney($sale->total_amount) }} |
{{ \App\Models\SystemSetting::formatMoney($sale->paid_amount) }} |
{{ \App\Models\SystemSetting::formatMoney($sale->balance_amount) }} |
{{ $sale->user?->name ?: '-' }} |
@empty
| No records found. |
@endforelse
@endif