@foreach ($statues as $key => $status)
@php
$invoices = App\Models\Invoice::where('workspace', getActiveWorkSpace())
->where('status', $key)
->get();
$countstatus = $invoices->count();
$totalAmount = 0;
foreach ($invoices as $invoice) {
$totalAmount += $invoice->getDue();
}
$total = $totalDueAmount != 0 ? number_format($totalAmount / $totalDueAmount, 4) : 0;
@endphp
{{ currency_format_with_sym($totalAmount) }}
{{ __('Total Amount') }}
{{ $total * 100 }}{{ __('%') }}
{{ __('Total Percentage') }}
@endforeach