(一)报关单证保存后的存储过程
- 更新T_modulelist的StorageProductAfterSave值
UPDATE T_ModuleList SET StorageProductAfterSave=‘SaveInvoiceAfter’ where modulename=‘报关单证’
2.创建存储过程
CREATE PROC SaveInvoiceAfter(@InvoiceNum varchar(30))
As
Begin
…写你的逻辑,其中参数@InvoiceNum是单据号
end
(二)出运通知保存后存储过程
1.更新T_modulelist的StorageProductAfterSave值
UPDATE T_ModuleList SET StorageProductAfterSave=‘SaveLetterOfAdviceAfter’ where modulename=‘出运通知’
2.创建存储过程
CREATE PROC SaveLetterOfAdviceAfter(@SerialNum varchar(30))
As
Begin
–写你的逻辑,其中参数@SerialNum是出运通知单据号
Update ufdata_999_2019.dbo.DispatchLists
set ufdata_999_2019.dbo.DispatchLists.cItemCode=T_LetterOfAdviceProduct.cItemCode,
ufdata_999_2019.dbo.DispatchLists.cItemName=T_LetterOfAdviceProduct.cItemName
From T_LetterOfAdviceProduct
Where T_LetterOfAdviceProduct.SerialNum=@SerialNum and T_LetterOfAdviceProduct.isdel=0 and ufdata_999_2019.dbo.DispatchLists.cDefine31=T_LetterOfAdviceProduct.GUID
end
(三)下达生产保存后执行存储过程
1.更新T_modulelist的StorageProductAfterSave值
UPDATE T_ModuleList SET StorageProductAfterSave=‘SaveSCOrderAfter’ where modulename=‘下达生产’
2.创建存储过程
CREATE PROC SaveSCOrderAfter(@PactNum varchar(30))
As
Begin
…写你的逻辑,其中参数@PactNum是单据号,跟mom_order的自定义项10对应
end
(四)议付单证保存后存储过程
利润结算获取外销合同费用
1.打开数据库,选择对应账套,打开存储过程,点击新建存储过程
2.输入以下sql语句
CREATE PROCEDURE [dbo].[SaveInvoiceDOCAfter](@InvoiceNum varchar(30))
As
Begin
if(exists(select * from T_InvoiceDOC where InvoiceNum=@InvoiceNum and isdel=0 and InvoiceDOCComplete=‘已完成’))
begin
delete T_InvoiceDOCInFee WHERE InvoiceNum=@InvoiceNum and isdel=0
insert into T_InvoiceDOCInFee(InvoiceNum,ISDel,SortID,InFeeDesc,Curr,Fee,RMBFee,Remark,RMBRate,GUID,Rate)
select @InvoiceNum,
ISDel,SortID,InFeeDesc,Curr,Fee,RMBFee,Remark,RMBRate,GUID,Rate from T_ExpPactInFee
where ISDel =0 and pactnum in (select exppactnum from T_InvoiceDOCProduct where ISDel=0 and InvoiceNum=@InvoiceNum)
end
end
3.执行该语句
4.新建查询,执行以下语句
UPDATE T_ModuleList SET StorageProductAfterSave=‘SaveInvoiceDocAfter’ where modulename=‘议付单证’