# Sheduled Task

### ⏱️ Scheduled Task: LateFeeTask <a href="#geplanter-task-latefeetask" id="geplanter-task-latefeetask"></a>

The plugin includes an automatic scheduled task that regularly calculates late fees for items that have not been returned on time.

***

#### ⚙️ How It Works

1. The task searches for all reservations where:
   * returned\_date IS NULL
   * cancelled = 0
   * end\_date < CURDATE()
   * has\_late\_fee = 0
2. For each product, the value from customFields.rentalandreservations\_late\_fee is retrieved.
3. The late fee (late\_fee\_due) is calculated as:

   DaysLate × FeePerDay
4. The record is updated and the field has\_late\_fee (or jacket) is set to 1.
5. All results and errors are logged via the Shopware logger.

### &#x20;<a href="#geplanter-task-latefeetask" id="geplanter-task-latefeetask"></a>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.pixeleyes.de/anleitungen-instructions/english/documentation-of-our-shopware-6-plugins/product-rental-and-reservations-for-shopware-6/sheduled-task.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
