Add Scan in message with "Cancel" option for items currently on loan
A common mistake when working with "Scan in" is to accidentally scan in the same item twice. When working with home deliveries, this means the first scan in will loan the item out to the patron, while the second scan in will return it again. This alone might be a problem, but it gets even worse when there are requests for the item. The item will either be placed on hold shelf for or even loaned out to the next patron if it was requested for home delivery. In both cases, both the new and the old patron might receive messages telling them about the status change, which means we don't only have to fix the situation in Alma but also communicate the mistake and explain the messages to the patrons.
There are blocks to prevent items that are lent out to one patron from being lent out directly to another without return first, but since the Scan in workflow does a return first and only then tries to loan the item out, it will not help in this scenario.
Instead I suggest adding another "Scan in message" with the "Cancel" option to make it possible to abort the scan in. The simplest implementation would be to just warn for any lent out item, letting the operator decide if they should proceed, but that might be problematic for some who use scan in extensively to (intentionally) return books. If so, more complex logic might be required, like triggering only if the item is also requested.
With this change, there is a second chance of catching the mistake before it makes a mess of the request queue.