网上订单和销售模块的订单是两个相互独立的模块,虽然都可以互相转化,系统也仅仅是转换了部分字段以及功能,如果想要更多字段,比如自定义字段转化的话,最简单的方法就是在数据库中些触发器,下面是本人写的销售订单上自定义字段,然后销售订单转物流发货的时候,吧该字段同步到网上订单,可以拿来参考下,希望可以帮到您。
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
— =============================================
— Author: <Author,,王**>
— Create date: <Create Date,20220626,>
— Description: <Description,,销售订单转物流发货时,需要把所属网店同步到网上订单>
— =============================================
create TRIGGER UpdateWangdian
ON [dbo].[IC_Web2ERPOrders]
for INSERT,UPDATE
AS
BEGIN
declare @webshopid varchar(50)
IF EXISTS (select COUNT(*) from inserted where FWebshopID=’localERP_Order’)
begin
update c set c.FWebshopID =b.f_103
from SEOrder a inner join t_Item_10001 b on a.FHeadSelfS0193=b.FItemID
left join IC_Web2ERPOrders c on a.FBillNo=c.FOrderID
left join IC_WebshopToStorage d on c. FWebshopID=d. FWebshopID
where c.FID in (select fid from inserted)
end
SET NOCOUNT ON;
END
GO