@extends('admin.layout') @section('content')
Report(Income)
Date | Flat | @foreach($utility_setups as $item){{ $item->title ?? '' }} ({{ $item->ref_code ?? '' }}) | @endforeach|
---|---|---|---|
{{ !empty($item->created_at)? date('d/m/Y', strtotime($item->created_at)) : '' }} | {{ $item->flat_no ?? '' }} | @foreach($utility_setups as $utility) @php $found = 0 @endphp @foreach($item->rent_invoice_detail as $utility_item) @if($utility_item->utility_ref_code == $utility->ref_code){{ $utility_item->amount }} | @php $total[$utility->ref_code][] = $utility_item->amount ; $found = 1 @endphp @endif @endforeach @if($found == 0)--- | @php $total[$utility->ref_code][] =0; $found = 1 @endphp @endif @endforeach
Total= | @foreach($utility_setups as $utility) @php $found = 0 @endphp{{ array_sum($total[$utility->ref_code]) ?? '0' }} | @endforeach