@extends('layouts.app') @section('page_title','Profit 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>Date</th><th>Fuel</th><th>Qty</th><th>Sale</th><th>Cost</th><th>Profit</th></tr></thead><tbody>@foreach($items as $i)<tr><td>{{ $i->sale->sale_date }}</td><td>{{ $i->fuelType->name_en }}</td><td>{{ $i->quantity }}</td><td>{{ number_format($i->total,2) }}</td><td>{{ number_format($i->cost_total,2) }}</td><td>{{ number_format($i->profit,2) }}</td></tr>@endforeach</tbody><tfoot><tr><th colspan="3">Total</th><th>{{ number_format($items->sum('total'),2) }}</th><th>{{ number_format($items->sum('cost_total'),2) }}</th><th>{{ number_format($items->sum('profit'),2) }}</th></tr></tfoot></table></div></div>@endsection
