This commit is contained in:
seb
2026-10-20 23:19:43 +02:00
parent 813e7c89b8
commit e3761bc48b

View File

@@ -249,7 +249,11 @@ export async function recordStockAdjustmentHistory(runner, { articleId, companyu
/** Records price changes in article history. */ /** Records price changes in article history. */
export async function recordPriceChangeHistory(runner, { articleId, companyuserId, date, oldPrices, newPrices }) { export async function recordPriceChangeHistory(runner, { articleId, companyuserId, date, oldPrices, newPrices }) {
const fmtPrice = (p) => `${p.net ?? p.price}@${p.taxRate ?? p.tax ?? 0}%`; const fmtPrice = (p) => {
const net = p.net ?? p.price;
const tax = p.taxRate ?? p.tax ?? 0;
return `${formatCurrencyDe(calculateGross(net, 0, tax))}@${tax}%`;
};
const oldStr = (oldPrices || []).map(fmtPrice).join(', '); const oldStr = (oldPrices || []).map(fmtPrice).join(', ');
const newStr = (newPrices || []).map(fmtPrice).join(', '); const newStr = (newPrices || []).map(fmtPrice).join(', ');
if (oldStr === newStr) return; if (oldStr === newStr) return;