|
@@ -301,7 +301,9 @@ namespace Comal.Stores
|
|
|
var txnid = Guid.NewGuid();
|
|
|
if(holdingQty < qty)
|
|
|
{
|
|
|
- var extraRequired = qty - holdingQty;
|
|
|
+ // Don't pull more than the required quantity, meaning if the holding is negative, it will remain negative.
|
|
|
+ var extraRequired = Math.Max(qty - holdingQty, qty);
|
|
|
+
|
|
|
// We don't have enough stock in this case, so transfer the necessary stock from general. We don't check for quantity in general stock,
|
|
|
// but instead will let general stock go negative if not enough. Obviously we have the stock, because its being sent to site. So if we do
|
|
|
// get negatives, it means probably our number are wrong I think.
|