u
This commit is contained in:
@@ -116,7 +116,7 @@ export default function adjust(provider) {
|
||||
const resolvedArticles = [];
|
||||
for (const item of normalizedLines) {
|
||||
const resolved = await resolveArticle(googleAuthId, item.sku, activeTx);
|
||||
const artRes = await runner.query('SELECT is_father, articlelist_id FROM article WHERE id = @articleId', {
|
||||
const artRes = await runner.query('SELECT is_father, articlelist_id, track_stock FROM article WHERE id = @articleId', {
|
||||
articleId: resolved.articleId,
|
||||
});
|
||||
if (artRes.rows[0]?.is_father) {
|
||||
@@ -127,6 +127,10 @@ export default function adjust(provider) {
|
||||
throw new Error(`A Stückliste cannot have manual stock adjustments (${item.sku})`);
|
||||
}
|
||||
|
||||
if (Number(artRes.rows[0]?.track_stock ?? 1) === 0) {
|
||||
throw new Error(`Stock tracking is disabled for article (${item.sku})`);
|
||||
}
|
||||
|
||||
const nameRes = await runner.query(GET_ARTICLE_NAME_SQL, {
|
||||
articleId: resolved.articleId,
|
||||
languageId: resolved.languageId,
|
||||
|
||||
Reference in New Issue
Block a user