@extends('layouts.app')
@section('page_title','Sales List')
@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="{{ request('from') }}" class="form-control"></div><div class="col-md-3"><input type="date" name="to" value="{{ request('to') }}" class="form-control"></div><div class="col-md-2"><button class="btn btn-success w-100">Filter</button></div><div class="col-md-4 text-end"><a href="{{ route('fuel-sales.create') }}" class="btn btn-primary">New Sale</a></div></form><div class="table-responsive"><table class="table align-middle"><thead><tr><th>Invoice</th><th>Date</th><th>Customer</th><th>Total</th><th>Paid</th><th>Due</th><th>Action</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><td><a class="btn btn-sm btn-outline-success" href="{{ route('fuel-sales.print',$sale) }}">Print</a></td></tr>@endforeach</tbody></table></div>{{ $sales->links() }}</div></div>
@endsection
