@foreach($units as $key=>$unit) @endforeach @foreach($units as $key=>$unit) @php $total_units[$key] = 0; if(!empty($formated_report[$key])) { foreach($formated_report[$key] as $value) { $total_units[$key] += $value->paid; } } @endphp @endforeach @foreach($units as $key=>$unit) @php $total_units[$key] = 0; if(!empty($formated_report[$key])) { foreach($formated_report[$key] as $value) { $total_units[$key] += $value->amount; } } @endphp @endforeach {{-- @foreach($units as $key=>$unit) @php $total_amount[$key] = 0; $total_payment[$key] = 0; $total_dues[$key] = 0; $total_discount[$key] = 0; $total_tax[$key] = 0; if(!empty($formated_report[$key])) { foreach($formated_report[$key] as $value) { $total_amount[$key] = $total_amount[$key] + $value->total; $total_payment[$key] = $total_payment[$key] + $value->payment; $total_dues[$key] = $total_dues[$key] + $value->dues; $total_discount[$key] = $total_discount[$key] + $value->discount; $total_tax[$key] = $total_tax[$key] + $value->tax; } } @endphp @endforeach --}} {{-- @foreach($units as $key=>$unit) @endforeach --}} {{-- @foreach($units as $key=>$unit) @endforeach --}} {{-- @foreach($units as $key=>$unit) @endforeach --}} {{-- @foreach($units as $key=>$unit) @endforeach --}} {{-- @if(!empty($formated_expense)) @foreach($expense_cat as $key=>$value) @foreach($units as $key=>$unit) @php $total_expense_payment = 0; if(!empty($formated_expense[$key])) { foreach($formated_expense[$key] as $avalue) { if($avalue->expense_category_id == $value->id) { $total_expense_payment = $total_expense_payment + $avalue->payment; } } } @endphp @endforeach @endforeach @endif --}}
 {{$unit}}
{{__('Incoming')}} {{ $total_units[$key]}}
{{__('Outgoing')}} {{ $total_units[$key]}}
{{__('Purchase Amount')}} {{ $total_amount[$key]}}
{{__('Purchase Payment')}} {{ $total_payment[$key]}}
{{__('Purchase Dues')}} {{ $total_dues[$key]}}
{{__('Purchase Discount')}} {{ $total_discount[$key]}}
{{__('Purchase Tax')}} {{ $total_tax[$key]}}
{{__($value->name)}} {{$total_expense_payment}}