This commit is contained in:
seb
2026-10-16 22:09:12 +02:00
parent 796f6a3272
commit 7635821dad
38 changed files with 6191 additions and 3350 deletions

View File

@@ -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);