{{ __('main.ledger') }}
@if ($customers && count($customers) > 0)
    @foreach ($customers as $item)
  • {{ $item->file_number }} - {{ $item->first_name }} - {{ $item->phone_number_1 }}
  • @endforeach
@elseif($customer_query != '' && count($customers) == 0)
  • {{ __('main.no_customers_found') }}
@endif
@if (!$selected_customer)
 
@endif @if ($selected_customer)
@php $total_invoices = 0; $total_sales = 0; $total_payments = 0; $total_discounts = 0; $credits = 0; $debits = 0; @endphp
@php $debits += $selected_customer->opening_balance; @endphp @foreach ($data as $item) @if ($item['identifier'] == 1) @php $debits += $item['total']; @endphp @endif @if ($item['identifier'] == 2) @php $credits += $item['paid_amount']; @endphp @if ($item['payment_type'] == 1) @elseif($item['payment_type'] == 2) @elseif($item['payment_type'] == 3) @endif @endif @if ($item['identifier'] == 3) @php $credits += $item['amount']; @endphp @endif @if ($item['identifier'] == 4) @php $credits += $item['total']; @endphp @endif @if ($item['identifier'] == 5) @php $debits += $item['paid_amount']; $salesreturn = \App\Models\SalesReturn::where('id', $item['sales_return_id'])->first(); @endphp @endif @endforeach
{{ __('main.date') }} {{ __('main.from') }} {{ __('main.voucher_no') }} {{ __('main.particulars') }} {{ __('main.debit') }} {{ __('main.credit') }} {{ __('main.balance') }}
{{ $selected_customer->created_at->format('d/m/Y h:i A') }} OB - {{ __('main.opening_balance') }} {{ number_format($selected_customer->opening_balance, 2) }} 0 {{ number_format($selected_customer->opening_balance, 2) }}
{{ Carbon\Carbon::parse($item['created_at'])->format('d/m/Y h:i A') }} {{ __('main.sales') }} #{{ $item['invoice_number'] }} {{ __('main.sales') }} {{ number_format($item['total'], 2) }} 0 @if ($debits - $credits < 0) {{ number_format(($debits - $credits) * -1, 2) }} Cr. @else {{ number_format($debits - $credits, 2) }} Dr. @endif
{{ Carbon\Carbon::parse($item['date'])->format('d/m/Y h:i A') }} {{ __('main.cash_receipt') }} #{{ $item['voucher_no'] }} {{ __('main.cash_receipt') }} @php $invoice = \App\Models\Invoice::where('id', $item['invoice_id'])->first(); @endphp (#{{ $invoice->invoice_number ?? '-' }}) 0 {{ number_format($item['paid_amount'], 2) }} @if ($debits - $credits < 0) {{ number_format(($debits - $credits) * -1, 2) }} Cr. @else {{ number_format($debits - $credits, 2) }} Dr. @endif
{{ Carbon\Carbon::parse($item['date'])->format('d/m/Y h:i A') }} {{ __('main.cash_receipt') }} #{{ $item['voucher_no'] }} {{ __('main.cash_receipt') }} ({{ __('main.against_opening_balance') }}) 0 {{ number_format($item['paid_amount'], 2) }} @if ($debits - $credits < 0) {{ number_format(($debits - $credits) * -1, 2) }} Cr. @else {{ number_format($debits - $credits, 2) }} Dr. @endif
{{ Carbon\Carbon::parse($item['date'])->format('d/m/Y h:i A') }} {{ __('main.cash_receipt') }} #{{ $item['voucher_no'] }} {{ __('main.cash_receipt') }} 0 {{ number_format($item['paid_amount'], 2) }} @if ($debits - $credits < 0) {{ number_format(($debits - $credits) * -1, 2) }} Cr. @else {{ number_format($debits - $credits, 2) }} Dr. @endif
{{ Carbon\Carbon::parse($item['created_at'])->format('d/m/Y h:i A') }} {{ __('main.discount') }} - {{ __('main.payment_discount') }} 0 {{ number_format($item['amount'], 2) }} @if ($debits - $credits < 0) {{ number_format(($debits - $credits) * -1, 2) }} Cr. @else {{ number_format($debits - $credits, 2) }} Dr. @endif
{{ Carbon\Carbon::parse($item['date'])->format('d/m/Y h:i A') }} {{ __('main.sr') }} #{{ $item['sales_return_number'] }} {{ __('main.sales_return') }} @php $invoice = \App\Models\Invoice::where('id', $item['invoice_id'])->first(); @endphp - #{{ $invoice->invoice_number ?? '-' }} 0 {{ number_format($item['total'], 2) }} @if ($debits - $credits < 0) {{ number_format(($debits - $credits) * -1, 2) }} Cr. @else {{ number_format($debits - $credits, 2) }} Dr. @endif
{{ Carbon\Carbon::parse($item['date'])->format('d/m/Y h:i A') }} {{ __('main.cash') }} #{{ $item['voucher_no'] ?? '-' }} {{ __('main.sales_return') }} - #{{ $salesreturn->sales_return_number }} ({{ __('main.cash_returned') }}) {{ number_format($item['paid_amount'], 2) }} 0 @if ($debits - $credits < 0) {{ number_format(($debits - $credits) * -1, 2) }} Cr. @else {{ number_format($debits - $credits, 2) }} Dr. @endif
- - - {{ __('main.total') }} {{ number_format($debits, 2) }} {{ number_format($credits, 2) }} @if ($debits - $credits < 0) {{ number_format(($debits - $credits) * -1, 2) }} Cr. @else {{ number_format($debits - $credits, 2) }} Dr. @endif
@endif