{{-- resources/views/modules/reports/supplier-statement.blade.php --}} @extends('layouts.master') @section('title', 'Supplier Statement Report') @section('content')
Back to Reports
Supplier Statement Report
@if(session('success'))
{{ session('success') }}
@endif @if($errors->any())
    @foreach($errors->all() as $error)
  • {{ $error }}
  • @endforeach
@endif
@csrf

@if(isset($allStatements) && count($allStatements) > 0)
@csrf
@foreach($allStatements as $supplierStatement)
{{ $supplierStatement['supplier']->supplier_account }} ({{ $supplierStatement['supplier']->supplier_code }})
@php $balance = $supplierStatement['openingBalance']; $grandBalance = $balance; @endphp @foreach($supplierStatement['statementData'] as $row) @php $balance += ($row['dr'] - $row['cr']); $grandBalance = $balance; @endphp @endforeach
Date Description Reference DR CR Balance
{{ $dateFrom }} Opening Balance {{ number_format($balance > 0 ? $balance : 0, 2) }} {{ number_format($balance < 0 ? abs($balance) : 0, 2) }} {{ number_format($balance, 2) }}
{{ $row['date'] }} {{ $row['description'] }} {{ $row['reference'] }} {{ number_format($row['dr'], 2) }} {{ number_format($row['cr'], 2) }} {{ number_format($balance, 2) }}
Grand Total : {{ number_format($grandBalance, 2) }}
@endforeach

Copyright © Melsoft (Private) Limited

@elseif(isset($statementData) && count($statementData) > 0)
Supplier Statement
@csrf
@php $grandBalance = 0; @endphp @foreach($statementData as $row) @php $grandBalance += $row['balance']; @endphp @endforeach
Date Description Reference DR CR Balance
{{ $row['date'] }} {{ $row['description'] }} {{ $row['reference'] }} {{ number_format($row['dr'], 2) }} {{ number_format($row['cr'], 2) }} {{ number_format($row['balance'], 2) }}
Grand Total : {{ number_format($grandBalance, 2) }}

Copyright © Melsoft (Private) Limited

@elseif(isset($statementData) && count($statementData) == 0)
No transactions found for the selected criteria.
@endif
@endsection @section('styles') @endsection @push('scripts') @endpush