@extends('layouts.app') @section('css') @endsection @section('content')
{{ __('Customers') }} >> {{ $customerData->first_name }} {{ $customerData->last_name }} >> {{ __('Ledger') }}
@include('admin.customer.customer_tab')
{{ __('Total Purchase') }}

{{ __('Paid') }}

{{ __('Balance') }}

@php $balance = $totalPaid = $totalBill = 0; @endphp @foreach($customer_ledger as $key=>$data) @php $balance += isset($data['total']) ? $data['total'] : 0; $balance -= isset($data['amount']) ? $data['amount'] : 0; $totalPaid += isset($data['amount']) ? $data['amount'] : 0; $totalBill += isset($data['total']) ? $data['total'] : 0; @endphp @endforeach
{{ __('S/N') }} {{ __('Date') }} {{ __('Invoice No') }} {{ __('Paid Amount') }} {{ __('Bill Amount') }} {{ __('Balance') }}
{{ ++$key }} {{ formatDate($data['transaction_date']) }} {{ $data['reference'] }} @if(isset($data['amount'])) {{ formatCurrencyAmount($data['amount'], $customerData->currency->symbol) }} @else {{ '-' }} @endif @if(isset($data['total'])) {{ formatCurrencyAmount($data['total'], $customerData->currency->symbol) }} @else {{ '-' }} @endif {{ formatCurrencyAmount($balance, $customerData->currency->symbol) }}
{{ __('Total') }} = {{ formatCurrencyAmount($totalPaid, $customerData->currency->symbol) }} {{ formatCurrencyAmount($totalBill, $customerData->currency->symbol) }} {{ formatCurrencyAmount($balance, $customerData->currency->symbol) }}
@endsection @section('js') @endsection