@if(isset($showBranch) && $showBranch) @endif @if(!isset($readonly) || !$readonly) @endif @php $currentDate = ''; $dailyTotal = 0; @endphp @forelse($purchases as $index => $p) @php // Set locale to Indonesian for day and month names \Carbon\Carbon::setLocale('id'); $date = \Carbon\Carbon::parse($p->date); $dateString = $date->translatedFormat('l, d F Y'); $dailyTotal += $p->total_price; @endphp @if($dateString !== $currentDate) @php $currentDate = $dateString; @endphp @php $colspan = 5; if(isset($showBranch) && $showBranch) $colspan++; if(!isset($readonly) || !$readonly) $colspan++; @endphp @endif @if(isset($showBranch) && $showBranch) @endif @if(!isset($readonly) || !$readonly) @endif @php // Determine if the next item has a different date, or if this is the last item $nextDateString = ''; if(isset($purchases[$index + 1])) { $nextDate = \Carbon\Carbon::parse($purchases[$index + 1]->date); $nextDateString = $nextDate->translatedFormat('l, d F Y'); } @endphp @if($loop->last || $nextDateString !== $currentDate) @php $subtotalColspan = 3; if(isset($showBranch) && $showBranch) $subtotalColspan++; @endphp @if(!isset($readonly) || !$readonly) @endif @php $dailyTotal = 0; @endphp @endif @empty @endforelse @if(!$purchases->isEmpty()) @php $totalKeseluruhan = $purchases->sum('total_price'); $footerColspan = 3; if(isset($showBranch) && $showBranch) $footerColspan++; @endphp @if(!isset($readonly) || !$readonly) @endif @endif
# Barang Jumlah TotalCabangAksi
{{ $dateString }}
{{ $index + 1 }} {{ $p->item }} {{ $p->quantity }} Rp{{ number_format($p->total_price, 0, ',', '.') }}{{ $p->branch }}
@csrf @method('DELETE')
Total Pengeluaran {{ $currentDate }}: Rp{{ number_format($dailyTotal, 0, ',', '.') }}
Belum ada data transaksi.
TOTAL KESELURUHAN: Rp{{ number_format($totalKeseluruhan, 0, ',', '.') }}