This commit is contained in:
seb
2026-10-12 13:52:16 +02:00
parent c614a67b97
commit 3d6bc97411
5 changed files with 127 additions and 38 deletions

View File

@@ -231,32 +231,18 @@ export default function add(provider) {
transactionText?.trim() ||
(manifestArticle.manifestNumber ? `Lieferung ${manifestArticle.manifestNumber}` : 'Lieferung');
historyText = `${base}${suffix}`;
} else if (isShipping) {
const details = [];
if (manifestArticle.supplierName) {
details.push(`Kunde: "${manifestArticle.supplierName}"`);
}
if (warehouseName) {
details.push(`Lager: "${warehouseName}"`);
}
if (amount != null && Number.isFinite(Number(amount))) {
details.push(`Menge: ${amount}`);
}
const suffix = details.length ? ` (${details.join(', ')})` : '';
const base =
transactionText?.trim() ||
(manifestArticle.manifestNumber ? `Versand Auftrag ${manifestArticle.manifestNumber}` : 'Versand');
historyText = `${base}${suffix}`;
} else if (warehouseName && !transactionText.includes(warehouseName)) {
historyText = `${transactionText} (Lager: "${warehouseName}")`;
}
for (const match of articleMatches.rows) {
await runner.query(queries.INSERT_ARTICLE_HISTORY, {
articleId: match.articleId,
companyuserId,
text: historyText,
});
if (!isShipping) {
for (const match of articleMatches.rows) {
await runner.query(queries.INSERT_ARTICLE_HISTORY, {
articleId: match.articleId,
companyuserId,
text: historyText,
});
}
}
}