@extends('pdf.layouts.app') @section('title', 'Cost Center Report') @section('styles') @endsection @section('content')
@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
Date Constraint Number Constraint Account Currency Debit Credit Balance
{{ $row['date'] ?? '' }} {{ $row['number_doc'] ?? '' }} {{ $row['constraint_name'] ?? '' }} {{ $row['tree_account_title'] ?? '' }} {{ $row['currency_name'] ?? '' }} {{ number_format($row['debit'] ?? 0, 2) }} {{ number_format($row['credit'] ?? 0, 2) }} {{ number_format($row['balance'] ?? 0, 2) }}
Total: {{ number_format($center['total_debit'] ?? 0, 2) }} {{ number_format($center['total_credit'] ?? 0, 2) }} {{ number_format($center['total_balance'] ?? 0, 2) }}
@endforeach @else

There is no Cost Center data available.

@endif
@endsection