@extends('Reports.template') @section('title', __('Supplier Ledger')) @section('ExternalCss') @parent @endsection @section('Content') @php $formatLedgerAmount = function ($minor) { return $minor == 0 ? '0,00' : \Helper::customAmountFormat($minor / 100); }; @endphp
@if (session('supplierLedgerFreezeMessage'))
{{ session('supplierLedgerFreezeMessage') }}
@endif
@forelse ($report['groups'] as $group) @forelse ($group['entries'] as $entry) @php $documentDate = $entry->bill_date && substr($entry->bill_date, 0, 10) !== '0000-00-00' ? \Carbon\Carbon::parse($entry->bill_date) : null; @endphp @empty @endforelse @empty @endforelse @if (count($report['groups']) > 0) @endif
@if ($businessEntity && $businessEntity->logo) @endif @if ($businessEntity)
{{ $businessEntity->name }}
{{ trim($businessEntity->add1 . ' ' . $businessEntity->add2 . ' ' . $businessEntity->city . ' ' . $businessEntity->pincode) }}
{{ __('Phone') }} : {{ $businessEntity->tel1 }}
@endif
{{ __('Supplier Ledger') }} {{ __('Period') }} : {{ \Carbon\Carbon::parse($fromDate)->format('d/m/Y') }} {{ __('TO') }} {{ \Carbon\Carbon::parse($toDate)->format('d/m/Y') }}
{{ __('Doc. Date / Time') }} {{ __('Due Date') }} {{ __('T. Doc') }} {{ __('Series') }} {{ __('Doc No') }} {{ __('Ext. No') }} {{ __('Account') }} {{ __('Status') }} {{ __('Credit') }} {{ __('Debit') }} {{ __('Balance') }}
{{ ($group['supplier']->supplier_code ?: $group['supplier']->supplier_id) . ' / ' . $group['supplier']->supplier_name }} {{ __('Credit') }} {{ __('Debit') }}  {{ __('Op Bal') }} : {{ $formatLedgerAmount($group['opening_minor']) }}
{{ $documentDate ? $documentDate->format('d/m/Y') : '-' }} {{ $entry->event_time }} {{ $documentDate ? $documentDate->copy()->addDays(30)->format('d/m/Y') : '-' }} {{ __(['P' => 'Purchase', 'GRN' => 'Purchase', 'PR' => 'Purchase return', 'GRNR' => 'Purchase return', 'PAYMENT' => 'Payment'][$entry->document_type]) }} 1 {{ $entry->purchase_trn_no }} {{ $entry->bill_no }} CCO {{ $entry->document_type === 'PAYMENT' ? 'LIQ' : 'PND' }} {{ $formatLedgerAmount($entry->credit_minor) }} {{ $formatLedgerAmount($entry->debit_minor) }} {{ $formatLedgerAmount($entry->balance_minor) }}
{{ __('No transactions in this period.') }}
{{ __('Supplier total / Closing balance') }} {{ $formatLedgerAmount($group['credit_minor']) }} {{ $formatLedgerAmount($group['debit_minor']) }} {{ $formatLedgerAmount($group['closing_minor']) }}
{{ __('No supplier balances or transactions found for the selected period and supplier.') }}
{{ __('Overall total / Closing balance') }} ({{ __('Opening') }}: {{ $formatLedgerAmount($report['totals']['opening_minor']) }}) {{ $formatLedgerAmount($report['totals']['credit_minor']) }} {{ $formatLedgerAmount($report['totals']['debit_minor']) }} {{ $formatLedgerAmount($report['totals']['closing_minor']) }}
{{ __('Balance = opening + credit - debit. Negative balance is payable to supplier.') }} {{ strtoupper(session('userId')) . ' # ' . $printedAt->format('d/m/Y H:i:s') }}
{{ __('Back') }}
@endsection @section('ExternalJs') @endsection