@extends('layouts.app') @section('stitle', __('messages.incomeStatement')) @section('title', __('messages.incomeStatement')) @section('content')
@if(session()->get('title') == "success") @elseif (session()->get('title') == "error") @elseif($errors->any()) @else @endif

{{__('messages.incomeStatement')}}

{{--
--}}
@php $totalDebit = 0; $totalCredit = 0; $totalRevenue = 0; $rpCheckName = array(); @endphp @foreach($revenueData as $journalEntry) @if(!in_array($journalEntry->getChartOfAccount->parent->name, $rpCheckName)) @endif @php $totalRevenue += $journalEntry->total_balance; $rpCheckName[] = $journalEntry->getChartOfAccount->parent->name; @endphp @endforeach @php $totalExpense = 0; $epCheckName = array(); @endphp @foreach($expenseData as $journalEntry) @if(!in_array($journalEntry->getChartOfAccount->parent->name, $epCheckName)) @endif @php $totalExpense += $journalEntry->total_balance; $epCheckName[] = $journalEntry->getChartOfAccount->parent->name; @endphp @endforeach @php $total = $totalRevenue-$totalExpense @endphp @if($total > 0) @else @endif
{{(setUserLang() == "ar") ? $journalEntry->getChartOfAccount->parent->code .'-'. $journalEntry->getChartOfAccount->parent->arabic_name : $journalEntry->getChartOfAccount->parent->code .'-'. $journalEntry->getChartOfAccount->parent->name }}
{{(setUserLang() == "ar") ? $journalEntry->getChartOfAccount->code .'-'. $journalEntry->getChartOfAccount->arabic_name : $journalEntry->getChartOfAccount->code .'-'. $journalEntry->getChartOfAccount->name }} {{ $journalEntry->total_balance}}
{{__('messages.Total')}} {{$totalRevenue}}
{{__('messages.grossProfit')}} {{$totalRevenue}}
{{(setUserLang() == "ar") ? $journalEntry->getChartOfAccount->parent->code .'-'. $journalEntry->getChartOfAccount->parent->arabic_name : $journalEntry->getChartOfAccount->parent->code .'-'. $journalEntry->getChartOfAccount->parent->name }}
{{(setUserLang() == "ar") ? $journalEntry->getChartOfAccount->code .'-'. $journalEntry->getChartOfAccount->arabic_name : $journalEntry->getChartOfAccount->code .'-'. $journalEntry->getChartOfAccount->name }} {{ $journalEntry->total_balance}}
{{__('messages.total')}} {{$totalExpense}}
{{__('messages.netProfit')}} {{$total}}
{{__('messages.netLosses')}} {{$total}}
@endsection @push('my_scripts') @endpush