本文主要是介绍K3 采购订单选单时,换供应商的问题,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
采购部门有这样一种操作,如果是有A供应商的申请单过来,需要从B供应商处购买,由于物料较多,先做一张订单,然后在这张订单上去增加,进行选单操作,但选单出的申请单数据,都是B供应商的申请单,而不是A供应商的数据。
跟踪语句出语句如下
Select top 100000 t15.FName,v1.FTranType as FTranType,v1.FInterID as FInterID,u1.FEntryID as FEntryID,u1.Fauxqty as Fauxqty,t11.FQtyDecimal as FQtyDecimal,t11.FPriceDecimal as FPriceDecimal,u1.FSecCommitQty as FSecCommitQty,u1.FSecQty as FSecQty from POrequest v1
INNER JOIN POrequestEntry u1 ON v1.FInterID = u1.FInterID AND u1.FInterID <>0 LEFT OUTER JOIN t_Department t4 ON v1.FDeptID = t4.FItemID AND t4.FItemID <>0 LEFT OUTER JOIN ICMO t5 ON v1.FSCBillInterID = t5.FInterID AND t5.FInterID <>0 LEFT OUTER JOIN t_Submessage t17 ON v1.FMRP = t17.FInterID AND t17.FInterID <>0 LEFT OUTER JOIN t_Emp t8 ON v1.FRequesterID = t8.FItemID AND t8.FItemID <>0 INNER JOIN t_ICItem t11 ON u1.FItemID = t11.FItemID AND t11.FItemID <>0 INNER JOIN t_MeasureUnit t14 ON u1.FUnitID = t14.FItemID AND t14.FItemID <>0 LEFT OUTER JOIN t_Supplier t15 ON u1.FSupplyID = t15.FItemID AND t15.FItemID <>0 LEFT OUTER JOIN t_MeasureUnit t16 ON t11.FUnitID = t16.FMeasureUnitID AND t16.FMeasureUnitID <>0 LEFT OUTER JOIN t_MeasureUnit t500 ON t11.FOrderUnitID = t500.FItemID AND t500.FItemID <>0 LEFT OUTER JOIN t_MeasureUnit t502 ON t11.FSecUnitID = t502.FItemID AND t502.FItemID <>0 LEFT OUTER JOIN t_Submessage t103 ON v1.FBizType = t103.FInterID AND t103.FInterID<>0 LEFT OUTER JOIN v_ICPlanCategoryEntry t9521 ON v1.FPlanCategory = t9521.FID AND t9521.FID<>0 where 1=1 AND (
ISNULL(t15.FName,'') LIKE '%顺%'
)AND (( (u1.FSupplyID=208873 OR ISNULL(u1.FSupplyID,0)=0) and (v1.FStatus IN (1, 2) AND u1.FQty>u1.FCommitQty AND u1.FMrpClosed=0 AND v1.FBizType = 12510)) AND ((v1.FCheckerID>0)))
其中条件有“ (u1.FSupplyID=208873 OR ISNULL(u1.FSupplyID,0)=0)”,这个就是供应商的代码条件
经过查询和分析,认为其应该来自于选单关联表ICSelbills
在https://www.cnblogs.com/caipanlong123/p/11065784.html
中FSELTYPE=1的这样的描述
FSelType:目标字段的类型;0表示单据分录字段,2表示单据头字段,1表示该目标字段的当前值将会作为选单序时簿的过滤条件;
于是
delete ICSelbills where FFieldName='FRequestInterID' and FDstCtlField='FSupplyID' and FSelType=1
并做好备份
--INSERT INTO ICSelbills (FID, FFieldName, FDstCtlField, FSelType, FDK, FColName, FName, FTableName, FTableAlias, FAction, FROB, FAllowEdited)
--VALUES('P02','FRequestInterID','FSupplyID',1,1,'','FSupplyID','PORequestEntry','u1','',0,0)
再操作时
可见“ (u1.FSupplyID=208873 OR ISNULL(u1.FSupplyID,0)=0)”的供应商条件已经没有了。
在程序中选单也能过滤出任务供应商的申请单了。
另外后面的和一个条件来自于ICClassLink
这篇关于K3 采购订单选单时,换供应商的问题的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!