@extends('master.app') @section('title', 'Suppliers') @section('body')
Total Purchase
@foreach ($currencies as $row)
{{ $bills->where('supplier_id', $supplier->id)->where('currency_id', $row->id)->sum('grand_total') }} {{ $row->title_ps }}
@endforeach
Total Payment
@foreach (App\Models\Currency::all() as $row)
{{ $payments->where('supplier_id', $supplier->id)->where('currency_id', $row->id)->sum('amount') }} {{ $row->title_ps }}
@endforeach
Total Advance
@foreach (App\Models\Currency::all() as $row)
{{ $advance->where('supplier_id', $supplier->id)->where('currency_id', $row->id)->sum('amount') }} {{ $row->title_ps }}
@endforeach
Balance
@foreach (App\Models\Currency::all() as $row)
@php $bill = $bills ->where('supplier_id', $supplier->id) ->where('currency_id', $row->id) ->sum('grand_total'); $pay = $payments ->where('supplier_id', $supplier->id) ->where('currency_id', $row->id) ->sum('amount'); $ad = $advance ->where('supplier_id', $supplier->id) ->where('currency_id', $row->id) ->sum('amount'); $py_ad = $pay + $ad; $balance = $bill - $py_ad; @endphp {{ $row->title_ps }} {{ $balance }}
@endforeach
@endsection @section('pageJs') @endsection