{{-- resources/views/admin/customers/show.blade.php --}} @extends('admin.layouts.master') @section('title', 'عرض عميل') @section('css') @endsection @section('content') @php $fmt = fn($n, $d=2) => number_format((float)($n ?? 0), $d); $netLabel = function ($net) { $net = (float)$net; if ($net > 0) return ['مدين', 'success']; if ($net < 0) return ['دائن', 'danger']; return ['متزن', 'info']; }; $custStart = (float)($customer->start_balance ?? 0); $custCur = (float)($customer->current_balance ?? 0); $delta = $custCur - $custStart; $kpis = $kpis ?? [ 'total_debit' => (float)($lines?->sum('debit') ?? 0), 'total_credit' => (float)($lines?->sum('credit') ?? 0), 'net_move' => (float)(($lines?->sum('debit') ?? 0) - ($lines?->sum('credit') ?? 0)), ]; [$custStartTxt, $custStartCls] = $netLabel($custStart); [$custCurTxt, $custCurCls] = $netLabel($custCur); [$netMoveTxt, $netMoveCls] = $netLabel($kpis['net_move'] ?? 0); $running = 0.0; @endphp
| العملة | الفرع | إجمالي مدين | إجمالي دائن | الرصيد | الطبيعة |
|---|---|---|---|---|---|
| {{ $b->currency_code ?? 'EGP' }} | {{ $b->branch_id ?? '—' }} | {{ $fmt($b->debit_total) }} | {{ $fmt($b->credit_total) }} | {{ $fmt($bal) }} | {{ $t }} |
| التاريخ | رقم القيد | البيان | العملة | مدين | دائن | الرصيد التراكمي |
|---|---|---|---|---|---|---|
| {{ $entryDate ? \Carbon\Carbon::parse($entryDate)->format('Y-m-d') : '-' }} |
@if($entryId && Route::has('journal_entries.show'))
{{ $entryNo }}
@else
{{ $entryNo }}
@endif
@if($src)
مصدر: {{ $src }}
@endif
|
{{ $memo }}
line #{{ (int)($line->line_no ?? 1) }}
@if(!empty($line->branch_id)) • branch: {{ $line->branch_id }} @endif
@if(!empty($line->cost_center_id)) • cc: {{ $line->cost_center_id }} @endif
@if(!empty($line->project_id)) • project: {{ $line->project_id }} @endif
@if(!empty($line->warehouse_id)) • wh: {{ $line->warehouse_id }} @endif
@if($refType && $refId)
• ref: {{ class_basename($refType) }} #{{ $refId }}
@endif
|
{{ $ccy }} | {{ $fmt($d) }} | {{ $fmt($c) }} | {{ $fmt($running) }} |