feat(ocp): materials contorls and transfer to next lot logic
This commit is contained in:
@@ -1,20 +1,36 @@
|
||||
export const labelInfo = `
|
||||
select top(500) e.Barcode,
|
||||
e.IdArtikelvarianten as av,
|
||||
e.lfdnr as rn,
|
||||
IdEtikettenLayout as labelLayout,
|
||||
AnzStkJePalette,
|
||||
Sonstiges_9,AnzStkJeKarton
|
||||
,case when EinlagerungsMengeSum IS NULL then 'notOnStock' else 'onStock' end as stockStatus
|
||||
,EinlagerungsMengeSum
|
||||
--,*
|
||||
from [AlplaPROD_test1].dbo.[T_EtikettenGedruckt] e (nolock)
|
||||
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 as l on
|
||||
e.LfdNr = l.Lfdnr
|
||||
alplaprod_test1.dbo.V_LagerPositionenBarcodes (nolock) as l on
|
||||
e.RunningNumber = l.Lfdnr
|
||||
|
||||
where e.LfdNr in ([runningNr])
|
||||
WHERE e.RunningNumber IN (@runningNumber)
|
||||
|
||||
order by add_date desc
|
||||
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) 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)
|
||||
)
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user