u
This commit is contained in:
@@ -55,6 +55,7 @@ async function run() {
|
||||
|
||||
// Create a delivery manifest with lines
|
||||
const delivery = await store.delivery.create(googleAuthId, {
|
||||
supplierId: supplier.id,
|
||||
externalNumber: 'DEL-1',
|
||||
date: new Date().toISOString(),
|
||||
lines: [
|
||||
@@ -217,9 +218,15 @@ async function run() {
|
||||
const history = await store.article.getHistoryBySku(googleAuthId, article.sku);
|
||||
const historyTexts = history.map((h) => h.text);
|
||||
console.log('Article history texts:', historyTexts);
|
||||
assert(historyTexts.includes('Initial delivery movement'), 'History should include initial delivery movement');
|
||||
assert(historyTexts.includes('Damaged item written off'), 'History should include damaged item written off');
|
||||
assert(historyTexts.includes('Second line goods receipt'), 'History should include second line goods receipt');
|
||||
assert(
|
||||
historyTexts.some((t) => t.includes('Initial delivery movement') && t.includes('Lieferant: "Supplier X"') && t.includes('EK brutto: 11.90') && t.includes('Menge: 5')),
|
||||
'History should include initial delivery movement with supplier, EK brutto, and amount',
|
||||
);
|
||||
assert(historyTexts.includes('Damaged item written off'), 'History should include undamaged adjustment memo as is');
|
||||
assert(
|
||||
historyTexts.some((t) => t.includes('Second line goods receipt') && t.includes('Lieferant: "Supplier X"') && t.includes('EK brutto: 23.80') && t.includes('Menge: 10')),
|
||||
'History should include second line goods receipt with details',
|
||||
);
|
||||
|
||||
console.log('✓ All ledger tests passed successfully!');
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user