> For the complete documentation index, see [llms.txt](https://docs.pixeleyes.de/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pixeleyes.de/anleitungen-instructions/english/documentation-of-our-shopware-6-plugins/product-rental-and-reservations-for-shopware-6/sheduled-task.md).

# 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>
