@extends('master.app') @section('title', 'Report') @section('pageCSS') @endsection @section('body')
@foreach ($currencies as $row) @endforeach @foreach ($currencies as $row) @endforeach @foreach ($currencies as $row) @endforeach @foreach ($currencies as $row) @endforeach @foreach ($suppliers as $row) @foreach ($currencies as $cur_row) @endforeach @foreach ($currencies as $cur_row) @endforeach @foreach ($currencies as $cur_row) @endforeach @foreach ($currencies as $cur_row) @php $balance=$purchase->where('supplier_id',$row->id)->where('currency_id',$cur_row->id)->sum('grand_total')-($advances->where('supplier_id', $row->id)->where('currency_id', $cur_row->id)->sum('amount')+$payment->where('supplier_id', $row->id)->where('currency_id', $cur_row->id)->sum('amount')); @endphp @if($balance!=0) @else @endif @endforeach @endforeach @foreach ($currencies as $row) @endforeach @foreach ($currencies as $row) @endforeach @foreach ($currencies as $row) @endforeach @foreach ($currencies as $row) @endforeach @foreach ($currencies as $row) @endforeach @foreach ($currencies as $row) @endforeach @foreach ($currencies as $row) @endforeach @foreach ($currencies as $row) @endforeach
Name INVOICES Payments ADVANCES BALANCES
{{ $row->title_en }}{{ $row->title_en }}{{ $row->title_en }}{{ $row->title_en }}
{{ $row->name }}{{ $purchase->where('supplier_id', $row->id)->where('currency_id', $cur_row->id)->sum('grand_total') }} {{ $payment->where('supplier_id', $row->id)->where('currency_id', $cur_row->id)->sum('amount') }} {{ $advances->where('supplier_id', $row->id)->where('currency_id', $cur_row->id)->sum('amount') }} {{ $balance }} {{ $balance }}
Subtotal INVOICES PAYMENTS ADVANCES BALANCES
{{ $row->title_en }}{{ $row->title_en }}{{ $row->title_en }}{{ $row->title_en }}
{{ $purchase->where('currency_id',$row->id)->sum('grand_total') }}{{ $payment->where('currency_id',$row->id)->sum('amount') }}{{ $advances->where('currency_id',$row->id)->sum('amount') }}{{ $purchase->where('currency_id',$row->id)->sum('grand_total')-($payment->where('currency_id',$row->id)->sum('amount')+$advances->where('currency_id',$row->id)->sum('amount')) }}
@endsection @section('pageJs') @endsection