@php $report_type = (request('type'))?? 'total'; @endphp

@lang('accounting/reports/accounts/income-list.income_list')

@php $from_date = request('from_date') ?? $active_year->from; $to_date = request('to_date') ?? $active_year->to; @endphp
@if(request()->from_date)

@lang('accounting/reports/accounts/trial-balance.from_date') {{ $from_date }}

@endif @if(request()->to_date)

@lang('accounting/reports/accounts/trial-balance.to_date') {{ $to_date }}

@endif
@php $report_type = (request('type'))?? 'total'; @endphp @if ($report_type == 'total') {{-- --}}
@lang('accounting/reports/accounts/income-list.account') @lang('accounting/reports/accounts/income-list.value')
@lang('accounting/reports/accounts/income-list.sales') {{ dn($incomeList['sales']['value']) }}
@lang('accounting/reports/accounts/income-list.sales_cost') {{ dn($incomeList['sales-cost']['value']) }}
@lang('accounting/reports/accounts/income-list.beginning_inventory') {{ dn($incomeList['sales-cost']['subList']['beginning-inventory']['value']) }}
@lang('accounting/reports/accounts/income-list.purchases') {{ dn($incomeList['sales-cost']['subList']['purchases']['value']) }}
@lang('accounting/reports/accounts/income-list.ending_inventory'){{ dn($incomeList['sales-cost']['subList']['ending-inventory']['value']) }}
@lang('accounting/reports/accounts/income-list.total_profit') {{ dn($incomeList['total-profit']) }}
@lang('accounting/reports/accounts/income-list.revenue') {{ dn($incomeList['revenue']['value']) }}
@lang('accounting/reports/accounts/income-list.expenses') {{ dn($incomeList['expenses']['value']) }}
@lang('accounting/reports/accounts/income-list.net') {{ $incomeList['net-profit'] > 0 ? 'الربح' : 'الخسارة' }} {{ dn($incomeList['net-profit']) }}
@else {{-- Sales section --}} @forelse ($incomeList['sales']['actions'] as $account_id => $actions) @if ($actions->count()) @endif @empty @endforelse
@lang('accounting/reports/accounts/income-list.account'): @lang('accounting/reports/accounts/income-list.sales') @lang('accounting/reports/accounts/income-list.value'): {{ dn($incomeList['sales']['value']) }}
{{ $actions[0]->account->name }} {{ dn($actions->sum('amount')) }}
@lang('accounting/reports/accounts/income-list.no_transactions')
{{-- Sales cost section --}} @foreach ($incomeList['sales-cost']['subList']['beginning-inventory']['actions'] as $account_id => $actions) @endforeach @foreach ($incomeList['sales-cost']['subList']['purchases']['actions'] as $account_id => $actions) @endforeach @foreach ($incomeList['sales-cost']['subList']['ending-inventory']['actions'] as $account_id => $actions) @endforeach
@lang('accounting/reports/accounts/income-list.account'): @lang('accounting/reports/accounts/income-list.sales_cost') @lang('accounting/reports/accounts/income-list.value'): {{ dn($incomeList['sales-cost']['value']) }}
{{ $actions[0]->account->name }} {{ dn($actions->sum('amount')) }}
{{ $actions[0]->account->name }} {{ dn($actions->sum('amount')) }}
{{ $actions[0]->account->name }} {{ dn($actions->sum('amount')) }}
{{-- Revenue section --}} @forelse ($incomeList['revenue']['actions'] as $account_id => $actions) @if ($actions->count()) @endif @empty @endforelse
@lang('accounting/reports/accounts/income-list.account'): @lang('accounting/reports/accounts/income-list.revenue') @lang('accounting/reports/accounts/income-list.value'): {{ dn($incomeList['revenue']['value']) }}
{{ $actions[0]->account->name }} {{ dn($actions->sum('amount')) }}
@lang('accounting/reports/accounts/income-list.no_transactions')
{{-- Expenses section --}} @forelse ($incomeList['expenses']['actions'] as $account_id => $actions) @if ($actions->count()) @endif @empty @endforelse
@lang('accounting/reports/accounts/income-list.account'): @lang('accounting/reports/accounts/income-list.expenses') @lang('accounting/reports/accounts/income-list.value'): {{ dn($incomeList['expenses']['value']) }}
{{ $actions[0]->account->name }} {{ dn($actions->sum('amount')) }}
@lang('accounting/reports/accounts/income-list.no_transactions')
{{-- Net loss and profit section--}}
@lang('accounting/reports/accounts/income-list.net') {{ $incomeList['net-profit'] > 0 ? 'الربح' : 'الخسارة' }} {{ dn($incomeList['net-profit']) }}
@endif
@push('script') @endpush