@extends('layouts.layout-horizontal') @section('title', 'Ledger') @section('content')
Party Ledger
{{ ucfirst($companyMode) }} Mode

{{-- Quick Summary Cards --}}
Total Parties

{{ $parties->count() }}

Sales Parties

{{ $parties->whereIn('party_type', ['sales', 'both'])->count() }}

Purchase Parties

{{ $parties->whereIn('party_type', ['purchase', 'both'])->count() }}

Receivable Outstanding

{{ indian_number($parties->sum(fn($p) => max($p->ledger_outstanding, 0)), 2) }}

Payable Outstanding

{{ indian_number(abs($parties->sum(fn($p) => min($p->ledger_outstanding, 0))), 2) }}

{{-- Batch Print Button --}}
Party List
{{-- Party List Table --}}
@foreach($parties as $party) @endforeach
Party Name Type City / Location Mobile GSTIN Outstanding Action
{{ $party->name }}
@csrf
{{ $party->ledger_location }} {{ $party->mobile ?? '-' }} {{ $party->gst_number ?? '-' }} @php $os = (float) $party->ledger_outstanding; @endphp @if(abs($os) > 0.5) {{ indian_number(abs($os), 2) }} {{ $os > 0 ? 'Dr' : 'Cr' }} @else - @endif Ledger
@endsection @push('scripts') @endpush