@extends('layouts.default') @section('title', trans('reports.standard.title.standardreports', ['type' => trans('reports.standard.profitandloss')])) @section('new_button') {{-- // --}} @endsection @section('content')
{!! Form::open(['url'=>'/reports/standard/profit-loss']) !!} @include('accounts.reports.standard.date-filter-view') {!! Form::close() !!}

{{ trans('reports.standard.profitandloss') }}

Account Total
{{-- INCOMES --}}

@php $gtotal = 0; @endphp @foreach($incomes as $income) @if(count($income->chartofhistory) > 0) @php $total = 0; $charts = $income->chartofhistory; @endphp @foreach ($charts as $item) @php if($item->amount_type == 'add') { $total = $total + $item->amount; } else { $total = $total - $item->amount; } @endphp @endforeach
{{ $income->name }} @money($total, 'USD', true)
@php $gtotal = $gtotal + $total; $total = 0; @endphp @endif @endforeach
Income Total @money($gtotal, 'USD', true)
{{-- EXPENSES --}}

@php $egtotal = 0; @endphp @foreach($expenses as $expense) @if(count($expense->chartofhistory) > 0) @php $etotal = 0; $echarts = $expense->chartofhistory; @endphp @foreach ($echarts as $item) @php if($item->amount_type == 'add') { $etotal = $etotal + $item->amount; } else { $etotal = $etotal - $item->amount; } @endphp @endforeach
{{ $expense->name }} @money($etotal, 'USD', true)
@php $egtotal = $egtotal + $etotal; $etotal = 0; @endphp @endif @endforeach
Expense Total @money($egtotal, 'USD', true)
NET OPERATIONG INCOME @money($gtotal - $egtotal, 'USD', true)
@include('accounts.reports.standard.filter') @include('includes.datepicker') @endsection