生产订单变更单审核提示未正常生成投产数据
问题描述
成本管理系统参数-普通与委外生产投产方式不是按订单下达时投产,导致生产订单变更单审核提示“订单未正常生成投产数据,请在投入产量归集-业务操作-更新投产后再审核”。
原因分析
原因1:普通与委外生产投产方式不是按订单下达时投产,而是按最大/小领料套数投产时,生产订单/委外订单执行至下达不会自动生成【投入产量归集】,需要启用产品成本核算然后在【投入产量归集】点“更新”,有投入产量归集后才能审核生产订单变更单。
投入产量归集中生产订单/委外订单的投入数量有几种计算方式:https://wenku.my7c.com/link/s/ljiyT
原因2:生产订单没有通过按钮操作“执行至下达”,而是直接在数据库改生产订单的“业务状态”为下达,或者放开“业务状态”字段锁定性改为下达,也就是没有触发下达操作所以没有投入产量归集。
解决方法
方法1:
没有启用产品成本核算的情况下,是无法打开【投入产量归集】菜单,需要在数据库执行下方脚本把已下达生产订单的投入产量归集补上(是批量处理脚本,无需修改)。【操作前有疑问提单联系金蝶研发处理】
----------基于最新8.2.0.20240229版本批量插入投入产量归集的SQL脚本,T_CB_INPUTQTYENTRY的字段是最全的。 --表备份 SELECT * INTO T_CB_INPUTQTYENTRYBAK FROM T_CB_INPUTQTYENTRY DECLARE @FENTRYID INT ; --获取内码ID SELECT @FENTRYID=MAX(FENTRYID) FROM T_CB_INPUTQTYENTRY --普通生产 INSERT INTO T_CB_INPUTQTYENTRY(FENTRYID,FSEQ,FID,FPRODUCTTYPE,FDATE,FPRODUCTID,FSRCBILLNAME,FSRCBILLFORMID, FSRCBILLNO,FSRCBILLID,FSRCENTRYID,FSRCSEQ,FPROORDERTYPE,FPROORDERID, FPROORDERSEQ,FPROORDERENTRYID,FPROORDERNO,FBOMID,FUNITID,FQTY, FROWID,FSRCDATATYPE,FPUTTYPE,FPRODUCTDIMEID,FCOSTCENTERID,FLOTNUMBER,FAUXPROPID,FWORKSHOPID,FPARENTROWID,FMTONO,FENTRUSTORGID,FTRUSTEEORGID) SELECT ROW_NUMBER() OVER(ORDER BY T1.FENTRYID ASC)+ @FENTRYID AS FENTRYID,1 AS FSEQ, INPUT.FID,'1' AS FENTRYSEQ,T2.FCONVEYDATE,T1.FMATERIALID,N'普通生产' AS FSRCNAME,'PRD_MO' AS FSRCBILLFORMID, T0.FBILLNO,T0.FID AS FSRCBILLID,T1.FENTRYID AS FSRCENTRYID,T1.FSEQ AS FSRCSEQ,'PO' AS FPROORDERTYPE,'PO@'+CONVERT(NVARCHAR(20), T1.FENTRYID) AS FPROORDERID, T1.FSEQ AS FPROORDERSEQ,T1.FENTRYID AS FPROORDERENTRYID, T0.FBILLNO AS FSRCBILLNO,T1.FBOMID,T1.FBASEUNITID,T1.FBASEUNITQTY, T1.FROWID,'0' AS FSRCTYPE ,'2' AS FPUTTYPE,0 AS FPRODUCTDIMEID,0 AS FCOSTCENTERID,0 AS FLOTNUMBER,0 AS FAUXPROPID,T1.FWORKSHOPID AS FWORKSHOPID,T1.FPARENTROWID AS FPARENTROWID,' 'AS FMTONO, 0 AS FENTRUSTORGID,0 AS FTRUSTEEORGID --SELECT COUNT(*) FROM T_PRD_MO T0 INNER JOIN T_PRD_MOENTRY T1 ON T1.FID=T0.FID INNER JOIN T_PRD_MOENTRY_A T2 ON T2.FENTRYID=T1.FENTRYID INNER JOIN (SELECT FBIZORGID,MIN(FID) AS FID FROM T_CB_INPUTQTY GROUP BY FBIZORGID) INPUT ON INPUT.FBIZORGID=T0.FPRDORGID WHERE NOT EXISTS(SELECT 1 FROM T_CB_INPUTQTYENTRY WHERE FPROORDERTYPE='PO' AND FSRCENTRYID=T1.FENTRYID AND FSRCBILLFORMID='PRD_MO') AND T2.FCONVEYDATE IS NOT NULL --获取内码ID SELECT @FENTRYID=MAX(FENTRYID) FROM T_CB_INPUTQTYENTRY --委托受托委托方 INSERT INTO T_CB_INPUTQTYENTRY(FENTRYID,FSEQ,FID,FPRODUCTTYPE,FDATE,FPRODUCTID,FSRCBILLNAME,FSRCBILLFORMID, FSRCBILLNO,FSRCBILLID,FSRCENTRYID,FSRCSEQ,FPROORDERTYPE,FPROORDERID, FPROORDERSEQ,FPROORDERENTRYID,FPROORDERNO,FBOMID,FUNITID,FQTY, FROWID,FSRCDATATYPE,FPUTTYPE,FPRODUCTDIMEID,FCOSTCENTERID,FLOTNUMBER,FAUXPROPID,FWORKSHOPID,FPARENTROWID,FMTONO,FENTRUSTORGID,FTRUSTEEORGID) SELECT ROW_NUMBER() OVER(ORDER BY T1.FENTRYID ASC)+ @FENTRYID AS FENTRYID,1 AS FSEQ, INPUT.FID,'1' AS FENTRYSEQ,T2.FCONVEYDATE,T1.FMATERIALID,N'普通生产' AS FSRCNAME,'PRD_MO' AS FSRCBILLFORMID, T0.FBILLNO,T0.FID AS FSRCBILLID,T1.FENTRYID AS FSRCENTRYID,T1.FSEQ AS FSRCSEQ,'OUTSRC' AS FPROORDERTYPE,'WTJG@'+CONVERT(NVARCHAR(20), T1.FENTRYID) AS FPROORDERID, T1.FSEQ AS FPROORDERSEQ,T1.FENTRYID AS FPROORDERENTRYID, T0.FBILLNO AS FSRCBILLNO,T1.FBOMID,T1.FBASEUNITID,T1.FBASEUNITQTY, T1.FROWID,'0' AS FSRCTYPE ,'2' AS FPUTTYPE,0 AS FPRODUCTDIMEID,0 AS FCOSTCENTERID,0 AS FLOTNUMBER,0 AS FAUXPROPID,0 AS FWORKSHOPID,T1.FPARENTROWID AS FPARENTROWID,' 'AS FMTONO, T0.FENTRUSTORGID AS FENTRUSTORGID,T0.FPRDORGID AS FTRUSTEEORGID --SELECT COUNT(*) FROM T_PRD_MO T0 INNER JOIN T_PRD_MOENTRY T1 ON T1.FID=T0.FID INNER JOIN T_PRD_MOENTRY_A T2 ON T2.FENTRYID=T1.FENTRYID INNER JOIN (SELECT FBIZORGID,MIN(FID) AS FID FROM T_CB_INPUTQTY GROUP BY FBIZORGID) INPUT ON INPUT.FBIZORGID=T0.FENTRUSTORGID WHERE NOT EXISTS(SELECT 1 FROM T_CB_INPUTQTYENTRY WHERE FPROORDERTYPE='PO' AND FSRCENTRYID=T1.FENTRYID AND FSRCBILLFORMID='PRD_MO') AND T2.FCONVEYDATE IS NOT NULL AND T0.FENTRUSTORGID>0 --获取内码ID SELECT @FENTRYID=MAX(FENTRYID) FROM T_CB_INPUTQTYENTRY --委外生产 INSERT INTO T_CB_INPUTQTYENTRY(FENTRYID,FSEQ,FID,FPRODUCTTYPE,FDATE,FPRODUCTID,FSRCBILLNAME,FSRCBILLFORMID, FSRCBILLNO,FSRCBILLID,FSRCENTRYID,FSRCSEQ,FPROORDERTYPE,FPROORDERID, FPROORDERSEQ,FPROORDERENTRYID,FPROORDERNO,FBOMID,FUNITID,FQTY, FROWID,FSRCDATATYPE,FPUTTYPE,FPRODUCTDIMEID,FCOSTCENTERID,FLOTNUMBER,FAUXPROPID,FWORKSHOPID,FPARENTROWID,FMTONO,FENTRUSTORGID,FTRUSTEEORGID) SELECT ROW_NUMBER() OVER(ORDER BY T1.FENTRYID ASC)+ @FENTRYID AS FENTRYID,1 AS FSEQ, INPUT.FID,'1' AS FENTRYSEQ,T1.FCONVEYDATE,T1.FMATERIALID,N'委外生产' AS FSRCNAME,'SUB_SUBREQORDER' AS FSRCBILLFORMID, T0.FBILLNO,T0.FID AS FSRCBILLID,T1.FENTRYID AS FSRCENTRYID,T1.FSEQ AS FSRCSEQ,'OUTSRC' AS FPROORDERTYPE,'OUTSRC@'+CONVERT(NVARCHAR(20), T1.FENTRYID) AS FPROORDERID, T1.FSEQ AS FPROORDERSEQ,T1.FENTRYID AS FPROORDERENTRYID, T0.FBILLNO AS FSRCBILLNO,T1.FBOMID,T2.FBASEUNITID,T2.FBASEUNITQTY, T1.FROWID,'0' AS FSRCTYPE ,'2' AS FPUTTYPE,0 AS FPRODUCTDIMEID,0 AS FCOSTCENTERID,0 AS FLOTNUMBER,0 AS FAUXPROPID,0 AS FWORKSHOPID,T1.FPARENTROWID AS FPARENTROWID,' 'AS FMTONO, 0 AS FENTRUSTORGID,0 AS FTRUSTEEORGID --SELECT COUNT(*) FROM T_SUB_REQORDER T0 INNER JOIN T_SUB_REQORDERENTRY T1 ON T1.FID=T0.FID INNER JOIN T_SUB_REQORDERENTRY_A T2 ON T2.FENTRYID=T1.FENTRYID INNER JOIN (SELECT FBIZORGID,MIN(FID) AS FID FROM T_CB_INPUTQTY GROUP BY FBIZORGID) INPUT ON INPUT.FBIZORGID=T0.FSUBORGID WHERE NOT EXISTS(SELECT 1 FROM T_CB_INPUTQTYENTRY WHERE FPROORDERTYPE='OUTSRC' AND FSRCENTRYID=T1.FENTRYID AND FSRCBILLFORMID='SUB_SUBREQORDER') AND T1.FCONVEYDATE IS NOT NULL --修复种子表 DECLARE @COUNT INT ; SELECT @COUNT = MAX(FENTRYID) + 1 FROM T_CB_INPUTQTYENTRY; BEGIN DBCC CHECKIDENT ('Z_CB_INPUTQTYENTRY',RESEED,@COUNT); END
方法2:
启用产品成本核算的情况下,生产订单的下达日期在哪年哪月,在【投入产量归集】查询对应年期然后点“更新投产(全部)”或“更新投产(差量)”。
启用产品成本核算的情况下,也可以用方法1。
生产订单变更单审核提示未正常生成投产数据
问题描述成本管理系统参数-普通与委外生产投产方式不是按订单下达时投产,导致生产订单变更单审核提示“订单未正常生成投产数据,请在投入...
点击下载文档
本文2024-09-16 18:53:32发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-25057.html
您需要登录后才可以发表评论, 登录登录 或者 注册
最新文档
热门文章