@if(isset($showBranch) && $showBranch) @endif @if(!isset($readonly) || !$readonly) @endif @php $currentDate = ''; $dailyTotal = 0; @endphp @forelse($sales as $index => $s) @php \Carbon\Carbon::setLocale('id'); $date = \Carbon\Carbon::parse($s->date); $dateString = $date->translatedFormat('l, d F Y'); $dailyTotal += $s->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($sales[$index + 1])) { $nextDate = \Carbon\Carbon::parse($sales[$index + 1]->date); $nextDateString = $nextDate->translatedFormat('l, d F Y'); } @endphp @if($loop->last || $nextDateString !== $currentDate) @php $subtotalColspan = 4; if(isset($showBranch) && $showBranch) $subtotalColspan++; @endphp @if(!isset($readonly) || !$readonly) @endif @php $dailyTotal = 0; @endphp @endif @empty @endforelse @if(!$sales->isEmpty()) @php $totalKeseluruhan = $sales->sum('total_price'); $footerColspan = 4; if(isset($showBranch) && $showBranch) $footerColspan++; @endphp @if(!isset($readonly) || !$readonly) @endif @endif
# Tanggal / Hari Barang Jumlah TotalCabangAksi
{{ $dateString }}
{{ $index + 1 }} {{ $s->product ? $s->product->name : $s->item }} {{ $s->quantity }} Rp{{ number_format($s->total_price, 0, ',', '.') }}{{ $s->branch }}
@csrf @method('DELETE')
Total Pendapatan {{ $currentDate }}: Rp{{ number_format($dailyTotal, 0, ',', '.') }}
Belum ada data transaksi.
TOTAL KESELURUHAN: Rp{{ number_format($totalKeseluruhan, 0, ',', '.') }}