@extends('master.authMaster') @section('content')

{{ ucfirst($vendor->vendor_name) }}

@if ($vendorType == 'internal') @if (isset($vendorRecords) && $vendorRecords->count() > 0)

Transaction History

@php $totalAmountSum = 0; $paidAmountSum = 0; @endphp @forelse($vendorRecords as $record) @php $totalAmountSum += $record->total_amount; $paidAmountSum += $record->paid_amount; $balance = $record->total_amount - $record->paid_amount; @endphp {{-- --}} @empty @endforelse
Date Expense Head Name Narration Total Salary Paid
{{ \Carbon\Carbon::parse($record->created_at)->format('d-m-Y') }} {{ $record->expense_head_name ?? '-' }} {{ $record->transaction_narration ?? '-' }} ₹ {{ number_format($record->paid_amount, 2) }} @if ($balance > 0) Due: ₹ {{ number_format($balance, 2) }} @elseif($balance < 0) Advance: ₹ {{ number_format(abs($balance), 2) }} @else Cleared @endif
No records found
@php $grandBalance = $totalAmountSum - $paidAmountSum; @endphp {{-- --}}
Grand Total ₹ {{ number_format($totalAmountSum, 2) }} ₹ {{ number_format($paidAmountSum, 2) }} @if ($grandBalance > 0) Outstanding Balance : ₹ {{ number_format($grandBalance, 2) }} @elseif($grandBalance < 0) Advance: ₹ {{ number_format(abs($grandBalance), 2) }} @else Cleared @endif
@else

No records found !!

@endif @else @if (isset($vendorRecords) && $vendorRecords->count() > 0)

Transaction History

@php $totalAmountSum = 0; $paidAmountSum = 0; @endphp @forelse($vendorRecords as $record) @php $totalAmountSum += $record->total_amount; $paidAmountSum += $record->paid_amount; $balance = $record->total_amount - $record->paid_amount; @endphp @empty @endforelse
Date Expense Head Name Narration Total Payment Amount Total Paid Amount
{{ \Carbon\Carbon::parse($record->created_at)->format('d-m-Y') }} {{ $record->expense_head_name ?? '-' }} {{ $record->transaction_narration ?? '-' }} ₹ {{ number_format($record->total_amount, 2) }} ₹ {{ number_format($record->paid_amount, 2) }} @if ($balance > 0) Due: ₹ {{ number_format($balance, 2) }} @elseif($balance < 0) Extra: ₹ {{ number_format(abs($balance), 2) }} @else Cleared @endif
No records found
@php $grandBalance = $totalAmountSum - $paidAmountSum; @endphp
Grand Total ₹ {{ number_format($totalAmountSum, 2) }} ₹ {{ number_format($paidAmountSum, 2) }} @if ($grandBalance > 0) Outstanding Balance : ₹ {{ number_format($grandBalance, 2) }} @elseif($grandBalance < 0) Extra: ₹ {{ number_format(abs($grandBalance), 2) }} @else Cleared @endif
@else

No records found !!

@endif @endif
@endsection