@extends('layouts.app') @section('page_title','Daily Sales Report') @section('content')<div class="card top-card"><div class="card-body"><form class="row g-2 mb-3"><div class="col-md-3"><input type="date" name="from" value="{{ $from }}" class="form-control"></div><div class="col-md-3"><input type="date" name="to" value="{{ $to }}" class="form-control"></div><div class="col-md-2"><button class="btn btn-success w-100">Filter</button></div></form><table class="table"><thead><tr><th>Invoice</th><th>Date</th><th>Customer</th><th>Total</th><th>Paid</th><th>Due</th></tr></thead><tbody>@foreach($sales as $sale)<tr><td>{{ $sale->invoice_no }}</td><td>{{ $sale->sale_date }}</td><td>{{ $sale->customer?->name ?? 'Walk-in' }}</td><td>{{ number_format($sale->total,2) }}</td><td>{{ number_format($sale->paid_amount,2) }}</td><td>{{ number_format($sale->due_amount,2) }}</td></tr>@endforeach</tbody><tfoot><tr><th colspan="3">Total</th><th>{{ number_format($sales->sum('total'),2) }}</th><th>{{ number_format($sales->sum('paid_amount'),2) }}</th><th>{{ number_format($sales->sum('due_amount'),2) }}</th></tr></tfoot></table></div></div>@endsection
