export const labelInfo = `
declare @runningNumber nvarchar(max) = [runningNr]

select e.Barcode,
e.RunningNumber as runnungNumber,
externalRunningNumber= null,
e.ArticleHumanReadableId as av,
e.LabelManagementHumanReadableId as labelLayout,
case when EinlagerungsMengeSum IS NULL then 'notOnStock' else 'onStock' end as stockStatus
from [test1_AlplaPROD2.0_Read].[labelling].[InternalLabel] (nolock) as e

left join
alplaprod_test1.dbo.V_LagerPositionenBarcodes (nolock) as l on
e.RunningNumber = l.Lfdnr

WHERE e.RunningNumber IN (@runningNumber)

union all 

select ext.Barcode
,RunningNumber as runnungNumber
,SsccEanRunningNumber as externalRunningNumber
,ArticleHumanReadableId
,case when LabelManagementHumanReadableId is null then (select HumanReadableId from [test1_AlplaPROD2.0_Read].[masterData].[LabelManagement] (nolock) where LabelMarkerId = 7 and Active = 1) else LabelManagementHumanReadableId end as labelLayout
,case when EinlagerungsMengeSum IS NULL then 'notOnStock' else 'onStock' end as stockStatus
from [test1_AlplaPROD2.0_Read].[labelling].[ExternalLabel] (nolock) as ext

left join
alplaprod_test1.dbo.V_LagerPositionenBarcodes (nolock) as l on
ext.RunningNumber = l.Lfdnr

WHERE ext.SsccEanRunningNumber IN (@runningNumber) and 
ext.RunningNumber NOT IN (
        SELECT RunningNumber FROM [test1_AlplaPROD2.0_Read].[labelling].[InternalLabel] WHERE RunningNumber IN (@runningNumber)
    )
`;
