已经按照如下语句去检查单位了,均没查到数据,为什么及时库存还是报错?
--即时库存基本单位检查
select * from T_STK_INVENTORY t1
inner join T_BD_MATERIALBASE t3 on t1.FMATERIALID = t3.FMATERIALID
where t1.FBASEUNITID <> t3.FBASEUNITID
--即时库存辅助、库存单位检查
select * from T_STK_INVENTORY t1 inner join T_BD_MATERIALSTOCK t2
on t1.FMATERIALID = t2.FMATERIALID
where t1.FSTOCKUNITID <> t2.FSTOREUNITID or t1.FSECUNITID <> t2.FAUXUNITID
--库存余额基本、辅助单位检查
select * from T_STK_INVbal t1 inner join T_BD_MATERIALSTOCK t2
on t1.FMATERIALID = t2.FMATERIALID
inner join T_BD_MATERIALBASE t3 on t1.FMATERIALID = t3.FMATERIALID
where t1.FBASEUNITID <> t3.FBASEUNITID or t1.FSECUNITID <> t2.FAUXUNITID
--结存临时明细基本、辅助单位检查 需要做库存关账才能查询最新有效数据
select t1.FFORMID 单据类型,t5.fname 单据类型名称,t1.fbillno 单据编号,t1.fbillid 单据内码,t1.FBASEQTY 基本单位数量,t1.FBASEUNITID 单据基本单位,
t2.FBASEUNITID 物料基本单位,t1.FSECUNITID 单据辅助单位,t3.FAUXUNITID 物料辅助单位, t1.fmaterialid 物料内码,t4.fnumber 物料编码, t1.*
from T_STK_STKBALOCCUR t1 inner join
T_BD_MATERIALBASE t2 on t1.FMATERIALID = t2.FMATERIALID
inner join T_BD_MATERIALSTOCK t3 on t1.FMATERIALID = t3.FMATERIALID
inner join T_BD_MATERIAL t4 on t1.FMATERIALID = t4.FMATERIALID
inner join t_meta_objecttype_L t5 on t1.fformid = t5.fid and t5.flocaleid = 2052
where t1.FBASEUNITID <> t2.FBASEUNITID or t1.FSECUNITID <> t3.FAUXUNITID