This commit is contained in:
seb
2026-10-16 12:35:07 +02:00
parent 70e3ae7a87
commit 796f6a3272
23 changed files with 193 additions and 38 deletions

View File

@@ -652,3 +652,9 @@ SELECT
) AS articleJson
FROM auth
`;
export const CHECK_HAS_WAREHOUSE = `
SELECT TOP 1 id
FROM warehouse
WHERE company_id = @companyId;
`;

View File

@@ -67,3 +67,16 @@ WHERE id = @id AND company_id = @companyId;
export const CHECK_LEDGER_USAGE = `
SELECT TOP 1 id FROM ledger WHERE warehouse_id = @warehouseId;
`;
export const COUNT_BY_COMPANY = `
SELECT COUNT(1) AS count
FROM warehouse
WHERE company_id = @companyId;
`;
export const CHECK_TRACK_STOCK_ARTICLES = `
SELECT TOP 1 id
FROM article
WHERE company_id = @companyId AND track_stock = 1;
`;