This commit is contained in:
seb
2026-10-23 20:31:39 +02:00
parent 8002ca56e6
commit 82ab27ef2b
11 changed files with 39 additions and 41 deletions

View File

@@ -350,7 +350,7 @@ async function run() {
assert.equal(acceptNegResult.adjust_ledger.warehouse_id, wh1.id);
// 9. Test store.stock.ship with shipmentmanifestitem
console.log('9. Testing store.stock.ship (positive shipment & negative retoure)...');
console.log('9. Testing store.stock.ship (positive shipment & rejection of negative line)...');
const order3 = await store.order.create(googleAuthId, {
number: 'O-3',
entityId: customer.id,
@@ -380,14 +380,14 @@ async function run() {
assert.equal(shipPosResult.document_ledger.amount, -4);
assert.equal(shipPosResult.adjust_ledger.amount, -4);
// Negative shipment line: retoure of a shipment (incoming)
const shipNegResult = await store.stock.ship(googleAuthId, {
manifestarticleId: negShipLineId,
warehouseId: wh1.id,
});
assert.equal(shipNegResult.document_ledger.transaction_type, 'RETOURE');
assert.equal(shipNegResult.document_ledger.amount, 1);
assert.equal(shipNegResult.adjust_ledger.amount, 1);
// Negative shipment line: shipping is rejected
await assert.rejects(
store.stock.ship(googleAuthId, {
manifestarticleId: negShipLineId,
warehouseId: wh1.id,
}),
/Amount must be positive/,
);
// 10. Test store.stock.adjust
console.log('10. Testing store.stock.adjust failure on untracked article...');