@ -758,12 +758,28 @@
Group by QtyReported
</select>
<select id= "getStockPrint" resultType= "com.heai.modules.production.entity.StockPrintData" >
select a.TransNo,a.Site,a.WareHouseId,a.BatchNo,a.LocationId,a.PartNo,a.OrderNo,a.TransDate,a.Qty,a.PrintFlag,dbo.Get_PartDesc(a.Site,a.PartNo) as partDesc,Round(dbo.Get_Part_NetWeight(a.Site,a.PartNo)*a.Qty/1000,2) weight
,dbo.Get_WareHouseDesc(a.Site,a.WareHouseId) as wareHouseDesc,dbo.Get_Part_UMID(a.Site,a.PartNo) umid,dbo.get_expiredDate_print(a.Site,a.PartNo,a.BatchNo) expiredDate
,dbo.Get_StorePrintPartStatus(a.Site,a.PartNo,a.BatchNo) status,isnull(Round(b.QtyOnHand,3),0) QtyOnHand
select a.TransNo
, a.Site
, a.WareHouseId
, a.BatchNo
, a.LocationId
, a.PartNo
, a.OrderNo
, a.TransDate
, a.Qty
, a.PrintFlag
, dbo.Get_PartDesc(a.Site, a.PartNo) as partDesc
, Round(dbo.Get_Part_NetWeight(a.Site, a.PartNo) * a.Qty / 1000, 2) weight
, dbo.Get_WareHouseDesc(a.Site, a.WareHouseId) as wareHouseDesc
, dbo.Get_Part_UMID(a.Site, a.PartNo) umid
, dbo.get_expiredDate_print(a.Site, a.PartNo, a.BatchNo) expiredDate
, dbo.Get_StorePrintPartStatus(a.Site, a.PartNo, a.BatchNo) status
, isnull(Round(b.QtyOnHand, 3), 0) QtyOnHand
from StockPrint a
left join InventoryStock b on a.Site=b.site and a.WareHouseId=b.WarehouseID and a.PartNo=b.PartNo and a.BatchNo=b.BatchNo and
a.LocationId=b.LocationId
left join InventoryStock b
on a.Site = b.site and a.WareHouseId = b.WarehouseID and a.PartNo = b.PartNo and
a.BatchNo = b.BatchNo and
a.LocationId = b.LocationId
<where >
<if test= "startDate != null " >
and a.TransDate >= #{startDate}
@ -1712,11 +1728,16 @@
</select>
<select id= "checkSPBOMIsIssure" resultType= "com.heai.modules.app.entity.SoBomData" >
select a.ComponentPartNo, ISNULL(Sum( case when b.Direction='-' then TransQty else TransQty*(-1.0) end), 0) as qty
from SOBOM a left join TransDetail b on a.site=b.site and a.ComponentPartNo=b.PartNo and b.TransNo like 'SI%'
and OrderRef3=convert(varchar(20),#{seqNo}) and (a.ComponentPartNo like 'RC%' or a.ComponentPartNo like 'SC%' or a.ComponentPartNo like 'VP%' )
where a.orderNo=#{orderNo} and a.site=#{site}
select a.ComponentPartNo,
ISNULL(Sum(case when b.Direction = '-' then TransQty else TransQty * (-1.0) end), 0) as qty
from SOBOM a
left join TransDetail b on a.site = b.site and a.ComponentPartNo = b.PartNo and b.TransNo like 'SI%'
and OrderRef3 = convert(varchar (20), #{seqNo}) and
(a.ComponentPartNo like 'RC%' or a.ComponentPartNo like 'SC%' or
a.ComponentPartNo like 'VP%')
where a.orderNo = #{orderNo}
and a.site = #{site}
group by a.ComponentPartNo
</select>