@extends('pdf.layouts.daily_constraints.app') @section('title', __('Daily Constraint') . ' #' . ($header['constraint_number'] ?? '')) @section('content') @php $dir = $direction ?? 'rtl'; $isRtl = $dir === 'rtl'; $start = $isRtl ? 'right' : 'left'; $end = $isRtl ? 'left' : 'right'; @endphp {{-- ══ 1. INFO CARDS (Top 3 Boxes) ══ --}} {{-- mPDF: borders must be on , not on
--}} {{-- JE NUMBER --}} {{-- ENTRY DATE --}} {{-- NAME --}}
{{ $isRtl ? 'رقم القيد' : 'JE NUMBER' }}
{{ $header['constraint_number'] ?? '-' }}
{{ $isRtl ? 'التاريخ' : 'ENTRY DATE' }}
{{ $header['date'] ?? '-' }}
{{ $isRtl ? 'الاسم' : 'NAME' }}
{{ $header['ref_number'] ?? '-' }}
{{-- Spacer --}}
 
{{-- ══ DESCRIPTION ROW ══ --}}
{{ $isRtl ? 'الوصف' : 'DESCRIPTION' }}
{{ $header['description'] ?? '-' }}
{{-- spacer --}}
 
{{-- ══ 2. TRANSACTIONS TABLE ══ --}} @foreach($transactions as $line) @if(!empty($line['description'])) @endif @endforeach
{{ $isRtl ? 'اسم الحساب' : 'ACCOUNT NAME' }} {{ $isRtl ? 'وصف الحركة' : 'TRANSFER NAME' }} {{ $isRtl ? 'مدين' : 'DEBIT' }} {{ $isRtl ? 'دائن' : 'CREDIT' }} {{ $isRtl ? 'مركز التكلفة' : 'COST CENTER' }}
{{ $line['account_name'] }}
{{ $line['account_number'] }}
{{ $line['transfer_name'] }} @if($line['is_foreign'])
{{ number_format((float)$line['debit'], 2) }} {{ $line['curr_symbol'] }}
(Rate: {{ $line['curr_rate'] }})
@endif
{{ number_format((float)$line['debit_egp'], 2) }} {{ $isRtl ? 'ج.م' : 'EGP' }}
@if($line['is_foreign'])
{{ number_format((float)$line['credit'], 2) }} {{ $line['curr_symbol'] }}
(Rate: {{ $line['curr_rate'] }})
@endif
{{ number_format((float)$line['credit_egp'], 2) }} {{ $isRtl ? 'ج.م' : 'EGP' }}
{{ $line['cost_center_name'] ?: '-' }}
{{ $isRtl ? 'ملاحظات:' : 'Notes:' }} {{ $line['description'] }}
{{-- spacer --}}
 
{{-- ══ 3. TOTALS — single unified card ══ --}} @php $diff = abs(($totals['total_debit'] ?? 0) - ($totals['total_credit'] ?? 0)); @endphp {{-- TOTAL DEBIT --}} {{-- TOTAL CREDIT --}} {{-- DIFFERENCE (light bg) --}}
{{ $isRtl ? 'إجمالي المدين' : 'TOTAL DEBIT' }}
{{ number_format((float)($totals['total_debit'] ?? 0), 2) }} {{ $isRtl ? 'ج.م' : 'EGP' }}
{{ $isRtl ? 'إجمالي الدائن' : 'TOTAL CREDIT' }}
{{ number_format((float)($totals['total_credit'] ?? 0), 2) }} {{ $isRtl ? 'ج.م' : 'EGP' }}
{{ $isRtl ? 'الفرق' : 'DIFFERENCE' }}
{{ number_format($diff, 2) }}
@endsection