u
This commit is contained in:
@@ -160,7 +160,7 @@ export default function create(provider) {
|
||||
let amount;
|
||||
if (line.amount !== undefined && line.amount !== null) {
|
||||
amount = Number(line.amount);
|
||||
if (!Number.isFinite(amount) || amount <= 0) {
|
||||
if (!Number.isFinite(amount) || amount === 0) {
|
||||
throw new Error('Invalid lines');
|
||||
}
|
||||
} else {
|
||||
@@ -172,7 +172,7 @@ export default function create(provider) {
|
||||
}
|
||||
|
||||
const currentProposed = proposedBySku.get(sku) || 0;
|
||||
if (alreadyShipped + currentProposed + amount > ordered) {
|
||||
if (amount > 0 && alreadyShipped + currentProposed + amount > ordered) {
|
||||
throw new Error(`Shipment amount exceeds ordered amount for article (${sku})`);
|
||||
}
|
||||
proposedBySku.set(sku, currentProposed + amount);
|
||||
|
||||
Reference in New Issue
Block a user