Last Movement Date

From KB
Revision as of 12:10, 17 September 2024 by BL>Angela
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Each vehicle in the system has a last movement date and time which is used to keep track of the vehicle’s latest event, such as a rental, repair order, non-revenue movement, etc. The latest event will update the vehicle’s current status. If any other events happen in the meantime, such as an old contract being closed after the vehicle is rented again, this historical data will not overwrite the current data.


Vehicle Transactions

When something happens to a vehicle, a transaction is created. Each transaction has a starting (out) date and time, and an ending (in) date and time. When a vehicle is rented, the transaction’s ‘Out’ date and time is the same as the contract’s pickup date and time. When the vehicle returns, the return date and time is assigned to the transaction’s ‘In’ information.

Some transactions are instantaneous; the ‘Out’ and ‘In’ dates/times are identical. When you modify a vehicle’s status an instantaneous transaction is created, with the dates/time being the current date and time.


How the Last Movement Date is Updated

When a vehicle is rented, the transaction is assigned the pickup date/time. The system will check the last movement date of the vehicle that is being rented. If the last movement date is prior to the pickup date, then it is updated. This rental is now the current transaction.

When the vehicle is returned, the system again compares the pickup date to the last movement date. If they are the same, this rental is still the current transaction, so we again update the last movement date with the return date. The vehicle’s current information, such as status, odometer, and current location, are also updated.

If the last movement date does NOT match the pickup date/time, then something has happened to the vehicle since the contract was opened. This contract is not the current transaction, so the last movement date and current vehicle information is not updated. A message is displayed to inform you of this. However, the transaction’s ‘In’ information will still be updated.


Why Do We Need This?

The last movement date verification keeps the vehicle’s current information in step with what is actually happening to the vehicle. Here is an example of how it works:

A vehicle that is on-rent on contract #123 has been brought back. It’s a very busy day, and the vehicle is needed for the renter who is standing at the counter. The vehicle is given to that renter (contract #456) before the previous contract is closed. For the moment, the vehicle is on two contracts.

When the first contract (#123) is finally closed, the last movement date verification will fail. Since contract #456 is the current transaction, closing contract #123 will NOT update the vehicle’s current information. If it did, the vehicle’s status will show ‘Available’. It is not available; it’s on-rent to contract #456.

By not updating the vehicle’s current information, the information that was written by contract #456 is preserved.