create view OM_HX_CK_List
as
--先材料期初后出库单
--期初的委外材料期初
select distinct top 100 percent RKRdRecords.AutoID, --子表标识
OM_POmain.MainID, --订单主表标识
'' as CKcode, --出库单号
'' as CKdate, --出库日期
OM_RdRecord.cInvCode as CKInvCode, --材料编号
Inventory.cInvName as CKInvName, --材料名称
Inventory.cInvStd as CKInvStd, --规格型号
Inventory.cComunitCode as CKComunitCode, --计量单位
ComputationUnit.cComUnitName as CKComUnitName, --单位名称
isnull(OM_RdRecord.iQuantity,0) as CKQuantity, --出库数量
--改为核销单价?
--OM_RdRecord.iUnitCost as CKUnitCost, --出库单价
OM_JSRecords.iHXUnitCost as CKUnitCost, --出库单价