Add article.setPricesBySku to replace POS prices for a SKU.

Gives dashback a single store call that atomically replaces all price rows for the article’s poscustomergroup.
This commit is contained in:
seb
2026-08-01 05:16:50 +02:00
parent 9be9f7f74c
commit 54700a145e
5 changed files with 156 additions and 1 deletions

11
src/sql/price.js Normal file
View File

@@ -0,0 +1,11 @@
export const DELETE_BY_ARTICLE_AND_CUSTOMERGROUP = `
DELETE FROM price
WHERE article_id = @articleId
AND customergroup_id = @customerGroupId
`;
export const CREATE = `
INSERT INTO price (tax_id, article_id, minmultiplier, customergroup_id, net)
OUTPUT INSERTED.id
VALUES (@taxId, @articleId, @minmultiplier, @customerGroupId, @net)
`;