@extends('layouts.app') @section('title', 'Location Profit & Loss') @section('content')

Profit & Loss - {{ $location->name ?? 'Location' }} Period: {{ @format_date($startDate) }} to {{ @format_date($endDate) }}

@component('components.widget', ['class' => 'box-primary'])
{!! Form::label('start_date', __('accounting-reports::lang.start_date') . ':') !!} {!! Form::text('start_date', @format_date($startDate ?? now()->startOfMonth()), ['class' => 'form-control date-picker', 'readonly', 'id' => 'start_date']) !!}
{!! Form::label('end_date', __('accounting-reports::lang.end_date') . ':') !!} {!! Form::text('end_date', @format_date($endDate ?? now()->endOfMonth()), ['class' => 'form-control date-picker', 'readonly', 'id' => 'end_date']) !!}

Back to All Locations
@endcomponent @php $summary = $plData['summary'] ?? []; $tradingAccount = $plData['trading_account'] ?? []; $plAccount = $plData['pl_account'] ?? []; @endphp
Total Revenue @format_currency($summary['total_revenue'] ?? 0)
COGS @format_currency($summary['total_cogs'] ?? 0)
Gross Profit @format_currency($summary['gross_profit'] ?? 0)
{{ number_format($summary['gross_profit_percentage'] ?? 0, 2) }}% Margin
Net Profit @format_currency($summary['net_profit'] ?? 0)
{{ number_format($summary['net_profit_percentage'] ?? 0, 2) }}% Margin

Trading Account

Revenue
Sales @format_currency($tradingAccount['revenue'] ?? 0)
Total Revenue @format_currency($tradingAccount['revenue'] ?? 0)
Less: Cost of Goods Sold
Opening Stock @format_currency($tradingAccount['opening_stock'] ?? 0)
Purchases @format_currency($tradingAccount['purchases'] ?? 0)
Less: Purchase Returns @format_currency($tradingAccount['purchase_return'] ?? 0)
Less: Closing Stock @format_currency($tradingAccount['closing_stock'] ?? 0)
Total COGS @format_currency($tradingAccount['cogs'] ?? 0)
Gross Profit @format_currency($tradingAccount['gross_profit'] ?? 0)

Profit & Loss Account

Income
Gross Profit @format_currency($tradingAccount['gross_profit'] ?? 0)
Other Income @format_currency($plAccount['total_indirect_incomes'] ?? 0)
Total Income @format_currency(($tradingAccount['gross_profit'] ?? 0) + ($plAccount['total_indirect_incomes'] ?? 0))
Expenses
Operating Expenses @format_currency($plAccount['total_indirect_expenses'] ?? 0)
Net Profit / (Loss) @format_currency($plAccount['net_profit'] ?? 0)

Key Performance Metrics

{{ number_format($summary['gross_profit_percentage'] ?? 0, 2) }}%
Gross Profit Margin
@format_currency($summary['gross_profit'] ?? 0)
{{ number_format($summary['net_profit_percentage'] ?? 0, 2) }}%
Net Profit Margin
@format_currency($summary['net_profit'] ?? 0)
{{ number_format(($summary['total_cogs'] ?? 0) > 0 && ($summary['total_revenue'] ?? 0) > 0 ? (($summary['total_cogs'] / $summary['total_revenue']) * 100) : 0, 2) }}%
COGS Ratio
@format_currency($summary['total_cogs'] ?? 0)
{{ number_format(($summary['total_indirect_expenses'] ?? 0) > 0 && ($summary['total_revenue'] ?? 0) > 0 ? (($summary['total_indirect_expenses'] / $summary['total_revenue']) * 100) : 0, 2) }}%
Expense Ratio
@format_currency($summary['total_indirect_expenses'] ?? 0)
@endsection @section('javascript') @endsection