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

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

ACCOUNT / DATE TRANSACTION TYPE NUM NAME DESCRIPTION AMOUNT
{{-- INCOMES --}}

@php $incometotal = 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
{{ Carbon::parse($item->created_at)->format($date_format) }} {{ $item->transaction_type }} {{ $item->number }} {{ $item->name }} {{ $item->description }} {{ ($item->amount_type=='add')?'+':'-' }}@money($item->amount, 'USD', true)
{{ $income->name }} @money($total, 'USD', true)
@php $incometotal = $incometotal + $total; $total = 0; @endphp @endif @endforeach
{{-- INCOME TOTAL --}}
Income Total @money($incometotal, 'USD', true)
{{-- EXPENSES --}}

@php $expensetotal = 0; @endphp @foreach($expenses as $expense) @if(count($expense->chartofhistory) > 0)

@php $etotal = 0; $charts = $expense->chartofhistory; @endphp @foreach ($charts as $item) @php if($item->amount_type == 'add') { $etotal = $etotal + $item->amount; } else { $etotal = $etotal - $item->amount; } @endphp @endforeach
{{ Carbon::parse($item->created_at)->format($date_format) }} {{ $item->transaction_type }} {{ $item->number }} {{ $item->name }} {{ $item->description }} {{ ($item->amount_type=='add')?'+':'-' }}@money($item->amount, 'USD', true)
{{ $expense->name }} @money($etotal, 'USD', true)
@php $expensetotal = $expensetotal + $etotal; $etotal = 0; @endphp @endif @endforeach
{{-- EXPENSE TOTAL --}}
Expeses Total @money($expensetotal, 'USD', true)
NET INCOME @money($incometotal - $expensetotal, 'USD', true)
@include('accounts.reports.standard.filter') @include('includes.datepicker') @endsection