> ## Documentation Index
> Fetch the complete documentation index at: https://docsv4.mile.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Vehicle Maintenance

> Keep vehicles out of route optimization while they are in the workshop.

**Vehicle Maintenance** lets you record the periods when a vehicle is in the workshop. While a maintenance period applies to the routing date, the vehicle is left out of route optimization, and it comes back on its own once the period is over. You don't have to switch the vehicle off and on again yourself.

A maintenance schedule is one period for one vehicle: a **Date From** and a **Date To** (date and time), plus optional **Notes** of up to 500 characters. A vehicle can have as many schedules as you need, for example a whole year of planned services.

> [!NOTE]
>
> Required permission:
>
> * View vehicle
> * Edit vehicle

## How maintenance affects optimization

* On the routing date, a vehicle is left out of the optimization when one of its schedules covers that calendar day. The whole day counts, including the first and the last day of the period, and the hours are ignored: a one-hour service on 10 November keeps the vehicle out for all of 10 November.
* A schedule that has already ended stops keeping the vehicle out right away. A service that ends at 13:00 frees the vehicle from 13:00 onward.
* The routing date is the date picked on the [Visit](https://docsv4.mile.app/pages/planning/routing/visit.md#date) page, or today. The vehicle list shows which date it is checking (see [Badges and filters](#badges-and-filters)).
* Maintenance never changes which vehicles the profile uses. It only hides the vehicle while a schedule applies. When the schedule is over, the vehicle's **Use** switch shows on again.
* If every vehicle in the optimization is under maintenance, the optimization doesn't run and shows: **Every vehicle in this request is under maintenance on the routing date. Remove the schedule or force one of them active before optimizing.**
* Dates and times are shown in your device's time zone.

## How to use it

![Maintenance button](https://mintcdn.com/mileappv4/zD1RgJTPvHSMKzay/images/v4/planning/vehicle/vehicle-maintenance/open-maintenance.png?fit=max\&auto=format\&n=zD1RgJTPvHSMKzay\&q=85\&s=d07e409f3bfda186bbc00b43754be539)

1. Open **Planning › Routing › Configuration** and go to **Vehicles**.
2. Click **Maintenance** (item 1 in the picture), next to **New**. The **Vehicle Maintenance** window opens for all vehicles of the hub.

To manage one vehicle only, click **⋯** in that vehicle's **Action** column and choose **Maintenance**. The window then shows and adds schedules for that vehicle only.

### Adding schedules

![Add schedules](https://mintcdn.com/mileappv4/zD1RgJTPvHSMKzay/images/v4/planning/vehicle/vehicle-maintenance/add-schedule.png?fit=max\&auto=format\&n=zD1RgJTPvHSMKzay\&q=85\&s=2e97cf80247eb6ac7baf8ff7f85ed784)

The lower part of the window, **Add schedules**, starts with one empty row.

1. Select the **Vehicle** (item 1 in the picture).
2. Pick **Date From**, the date and time the maintenance starts (item 2 in the picture). An empty picker reads **Pick a date and time**.
3. Pick **Date To**, the date and time the vehicle is back (item 3 in the picture). It must be later than **Date From**.
4. Optionally, type **Notes** (item 4 in the picture), for example the work to be done. Up to 500 characters.
5. To add more schedules in one go, click **Add row** (item 5 in the picture). The trash icon at the end of a row removes it.
6. Click **Save** (item 6 in the picture).

**Save** stays disabled until every filled-in row is complete and valid. A row with a problem says what to fix: **Fill in vehicle, Date From and Date To**, **Date To must be later than Date From**, or **Overlaps another row for B 1234 XY**. Two schedules of the same vehicle can't overlap. A schedule may start exactly when another one ends.

After a successful save (**2 schedules saved**), the window stays open, the new schedules appear in the table above, and the form goes back to one empty row. If the save is refused, for example because a schedule overlaps one that is already saved, the reason appears below the form and nothing is saved.

Clicking **Close** while the form still has rows filled in asks **Discard unsaved schedules?**. Click **Discard** to close without saving, or **Keep editing** to go back to the form.

### Viewing, changing and deleting schedules

![Schedules](https://mintcdn.com/mileappv4/zD1RgJTPvHSMKzay/images/v4/planning/vehicle/vehicle-maintenance/schedule-table.png?fit=max\&auto=format\&n=zD1RgJTPvHSMKzay\&q=85\&s=a44fe02da78812e352aa36b4831db317)

The **Schedules** table at the top of the window lists the saved schedules, five per page, with **No.**, **Vehicle**, **Date From**, **Date To**, **Notes** and **Action**.

1. Pick a vehicle to see only its schedules (item 1 in the picture). **All vehicles** shows the whole hub.
2. Set the date range (item 2 in the picture). The table shows every schedule that overlaps those days. It starts with today.
3. Check the saved rows (item 3 in the picture). To change a value, click it. The change is saved when you leave the field (**Maintenance schedule updated**), and the same overlap rules apply.
4. To delete a schedule, click its trash icon in **Action** (item 4 in the picture) and confirm. A deleted schedule can't be restored.
5. **Import** (item 5 in the picture) loads schedules from a spreadsheet. See [Importing schedules](#importing-schedules).

Changes in the table are saved on their own. They don't depend on the **Save** button of the window.

![Ended schedule](https://mintcdn.com/mileappv4/zD1RgJTPvHSMKzay/images/v4/planning/vehicle/vehicle-maintenance/ended-schedule.png?fit=max\&auto=format\&n=zD1RgJTPvHSMKzay\&q=85\&s=27fb1bc71aa639ad1c25fdb32fce404a)

A schedule that has already ended (item 1 in the picture) is kept as the vehicle's maintenance history and can't be changed or deleted. Its **Action** column shows a lock icon instead of the trash icon (item 2 in the picture). Hover over it to read **Ended schedules are read-only**. Upcoming and running schedules can still be changed, so to extend a service that is running late, change its **Date To**.

### Importing schedules

![Import schedules](https://mintcdn.com/mileappv4/zD1RgJTPvHSMKzay/images/v4/planning/vehicle/vehicle-maintenance/import.png?fit=max\&auto=format\&n=zD1RgJTPvHSMKzay\&q=85\&s=1c6e2c8fb7ab472cac778e13faddff58)

1. Click **Import** in the schedule table.
2. Click **Download** (item 1 in the picture) to get the template. It has the columns **Vehicle\***, **Date From\***, **Date To\*** and **Notes**.
3. Fill in one schedule per row. Write the vehicle name as it appears in the hub, and the dates as `YYYY-MM-DD HH:mm` or as Excel dates.
4. Drag the file onto the box, or click **Click here** to choose it (item 2 in the picture). The file must be `.xlsx` or `.xls`, no larger than 5 MB, with up to 1,000 rows.
5. The rows land in the form so you can review them: **3 schedules imported. Review them, then click Save.** Nothing is saved until you click **Save**.

To go back to typing schedules by hand, click **Bulk Manual** (item 3 in the picture).

If any row has a problem, the whole file is refused (**Import failed**) and the message names the rows by their Excel row number, for example **Row 3: the vehicle is not found in this hub.** or **Row 4: dates must be YYYY-MM-DD HH:mm.** Fix the file and import it again.

## Badges and filters

![Maintenance badges](https://mintcdn.com/mileappv4/zD1RgJTPvHSMKzay/images/v4/planning/vehicle/vehicle-maintenance/badges.png?fit=max\&auto=format\&n=zD1RgJTPvHSMKzay\&q=85\&s=5320654bc808407335372a260972c791)

Each vehicle shows at most one badge next to its name. Hover over a badge to see the period behind it.

1. **Under Maintenance** (item 1 in the picture): a schedule is running right now.
2. **Scheduled Maintenance** (item 2 in the picture): a schedule starts within the next 24 hours.
3. The summary next to **Total Vehicle** (item 3 in the picture) counts the hub's vehicles, for example **1 under maintenance** and **1 scheduled**. Forced active vehicles count as under maintenance.
4. **Availability for 29 Oct 2026** (item 4 in the picture) is the routing date the **Use** switches are checked against. Its info icon explains: *The routing date picked on the Visit page, or today. A schedule that touches this day keeps the vehicle out of optimization.*
5. The list next to the search (item 5 in the picture) filters the vehicles: **All**, **Under maintenance** (including forced active vehicles), **Scheduled**, or **Available** (vehicles that are not kept out on the routing date).

A third badge, **Forced Active**, shows when a schedule is running but the vehicle is used anyway. See the next section.

A schedule that starts more than 24 hours from now shows no badge yet, but it still keeps the vehicle out when the routing date is a day it covers. When a selected vehicle is kept out, hovering over its switch says, for example, *Under maintenance on 29 Oct 2026. Turn it on to use it anyway.*

## Using a vehicle under maintenance

![Use vehicle under maintenance](https://mintcdn.com/mileappv4/zD1RgJTPvHSMKzay/images/v4/planning/vehicle/vehicle-maintenance/force-active.png?fit=max\&auto=format\&n=zD1RgJTPvHSMKzay\&q=85\&s=336ba31ecbaec1587b956850b42488ad)

Sometimes a vehicle is needed even though it is booked for maintenance, for example when the service is postponed. Turn on the **Use** switch of the vehicle. The app asks **Use vehicle under maintenance?**, for example *B 1234 XY is under maintenance (29 Oct 2026, 21:47 – 30 Oct 2026, 18:47). It will be used for routing anyway.*

1. Click **Use anyway** (item 1 in the picture) to include the vehicle in the optimization. It is marked **Forced Active** until its schedule ends or you turn it off.
2. Click **Cancel** (item 2 in the picture) to keep the vehicle off.

Turning a **Forced Active** vehicle off removes the override. The next time you turn it on, the app asks again. The schedule itself isn't changed.

### Selecting all vehicles

![Use vehicles under maintenance](https://mintcdn.com/mileappv4/zD1RgJTPvHSMKzay/images/v4/planning/vehicle/vehicle-maintenance/select-all.png?fit=max\&auto=format\&n=zD1RgJTPvHSMKzay\&q=85\&s=0ed76ca92d01aa84081beae2271c1ee4)

When you turn on the switch next to **Total Vehicle** and some of the listed vehicles are kept out on the routing date, one question appears for all of them: **Use vehicles under maintenance?**, for example *1 of the vehicles you are selecting are under maintenance. Including them marks each one Forced Active until its schedule ends or you turn it off again.*

1. Click **Use anyway** (item 1 in the picture) to select every vehicle, including the ones under maintenance, which become **Forced Active**.
2. Or click **Select the others** (item 2 in the picture) to select every other vehicle and leave the ones under maintenance out. Closing the question works the same way as **Select the others**.

If some vehicles can't be set to **Forced Active**, they are left unselected and a message says so, for example **1 vehicle(s) could not be set to Forced Active and were left unselected.**

## Notes

* Vehicle Maintenance uses the existing vehicle permissions. There is no separate maintenance permission. Without **Edit vehicle** you can look at the schedules but not add, change or delete them, and you can't force a vehicle active.
* A [routing schedule](https://docsv4.mile.app/pages/planning/schedule/routing-schedule/introduction.md) leaves out vehicles under maintenance on the day it runs, the same way. When every vehicle of its profile is under maintenance, the run is skipped with **Profile has no vehicle**.
* You can record a service that has already happened by adding a schedule in the past. It is saved as history and is read-only from then on.
* Deleting a vehicle also permanently deletes its maintenance schedules.
* Vehicles of a sub hub used by [Cross Docking](https://docsv4.mile.app/pages/planning/routing/configuration/cross-docking.md) are scheduled from their own hub.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.