@extends('layouts.app') @section('content')

Purchase & Sales Report

Back to Purchase Report
Purchases
Amount: BDT {{ number_format($purchaseAmount, 2) }}
Paid: BDT {{ number_format($purchasePaid, 2) }}
Due: BDT {{ number_format($purchaseDue, 2) }}
Sales
Amount: BDT {{ number_format($salesAmount, 2) }}
Received: BDT {{ number_format($salesReceived, 2) }}
Due: BDT {{ number_format($salesDue, 2) }}
Net (Sales - Purchases)
Amount: BDT {{ number_format($salesAmount - $purchaseAmount, 2) }}
Cashflow (Received - Paid): BDT {{ number_format($salesReceived - $purchasePaid, 2) }}
Item-wise Summary
@php $t_pq = 0; $t_pa = 0; $t_sq = 0; $t_sa = 0; @endphp @forelse(($itemWise ?? []) as $row) @php $t_pq += $row['purchase_qty']; $t_pa += $row['purchase_amount']; $t_sq += $row['sales_qty']; $t_sa += $row['sales_amount']; $p_avg = $row['purchase_qty'] > 0 ? $row['purchase_amount'] / $row['purchase_qty'] : 0; $s_avg = $row['sales_qty'] > 0 ? $row['sales_amount'] / $row['sales_qty'] : 0; $profit = $row['sales_amount'] - $row['purchase_amount']; @endphp @empty @endforelse
Item Purchased Qty Purchased Avg. Purchased Amount Sales Qty Sales Avg. Sales Amount Profit/Loss
{{ $row['item_name'] }} {{ number_format($row['purchase_qty'], 2) }} BDT {{ number_format($p_avg, 2) }} BDT {{ number_format($row['purchase_amount'], 2) }} {{ number_format($row['sales_qty'], 2) }} BDT {{ number_format($s_avg, 2) }} BDT {{ number_format($row['sales_amount'], 2) }} BDT {{ number_format($profit, 2) }}
No data found for this date range.
Total {{ number_format($t_pq, 2) }} BDT {{ number_format(($t_pq>0 ? $t_pa/$t_pq : 0), 2) }} BDT {{ number_format($t_pa, 2) }} {{ number_format($t_sq, 2) }} BDT {{ number_format(($t_sq>0 ? $t_sa/$t_sq : 0), 2) }} BDT {{ number_format($t_sa, 2) }} BDT {{ number_format($t_sa - $t_pa, 2) }}
@endsection