export const shortageBookings = `

use AlplaPROD_test1
Declare @range int = [time] -- change this to be range in minutues you want to monitor, this shouldnt be more than the interval check so we do not see duplicates
declare @avType nvarchar(3) = '[type]' --change to blank or single to have specific ones if all the type is ignored
declare @avTypeID NVARCHAR(MAX) = '[avType]' -- this can only be 1 article now.

  select 
  IdArtikelVarianten as materialAV
  ,IdArtikelTyp
  ,ArtikelTypBez
  ,ArtikelVariantenAlias as materialAlias
  ,CAST(Menge as varchar) as qtyShortpcs
  ,ProduktionsLos as productionlot
  ,LEFT(PARSE(Right(barcode, 39) as int), LEN(PARSE(Right(barcode, 39)as int)) - 1) as palletWithShortBookings
  ,m.Standort as machineNumber
  ,m.Bezeichnung ,m.Bezeichnung as machineAlias
  ,Buchungsdatum as bookingDate
  
  from [dbo].[V_LagerBuchungen] (nolock) s
  
  left join

  dbo.T_Maschine (nolock) as m 
  on m.IdMaschine = s.IdMaschine
  
  where beleg like '%$Sho%' and s.Add_Date > DATEADD(MINUTE, -@range, getdate()) 
  and (@avType = 'all' or IdArtikelTyp in (@avTypeID))

  order by ProduktionsLos
`;
