@extends('layouts.master') @section('title', $title) @php $db_settings = \App\Models\Setting::get(); $settings = []; foreach ($db_settings as $row) { $settings[$row->name] = $row->value; } @endphp @section('content')
@if (isset($settings['icon']) && is_file('storage/settings/' . $settings['icon']))
ICON
@endif
{{ $settings['website_name'] ?? '' }}
{{ $settings['address'] ?? '' }}
{{ $settings['number_1'] ?? '' }}, {{ $settings['number_2'] ?? '' }}

Customer statement
Customer Name: {{ $customer?->name }}
Start date: {{ now()->startOfMonth()->format('d M, Y') }}
End date: {{ now()->endOfMonth()->format('d M, Y') }}
@php $balance = $customer->opening_balance ?? 0; $counter = 1; $credit = 0; $debit = $customer->opening_balance ?? 0; @endphp @foreach ($statement as $item) @php $balance = $balance + $item?->debit - $item?->credit; $credit += $item?->credit; $debit += $item?->debit; @endphp @endforeach
# Date Description Debit Credit Runnnig balance
{{ $counter++ }} {{ $customer->created_at->format('d M, Y') }} Opening balance {{ $customer->opening_balance }} 0 {{ $balance }}
{{ $counter++ }} {{ \Carbon\Carbon::parse($customer->date)->format('d M, Y') }} {{ $item?->description }} {{ $item?->debit }} {{ $item?->credit }} {{ $balance }}
Total {{ $debit }} {{ $credit }} {{ $debit - $credit }}
@endsection @section('page_js') @endsection