Illustration of Logic for Serialized Rental Calculation
Serialized containers can be tracked individually. For each of their goods-receipts and goods-issues the corresponding exchange-partner is noted in the posting so that each cycle of renting out and giving back can be calculated. Serial numbers which have been rented out during the whole rental-period are considered in the calculation, as well as containers with missing rental-date or return-date in the rental period.
If the container is returned during the rent-free period no rental-cost is calculated.
Delivery-cost and return-cost can be added optionally.

Code Snippet
123456Rental Amount Calculation:
For all serial-numbers with rental-start date before end of rental period AND rental end date after begin of rental period:
(Rental End-Date - Rental Start-Date) - rent-free days1) * (daily rental charge - discount)
+ delivery cost + return cost
*1 calculated charged days cannot get negative because of rent-free days