|
|
|
@ -827,6 +827,52 @@ |
|
|
|
order by a.TransDate desc |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="getStockPrintAll" resultType="com.heai.modules.production.entity.StockPrintData"> |
|
|
|
select 'N/A' as TransNo |
|
|
|
, a.Site |
|
|
|
, a.WareHouseId |
|
|
|
, a.BatchNo |
|
|
|
, a.LocationId |
|
|
|
, a.PartNo |
|
|
|
, 'N/A' as OrderNo |
|
|
|
, a.FirstInDate as TransDate |
|
|
|
, Round(a.QtyOnHand, 3) as Qty |
|
|
|
, 'N' as PrintFlag |
|
|
|
, dbo.Get_PartDesc(a.Site, a.PartNo) as partDesc |
|
|
|
, Round(dbo.Get_Part_NetWeight(a.Site, a.PartNo) * isnull(Round(a.QtyOnHand, 3), 0) / 1000, 2) weight |
|
|
|
, dbo.Get_WareHouseDesc(a.Site, a.WareHouseId) as wareHouseDesc |
|
|
|
, dbo.Get_Part_UMID(a.Site, a.PartNo) umid |
|
|
|
, a.ExpiredDate as expiredDate |
|
|
|
, dbo.Get_StorePrintPartStatus(a.Site, a.PartNo, a.BatchNo) status |
|
|
|
, isnull(Round(a.QtyOnHand, 3), 0) QtyOnHand |
|
|
|
from InventoryStock a |
|
|
|
<where> |
|
|
|
Round(a.QtyOnHand, 3) > 0 |
|
|
|
<if test="startDate != null "> |
|
|
|
and a.TransDate >= #{startDate} |
|
|
|
</if> |
|
|
|
<if test="endDate != null "> |
|
|
|
and #{endDate} >= a.TransDate -1 |
|
|
|
</if> |
|
|
|
<if test="site != null and site != ''"> |
|
|
|
AND a.site = #{site} |
|
|
|
</if> |
|
|
|
<if test="orderNo != null and orderNo != ''"> |
|
|
|
AND a.orderNo LIKE #{orderNo} |
|
|
|
</if> |
|
|
|
<if test="seqNo != null and seqNo != ''"> |
|
|
|
AND a.seqNo = #{seqNo} |
|
|
|
</if> |
|
|
|
<if test="batchNo != null and batchNo != ''"> |
|
|
|
AND a.BatchNo LIKE #{batchNo} |
|
|
|
</if> |
|
|
|
<if test="partNo != null and partNo != ''"> |
|
|
|
AND a.PartNo LIKE #{partNo} |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
order by a.TransDate desc |
|
|
|
</select> |
|
|
|
|
|
|
|
<update id="updatePrintStock"> |
|
|
|
update StockPrint set PrintFlag='Y' where Site=#{site} and TransNo=#{transNo} |
|
|
|
</update> |
|
|
|
|