@extends('admin.layouts.app') @section('title', 'Profit & Loss Report') @section('page_title', 'Profit & Loss Report') @section('content')
Profit & Loss Report
Print
Reset
Total Purchase

{{ number_format($totalPurchase, 2) }}

Total Sales

{{ number_format($totalSales, 2) }}

Total TDS/VDS

{{ number_format($totalTdsVds, 2) }}

Net {{ $totalProfit >= 0 ? 'Profit' : 'Loss' }}

{{ $totalProfit >= 0 ? number_format($totalProfit, 2) : '('.number_format(abs($totalProfit), 2).')' }}

@php $sl = 1; @endphp @forelse($reportData as $row) @php $rowProfit = $row['sales_amount'] - $row['purchase_amount'] - $row['tds_vds_other']; @endphp @empty @endforelse
Sl Date Shipment Supplier Purchase Sales TDS/VDS Profit/Loss
{{ $sl++ }} {{ $row['purchase_date'] ? \Carbon\Carbon::parse($row['purchase_date'])->format('d-m-y') : '-' }} {{ $row['shipment_number'] }} {{ $row['supplier_name'] }} {{ number_format($row['purchase_amount'], 2) }} {{ number_format($row['sales_amount'], 2) }} {{ number_format($row['tds_vds_other'], 2) }} {{ $rowProfit >= 0 ? number_format($rowProfit, 2) : '('.number_format(abs($rowProfit), 2).')' }}
No transactions found
Grand Total {{ number_format($totalPurchase, 2) }} {{ number_format($totalSales, 2) }} {{ number_format(array_sum(array_column($reportData, 'tds_vds_other')), 2) }} {{ $totalProfit >= 0 ? number_format($totalProfit, 2) : '('.number_format(abs($totalProfit), 2).')' }}
Expenses Summary
@forelse($expensesByCategory as $exp) @empty @endforelse
Category Amount
{{ $exp['category'] ?: 'Other' }} {{ number_format($exp['total'], 2) }}
No expenses found
Total Expenses {{ number_format($totalExpenses, 2) }}
@php $netProfit = $totalProfit - $totalExpenses; @endphp
Net Profit Calculation
Gross Profit (Total Profit/Loss) {{ $totalProfit >= 0 ? number_format($totalProfit, 2) : '('.number_format(abs($totalProfit), 2).')' }}
Less: Total Expenses (-) {{ number_format($totalExpenses, 2) }}
{{ $netProfit >= 0 ? 'Net Profit' : 'Net Loss' }} {{ $netProfit >= 0 ? number_format($netProfit, 2) : '('.number_format(abs($netProfit), 2).')' }}
@endsection