select
'Allocated - general or pending issue'
as
AllocType,
CASE
WHEN
MANUFACTUREORDERST_I =
'1'
THEN
'quote'
WHEN
MANUFACTUREORDERST_I =
'2'
THEN
'open'
WHEN
MANUFACTUREORDERST_I =
'3'
THEN
'released'
WHEN
MANUFACTUREORDERST_I =
'4'
THEN
'hold'
WHEN
MANUFACTUREORDERST_I =
'5'
THEN
'cancelled'
WHEN
MANUFACTUREORDERST_I =
'6'
THEN
'complete'
WHEN
MANUFACTUREORDERST_I =
'7'
THEN
'partially rec.'
WHEN
MANUFACTUREORDERST_I =
'8'
THEN
'closed'
END
AS
MOstatus,
*
from
MOP1400
inner
join
dbo.WO010032
ON
dbo.MOP1400 .MANUFACTUREORDER_I = dbo.WO010032.MANUFACTUREORDER_I
where
ATYALLOC > 0
select
'Allocated - bin '
as
AllocType,
CASE
WHEN
MANUFACTUREORDERST_I =
'1'
THEN
'quote'
WHEN
MANUFACTUREORDERST_I =
'2'
THEN
'open'
WHEN
MANUFACTUREORDERST_I =
'3'
THEN
'released'
WHEN
MANUFACTUREORDERST_I =
'4'
THEN
'hold'
WHEN
MANUFACTUREORDERST_I =
'5'
THEN
'cancelled'
WHEN
MANUFACTUREORDERST_I =
'6'
THEN
'complete'
WHEN
MANUFACTUREORDERST_I =
'7'
THEN
'partially rec.'
WHEN
MANUFACTUREORDERST_I =
'8'
THEN
'closed'
END
AS
MOstatus,
*
from
MOP1900
inner
join
dbo.WO010032
ON
dbo.MOP1900.MANUFACTUREORDER_I = dbo.WO010032.MANUFACTUREORDER_I
where
ATYALLOC > 0
select
'Allocated - lot or pending issue'
as
AllocType,
CASE
WHEN
MANUFACTUREORDERST_I =
'1'
THEN
'quote'
WHEN
MANUFACTUREORDERST_I =
'2'
THEN
'open'
WHEN
MANUFACTUREORDERST_I =
'3'
THEN
'released'
WHEN
MANUFACTUREORDERST_I =
'4'
THEN
'hold'
WHEN
MANUFACTUREORDERST_I =
'5'
THEN
'cancelled'
WHEN
MANUFACTUREORDERST_I =
'6'
THEN
'complete'
WHEN
MANUFACTUREORDERST_I =
'7'
THEN
'partially rec.'
WHEN
MANUFACTUREORDERST_I =
'8'
THEN
'closed'
END
AS
MOstatus,
*
from
MOP1020
inner
join
dbo.WO010032
ON
dbo.MOP1020.MANUFACTUREORDER_I = dbo.WO010032.MANUFACTUREORDER_I