|
|
@ -1513,6 +1513,7 @@ where ODNType='1' and a.Quantity-a.RCVQuantity>0"; |
|
|
|
when a.FromWarehouseCode='025' then a.FromWarehouseCode+'/'+'L5' |
|
|
|
when a.FromWarehouseCode='026' then a.FromWarehouseCode+'/'+'L6' |
|
|
|
when a.FromWarehouseCode='027' then a.FromWarehouseCode+'/'+'L7' |
|
|
|
when a.FromWarehouseCode='015' then a.FromWarehouseCode+'/'+'C1' |
|
|
|
else a.FromWarehouseCode+'/'+c.WarehouseName end as '调拨仓', |
|
|
|
|
|
|
|
case when a.ToWarehouseCode='021' then a.ToWarehouseCode+'/'+'L1' |
|
|
@ -1522,15 +1523,18 @@ else a.FromWarehouseCode+'/'+c.WarehouseName end as '调拨仓', |
|
|
|
when a.ToWarehouseCode='025' then a.ToWarehouseCode+'/'+'L5' |
|
|
|
when a.ToWarehouseCode='026' then a.ToWarehouseCode+'/'+'L6' |
|
|
|
when a.ToWarehouseCode='027' then a.ToWarehouseCode+'/'+'L7' |
|
|
|
else a.ToWarehouseCode+'/'+c.WarehouseName end as '目标仓', |
|
|
|
when a.ToWarehouseCode='015' then a.ToWarehouseCode+'/'+'C1' |
|
|
|
else a.ToWarehouseCode+'/'+d.WarehouseName end as '目标仓', |
|
|
|
format(a.MTIME , 'yyyy-MM-dd') as '调拨时间' |
|
|
|
from dbo.ICSWareHouseLotInfoLog a |
|
|
|
inner join dbo.ICSInventory b on a.InvCode=b.InvCode and a.WorkPoint=b.WorkPoint |
|
|
|
inner join dbo.ICSWarehouse c on a.ToWarehouseCode=c.WarehouseCode and a.WorkPoint=c.WorkPoint |
|
|
|
inner join dbo.ICSWarehouse c on a.FromWarehouseCode=c.WarehouseCode and a.WorkPoint=c.WorkPoint |
|
|
|
inner join dbo.ICSWarehouse d on a.ToWarehouseCode=d.WarehouseCode and a.WorkPoint=d.WorkPoint |
|
|
|
where BusinessCode in ('70','47') and a.TransType in ('6','14') |
|
|
|
and format(a.MTIME , 'yyyy-MM-dd') =format(getdate() , 'yyyy-MM-dd') |
|
|
|
)a |
|
|
|
group by a.调拨时间 ,a.存货编码,a.存货名称,a.调拨仓,a.目标仓";
|
|
|
|
group by a.调拨时间 ,a.存货编码,a.存货名称,a.调拨仓,a.目标仓 |
|
|
|
";
|
|
|
|
|
|
|
|
DataTable dt = SqlHelper.GetDataTableBySql(SqlText); |
|
|
|
|
|
|
@ -1633,7 +1637,7 @@ SELECT |
|
|
|
|
|
|
|
|
|
|
|
select count(*) as DB into #Temp5 from( |
|
|
|
select a.调拨仓,a.存货编码,a.存货名称,sum(a.数量) as 数量,a.目标仓,a.调拨时间 |
|
|
|
select a.调拨仓,a.存货编码,a.存货名称,cast(sum(a.数量 )as decimal(16,2) ) 数量,a.目标仓,a.调拨时间 |
|
|
|
from( |
|
|
|
select a.InvCode as '存货编码',b.InvName+'|'+b.InvStd as '存货名称', |
|
|
|
case when b.AmountEnable='1' then a.Quantity/b.EATTRIBUTE1 else a.Quantity end '数量', |
|
|
@ -1653,15 +1657,17 @@ else a.FromWarehouseCode+'/'+c.WarehouseName end as '调拨仓', |
|
|
|
when a.ToWarehouseCode='025' then a.ToWarehouseCode+'/'+'L5' |
|
|
|
when a.ToWarehouseCode='026' then a.ToWarehouseCode+'/'+'L6' |
|
|
|
when a.ToWarehouseCode='027' then a.ToWarehouseCode+'/'+'L7' |
|
|
|
else a.ToWarehouseCode+'/'+c.WarehouseName end as '目标仓', |
|
|
|
else a.ToWarehouseCode+'/'+d.WarehouseName end as '目标仓', |
|
|
|
format(a.MTIME , 'yyyy-MM-dd') as '调拨时间' |
|
|
|
from dbo.ICSWareHouseLotInfoLog a |
|
|
|
inner join dbo.ICSInventory b on a.InvCode=b.InvCode and a.WorkPoint=b.WorkPoint |
|
|
|
inner join dbo.ICSWarehouse c on a.ToWarehouseCode=c.WarehouseCode and a.WorkPoint=c.WorkPoint |
|
|
|
inner join dbo.ICSWarehouse c on a.FromWarehouseCode=c.WarehouseCode and a.WorkPoint=c.WorkPoint |
|
|
|
inner join dbo.ICSWarehouse d on a.ToWarehouseCode=d.WarehouseCode and a.WorkPoint=d.WorkPoint |
|
|
|
where BusinessCode in ('70','47') and a.TransType in ('6','14') |
|
|
|
and format(a.MTIME , 'yyyy-MM-dd') =format(getdate() , 'yyyy-MM-dd') |
|
|
|
)a |
|
|
|
group by a.调拨时间 ,a.存货编码,a.存货名称,a.调拨仓,a.目标仓 |
|
|
|
|
|
|
|
)e |
|
|
|
|
|
|
|
|
|
|
|
xxxxxxxxxx