@push('header') @endpush {{-- Status Messages --}} @if (session('success'))
{{ session('success') }}
@endif @if (session('error'))
{{ session('error') }}
@endif {{-- Validation Errors --}} @if ($errors->any())
    @foreach ($errors->all() as $error)
  • {{ $error }}
  • @endforeach
@endif {{-- Filter Section --}}
{{-- Supplier --}}
{{-- Date From --}}
{{-- Date To --}}
{{-- Transaction Type --}}
{{-- Reference Number --}}
{{-- Description --}}
{{-- Claim Month --}}
{{-- Posted Status --}}
{{-- Per Page --}}
{{-- Summary Cards --}}
Total Claims (Debit)
{{ number_format($totals['debit'], 2) }}
Total Recovery (Credit)
{{ number_format($totals['credit'], 2) }}
Net Balance
{{ number_format($totals['net_balance'], 2) }}
Closing Balance
{{ number_format($closingBalance, 2) }}
{{-- Main Report --}}
{{-- Report Header --}}

Moon Traders
Claim Register Report
@if ($dateFrom && $dateTo) Period: {{ \Carbon\Carbon::parse($dateFrom)->format('d-M-Y') }} to {{ \Carbon\Carbon::parse($dateTo)->format('d-M-Y') }} @elseif ($dateTo) As of: {{ \Carbon\Carbon::parse($dateTo)->format('d-M-Y') }} @endif @if ($selectedSupplier)
{{ $selectedSupplier->supplier_name }} @endif

Printed by: {{ auth()->user()->name }} | {{ now()->format('d-M-Y h:i A') }}
{{-- Data Table --}}
@php $supplierBalances = []; @endphp {{-- Opening Balance Row --}} @if ($openingBalance != 0) @endif @forelse ($claims as $index => $claim) @php $claimSupplierId = $claim->supplier_id; if (!isset($supplierBalances[$claimSupplierId])) { $supplierBalances[$claimSupplierId] = $openingBalances[$claimSupplierId] ?? 0; } $debit = (float) $claim->debit; $credit = (float) $claim->credit; $supplierBalances[$claimSupplierId] += $debit - $credit; $rowClosingBalance = $supplierBalances[$claimSupplierId]; @endphp @canany(['claim-register-edit', 'claim-register-post', 'claim-register-delete']) @endcanany @empty @endforelse {{-- Inline Add Form Row --}} @can('claim-register-create') @endcan {{-- Footer Totals --}}
Sr# Txn Date Supplier Reference Description Claim Month Type Debit (Claim) Credit (Recovery) Closing Balance Actions
Opening Balance @if ($dateFrom) (Before {{ \Carbon\Carbon::parse($dateFrom)->format('d-M-Y') }}) @endif - - {{ number_format($openingBalance, 2) }}
{{ $claims->firstItem() + $index }} {{ $claim->transaction_date->format('d.m.Y') }} {{ $claim->supplier?->short_name ?? $claim->supplier?->supplier_name ?? '-' }} {{ $claim->reference_number ?? '-' }} {{ $claim->description ?? '-' }} {{ $claim->claim_month ?? '-' }} {{ $claim->transaction_type === 'claim' ? 'DR' : 'CR' }} {{ $debit > 0 ? number_format($debit, 2) : '-' }} {{ $credit > 0 ? number_format($credit, 2) : '-' }} {{ number_format($rowClosingBalance, 2) }} @if (!$claim->isPosted())
@can('claim-register-post') @endcan @can('claim-register-edit') @endcan @can('claim-register-delete')
@csrf @method('DELETE')
@endcan
@else @endif
No claim entries found for the selected filters.
@csrf
+ -
Period Totals ({{ $claims->total() }} entries) {{ number_format($totals['debit'], 2) }} {{ number_format($totals['credit'], 2) }} {{ number_format($closingBalance, 2) }}
{{-- Add Entry Toggle Button --}} @can('claim-register-create')
@endcan
{{-- Claim Summary --}} @if ($selectedSupplier)
Claim Summary - {{ $selectedSupplier->short_name ?? $selectedSupplier->supplier_name }}
Claims (DR):- {{ number_format($totals['debit'], 2) }}
Recovery (CR):- {{ number_format($totals['credit'], 2) }}
Balance:- {{ number_format($closingBalance, 2) }}
@endif {{-- Pagination --}} @if ($claims->hasPages())
{{ $claims->links() }}
@endif
{{-- Edit Modal with Backdrop Blur --}} @can('claim-register-edit') @endcan @can('claim-register-post')

Are you sure you want to post this claim to the General Ledger? This action cannot be reversed.

@endcan @push('scripts') @endpush