@ -521,37 +521,39 @@
Group by QtyReported
Group by QtyReported
</select>
</select>
<select id= "getStockPrint" resultType= "com.heai.modules.production.entity.StockPrintData" >
<select id= "getStockPrint" resultType= "com.heai.modules.production.entity.StockPrintData" >
select TransNo,Site,WareHouseId,BatchNo,LocationId,PartNo,OrderNo,TransDate,Qty,PrintFlag,dbo.Get_PartDesc(Site,PartNo) as partDesc,Round(dbo.Get_Part_NetWeight(Site,PartNo)*Qty/1000,2) weight
,dbo.Get_WareHouseDesc(Site,WareHouseId) as wareHouseDesc,dbo.Get_Part_UMID(Site,PartNo) umid,dbo.get_expiredDate_print(Site,PartNo,BatchNo) expiredDate
,dbo.Get_StorePrintPartStatus(Site,PartNo,BatchNo) status
from StockPrint
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
<where >
<where >
<if test= "startDate != null " >
<if test= "startDate != null " >
and TransDate >= #{startDate}
and a. TransDate >= #{startDate}
</if>
</if>
<if test= "endDate != null " >
<if test= "endDate != null " >
and #{endDate} >= TransDate -1
and #{endDate} >= a. TransDate -1
</if>
</if>
<if test= "site != null and site != ''" >
<if test= "site != null and site != ''" >
AND site = #{site}
AND a. site = #{site}
</if>
</if>
<if test= "orderNo != null and orderNo != ''" >
<if test= "orderNo != null and orderNo != ''" >
AND orderNo LIKE #{orderNo}
AND a. orderNo LIKE #{orderNo}
</if>
</if>
<if test= "seqNo != null and seqNo != ''" >
<if test= "seqNo != null and seqNo != ''" >
AND seqNo = #{seqNo}
AND a. seqNo = #{seqNo}
</if>
</if>
<if test= "printFlag != null and printFlag != ''" >
<if test= "printFlag != null and printFlag != ''" >
AND printFlag = #{printFlag}
AND a. printFlag = #{printFlag}
</if>
</if>
<if test= "batchNo != null and batchNo != ''" >
<if test= "batchNo != null and batchNo != ''" >
AND BatchNo LIKE #{batchNo}
AND a. BatchNo LIKE #{batchNo}
</if>
</if>
<if test= "partNo != null and partNo != ''" >
<if test= "partNo != null and partNo != ''" >
AND PartNo LIKE #{partNo}
AND a. PartNo LIKE #{partNo}
</if>
</if>
</where>
</where>
order by TransDate desc
order by a. TransDate desc
</select>
</select>
<update id= "updatePrintStock" >
<update id= "updatePrintStock" >
@ -841,10 +843,10 @@
<insert id= "saveSOOpsTransferHeaderForShiYanShi" >
<insert id= "saveSOOpsTransferHeaderForShiYanShi" >
INSERT INTO SOOpsTransferHeader (TransNo,Site,FromProLineNo,ToProLineNo,ToWarehouseID,FromEnteredby,FromEnteredDate,TransDate,ToReceiver,FromReceiver,
INSERT INTO SOOpsTransferHeader (TransNo,Site,FromProLineNo,ToProLineNo,ToWarehouseID,FromEnteredby,FromEnteredDate,TransDate,ToReceiver,FromReceiver,
FromRemark,ToRemark,ConfirmedFlag,ToConfirmedBy,ToEnteredby,LatestUpdatedBy,LatestUpdatedDate, RecordVersion,
FromRemark,ToRemark,ConfirmedFlag,ToConfirmedBy,ToEnteredby,RecordVersion,
Status,ToTypeFlag_DB,ToTypeFlag,ConfirmedTransNo,need_inspect_flag,NeedReceiveFlag,inspect_remark) VALUES
Status,ToTypeFlag_DB,ToTypeFlag,ConfirmedTransNo,need_inspect_flag,NeedReceiveFlag,inspect_remark) VALUES
(#{transNo},#{site},'*','*','*',#{operatorId},GETDATE(),GETDATE(),'',#{operatorId},
(#{transNo},#{site},'*','*','*',#{operatorId},GETDATE(),GETDATE(),'',#{operatorId},
'','','N','N','',#{operatorId},GETDATE(), '0',
'','','N','N','','0',
'已录入','I',#{toTypeFlag},'','Y','N',#{inspectRemark})
'已录入','I',#{toTypeFlag},'','Y','N',#{inspectRemark})
</insert>
</insert>