@extends('pdf.layouts.app') @section('title', 'Cost Center Report') @section('styles') @endsection @section('content') @php $isRtl = ($direction ?? 'rtl') === 'rtl'; @endphp
@if(isset($data) && (is_array($data) || $data instanceof \Illuminate\Support\Collection)) @foreach($data as $center)

{{ $center['cost_center_name'] ?? '---' }}

@foreach($center['transactions'] as $row) @endforeach
{{ $isRtl ? 'التاريخ' : 'Date' }} {{ $isRtl ? 'رقم القيد' : 'Constraint Number' }} {{ $isRtl ? 'القيد' : 'Constraint' }} {{ $isRtl ? 'الحساب' : 'Account' }} {{ $isRtl ? 'العملة' : 'Currency' }} {{ $isRtl ? 'مدين' : 'Debit' }} {{ $isRtl ? 'دائن' : 'Credit' }} {{ $isRtl ? 'الرصيد' : 'Balance' }}
{{ $row['date'] ?? '' }} {{ $row['number_doc'] ?? '' }} {{ $row['constraint_name'] ?? '' }} {{ $row['tree_account_title'] ?? '' }} {{ $row['currency_name'] ?? '' }} {{ number_format($row['debit'] ?? 0, 2) }} @if(isset($row['debit_other']) && $row['debit_other'] > 0 && $row['debit'] != $row['debit_other'])
({{ number_format($row['debit_other'], 2) }} {{ $row['currency_symbol'] ?? '' }})
{{ $isRtl ? 'سعر الصرف:' : 'Rate:' }} {{ $row['rate'] ?? $row['transfer_rate'] ?? 1 }}
@endif
{{ number_format($row['credit'] ?? 0, 2) }} @if(isset($row['creditor_other']) && $row['creditor_other'] > 0 && $row['credit'] != $row['creditor_other'])
({{ number_format($row['creditor_other'], 2) }} {{ $row['currency_symbol'] ?? '' }})
{{ $isRtl ? 'سعر الصرف:' : 'Rate:' }} {{ $row['rate'] ?? $row['transfer_rate'] ?? 1 }}
@endif
{{ number_format($row['balance'] ?? 0, 2) }}
{{ $isRtl ? 'الإجمالي:' : 'Total:' }} {{ number_format($center['total_debit'] ?? 0, 2) }} {{ number_format($center['total_credit'] ?? 0, 2) }} {{ number_format($center['total_balance'] ?? 0, 2) }}
@endforeach @else

{{ $isRtl ? 'لا توجد بيانات مراكز تكلفة.' : 'There is no Cost Center data available.' }}

@endif
@endsection