@php($totalDue = (float) collect($ledgerRows)->sum('due')) @php($totalPaid = (float) collect($ledgerRows)->sum('paid')) {{-- @php($totalCut = (float) collect($ledgerRows)->sum('cut')) --}}
{{ __('Supplier Account View') }}

{{ __('Supplier Ledger') }}

{{--

{{ $selectedSupplier?->display_name ? 'Selected supplier ki purchases aur payments yahan simple ledger me nazar aayengi.' : 'Supplier select karke uska ledger dekh sakte hain.' }}

--}}
@error('supplier_id') {{ $message }} @enderror
@error('from_date') {{ $message }} @enderror
@error('to_date') {{ $message }} @enderror
{{--
--}}
{{ __('Supplier') }}
{{ $selectedSupplier->display_name ?? __('N/A') }}
{{ __('Opening Balance') }}
Rs. {{ number_format((float) $openingBalance, 2) }}
{{ __('Total Purchases') }}
Rs. {{ number_format($totalDue, 2) }}
{{ __('Closing Balance') }}
Rs. {{ number_format((float) $closingBalance, 2) }}
{{--
{{ __('Total Cut') }}
Rs. {{ number_format($totalCut, 2) }}
--}}
{{ __('Ledger Entries') }}
{{-- --}} {{-- --}} @forelse($ledgerRows as $row) {{-- --}} @empty @endforelse {{-- --}}
{{ __('Date') }} {{ __('Description') }} {{ __('Reference') }} {{ __('Due') }} {{ __('Paid') }}{{ __('Cut') }}{{ __('Balance') }}
- {{ __('Opening Balance') }} - {{ $openingBalance > 0 ? number_format((float) $openingBalance, 2) : '-' }} {{ $openingBalance < 0 ? number_format(abs((float) $openingBalance), 2) : '-' }} -Rs. {{ number_format((float) $openingBalance, 2) }}
{{ $row['date'] }} {{ $row['description'] }}
{{ $row['reference'] ?: '-' }}
{{-- @if(($row['type'] ?? '') === 'cut' && !empty($row['note']))
{{ $row['note'] }}
@endif --}}
{{ $row['due'] > 0 ? number_format((float) $row['due'], 2) : '-' }} {{ $row['paid'] > 0 ? number_format((float) $row['paid'], 2) : '-' }} {{ ($row['cut'] ?? 0) > 0 ? number_format((float) $row['cut'], 2) : '-' }} Rs. {{ number_format((float) $row['balance'], 2) }}
{{ __('No ledger entries found for selected filters.') }}
{{ __('Closing Balance') }} {{ $totalDue > 0 ? number_format($totalDue, 2) : '-' }} {{ $totalPaid > 0 ? number_format($totalPaid, 2) : '-' }}{{ $totalCut > 0 ? number_format($totalCut, 2) : '-' }}Rs. {{ number_format((float) $closingBalance, 2) }}