diff --git a/server/services/sqlServer/querys/notifications/blocking.ts b/server/services/sqlServer/querys/notifications/blocking.ts index bc71846..a1f5676 100644 --- a/server/services/sqlServer/querys/notifications/blocking.ts +++ b/server/services/sqlServer/querys/notifications/blocking.ts @@ -1,5 +1,5 @@ export const blockQuery = ` -SELECT +SELECT TOP(1) 'Alert! new blocking order: #' + cast(HumanReadableId as varchar) + ' - ' + ArticleVariantDescription as subject, cast([HumanReadableId] as varchar) as blockingNumber, [ArticleVariantDescription] as article, @@ -41,5 +41,6 @@ on [test1_AlplaPROD2.0_Reporting].[reporting_blocking].[BlockingOrder].Producti where [test1_AlplaPROD2.0_Reporting].[reporting_blocking].[BlockingOrder].[BlockingDate] between getdate() - 1 and getdate() + 1 and [test1_AlplaPROD2.0_Reporting].[reporting_blocking].[BlockingOrder].BlockingTrigger = 1 -and HumanReadableId NOT IN ([sentBlockingOrders]) +--and HumanReadableId NOT IN ([sentBlockingOrders]) +and HumanReadableId > [lastBlocking] `;