Corregido Store

Fixed Store stock held by checkouts after stock tracking was changed

A checkout gives back exactly the stock it held, even when stock tracking was turned off or on while it was open. A sale is always recorded in full.

Each order item records how many units its checkout held. When the checkout ends or the order is paid, those units are given back, whether or not the product still tracks stock. Before, turning tracking off while a checkout was open could leave its units held for good, and turning it on could release units another checkout held.

A sale that finds less stock than it sold is recorded in full and leaves the product below zero, instead of stopping at zero.