求帮修改下推单据的sql语句,把案例改了一半不会改了

栏目:k3wise知识作者:金蝶来源:金蝶云社区发布:2024-09-16浏览:1

求帮修改下推单据的sql语句,把案例改了一半不会改了

求做新建下推时所用的表的意思和列的含义
下面是我改样品申请单下推销售出库时里面的表
我要改成交货通知单 下推外购入库单 下面表 和里面列的意思不明白,也就不知道该怎么改了
请大神解答一下,或者能帮我注释一下 那一行做的是什么操作,该怎么改 谢谢啦
ICWriteBackTemplate
ICTableRelation
ICSelBills
ICClassWorkFlowJoin
ICClassWorkFlowBill
ICClassWorkFlow
ICClassLink
CRM_SampleReq 样品申请
CRM_SampleReqEntry 样品申请表体
ICMaxNum

下面是改了一半的代码

[list=1]
[*]

/******************************************************************************
[*] * DESCRIPTION: 样品申请单下推销售出库 *
[*] 要改成交货通知单下推外购入库单
[*]* BY: jun_qiu *
[*] * DATE: 2012-05-23 (由补丁PT064629同步而来) *
[*] ******************************************************************************/
[*]/****** Object:Data 选单关联:ICClassLink Script Date: 2012-05-23 ******/

