@extends('layouts.master-vnext') @section('page-title') Expenses {{ $division ? "- Department: {$division}" : "" }} @endsection @section('content')
@foreach($expenses as $idx => $types)

{{ $types->first()->first()->product_type === "App\Models\Expense\Product" ? "Expenses" : "Products going to stock"}}

@foreach($types as $groupName => $exp) @endforeach
Name Total
$exp->first()->product->group->id, 't' => $exp->first()->hasStockProduct ? 'stock' : 'exp', 'filterFrom' => $filterFrom->toIso8601String(), 'filterTo' => $filterTo->toIso8601String(), 'division' => $divisionId]) }}"> {{ $groupName }} @currency($exp->sum('total_in_default_currency')) {{ $currency->symbol }}
@currency($expenses[$idx]->sum(function($i) { return $i->sum('total_in_default_currency'); })) {{ $currency->symbol }}
@endforeach
@endsection