mirror of
https://github.com/frappe/books.git
synced 2024-11-08 14:50:56 +00:00
fix: stock validation issue
- future stock check was incorrect
This commit is contained in:
parent
afe04cccaf
commit
5ea8a09615
@ -180,14 +180,13 @@ export class StockManager {
|
||||
}
|
||||
|
||||
const quantityRemaining = quantityBefore - details.quantity;
|
||||
if (quantityAfter < quantityRemaining) {
|
||||
const futureQuantity = quantityRemaining + quantityAfter;
|
||||
if (futureQuantity < 0) {
|
||||
throw new ValidationError(
|
||||
[
|
||||
t`Insufficient Quantity.`,
|
||||
t`Transfer will cause future entries to have negative stock.`,
|
||||
t`Additional quantity (${
|
||||
quantityAfter - quantityRemaining
|
||||
}) required${batchMessage} to make outward transfer of item ${
|
||||
t`Additional quantity (${-futureQuantity}) required${batchMessage} to make outward transfer of item ${
|
||||
details.item
|
||||
} from ${details.fromLocation} on ${formattedDate}`,
|
||||
].join('\n')
|
||||
|
Loading…
Reference in New Issue
Block a user