@extends('layouts.app') @section('title') Profit Loss Statement @stop @section('breadcrumb') @stop @section('css') @stop @section('content')

@foreach($project_names as $key => $project_name) {{ $project_name }} @if($key < count($project_names) - 1) , @endif @endforeach

Profit or Loss Statement

{{date('d/m/Y', strtotime($from_date))}} - {{date('d/m/Y', strtotime($to_date))}}
@foreach($income as $account) @if($account['sum'] != 0 ) @endif @endforeach @foreach($cgs as $account) @if($account['sum'] != 0 ) @endif @endforeach @foreach($expense as $account) @if($account['sum'] != 0 ) @endif @endforeach
 
Income
{{$account['account']->number}} - {{$account['account']->name}} @if($account['sum'] > 0) ({{number_format(abs($account['sum']))}}) @else {{number_format(abs($account['sum']))}} @endif
Total Income @if($income_t < 0) ({{number_format(abs($income_t))}}) @else {{$income_t > 0 ? number_format($income_t) : '-'}} @endif
Cost of Goods Sold
{{$account['account']->number}} - {{$account['account']->name}} @if($account['sum'] > 0) ({{number_format(abs($account['sum']))}}) @else {{number_format(abs($account['sum']))}} @endif
Total COGS @if($cgs_t < 0) ({{number_format(abs($cgs_t))}}) @else {{$cgs_t> 0? number_format($cgs_t) : '-'}} @endif
Gross Profit {{number_format($income_t + $cgs_t)}}
Expense
{{$account['account']->number}} - {{$account['account']->name}} @if($account['sum'] > 0) ({{number_format(abs($account['sum']))}}) @else {{number_format(abs($account['sum']))}} @endif
Total Expense @if($expense_t < 0) ({{number_format(abs($expense_t))}}) @else {{$expense_t> 0? number_format($expense_t) : '-'}} @endif
Net Income {{number_format(($income_t + ($cgs_t ) + $expense_t))}}
@stop @section('js') @stop