关于序列号的使用原创
8人赞赏了该文章
960次浏览
编辑于2021年11月30日 17:14:38
1、序列号的【在库状态】
入库单据保存时,序列号【在库状态】为“待入库”,入库单据审核是,序列号【在库状态】为“在库”
出库单据保存时,序列号【在库状态】为“待出库”,入库单据审核是,序列号【在库状态】为“出库”
反审核单据时【在库状态】也会进行更新
2、即时库存明细如何联查到序列号?
联查的sql:
SELECT 'BD_SerialMainFile' fformid, SM.FSERIALID, INV.FID, SM.FNUMBER fserialno, ORGL.FNAME fstockorgname, MA.FMaterialId, MA.FNUMBER fmaterialnumber, MAL.FNAME fmaterialname, MAL.FSpecification fmaterialmodel, INV.FAuxPropID fauxpropcomid, ' ' fauxprop, BDSTL.FNAME fstockname, ROW_NUMBER() OVER( ORDER BY INV.FID ASC, SM.FNUMBER ASC) fidentityid FROM T_STK_INVENTORY INV INNER JOIN T_BD_SERIALBILLTRACE TRA ON INV.FID = TRA.FINVID INNER JOIN (SELECT MAX(T3.FBILLTRACEID) fbilltraceid FROM T_BD_SERIALBILLTRACE T3 INNER JOIN (SELECT DISTINCT FSERIALID FROM T_BD_SERIALBILLTRACE WHERE FINVID IN ('509a4c10-6865-8b73-11ec-51b34d657022')) t4 ON T4.FSERIALID = T3.FSERIALID WHERE (T3.FINVID <> ' ') GROUP BY T3.FSERIALID) tra2 ON TRA2.FBILLTRACEID = TRA.FBILLTRACEID INNER JOIN T_BD_SERIALMASTER SM ON SM.FSERIALID = TRA.FSERIALID LEFT OUTER JOIN T_ORG_ORGANIZATIONS_L ORGL ON (ORGL.FORGID = INV.FSTOCKORGID AND ORGL.FLOCALEID = 2052) INNER JOIN T_BD_MATERIAL MA ON (MA.FMASTERID = INV.FMATERIALID AND MA.FUSEORGID = INV.FSTOCKORGID) LEFT OUTER JOIN T_BD_MATERIAL_L MAL ON (MAL.FMATERIALID = MA.FMATERIALID AND MAL.FLOCALEID = 2052) LEFT OUTER JOIN T_BD_STOCK_L BDSTL ON (BDSTL.FSTOCKID = INV.FSTOCKID AND BDSTL.FLOCALEID = 2052) WHERE (SM.FFORBIDSTATUS = 'A' AND (INV.FID IN ('509a4c10-6865-8b73-11ec-51b34d657022') AND TRA.FSTATE = '1')) ORDER BY INV.FID ASC, SM.FNUMBER ASC
赞 8
8人点赞
还没有人点赞,快来当第一个点赞的人吧!
打赏
0人打赏
还没有人打赏,快来当第一个打赏的人吧!
推荐阅读