如何将有来源的应收单改为无来源

by limingk 2016.1.8 14:53

注:脚本执行有风险,对于客户正式环境请在研发指导下执行。

上游单据出问题的时候有可能用到将有来源应收单改为无来源的情况,脚本如下

 

declare @docno varchar(255)

declare @OrgCode varchar(255)

declare @ARBillID bigint

set @docno='应收单号'

set @OrgCode='组织编码'

 

 

select @ARBillID=a.ID from AR_ARBillHead a inner join Base_Organization b on a.Org=b.ID where a.DocNo=@docno and b.Code=@OrgCode

 

update AR_ARBillHead set AccrueBy=null,SrcBusinessType=449,SrcBillID=0,SrcBillNum='',SrcTypeTag=0,

SrcType=0 where ID=@ARBillID

 

 

update AR_ARBillLine set SrcDocType=-1,SrcBillLineID=0,SrcBillID=0,SrcBillNum='',SrcBillLineNum='',SrcBillSMLineID=0,

SrcBillSMLineNum=0,SrcBillSOID=0,SrcBillSOLineID=0,SrcBillSOLineNum='',SrcBillSONum='',SrcBillSOPlanID=0,

SrcBillSOPlanNum='',SrcBillShipmentID=0,SrcBillShipmentNum='',SrcDataID=0,SrcDataInstalID=0,SrcDataInstalLineNum='',

SrcDataLineNum='' where ARBillHead =@ARBillID

 

 

update AR_ARInstalment set SrcDataInstalmentID=0,SrcDataInstalmentNum=0 where ARBillHead=@ARBillID

 

 

update AR_ARBillMergeAccrueLine set SrcDocType=-1,SrcBillLineID=0,SrcBillID=0,SrcBillNum='',SrcBillLineNum='',SrcBillSMLineID=0,

SrcBillSMLineNum=0,SrcBillSOID=0,SrcBillSOLineID=0,SrcBillSOLineNum='',SrcBillSONum='',SrcBillSOPlanID=0,

SrcBillSOPlanNum='',SrcBillShipmentID=0,SrcBillShipmentNum='',SrcDataID=0,SrcDataInstalID=0,SrcDataInstalLineNum='',

SrcDataLineNum='' where ARBillHead=@ARBillID

Tags:

评论 (2) -

"offers" 美国 wrote at 2016/2/14 18:33:39 #

You actually make it seem so easy with your presentation but I find this matter to be actually something which I think I would never understand. It seems too complex and very broad for me. I am looking forward for your next post, I'll try to get the hang of it!

Krystle 美国 wrote at 2016/2/26 18:44:56 #

Por ejemplo, entrar a tu cámara y tomar una foto es un proceso sumamente sencillo y eficiente. Muchos celulares ya cuentan con botones físicos de acceso directo ademanes de movimiento (virar el teléfono) para abrir la cámara en un momento, sin tener que buscar ningún ícono en el teléfono.

添加评论



biuquote
微笑得意调皮害羞酷大笑惊讶发呆喜欢可怜尴尬闭嘴噘嘴皱眉伤心抓狂呕吐坏笑漫骂发怒
Loading


RecentComments

评论 RSS

Statistics

989 篇文章
0 个单页
645220 条评论
11 次评分
208792 次访问
访问统计开始于 2019年12月15日
平均日访问 5353 次
当前 103 人在线