|
@ -584,7 +584,7 @@ a.InvCode,b.InvName,b.ClassCode,b.InvStd,b.InvUnit, a.Quantity as Quantity, |
|
|
9999 as AbsolveQty, |
|
|
9999 as AbsolveQty, |
|
|
cast( isnull(h.BL,0)*a.Amount AS DECIMAL(18,4)) as AbsolveAmount, |
|
|
cast( isnull(h.BL,0)*a.Amount AS DECIMAL(18,4)) as AbsolveAmount, |
|
|
cast( isnull(c.LOTQTY,0)+isnull(f.GDQTY,0) as DECIMAL(18,4)) as CreatedQty, |
|
|
cast( isnull(c.LOTQTY,0)+isnull(f.GDQTY,0) as DECIMAL(18,4)) as CreatedQty, |
|
|
CAST( ((isnull(h.BL,0)*a.Amount) -(isnull(c.LOTQTY,0)+isnull(f.GDQTY,0))) as DECIMAL(18,4)) as thisCreateQty, |
|
|
|
|
|
|
|
|
CAST( ((isnull(h.BL,0)* case when b.AmountEnable='1' then a.Amount else a.Quantity end) -(isnull(c.LOTQTY,0)+isnull(f.GDQTY,0))) as DECIMAL(18,4)) as thisCreateQty, |
|
|
cast( a.Amount as DECIMAL(18,4)) as Amount, |
|
|
cast( a.Amount as DECIMAL(18,4)) as Amount, |
|
|
isnull(b.EffectiveEnable,0) as EffectiveEnable, |
|
|
isnull(b.EffectiveEnable,0) as EffectiveEnable, |
|
|
cast( isnull(b.EffectiveDays,0) as DECIMAL(18,4)) as EffectiveDays |
|
|
cast( isnull(b.EffectiveDays,0) as DECIMAL(18,4)) as EffectiveDays |
|
@ -605,7 +605,7 @@ where isnull(a.EATTRIBUTE1,'')='' |
|
|
left join ICSInventoryLotDetail b on a.LotNo=b.LotNo and a.Type='3' |
|
|
left join ICSInventoryLotDetail b on a.LotNo=b.LotNo and a.Type='3' |
|
|
where isnull(a.EATTRIBUTE1,'')='' |
|
|
where isnull(a.EATTRIBUTE1,'')='' |
|
|
group by b.TransCode,b.TransSequence |
|
|
group by b.TransCode,b.TransSequence |
|
|
) f on d.MOCode=f.TransCode and d.Sequence=f.TransSequence |
|
|
|
|
|
|
|
|
) f on d.MOCode=f.TransCode and d.Sequence+'~'+a.Sequence=f.TransSequence |
|
|
left join |
|
|
left join |
|
|
(select case when Flag>0 then ( case when PSLNUM>MLNUM then MLNUM else PSLNUM end) else PSLNUM end as BL ,MODetailID from ( |
|
|
(select case when Flag>0 then ( case when PSLNUM>MLNUM then MLNUM else PSLNUM end) else PSLNUM end as BL ,MODetailID from ( |
|
|
select a.MODetailID, |
|
|
select a.MODetailID, |
|
@ -637,7 +637,7 @@ a.InvCode,b.InvName,b.ClassCode,b.InvStd,b.InvUnit, a.Quantity as Quantity, |
|
|
9999 as AbsolveQty, |
|
|
9999 as AbsolveQty, |
|
|
cast( isnull(h.BL,0)*a.Amount AS DECIMAL(18,4)) as AbsolveAmount, |
|
|
cast( isnull(h.BL,0)*a.Amount AS DECIMAL(18,4)) as AbsolveAmount, |
|
|
cast( isnull(c.LOTQTY,0)+isnull(f.GDQTY,0) as DECIMAL(18,4)) as CreatedQty, |
|
|
cast( isnull(c.LOTQTY,0)+isnull(f.GDQTY,0) as DECIMAL(18,4)) as CreatedQty, |
|
|
CAST( ((isnull(h.BL,0)*a.Amount) -(isnull(c.LOTQTY,0)+isnull(f.GDQTY,0))) as DECIMAL(18,4)) as thisCreateQty, |
|
|
|
|
|
|
|
|
CAST( ((isnull(h.BL,0)* case when b.AmountEnable='1' then a.Amount else a.Quantity end ) -(isnull(c.LOTQTY,0)+isnull(f.GDQTY,0))) as DECIMAL(18,4)) as thisCreateQty, |
|
|
cast( a.Amount as DECIMAL(18,4)) as Amount, |
|
|
cast( a.Amount as DECIMAL(18,4)) as Amount, |
|
|
isnull(b.EffectiveEnable,0) as EffectiveEnable, |
|
|
isnull(b.EffectiveEnable,0) as EffectiveEnable, |
|
|
cast( isnull(b.EffectiveDays,0) as DECIMAL(18,4)) as EffectiveDays |
|
|
cast( isnull(b.EffectiveDays,0) as DECIMAL(18,4)) as EffectiveDays |
|
@ -658,7 +658,7 @@ where isnull(a.EATTRIBUTE1,'')='' |
|
|
left join ICSInventoryLotDetail b on a.LotNo=b.LotNo and a.Type='3' |
|
|
left join ICSInventoryLotDetail b on a.LotNo=b.LotNo and a.Type='3' |
|
|
where isnull(a.EATTRIBUTE1,'')='' |
|
|
where isnull(a.EATTRIBUTE1,'')='' |
|
|
group by b.TransCode,b.TransSequence |
|
|
group by b.TransCode,b.TransSequence |
|
|
) f on d.MOCode=f.TransCode and d.Sequence=f.TransSequence |
|
|
|
|
|
|
|
|
) f on d.MOCode=f.TransCode and d.Sequence+'~'+a.Sequence=f.TransSequence |
|
|
left join |
|
|
left join |
|
|
(select MinBL as BL ,MODetailID from ( |
|
|
(select MinBL as BL ,MODetailID from ( |
|
|
select a.MODetailID, |
|
|
select a.MODetailID, |
|
|