| Category | Items | Item Code | Amount |
|---|---|---|---|
| {{ $category->name }} | @endif{{ $categoryItem->name }} | {{ $categoryItem->sr_code }} |
@php
$total = 0;
@endphp
@forelse ($categoryItem->financialIncomes->where('created_at', '>=', $startDate)->where('created_at', '<=', $endDate) as $incomeItem)
@php
if ($currency->symbol == 'UGX') {
$total += $incomeItem->amount;
} else {
$rate = App\Models\FinancialRate::withTrashed()->find($incomeItem->rate_id);
if ($currency->id == $rate->base_currency_id) {
$total += $incomeItem->amount / $rate->rate;
} else {
$total += $incomeItem->amount * $rate->rate;
}
}
@endphp
@empty
No income items @endforelse {{-- {{ round($total, 2) }} --}} {{ number_format(round($total, 2), 2) }} |
| Total: | @php $gtotal = 0; @endphp @foreach ($category->categoryItems as $categoryItem) @php $total = 0; @endphp @forelse ($categoryItem->financialIncomes->where('created_at', '>=', $startDate)->where('created_at', '<=', $endDate) as $incomeItem) @php if ($currency->symbol == 'UGX') { $total += $incomeItem->amount; } else { $rate = App\Models\FinancialRate::withTrashed()->find($incomeItem->rate_id); if ($currency->id == $rate->base_currency_id) { $total += $incomeItem->amount / $rate->rate; } else { $total += $incomeItem->amount * $rate->rate; } } @endphp @empty @endforelse @php $gtotal += $total; @endphp @endforeach {{-- {{ round($gtotal, 2) }} --}} {{ number_format(round($gtotal, 2), 2) }} | ||
| No categories found | |||