星空物料相关信息sql原创
金蝶云社区-Jeffrey_Bao
Jeffrey_Bao
91人赞赏了该文章 367次浏览 未经作者许可,禁止转载编辑于2024年10月22日 22:18:38
--物料相关信息
select a.fnumber 物料,
       a1.fname 物料名,
       case a.fdocumentstatus when 'Z'  then'暂存'
       when 'A' then '创建'
       when 'B' then '审核中'
       when 'C' then '已审核'
       when 'D' then '重新审核'
       else '其他' end 数据状态,
       case a.fforbidstatus when 'A' then'否'
       when 'B' then'是'
       else '其他' end 禁用状态,
       c.fnumber 仓库id,
       c1.fname 仓库,
       b.fisbatchmanage 启用批号管理,
       d.fcheckincoming 来料检验,
       a.f_qmav_qcpoint wms质检节点,
       e.ffinishreceiptoverrate 入库超收比例,
       e.f_qmav_overreceiving wms是否允许超收,
       f.fisenable  库存属性_仓库,
       f1.fisenable  库存属性_仓位,
       f2.fisenable  库存属性_bom版本,
       f3.fisenable  库存属性_批号,
       f4.fisenable  库存属性_计划跟踪号,
       g.fisenable  辅助属性_规格大小,
       g1.fisenable  辅助属性_厂区,
       g2.fisenable  辅助属性_供应商,
       a.f_qmav_pushtowms 已同步wms,
       h.FNAME 创建人,
       a.fcreatedate 创建日期,
       i.FNAME 修改人,
--       a2.fnumber+a3.fname 创建组织名,
       a4.fnumber+a5.fname 使用组织名
from t_bd_material a  --物料
left join t_bd_material_l a1 on a.fmaterialid = a1.fmaterialid --物料名
--left join t_org_organizations a2 on a.fcreateorgid=a2.forgid --创建组织
--left join t_org_organizations_l a3 on a3.forgid =a2.forgid and a3.fname is not null--创建组织名
left join t_org_organizations a4 on a.fuseorgid=a4.forgid --使用组织
left join t_org_organizations_l a5 on a4.forgid =a5.forgid --使用组织名
left join t_bd_materialstock b on a.fmaterialid=b.fmaterialid--库存
left join t_bd_stock c on b.fstockid =c.fstockid --仓库
left join t_bd_stock_l c1 on c.fstockid =c1.fstockid --仓库名
left join t_bd_materialquality d on a.fmaterialid =d.fmaterialid--质量
left join t_bd_materialproduce e on a.fmaterialid =e.fmaterialid--生产
left join t_bd_materialinvpty f on a.fmaterialid =f.fmaterialid and f.finvptyid ='10001'--库存属性(仓库)
left join t_bd_materialinvpty f1 on a.fmaterialid =f1.fmaterialid and f1.finvptyid ='10002'--库存属性(仓位)
left join t_bd_materialinvpty f2 on a.fmaterialid =f2.fmaterialid and f2.finvptyid ='10003'--库存属性(bom版本)
left join t_bd_materialinvpty f3 on a.fmaterialid =f3.fmaterialid and f3.finvptyid ='10004'--库存属性(批号)
left join t_bd_materialinvpty f4 on a.fmaterialid =f4.fmaterialid and f4.finvptyid ='10006'--库存属性(计划跟踪号)
left join t_bd_materialauxpty g on a.fmaterialid =g.fmaterialid and g.fauxpropertyid ='100001'--辅助属性(规格大小)
left join t_bd_materialauxpty g1 on a.fmaterialid =g1.fmaterialid and g1.fauxpropertyid ='100003'--辅助属性(厂区)
left join t_bd_materialauxpty g2 on a.fmaterialid =g2.fmaterialid and g2.fauxpropertyid ='100004'--辅助属性(供应商)
left join T_SEC_USER h on h.FUSERID =a.fcreatorid--创建人
left join T_SEC_USER i on i.FUSERID =a.fmodifierid--修改人
where 1=1
and a4.fnumber='104'--组织
and a.fforbidstatus='A'--未禁用
--and c1.fname='五金仓库'
and a.fnumber in ('01.002','01.001','1.02.01');






图标赞 91
91人点赞
还没有人点赞,快来当第一个点赞的人吧!
图标打赏
0人打赏
还没有人打赏,快来当第一个打赏的人吧!

您的鼓励与嘉奖将成为创作者们前进的动力,如果觉得本文还不错,可以给予作者创作打赏哦!

请选择打赏金币数 *

10金币20金币30金币40金币50金币60金币
可用金币: 0