--外购入库单是1 所以FDestClassTypeID写-1 交货通知单是1007351
[*]Delete ICClassLink WHERE FDestClassTypeID = -1 AND FSourClassTypeID = 1007351
[*]GO
[*]--CRM_SampleReqEntry 样品申请单表体 改成交货通知单表体 ICDeliveryNoticeEntry
[*]INSERT INTO ICClassLink(FSourClassTypeID,FDestClassTypeID,FSourBillShowIndex,FAllowCopy,FAllowCheck,FAllowForceCheck,FFlowControl,FDeCondition,FCondition,FDeHCondition,FDeBCondition,FSourBillFID,FSourBillFEntryID,FSourBillFBillNo,FObjectName,FObjectType,FObjectID,FIsUsed,FUsePage,FDefaultPage,FSRCIDKey,FSRCEntryIDKey,FSRCBillNoKey,FSRCClassIDKey,FISUserDefine,FDestTranTypeID,FSourTranTypeID,FSelectListID,FMustSelected,FSystemReserved,FROB,FFieldName,FRemark,FUseSpec,FSrcDestPage,FSrcPage,FToRed,FSourTypeID,FDestTypeID,FLookUpConditionUp,FLookUpConditionDown,FDefault,FUnControl)
[*]VALUES (1007351,-1,0,0,0,0,0,'','CRM_SampleReq.FCheckStatus=1 AND CRM_SampleReq.FCancellation=0 AND CRM_SampleReqEntry.FEntryID IS NOT NULL AND CRM_SampleReqEntry.FItemID>0 ','','','FID','FEntryID2','FBillNo','',0,0,2,',1,2,',',1,2,','FSourceInterId','FSourceEntryID','FSourceBillNo','FSourceTranType',1,1,1007351,1007351,0,0,3,'1007351','',-1,0,0,0,0,0,'','',1,6)
[*]GO
[*]/****** Object:Data 选单流程基本信息:ICClassWorkFlow Script Date: 2012-05-23 ******/
[*]DECLARE @MaxID AS INT
[*]SELECT @MaxID = ISNUll(Max(FID),10000) FROM ICClassWorkFlow
[*]
[*]DELETE ICClassWorkFlow WHERE ISNULL(FName_CHS,'')=N'交货通知单-外购入库单'
[*]INSERT INTO ICClassWorkFlow(FID,FName_CHS,FName_CHT,FName_EN,FSubSysID)
[*]VALUES (@MaxID + 1,N'交货通知单-外购入库单',N'交货通知单-外购入库单',N'ICDeliveryNotice-Purchase Receipt ',251)
[*]
[*]UPDATE ICMaxNum SET FMaxNum = @MaxID + 2 WHERE FTableName = 'ICClassWorkFlow'
[*]
[*]DELETE ICClassWorkFlowBill WHERE FID = @MaxID AND (FClassTypeID = -1 OR FClassTypeID = 1007351)
[*]DELETE ICClassWorkFlowBill WHERE FID = @MaxID + 1 AND (FClassTypeID = -1 OR FClassTypeID = 1007351)
[*]INSERT INTO ICClassWorkFlowBill(FID,FClassTypeID,FTop,FLeft,FWidth,FHeight,FTypeID)
[*]VALUES(@MaxID + 1,-1,2460,5160,2500,2000,0)
[*]
[*]INSERT INTO ICClassWorkFlowBill(FID,FClassTypeID,FTop,FLeft,FWidth,FHeight,FTypeID)
[*]VALUES(@MaxID + 1,1007351,2330,2200,2500,2000,0)
[*]
[*]DELETE ICClassWorkFlowJoin WHERE FSourClasstypeID = 1007351 AND FDestClassTypeID = -1
[*]INSERT INTO ICClassWorkFlowJoin(FID,FSourClasstypeID,FDestClassTypeID,FSourTypeID,FDestTypeID)
[*]VALUES(@MaxID + 1,1007351,-1,0,0)
[*]GO
[*]
[*]/****** Object:Data 选单模板:ICSelBills、ICTableRelation Script Date: 2012-05-23 ******/
[*]DELETE ICSelBills WHERE FFieldName = '1007351' AND FID = 'A01'
[*]GO
[*]
[*]INSERT INTO ICSelBills(FID,FFieldName,FDstCtlField,FSelType,FDK,FColName,FName,FTableName,FTableAlias,FAction,FROB,FAllowEdited)
[*]VALUES('A01','1007351','',-200,-1,'FInterID','FID','CRM_SampleReq','CRM_SampleReq','',0,0)
[*]GO
[*]
[*]INSERT INTO ICSelBills(FID,FFieldName,FDstCtlField,FSelType,FDK,FColName,FName,FTableName,FTableAlias,FAction,FROB,FAllowEdited)
[*]VALUES('A01','1007351',' ',-100,-1,'FEntryID','FEntryID','CRM_SampleReqEntry','CRM_SampleReqEntry','',0,0)
[*]GO
[*]
[*]INSERT INTO ICSelBills(FID,FFieldName,FDstCtlField,FSelType,FDK,FColName,FName,FTableName,FTableAlias,FAction,FROB,FAllowEdited)
[*]VALUES('A01','1007351','',-1,-1,'FBillNO','FBillNO','CRM_SampleReq','CRM_SampleReq','',0,0)
[*]GO
[*]
[*]INSERT INTO ICSelBills(FID,FFieldName,FDstCtlField,FSelType,FDK,FColName,FName,FTableName,FTableAlias,FAction,FROB,FAllowEdited)
[*]VALUES('A01','1007351','',-1,-1,'FPriceDecimal','FPriceDecimal','t_ICItem','t_4','',0,0)
[*]GO
[*]
[*]INSERT INTO ICSelBills(FID,FFieldName,FDstCtlField,FSelType,FDK,FColName,FName,FTableName,FTableAlias,FAction,FROB,FAllowEdited)
[*]VALUES('A01','1007351','',-1,-1,'FQtyDecimal','FQtyDecimal','t_ICItem','t_4','',0,0)
[*]GO
[*]
[*]INSERT INTO ICSelBills(FID,FFieldName,FDstCtlField,FSelType,FDK,FColName,FName,FTableName,FTableAlias,FAction,FROB,FAllowEdited)
[*]VALUES('A01','1007351','',-1,-1,'FTrack','FTrack','t_ICItem','t_4','',0,0)
[*]GO
[*]
[*]INSERT INTO ICSelBills(FID,FFieldName,FDstCtlField,FSelType,FDK,FColName,FName,FTableName,FTableAlias,FAction,FROB,FAllowEdited)
[*]VALUES ('A01','1007351','FSourceBillNo',0,0,'FSourceBillNo','FBillNo','CRM_SampleReq','CRM_SampleReq','',0,0)
[*]GO
[*]
[*]INSERT INTO ICSelBills(FID,FFieldName,FDstCtlField,FSelType,FDK,FColName,FName,FTableName,FTableAlias,FAction,FROB,FAllowEdited)
[*]VALUES ('A01','1007351','FSourceEntryID',0,0,'FSourceEntryID','FEntryID','CRM_SampleReqEntry','CRM_SampleReqEntry','',0,0)
[*]GO
[*]
[*]INSERT INTO ICSelBills(FID,FFieldName,FDstCtlField,FSelType,FDK,FColName,FName,FTableName,FTableAlias,FAction,FROB,FAllowEdited)
[*]VALUES ('A01','1007351','FSourceInterId',0,0,'FSourceInterId','FID','CRM_SampleReq','CRM_SampleReq','',0,0)
[*]GO
[*]
[*]INSERT INTO ICSelBills(FID,FFieldName,FDstCtlField,FSelType,FDK,FColName,FName,FTableName,FTableAlias,FAction,FROB,FAllowEdited)
[*]VALUES ('A01','1007351','FSourceTranType',0,0,'FSourceTranType','FClassTypeID','CRM_SampleReq','CRM_SampleReq','',0,0)
[*]GO
[*]
[*]INSERT INTO ICSelBills(FID,FFieldName,FDstCtlField,FSelType,FDK,FColName,FName,FTableName,FTableAlias,FAction,FROB,FAllowEdited)
[*]VALUES('A01','1007351','FSupplyID',1,0,'FCustomerID','FCustomerID','CRM_SampleReq','CRM_SampleReq','',0,0)
[*]GO
[*]
[*]INSERT INTO ICSelBills(FID,FFieldName,FDstCtlField,FSelType,FDK,FColName,FName,FTableName,FTableAlias,FAction,FROB,FAllowEdited)
[*]VALUES('A01','1007351','FSupplyID',2,0,'FCustomerID','FCustomerID','CRM_SampleReq','CRM_SampleReq','',0,0)
[*]GO
[*]
[*]INSERT INTO ICSelBills(FID,FFieldName,FDstCtlField,FSelType,FDK,FColName,FName,FTableName,FTableAlias,FAction,FROB,FAllowEdited)
[*]VALUES('A01','1007351','FSupplyID',2,1,'FCustName','FName','t_organization','t_2','',0,0)
[*]GO
[*]
[*]INSERT INTO ICSelBills(FID,FFieldName,FDstCtlField,FSelType,FDK,FColName,FName,FTableName,FTableAlias,FAction,FROB,FAllowEdited)
[*]VALUES('A01','1007351','FSupplyID',2,2,'FCustNumber','FNumber','t_organization','t_2','',0,0)
[*]GO
[*]
[*]INSERT INTO ICSelBills(FID,FFieldName,FDstCtlField,FSelType,FDK,FColName,FName,FTableName,FTableAlias,FAction,FROB,FAllowEdited)
[*]VALUES('A01','1007351','FDeptID',2,0,'FApplyDeptID','FApplyDeptID','CRM_SampleReq','CRM_SampleReq','',0,0)
[*]GO
[*]
[*]INSERT INTO ICSelBills(FID,FFieldName,FDstCtlField,FSelType,FDK,FColName,FName,FTableName,FTableAlias,FAction,FROB,FAllowEdited)
[*]VALUES('A01','1007351','FDeptID',2,1,'FDeptIDName','FName','t_Department','t_3','',0,0)
[*]GO
[*]
[*]INSERT INTO ICSelBills(FID,FFieldName,FDstCtlField,FSelType,FDK,FColName,FName,FTableName,FTableAlias,FAction,FROB,FAllowEdited)
[*]VALUES('A01','1007351','FDeptID',2,2,'FDeptIDNumber','FNumber','t_Department','t_3','',0,0)
[*]GO
[*]
[*]INSERT INTO ICSelBills(FID,FFieldName,FDstCtlField,FSelType,FDK,FColName,FName,FTableName,FTableAlias,FAction,FROB,FAllowEdited)
[*]VALUES('A01','1007351','FEmpID',2,0,'FReqestID','FReqestID','CRM_SampleReq','CRM_SampleReq','',0,0)
[*]GO
[*]
[*]INSERT INTO ICSelBills(FID,FFieldName,FDstCtlField,FSelType,FDK,FColName,FName,FTableName,FTableAlias,FAction,FROB,FAllowEdited)
[*]VALUES('A01','1007351','FEmpID',2,1,'FEmpIDName','FName','t_Emp','t_5','',0,0)
[*]GO
[*]
[*]INSERT INTO ICSelBills(FID,FFieldName,FDstCtlField,FSelType,FDK,FColName,FName,FTableName,FTableAlias,FAction,FROB,FAllowEdited)
[*]VALUES('A01','1007351','FEmpID',2,2,'FEmpIDNumber','FNumber','t_Emp','t_5','',0,0)
[*]GO
[*]
[*]INSERT INTO ICSelBills(FID,FFieldName,FDstCtlField,FSelType,FDK,FColName,FName,FTableName,FTableAlias,FAction,FROB,FAllowEdited)
[*]VALUES('A01','1007351','FItemID',0,2,'FItemID','FItemID','CRM_SampleReqEntry','CRM_SampleReqEntry','',0,0)
[*]GO
[*]
[*]INSERT INTO ICSelBills(FID,FFieldName,FDstCtlField,FSelType,FDK,FColName,FName,FTableName,FTableAlias,FAction,FROB,FAllowEdited)
[*]VALUES('A01','1007351','FItemID',0,1,'FItemIDName','FNumber','t_ICItem','t_4','',0,0)
[*]GO
[*]
[*]INSERT INTO ICSelBills(FID,FFieldName,FDstCtlField,FSelType,FDK,FColName,FName,FTableName,FTableAlias,FAction,FROB,FAllowEdited)
[*]VALUES('A01','1007351','FItemID',0,2,'FItemIDNumber','FNumber','t_ICItem','t_4','',0,0)
[*]GO
[*]
[*]INSERT INTO ICSelBills(FID,FFieldName,FDstCtlField,FSelType,FDK,FColName,FName,FTableName,FTableAlias,FAction,FROB,FAllowEdited)
[*]VALUES('A01','1007351','FItemModel',0,0,'FItemModel','FModel','t_ICItem','t_4','',0,0)
[*]GO
[*]
[*]INSERT INTO ICSelBills(FID,FFieldName,FDstCtlField,FSelType,FDK,FColName,FName,FTableName,FTableAlias,FAction,FROB,FAllowEdited)
[*]VALUES('A01','1007351','FItemName',0,0,'FItemName','FName','t_ICItem','t_4','',0,0)
[*]GO
[*]
[*]INSERT INTO ICSelBills(FID,FFieldName,FDstCtlField,FSelType,FDK,FColName,FName,FTableName,FTableAlias,FAction,FROB,FAllowEdited)
[*]VALUES('A01','1007351','FUnitID',0,0,'FUnitID','FUnitID','CRM_SampleReqEntry','CRM_SampleReqEntry','',0,0)
[*]GO
[*]
[*]INSERT INTO ICSelBills(FID,FFieldName,FDstCtlField,FSelType,FDK,FColName,FName,FTableName,FTableAlias,FAction,FROB,FAllowEdited)
[*]VALUES('A01','1007351','FUnitID',0,1,'FUnitName','FName','t_MeasureUnit','m_1','',0,0)
[*]GO
[*]
[*]INSERT INTO ICSelBills(FID,FFieldName,FDstCtlField,FSelType,FDK,FColName,FName,FTableName,FTableAlias,FAction,FROB,FAllowEdited)
[*]VALUES('A01','1007351','FUnitID',0,2,'FUnitNumber','FNumber','t_MeasureUnit','m_1','',0,0)
[*]GO
[*]
[*]INSERT INTO ICSelBills(FID,FFieldName,FDstCtlField,FSelType,FDK,FColName,FName,FTableName,FTableAlias,FAction,FROB,FAllowEdited)
[*]VALUES('A01','1007351','Fauxqty',0,0,'FQty','FQty','CRM_SampleReqEntry','CRM_SampleReqEntry','(CASE WHEN (CRM_SampleReqEntry.FQty - ISNULL(CRM_SampleReqEntry.FDeliveryQty, 0))<0 THEN 0 ELSE (CRM_SampleReqEntry.FQty - ISNULL(CRM_SampleReqEntry.FDeliveryQty, 0)) END)',1,0)
[*]GO
[*]
[*]INSERT INTO ICSelBills(FID,FFieldName,FDstCtlField,FSelType,FDK,FColName,FName,FTableName,FTableAlias,FAction,FROB,FAllowEdited)
[*]VALUES('A01','1007351','Fauxqty',0,0,'FQty','FQty','CRM_SampleReqEntry','CRM_SampleReqEntry','(CASE WHEN ISNULL(CRM_SampleReqEntry.FDeliveryQty, 0) <0 THEN 0 ELSE ISNULL(CRM_SampleReqEntry.FDeliveryQty, 0) END)',-1,0)
[*]GO
[*]
[*]INSERT INTO ICSelBills(FID,FFieldName,FDstCtlField,FSelType,FDK,FColName,FName,FTableName,FTableAlias,FAction,FROB,FAllowEdited)
[*]VALUES('A01','1007351','Fauxprice',0,0,'FPrice','FPrice','CRM_SampleReqEntry','CRM_SampleReqEntry','',0,0)
[*]GO
[*]
[*]INSERT INTO ICSelBills(FID,FFieldName,FDstCtlField,FSelType,FDK,FColName,FName,FTableName,FTableAlias,FAction,FROB,FAllowEdited)
[*]VALUES('A01','1007351','Fnote',0,0,'FSampleNote','FSampleNote','CRM_SampleReqEntry','CRM_SampleReqEntry','',0,0)
[*]GO
[*]
[*]INSERT INTO ICSelBills(FID,FFieldName,FDstCtlField,FSelType,FDK,FColName,FName,FTableName,FTableAlias,FAction,FROB,FAllowEdited)
[*]VALUES('A01','1007351','Fuse',2,0,'FSamplePurpose','FSamplePurpose','CRM_SampleReq','CRM_SampleReq','',0,0)
[*]GO
[*]
[*]INSERT INTO ICSelBills(FID,FFieldName,FDstCtlField,FSelType,FDK,FColName,FName,FTableName,FTableAlias,FAction,FROB,FAllowEdited)
[*]VALUES('A01','1007351','Fuse',2,1,'FSamplePurpose','FSamplePurpose','CRM_SampleReq','CRM_SampleReq','',0,0)
[*]GO
[*]
[*]INSERT INTO ICSelBills(FID,FFieldName,FDstCtlField,FSelType,FDK,FColName,FName,FTableName,FTableAlias,FAction,FROB,FAllowEdited)
[*]VALUES('A01','1007351','Fuse',2,2,'FSamplePurpose','FSamplePurpose','CRM_SampleReq','CRM_SampleReq','',0,0)
[*]GO
[*]
[*]DELETE ICTableRelation WHERE FFieldID = '1007351' AND FBillID = 'A01'
[*]GO
[*]
[*]INSERT INTO ICTableRelation(FTypeID,FInterID,FTableName,FTableNameAlias,FFieldName,FTableName11,FTableNameAlias11,FFieldName11,FLogic,FBillID,FFieldID,FMode,FIndex,FCondition,FLeftParentheses,FRightParentheses,FLogicOperator,FISConst,FConstType,FSubFilter)
[*]VALUES(0,1,'CRM_SampleReq','CRM_SampleReq','FID','CRM_SampleReqEntry','CRM_SampleReqEntry','FID','=','A01','1007351',0,0,'','','','=',0,0,'')
[*]GO
[*]
[*]INSERT INTO ICTableRelation(FTypeID,FInterID,FTableName,FTableNameAlias,FFieldName,FTableName11,FTableNameAlias11,FFieldName11,FLogic,FBillID,FFieldID,FMode,FIndex,FCondition,FLeftParentheses,FRightParentheses,FLogicOperator,FISConst,FConstType,FSubFilter)
[*]VALUES(0,2,'CRM_SampleReq','CRM_SampleReq','FCustomerID','t_organization','t_2','FItemID','*=','A01','1007351',0,0,'','','','=',0,0,'')
[*]GO
[*]
[*]INSERT INTO ICTableRelation(FTypeID,FInterID,FTableName,FTableNameAlias,FFieldName,FTableName11,FTableNameAlias11,FFieldName11,FLogic,FBillID,FFieldID,FMode,FIndex,FCondition,FLeftParentheses,FRightParentheses,FLogicOperator,FISConst,FConstType,FSubFilter)
[*]VALUES(0,3,'CRM_SampleReq','CRM_SampleReq','FApplyDeptID','t_Department','t_3','FItemID','*=','A01','1007351',0,0,'','','','=',0,0,'')
[*]GO
[*]
[*]INSERT INTO ICTableRelation(FTypeID,FInterID,FTableName,FTableNameAlias,FFieldName,FTableName11,FTableNameAlias11,FFieldName11,FLogic,FBillID,FFieldID,FMode,FIndex,FCondition,FLeftParentheses,FRightParentheses,FLogicOperator,FISConst,FConstType,FSubFilter)
[*]VALUES(0,4,'CRM_SampleReq','CRM_SampleReq','FReqestID','t_Emp','t_5','FItemID','*=','A01','1007351',0,0,'','','','=',0,0,'')
[*]GO
[*]
[*]INSERT INTO ICTableRelation(FTypeID,FInterID,FTableName,FTableNameAlias,FFieldName,FTableName11,FTableNameAlias11,FFieldName11,FLogic,FBillID,FFieldID,FMode,FIndex,FCondition,FLeftParentheses,FRightParentheses,FLogicOperator,FISConst,FConstType,FSubFilter)
[*]VALUES(0,5,'CRM_SampleReqEntry','CRM_SampleReqEntry','FItemID','t_ICItem','t_4','FItemID','*=','A01','1007351',0,0,'','','','=',0,0,'')
[*]GO
[*]
[*]INSERT INTO ICTableRelation(FTypeID,FInterID,FTableName,FTableNameAlias,FFieldName,FTableName11,FTableNameAlias11,FFieldName11,FLogic,FBillID,FFieldID,FMode,FIndex,FCondition,FLeftParentheses,FRightParentheses,FLogicOperator,FISConst,FConstType,FSubFilter)
[*]VALUES(0,6,'CRM_SampleReqEntry','CRM_SampleReqEntry','FUnitID','t_MeasureUnit','m_1','FMeasureUnitID','*=','A01','1007351',0,0,'','','','=',0,0,'')
[*]GO
[*]
[*]DELETE ICWriteBackTemplate WHERE FSrcTranType=1007351 AND FDestTranType=1
[*]GO
[*]--CRM_SampleReqEntry 样品申请单表体 改成交货通知单表体 ICDeliveryNoticeEntry
[*]INSERT INTO ICWriteBackTemplate(FSrcTranType,FDestTranType,FExecuteIndex,FSrcField,FSrcCommitField,FSrcAuxCommitField,FSrcUnitIDField,FDestField,FSrcBillKey,FSrcEntryKey,FDestBillKey,FDestEntryKey,FSrcKeyWord,FDestKeyWord,FOperator,FUpdateStatusField,FSourceInterIDField,FSourceEntryIDField,FOutInvokeClass,FSrcEntryTable,FSaveCheckAction)
[*]VALUES(1007351,1,10,'[Entry].FBaseQty','FBaseDeliveryQty','FDeliveryQty','FUnitID','[Entry].Fqty','FID','FEntryID','FInterID','FEntryID','FItemID','FItemID','+','','FSourceInterID','FSourceEntryID','','CRM_SampleReqEntry','SVSQTYCONTROL')
[*]GO


[/list]
[i]复制代码[/i]


有这方面的详细说明了吗?遇到同样问题
交货通知单可以自动生成收料通知单,然后通过收料通知单下推入库单。
后台改很复杂,涉及到很多单据的关联关系以及字段的映射关系,建议直接在BOS设计单据转换流程。

求帮修改下推单据的sql语句,把案例改了一半不会改了

求做新建下推时所用的表的意思和列的含义 下面是我改样品申请单下推销售出库时里面的表 我要改成交货通知单 下推外购入库单 下面表 ...
点击下载文档
标签: # K/3 WISE-BOS
分享:
确认删除?
回到顶部
客服QQ
  • 客服QQ点击这里给我发消息