几张库存表的关系
stockbillbody 需求表 billcode--> checkbillbody -->billcode
//仓库流程中的id 关系
select id,ownerid,name,flowid from partinfo --商品信息表
go
select billcode,partname,flowid,onlyid,partid from orderbillbody --物资需求表
go
select * from orderbillhand
go
select billcode,partname,flowid,onlyid,partid,orderid from stockbillbody --物资采购表
go
select * from stockbillhand
go
select billcode,partname, flowid,onlyid,stockid,partinid,partid from checkbillbody --物资品检表
go
select billcode,partname,flowid,onlyid,partid ,orderid from partsinputbody --入库表明细
go
select billcode,onlyid,flowid from partsinputhand--入库表单据
go
select billcode,partname,flowid,onlyid,partid ,orderid from partsoutputbody --出库表明细
go
select billcode,flowid from partsoutputhand--出库表单据
--orderbillbody,stockbillbody,checkbillbody partsinputbody,partsoutbody 中的partid 都与 partinfo 中的 id 关联
--orderbillbody.billcode=stockbillbody.billcode=checkbillbody.billcode
--orderbillbody.onlyid=stockbillbody.onlyid=checkbillbody.onlyid
--orderbillbody.flowid=stockbillbody.flowid=checkbillbody.flowid
--orderbillbody.onlyid=stockbillbody.orderid=checkbillbody.stockid
--orderbillbody.billcode=orderbillhand.billcode;orderbillbody.flowid=orderbillhand.flowid
--stockbillbody.flowid=stockbillhand.flowid stockbillbody.billcode<>stockbillhand.billcode ???