@use('App\Services\Date') @extends('reports::layouts.master_pdf') @section('koolreport') @php $subdomain = request()->route()->parameter('subdomain'); $is_student = app(\Hyn\Tenancy\Repositories\HostnameRepository::class)->findByHostname($subdomain)->website->company->is_student; $currency = $data['currency'] ?? 'SAR'; $sections = $data['cash_flow_direct'] ?? []; $renderAmount = static function ($value) { $amount = (float) $value; return $amount < 0 ? '(' . number_format(abs($amount), 2) . ')' : number_format($amount, 2); }; $renderAccounts = static function (array $accounts, int $depth = 1) use (&$renderAccounts, $renderAmount) { foreach ($accounts as $account) { $code = trim((string) ($account['code'] ?? '')); $name = trim((string) ($account['name'] ?? '')); $label = trim(($code !== '' ? $code . ' - ' : '') . $name); echo '
| @lang('reports::reports.account') | @lang('reports::reports.total') ({{ $currency }}) |
|---|---|
| {{ $section['name'] ?? '' }} | |
| {{ $subsection['name'] ?? '' }} | |
| {{ $subsection['total_label'] }} | {{ $renderAmount($subsection['total'] ?? 0) }} |
| {{ $subsection['name'] ?? '' }} | {{ $renderAmount($subsection['total'] ?? 0) }} |
| {{ $section['total_label'] ?? '' }} | {{ $renderAmount($section['total'] ?? 0) }} |
| {{ __('reports::reports.cash_flow_direct.net_change_in_cash') }} | {{ $renderAmount($data['net_change_in_cash'] ?? 0) }} |
| {{ __('reports::reports.cash_flow_direct.total_cash_equivalents') }} | {{ $renderAmount($data['total_cash_equivalents'] ?? 0) }} |
| {{ __('reports::reports.cash_flow_direct.available_cash_duration') }} | {{ $renderAmount($data['available_cash_duration'] ?? 0) }} |