Sheduled Task

⏱️ Scheduled Task: LateFeeTask

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.

Last updated