客户物料对应表中只体现了客户编码和客户名称,现在需要加一个客户的规格型号,如何操作啊?
是不是要在客户物料对应表加字段同时在客户物料对应表视图加字段 ,再后台改脚本?不知道应该如何修改。
---------------------
https://vip.kingdee.com/questions/367255338447355136/answers/367608053728409088?productLineId=1
https://vip.kingdee.com/article/24954?productLineId=1
https://vip.kingdee.com/article/39473?productLineId=1
https://vip.kingdee.com/article/14480?productLineId=1
-------------------
在“客户物料对应表”单据上加字段后台修改V_SAL_CUSTMATMAPPING视图,关联T_SAL_CUSTMATMAPPINGENTRY上新增的规格型号字段然后在“客户物料对应表视图”基础资料上新增字段,字段名和数据库的视图里新关联的那个字段一致
------------------------------
https://vip.kingdee.com/article/24954参考这个贴子设置好像成功了不知会不会有问题
1、在客户物料对应表单据,以及客户物料对应表视图分别添加了“客户规格”字段 ,字段名为“FCUSTFTOM”,并发布基础资料“客户物料对应表视图”(参考上贴)
2、修改脚本(附件)并执行
3、在单据中(如销售订单)设置“客户物料编码”引用属性“客户规格”
4、在单据中添加基础资料属性,关联客户物料编码的客户规格属性
效果:11、在客户物料对应表填入客户规格
2、订单中即可带出
if exists (select 1
from sysobjects
where id = object_id('V_SAL_CUSTMATMAPPING')
and type = 'V')
drop view V_SAL_CUSTMATMAPPING
go
/*==============================================================*/
/* View: V_SAL_CUSTMATMAPPING */
/*==============================================================*/
CREATE VIEW V_SAL_CUSTMATMAPPING AS
SELECT ((((CONVERT(VARCHAR(80), HEAD.FID) + '&') + CONVERT(VARCHAR(80), ENTRY.FENTRYID)) + '&')
+ CONVERT(VARCHAR(80), HEAD.FUSEORGID)) fid, HEAD.FID fheadfid, ENTRY.FCUSTMATNO fnumber, ENTRY.FAUXPROPID,
HEAD.FSALEORGID fcreateorgid, HEAD.FUSEORGID, FCUSTOMERID, HEAD.FCREATORID, HEAD.FCREATEDATE, HEAD.FMODIFIERID,
HEAD.FMODIFYDATE, 'C' fdocumentstatus, 'A' fforbidstatus, ENTRY.FMATERIALID, ENTRY.FEFFECTIVE,
ENTRY.FCUSTFUOM
FROM T_SAL_CUSTMATMAPPING HEAD INNER JOIN
T_SAL_CUSTMATMAPPINGENTRY ENTRY ON HEAD.FID = ENTRY.FID INNER JOIN
T_BD_MATERIAL M on ENTRY.FMATERIALID=M.FMATERIALID INNER JOIN
T_BD_MATERIAL_L ML on M.FMATERIALID=ML.FMATERIALID
WHERE HEAD.FDOCUMENTSTATUS = 'A'
UNION ALL
SELECT ((((CONVERT(VARCHAR(80), HEAD.FID) + '&') + CONVERT(VARCHAR(80), ENTRY.FENTRYID)) + '&')
+ CONVERT(VARCHAR(80), ISSUE.FISSUEORGID)) fid, HEAD.FID fheadfid, ENTRY.FCUSTMATNO fnumber,
ENTRY.FAUXPROPID, HEAD.FSALEORGID fcreateorgid, ISSUE.FISSUEORGID fuseorgid,
ISNULL(CUSTMASTER.FCUSTID, 0) fcustomerid, HEAD.FCREATORID, HEAD.FCREATEDATE, HEAD.FMODIFIERID,
HEAD.FMODIFYDATE, 'C' fdocumentstatus, 'A' fforbidstatus, MMASTER.FMATERIALID, ENTRY.FEFFECTIVE,
ENTRY.FCUSTFUOM
FROM T_SAL_CUSTMATMAPPING_ISSUE ISSUE INNER JOIN
T_SAL_CUSTMATMAPPING HEAD ON ISSUE.FID = HEAD.FID INNER JOIN
T_SAL_CUSTMATMAPPINGENTRY ENTRY ON HEAD.FID = ENTRY.FID INNER JOIN
T_BD_MATERIAL M ON M.FMATERIALID = ENTRY.FMATERIALID INNER JOIN
T_BD_MATERIAL_L ML on M.FMATERIALID=ML.FMATERIALID INNER JOIN
T_BD_MATERIAL MMASTER ON (MMASTER.FMASTERID = M.FMASTERID AND
(ISSUE.FISSUEORGID = MMASTER.FUSEORGID OR
EXISTS
(SELECT 1
FROM T_META_BASEDATATYPE BT
WHERE (BT.FBASEDATATYPEID = 'BD_MATERIAL' AND BT.FSTRATEGYTYPE = 1)))) INNER JOIN
T_BD_CUSTOMER CUST ON CUST.FCUSTID = HEAD.FCUSTOMERID INNER JOIN
T_BD_CUSTOMER CUSTMASTER ON (CUSTMASTER.FMASTERID = CUST.FMASTERID AND
(ISSUE.FISSUEORGID = CUSTMASTER.FUSEORGID OR
EXISTS
(SELECT 1
FROM T_META_BASEDATATYPE BT
WHERE (BT.FBASEDATATYPEID = 'BD_Customer' AND BT.FSTRATEGYTYPE = 1))))
WHERE (HEAD.FDOCUMENTSTATUS = 'A' AND (HEAD.FCUSTOMERID > 0))
UNION ALL
SELECT ((((CONVERT(VARCHAR(80), HEAD.FID) + '&') + CONVERT(VARCHAR(80), ENTRY.FENTRYID)) + '&')
+ CONVERT(VARCHAR(80), ISSUE.FISSUEORGID)) fid, HEAD.FID fheadfid, ENTRY.FCUSTMATNO fnumber,
ENTRY.FAUXPROPID, HEAD.FSALEORGID fcreateorgid, ISSUE.FISSUEORGID fuseorgid, 0 fcustomerid,
HEAD.FCREATORID, HEAD.FCREATEDATE, HEAD.FMODIFIERID, HEAD.FMODIFYDATE, 'C' fdocumentstatus,
'A' fforbidstatus, MMASTER.FMATERIALID, ENTRY.FEFFECTIVE,
ENTRY.FCUSTFUOM
FROM T_SAL_CUSTMATMAPPING_ISSUE ISSUE INNER JOIN
T_SAL_CUSTMATMAPPING HEAD ON ISSUE.FID = HEAD.FID INNER JOIN
T_SAL_CUSTMATMAPPINGENTRY ENTRY ON HEAD.FID = ENTRY.FID INNER JOIN
T_BD_MATERIAL M ON M.FMATERIALID = ENTRY.FMATERIALID INNER JOIN
T_BD_MATERIAL_L ML on M.FMATERIALID=ML.FMATERIALID INNER JOIN
T_BD_MATERIAL MMASTER ON (MMASTER.FMASTERID = M.FMASTERID AND
(ISSUE.FISSUEORGID = MMASTER.FUSEORGID OR
EXISTS
(SELECT 1
FROM T_META_BASEDATATYPE BT
WHERE (BT.FBASEDATATYPEID = 'BD_MATERIAL' AND BT.FSTRATEGYTYPE = 1))))
WHERE (HEAD.FDOCUMENTSTATUS = 'A' AND HEAD.FCUSTOMERID = 0)
go
推荐本站淘宝优惠价购买喜欢的宝贝:
本文链接:http://hqyman.cn/post/2803.html 非本站原创文章欢迎转载,原创文章需保留本站地址!
休息一下~~
客户物料对应表视图_SQL - .rar(0.91KB)