Calculating if vehicle's mileage is in service window
This seems overly complex or not complex enough.  If the fuel filter is replaced at 12,500, then the next service window should be from 25,000 to 30,000, not 27,500 to 32,500.  

If the fuel filter is not replaced by 17,500, it doesn't go back into service either.  It still needs replaced at 18,000, etc.  

$current_mileage = 27500;
$last_service = 12500;
$service_interval = 15000;
$half_window = 2500;

$is_due = $current_mileage + $half_window &lt;= $last_service + $service_interval;

$is_overdue = $current_mileage &gt; $last_service + $service_interval + $half_window;


This seems to better reflect how service windows work in practice.