@extends('layouts.master') @section('css') @endsection @section('title') {{__('home.customer_supplier_account')}} @stop @section('page-header')

{{__('home.customer_supplier_account')}}

كشف الحسابات والحركات المالية الشاملة للعملاء والموردين
الفترة: {{ date('Y') }}-01-01 إلى {{ date('Y-m-d') }}
@endsection @section('content') @if (session('success')) @endif @php $totalAllCredit = 0; $totalAllDebit = 0; $activeCustomersCount = 0; foreach($customers as $customer) { $c = $customer->total_credit ?? 0; $d = $customer->total_debit ?? 0; if(($d - $c) != 0) { $totalAllCredit += $c; $totalAllDebit += $d; $activeCustomersCount++; } } $netBalance = $totalAllDebit - $totalAllCredit; @endphp
إجمالي المدين

{{ number_format($totalAllDebit, 2) }}

إجمالي الدائن

{{ number_format($totalAllCredit, 2) }}

صافي الأرصدة

{{ number_format(abs($netBalance), 2) }} {{ $netBalance >= 0 ? '(مدين)' : '(دائن)' }}

العملاء ذوو الحركات

{{ $activeCustomersCount }} عميل

قائمة تفاصيل أرصدة العملاء

@php $i = 1; @endphp @foreach($customers as $customer) @php $credit = $customer->total_credit ?? 0; $debit = $customer->total_debit ?? 0; $balance = $debit - $credit; @endphp @if($debit - $credit != 0) @endif @endforeach
# {{__('home.clietName')}} {{__('home.tax_number')}} {{__('home.debit')}} (مدين) {{__('home.credit')}} (دائن) {{__('home.current balance')}}
{{ $i++ }}
{{ mb_substr($customer->name, 0, 1) }}
{{ $customer->name }}
{{ $customer->tax_no ?? '-' }} {{ number_format($debit, 2) }} {{ number_format($credit, 2) }} @if($balance > 0) {{__('home.debit')}} ({{ number_format($balance, 2) }}) @elseif($balance < 0) {{__('home.credit')}} ({{ number_format(abs($balance), 2) }}) @else {{__('home.Balanced')}} @endif
الإجمالي العام للنتائج الظاهرة {{ number_format($totalAllDebit, 2) }} {{ number_format($totalAllCredit, 2) }} @php $final = $totalAllDebit - $totalAllCredit; @endphp @if($final > 0) {{ number_format($final, 2) }} (مدين) @else {{ number_format(abs($final), 2) }} (دائن) @endif
@endsection @section('js') @endsection