@extends('layouts.user') @section('title', __('suppliers.supplier_ledger')) @section('content')
{{-- Header --}}
{{ __('suppliers.supplier_ledger') }}
{{ $supplier->name }} @if($supplier->phone) ({{ $supplier->phone }}) @endif
@php $currentDue = $current_due ?? (($sum_debit ?? 0) - ($sum_credit ?? 0)); @endphp {{-- Summary --}}
{{ __('suppliers.total_debit_purchases') }}
{{ number_format((float)($sum_debit ?? 0), 2) }}
{{ __('suppliers.total_credit_payments') }}
{{ number_format((float)($sum_credit ?? 0), 2) }}
{{ __('suppliers.current_due') }}
{{ number_format((float)$currentDue, 2) }}
{{-- Filters --}}
{{ __('suppliers.reset') }}
{{-- Table --}}
@forelse($transactions as $t) @empty @endforelse
{{ __('suppliers.date') }} {{ __('suppliers.type') }} {{ __('suppliers.debit') }} {{ __('suppliers.credit') }} {{ __('suppliers.memo_proof') }} {{ __('suppliers.note') }} {{ __('suppliers.action') }}
{{ optional($t->posted_at)->format('d M Y') ?? $t->created_at->format('d M Y') }}
{{ optional($t->posted_at)->format('h:i A') ?? $t->created_at->format('h:i A') }}
{{ strtoupper($t->type) }}
{{ $t->memo_no ?? $t->trx_no ?? '' }}
{{ number_format((float)$t->debit, 2) }} {{ number_format((float)$t->credit, 2) }}
@if($t->memo_photo) {{ __('suppliers.view_memo') }} @endif @if($t->payment_proof_photo) {{ __('suppliers.view_proof') }} @endif @if(!$t->memo_photo && !$t->payment_proof_photo) @endif
{{ $t->note }} {{ __('suppliers.edit') }}
@csrf @method('DELETE')
{{ __('suppliers.no_transactions_found') }}
{{ $transactions->links() }}
@endsection