@extends('layouts.app') @section('title') {{ trans_choice('accounting::report.profit_and_loss', 1) }} @endsection @section('css') @include('accounting::report.partials.report_css') @endsection @section('content') @include('accounting::layouts.nav') @component('accounting::components.section_header') @slot('title') {{ trans_choice('accounting::general.accounting', 1) }} {{ trans_choice('accounting::lang.report', 2) }} @endslot @slot('subtitle') {{ trans_choice('accounting::report.profit_and_loss', 1) }} @endslot @endcomponent
@component('accounting::components.box') @slot('header')
@component('accounting::components.download_action_button', [ 'url' => 'report/accounting/profit_and_loss', 'filters' => 'start_date=' . $start_date . '&end_date=' . $end_date . '&location_id=' . $location_id, ]) @endcomponent
@endslot @slot('body')

{{ trans_choice('accounting::report.profit_and_loss', 1) }} @if (!empty($start_date)) {{ trans('accounting::lang.for_period') }}: {{ $start_date }} {{ trans('accounting::lang.to') }} {{ $end_date }} @endif


{{ trans_choice('accounting::lang.clear', 1) }}!
{{-- REPORT BODY (only when dates are set) --}} {{-- REPORT BODY (only when dates are set) --}} @if (!empty($start_date) && !empty($end_date)) @component('accounting::components.box') @slot('body')

{{ trans_choice('accounting::report.profit_and_loss', 1) }}

@if ($location_id && $income->first()->location_name ?? false)

{{ trans_choice('accounting::lang.business_location', 1) }}: {{ $income->first()->location_name }}

@endif

{{ trans_choice('accounting::lang.start_date', 1) }}: {{ readable_date($start_date) }}   {{ trans_choice('accounting::lang.end_date', 1) }}: {{ readable_date($end_date) }}

{{-- 1. REVENUE --}}

1. {{ __('Revenue') }}

@foreach ($income as $acc) @php $bal = $acc->total_credit - $acc->total_debit; @endphp @endforeach
DescriptionAmount ({{ $currency_code }})
{{ $acc->name }} {{ $fmt($bal) }}
Total Revenue {{ $fmt($total_income) }}
{{-- 2. COGS --}}

2. {{ __('Cost of Goods Sold (COGS)') }}

Opening Inventory{{ $fmt($opening_stock) }}
Purchases{{ $fmt($purchases) }}
Closing Inventory{{ $fmt(-$closing_stock) }}
Total COGS {{ $fmt($total_cogs) }}
{{-- Gross Profit --}}
Gross Profit = Total Revenue – Total COGS {{ $fmt($gross_profit) }}
{{-- 3. OPERATING EXPENSES --}}

3. {{ __('Operating Expenses') }}

@foreach ($expense as $acc) @php $bal = $acc->total_debit - $acc->total_credit; @endphp @endforeach
DescriptionAmount ({{ $currency_code }})
{{ $acc->name }} {{ $fmt($bal) }}
Total Operating Expenses {{ $fmt($total_expense) }}
{{-- Operating Profit --}}
Operating Profit = Gross Profit – Total Operating Expenses {{ $fmt($operating_profit) }}
{{-- 5. NET PROFIT (before tax) --}}
Net Profit {{ $fmt($net_profit) }}
@endslot @endcomponent @endif
@endslot @endcomponent
@stop @section('javascript') @include('accounting::report.partials.report_js') @endsection