利用各行业的计算公式节税
2016-4-19 0:0:0 wondial利用各行业的计算公式节税
利用各行业的计算公式节税一、制造业节税计算公式
应纳税所得额=产品销售利润十其他业务利润十营业外收入-营业外支出
根据该计算公式,从产品销售利润到营业外支出,透明度愈来愈低,因此节税的基本思路是:尽可能将产品销售利润转为其他业务利润,尽可能将其他业务利润转为营业外收入,其好处是降低收入的明度,为避税提供方便。产品销售利润的计算公式是:
产品销售利润=产品销售净额-产品销售成本-产品销售税金-(销售费用十管理费用十财务费用)
产品销售净额=产品销售总额-(销售退回十销货折扣)
产品销售成本=本期产品成本十期初产品盘存-期末产品盘存
本期产品成本=本期生产成本十期初半成品、在产品盘存-期末半成品、在产品盘存
本期生产成本=本期生产费用的直接材料十直接工资十制造费用
二、商业节税计算公式
应纳税所得额=销货利润十其他业务利润十营业外收入-营业外支出
销货利润=销货净额-销货成本-销货税金-(销货费用十管理费用十财务费用)
销货净额=销货总额-(销货退回十销货折让)
销货成本=期初商品盘存十[本期进货-(进货退出十进货折让)十进货费用]-期末商品盘存
三、服务业的节税计算公式
应纳税所得额=业务收入净额十营业外收入-营业外支出
业务收入净额=业务收入总额-(业务收入税金十业务支出十管理费用十财务费用)
四、其他行业可参照以上公式计算
五、节税特别要注意的事项
1.依照上面所列的公式计算应纳税所得额,企业应首先根据税法和有关规定,确定成本与费用的开支范围,选择适合于本企业的成本计算方法和费用分配方法。
2.一般来说,凡是与生产经营有关的支出,都应计入企业的成本、费用。工业企业从产品制造开始至产品完成中间所发生的一切支出,除了直接材料与直接工资经计成本以外,其余应列为制造费用,待产品部分完成或全部完成,再摊入生产成本;
3.从产品销售开始至售出为止,在此期间所发生的支出(包括仓储费用、运送费用、营业费用以及广告费用)应列为销售费用。企业管理部门所发生的一切费用(包括财务、会计、总务、文书等人员工资、办公费等)应列为管理费用。
4,销售费用和管理费用不计入产品的生产成本。而应列为当期费用,单独核算。
商业企业的销货成本为进货原价加进货费用(如运费、保险费等),销售费用和管理费不计入销货成本而作为当期费用,单独核算。
5.计算公式中所列“营业外收入”,是指企业在其营业范围以外所发生的收入(如工业企业在银行存款或借出款项的利息收入;盘存盈余和出售资产盈余等);所列“营业外支出”是指企业在其营业范围以外所发生的支出(如盘存亏损、意外损失等)。因为都不是直接因营业而发生的收入或支出,也可以称为非营业收入和非营业支出。所列“财务费用”是指筹借营业资金所发生的利息支出等。
如果您的问题还没有解决,可以到 T+搜索>>上找一下答案
相关阅读
- 用友U8材料采购科目借贷发生不平有余额是什么原因详解2021-10-9 9:57:49
- 用友ERP-U8成本管理模块培训2019-5-13 12:8:25
- invalid object name 'tempdb..temp-accvouch70554a1232019-4-23 8:0:0
- 实时错误‘404’:automation错误2019-4-23 8:0:0
- 对于用友软件进行SQL跟踪器时,应注意什么问题?能写个步骤吗?2019-4-23 8:0:0
- 我们企业成本精细核算,需要针对每一件存货的每一次出入库进行记账, u8 能够支持吗2019-4-23 8:0:0
- 明细账打印预览死机2019-4-23 8:0:0
- 进UFO时总提示“MFC42.DLL中导致无效页错误就关闭退出2019-4-23 8:0:0
- 连接不上服务器故障分析2019-4-23 8:0:0
- 下标越界,用友软件年结后查询货位票未能统计表报错2019-4-23 8:0:0
最新信息
![在建工程暂估入账按账面价值入账,但后期陆续的支付工程款,这时该怎样做账? _0](https://www.kuaiji66.com/u8/zb_users/plugin/MiniTu/noimg.png)
在建工程暂估入账按账面价值入账,但后期陆续的支付工程款,这时该怎样做账? _0在建工程暂估入账按账面价值入账,但后期陆续的支付工程款,这时该怎样做账? 在建工程6月份已达到试运行状态,未峻工验收,按账面价值暂估入账,(假如,一个设备总价是200万,只支付了130万,开具130万发票,这时是按130万暂估,还是按200万暂估?)如按130万暂估,7月份按暂估的价值计提折旧,但7月份又支付一笔未支付完的设备的价款,8月份也有支付未支付完的价款,这时,7月份、8月份支付未支付完的设备价款要调整暂估入账吗?那要怎样做账? 还有建设管理费等摊销投资是暂估时就摊销吗?那摊销后,重新入账的设备还用在重新比例摊销吗? 如果按照130万元暂估,之后取得发票调整固定资产的入账价值,不调整已经计提的折旧
![在做销货单时报错,已打了最新补丁1460967993GTx6,并且更改了电脑系统日期格式,可是还不行,怎么解决?](http://sto.chanapp.chanjet.com/4a47ecad-3fcd-422b-879b-b2df91606e00/img/2016/04/18/1460975264Benv.png)
在做销货单时报错,已打了最新补丁1460967993GTx6,并且更改了电脑系统日期格式,可是还不行,怎么解决? 在做销货单时报错,已打了最新补丁1460967993GTx6,并且更改了电脑系统日期格式,可是还不行,怎么解决?
换个帐套也这样吗。@畅捷服务_韦小锋:是的,换了浏览器也如此,并且浏览器改设置都设置了需要修改注册表。在服务社区搜下,有修改注册表的方法@畅捷服务_韦小锋:你能把链接发给我吗?我没找到,非常感谢!A、可以在注册表中HKEY_USERS\S-1-5-20\Control Panel\International 位置下的sShortDate的值改为 yyyy/M/d 。操作前对注册表做好备份,以免操作失误。
B.开始-运行中输入regedit ,修改注册表 ,去除这两个位置的特殊字符 ,并且使键一致(可参照正常机器修改,或者直接更换操作系统)
1.HKEY_CURRENT_USER\Control Panel\International下的“sShortDate” 'sDate' 中的格式
2.HKEY_USER\.Default\Control Panel\International下的“sShortDate” 'sDate' 中的格式@畅捷服务_韦小锋:刚才试了试,问题已解决,非常感谢!
![与银行的服务器是如何连接的](https://www.kuaiji66.com/u8/zb_users/plugin/MiniTu/noimg.png)
对应产品线:财务系统
对应模块:网上银行模块
问题现象:与银行的服务器是连接的只有客户的ID,没有口令,产品的安全性怎么保证,另外银行处理支付单的时候写哪几张表的什么字段。
问题原因:网络安全性保障问题。
解决方案:一、网络安全性保障问题由银行负责,目前尚未出现网络被侵入的现象。另外如银行提供因为有签名端口+用户ID,所以安全性应该是有保证的。二、NB_payment网上银行支付单中的bPayed字段是是否已经支付的标志。
![用友U8 填制凭证摘要时,提示“实时错误5,AUTOMATIME”](https://www.kuaiji66.com/u8/zb_users/plugin/MiniTu/noimg.png)
用友U8 填制凭证摘要时,提示“实时错误5,AUTOMATIME”用友U8 填制凭证摘要时,提示“实时错误5,AUTOMATIME”
问题原因:系统设置问题 解决方法:进入控制面板的区域设置,修改常规下的区域位置,将“美国”改为“中文中国”,再将时间格式“YYYY-MM-DD”即可。
![用友U8软件零售单过账提示数据不正确资产负债表不平](https://www.kuaiji66.com/u8/zb_users/plugin/MiniTu/noimg.png)
用友U8软件零售单过账提示数据不正确资产负债表不平零售单过账提示数据不正确资产负债表不平
零售单过账提示数据不正确资产负债表不平原因分析: 当软件计算金额与电子称打印金额不一致时,就会出现“数据不正确,资产负债表不平”的提示。例如:商品的电子秤识别码为1200011011106,单价为后5位,11106,金额代表11.106,输入该商品后,用11.106除以该商品的单价35.00反算数量,最后在该商品行会显示一个合计金额11.10000010,这个合计金额不等于11.106,过账就会发生错误。问题解答: 先备份数据,再在查询分析器中执行如下脚本。set ANSI_NULLS ONset QUOTED_IDENTIFIER ONgoALTER PROCEDURE [dbo].[P_SetMoneyList] @Bill_ID int, @Bill_ID_Old int, @BillType int AS declare @Act_ID int, @Act_Money numeric(28,10), @Card_Money numeric(28,10), @YH_Money numeric(28,10), @PCMoney numeric(28,10) declare @CostMoney numeric(28,10), @DisMoney numeric(28,10), @DisMoney0 numeric(28,10), @TaxMoney numeric(28,10), @TaxMoney0 numeric(28,10), @CostMoney_1 numeric(28,10), @DisMoney_1 numeric(28,10), @TaxMoney_1 numeric(28,10), @TaxMoney0_1 numeric(28,10) declare @CostMoney_1_out numeric(28,10), @DisMoney_1_out numeric(28,10), @TaxMoney_1_out numeric(28,10), @TaxMoney0_1_out numeric(28,10), @CostMoney_2_in numeric(28,10), @DisMoney_2_in numeric(28,10), @TaxMoney_2_in numeric(28,10), @TaxMoney0_2_in numeric(28,10) declare @PD_Money numeric(28,10), @LS_Money_DJJ numeric(28,10), @LS_Money_Other_Tmp numeric(28,10), @LS_Money_DJJ_Tmp numeric(28,10), @Tmp_Money numeric(28,10) declare @Unit_ID_List int, @Act_ID_List int, @Act_Money_List numeric(28,10), @Act_Money_List1 numeric(28,10), @Act_Money_List_Tot numeric(28,10), @Act_Money_List1_Tot numeric(28,10) declare @s_Syb int, @BillDate varchar(10) , @BillSN varchar(100), @Unit_ID int, @User_ID int, @Audit_ID int, @Oper_ID int, @Period int declare @ActFullID_ZZ varchar(30), @Money_JF numeric(28,10), @Money_DF numeric(28,10), @Tmp_ZC numeric(28,10), @Tmp_FZ numeric(28,10), @Tmp_QY numeric(28,10) declare @JSMoney numeric(28,10), @Writejsbill int, @TmpWLBill_ID varchar(50), @TmpQLBill_ID int, @BillType_QL int, @YSDate varchar(20), @YU_Money numeric(28,10), @YU_Money_JS numeric(28,10), @YU_Money_JS_List numeric(28,10),@RecPayDate varchar(10) declare @OrderId int, @YUS_YUF_Money numeric(28,10),@YUS_YUF_Money_List numeric(28,10)declare @BillID_O int, @OrderId_O int, @NotMoney_O numeric(28,10), @CurrMoney_O numeric(28,10), @SelMoney_O numeric(28,10), @VIP_SwapIntegralM numeric(28,10) declare @Money_XS int declare @Thirdpayment int, @ThirdPaymentMoney numeric(28,10), @ItemBillNo varchar(30), @SumShippingMoney numeric(28,10), @SumShippingMoney_List_P numeric(28,10), @SumShippingMoney_List_Z numeric(28,10), @SRUnit int, @SRAcount_ID int, @SRAcount_Money numeric(28,10), @SRJSMoney numeric(28,10) declare @ysyf_id int,@BackMoney numeric(28,10),@order_id int,@BackYsyfMoney numeric(28,10) set nocount on if @BillType>=0 and @BillType<=300 begin select @s_Syb=s_Syb, @BillDate=BillDate, @BillSN=BillSN, @Unit_ID=isnull(Unit_ID,-1), @User_ID=Emp_ID, @Audit_ID=Audit_ID, @Oper_ID=Oper_ID, @Period=Period, @Act_ID=Act_ID, @Act_Money=case when Act_ID>1 then isnull(Act_Money,0) else 0 end, @Card_Money=isnull(Card_Money,0), @YH_Money=isnull(YH_Money,0), @PCMoney=abs(isnull(PCMoney,0)),@PD_Money=isnull(SumTaxMoney,0), @YUS_YUF_Money=isnull(YUS_YUF_Money,0),@VIP_SwapIntegralM=isnull(VIP_SwapIntegralM,0) ,@Thirdpayment=isnull(Thirdpayment,0), @ThirdPaymentMoney=isnull(ThirdPaymentMoney,0),@ItemBillNo=ItemBillNo,@SumShippingMoney=isnull(SumShippingMoney,0), @SRUnit=isnull(SRUnit,-1),@SRAcount_ID=isnull(SRAcount_ID,-1),@SRAcount_Money=isnull(SRAcount_Money,0), @SRJSMoney=isnull(SRJSMoney,0) from MasterBill where AutoID=@Bill_ID end if @BillType in (1,4,14,15,16,51,52,53,54,59) begin if @billtype in (59)begin select @PD_Money=sum(costmoney) from dbo.ListProdCheck where Bill_ID=@Bill_ID endelse if @BillType in (1,4,15,16) begin select @CostMoney=Isnull(Sum((CostMoney)),0), @DisMoney =Isnull(Sum((DisMoney)),0), @TaxMoney =Isnull(Sum((TaxMoney)),0), @TaxMoney0=Isnull(Sum((TaxMoney0)),0) from ListSale where Bill_ID=@Bill_ID and ZS_Syb=0 select @CostMoney_1=Isnull(Sum((CostMoney)),0), @DisMoney_1 =Isnull(Sum((DisMoney)),0), @TaxMoney_1 =Isnull(Sum((TaxMoney)),0), @TaxMoney0_1=Isnull(Sum((TaxMoney0)),0) from ListSale where Bill_ID=@Bill_ID and ZS_Syb=1 end else if @BillType=14 begin select @CostMoney=Isnull(Sum((CostMoney)),0), @DisMoney =Isnull(Sum((DisMoney)),0), @TaxMoney =Isnull(Sum((TaxMoney)),0), @TaxMoney0=Isnull(Sum((TaxMoney0)),0) from ListSale where Bill_ID=@Bill_ID and InorOut=1 and ZS_Syb=0 select @CostMoney_1_out=Isnull(Sum((CostMoney)),0), @DisMoney_1_out =Isnull(Sum((DisMoney)),0), @TaxMoney_1_out =Isnull(Sum((TaxMoney)),0), @TaxMoney0_1_out=Isnull(Sum((TaxMoney0)),0) from ListSale where Bill_ID=@Bill_ID and InorOut=1 and ZS_Syb=1 select @CostMoney_1=Isnull(Sum((CostMoney)),0), @DisMoney_1 =Isnull(Sum((DisMoney)),0), @TaxMoney_1 =Isnull(Sum((TaxMoney)),0), @TaxMoney0_1=Isnull(Sum((TaxMoney0)),0) from ListSale where Bill_ID=@Bill_ID and InorOut=2 and ZS_Syb=0 select @CostMoney_2_in=Isnull(Sum((CostMoney)),0), @DisMoney_2_in =Isnull(Sum((DisMoney)),0), @TaxMoney_2_in =Isnull(Sum((TaxMoney)),0), @TaxMoney0_2_in=Isnull(Sum((TaxMoney0)),0) from ListSale where Bill_ID=@Bill_ID and InorOut=2 and ZS_Syb=1 end else if @BillType=53 begin select @CostMoney=Isnull(Sum((CostMoney)),0), @DisMoney =Isnull(Sum((DisMoney)),0), @TaxMoney =Isnull(Sum((TaxMoney)),0), @TaxMoney0=Isnull(Sum((TaxMoney0)),0) from ListSale where Bill_ID=@Bill_ID and ZS_Syb=0 select @CostMoney_1=Isnull(Sum((CostMoney)),0), @DisMoney_1 =Isnull(Sum((DisMoney)),0), @TaxMoney_1 =Isnull(Sum((TaxMoney)),0), @TaxMoney0_1=Isnull(Sum((TaxMoney0)),0) from ListSale where Bill_ID=@Bill_ID and ZS_Syb=1 end else begin select @CostMoney=Isnull(Sum((CostMoney)),0), @DisMoney =Isnull(Sum((DisMoney)),0), @TaxMoney =Isnull(Sum((TaxMoney)),0), @TaxMoney0=Isnull(Sum((TaxMoney0)),0) from ListSale where Bill_ID=@Bill_ID end end else if @BillType in (0,3,55,56,57,58,61) begin if @BillType in (0,3) begin select @CostMoney=Isnull(Sum((CostMoney)),0), @DisMoney =Isnull(Sum((DisMoney)),0),@SumShippingMoney_List_P=isnull(sum(ShippingMoney),0), @TaxMoney =Isnull(Sum((TaxMoney)),0), @TaxMoney0 =Isnull(Sum((TaxMoney0)),0) from ListBuy where Bill_ID=@Bill_ID and ZS_Syb=0 select @CostMoney_1=Isnull(Sum((CostMoney)),0), @DisMoney_1 =Isnull(Sum((DisMoney)),0),@SumShippingMoney_List_Z=isnull(sum(ShippingMoney),0), @TaxMoney_1 =Isnull(Sum((TaxMoney)),0), @TaxMoney0_1 =Isnull(Sum((TaxMoney0)),0) from ListBuy where Bill_ID=@Bill_ID and ZS_Syb=1 end else if @BillType=61 begin select @CostMoney=Isnull(Sum((CostMoney)),0), @DisMoney=Isnull(Sum((DisMoney)),0), @TaxMoney=Isnull(Sum((TaxMoney)),0), @TaxMoney0=Isnull(Sum((TaxMoney0)),0) from ListBuy where Bill_ID=@Bill_ID and InorOut=1 and ZS_Syb=0 select @CostMoney_1_out=Isnull(Sum((CostMoney)),0), @DisMoney_1_out=Isnull(Sum((DisMoney)),0), @TaxMoney_1_out=Isnull(Sum((TaxMoney)),0), @TaxMoney0_1_out=Isnull(Sum((TaxMoney0)),0) from ListBuy where Bill_ID=@Bill_ID and InorOut=1 and ZS_Syb=1 select @CostMoney_1=Isnull(Sum(CostMoney),0), @DisMoney_1=Isnull(Sum((DisMoney)),0), @TaxMoney_1=Isnull(Sum((TaxMoney)),0), @TaxMoney0_1=Isnull(Sum((TaxMoney0)),0) from ListBuy where Bill_ID=@Bill_ID and InorOut=2 and ZS_Syb=0 select @CostMoney_2_in=Isnull(Sum(CostMoney),0), @DisMoney_2_in=Isnull(Sum((DisMoney)),0), @TaxMoney_2_in=Isnull(Sum((TaxMoney)),0), @TaxMoney0_2_in=Isnull(Sum((TaxMoney0)),0) from ListBuy where Bill_ID=@Bill_ID and InorOut=2 and ZS_Syb=1 end else begin select @CostMoney=Isnull(Sum((CostMoney)),0), @DisMoney=Isnull(Sum((DisMoney)),0), @TaxMoney=Isnull(Sum(TaxMoney),0), @TaxMoney0=Isnull(Sum((TaxMoney0)),0) from ListBuy where Bill_ID=@Bill_ID end end else if @BillType in (2,7,8,9,10,11,12,13,17,18,242,243,244,245,251,252) begin if @BillType=13 begin select @CostMoney=Isnull(Sum((CostMoney)),0), @DisMoney =Isnull(Sum((DisMoney)),0) from ListOther where Bill_ID=@Bill_ID and InorOut=1 select @CostMoney_1=Isnull(Sum((CostMoney)),0),@DisMoney_1 =Isnull(Sum((DisMoney)),0) from ListOther where Bill_ID=@Bill_ID and InorOut=2 end else if @BillType=251 begin select @DisMoney0=Isnull(Sum((DisMoney0)),0), @TaxMoney0 =Isnull(Sum((TaxMoney0)),0),@CostMoney=isnull(sum(Isnull((DisMoney0),0)-Isnull((TaxMoney0),0)),0) from ListOther where Bill_ID=@Bill_ID end else if @BillType=252 begin select @DisMoney0=Isnull(Sum((DisMoney0)),0), @TaxMoney0 =Isnull(Sum((TaxMoney0)),0),@CostMoney=isnull(sum(Isnull((DisMoney0),0)-Isnull((TaxMoney0),0)),0) from ListOther where Bill_ID=@Bill_ID end else begin select @CostMoney=Isnull(Sum((CostMoney)),0),@DisMoney =Isnull(Sum((DisMoney)),0) from ListOther where Bill_ID=@Bill_ID end end if (@BillType >=0 and @BillType<=59) or (@BillType>=242 and @BillType<=245) or (@BillType=61) or (@BillType=251) or (@BillType=252) begin if @s_Syb<>0 and @Bill_ID_Old<>-100 and @BillType=251 begin Declare Cur_Red Cursor Local Scroll for SELECT BillDate, BillSN, BillType, Unit_ID, User_ID, Audit_ID,Oper_ID, Period,Act_ID, -Act_Money FROM MoneyList where Bill_ID=@Bill_ID_Old and Act_ID not in(3,100) Open Cur_Red Fetch next from Cur_Red into @BillDate,@BillSN,@BillType,@Unit_ID,@User_ID,@Audit_ID,@Oper_ID,@Period,@Act_ID,@Act_Money while @@Fetch_Status=0 begin insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) select @s_Syb,@BillDate,@Bill_ID,@BillSN,@BillType,@Unit_ID,@User_ID,@Audit_ID,@Oper_ID,@Period,@Act_ID,@Act_Money if @@error<>0 goto Error Fetch next from Cur_Red into @BillDate,@BillSN,@BillType,@Unit_ID,@User_ID,@Audit_ID,@Oper_ID,@Period,@Act_ID,@Act_Money end Close Cur_Red deallocate Cur_Red if @CostMoney<>0 begin if @CostMoney>0 set @Tmp_Money=-abs(@CostMoney) if @CostMoney<0 set @Tmp_Money=abs(@CostMoney) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,3,@Tmp_Money) if @@error<>0 goto Error end if @TaxMoney0<>0 begin insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,100,@TaxMoney0) if @@error<>0 goto Error end update MoneyList set s_Syb=-2 where Bill_ID=@Bill_ID_Old and @Bill_ID_Old<>-100 and s_Syb=0 if @@error<>0 goto Error goto Success end if @BillType=251 and @s_Syb=0 begin if @DisMoney0>0 begin if @Act_Money<=@DisMoney0 begin set @Tmp_Money=abs(@Act_Money) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,@Act_ID,@Tmp_Money) if @@error<>0 goto Error if @Act_Money<@DisMoney0 begin set @Tmp_Money=-abs(@DisMoney0-@Act_Money) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,19,@Tmp_Money) if @@error<>0 goto Error end end if @Act_Money>@DisMoney0 begin set @Tmp_Money=abs(@Act_Money) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,@Act_ID,@Tmp_Money) if @@error<>0 goto Error if @Act_Money>@DisMoney0 begin set @Tmp_Money=abs(@DisMoney0-@Act_Money) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,19,@Tmp_Money) if @@error<>0 goto Error end end end if @DisMoney0<=0 begin if @Act_Money>0 begin set @Tmp_Money=abs(@Act_Money) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,@Act_ID,@Tmp_Money) if @@error<>0 goto Error end if abs(abs(@DisMoney0)+abs(@Act_Money))>0 begin set @Tmp_Money=abs(abs(@DisMoney0)+abs(@Act_Money)) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,19,@Tmp_Money) if @@error<>0 goto Error end end if @CostMoney<>0 begin if @CostMoney>0 set @Tmp_Money=-abs(@CostMoney) if @CostMoney<0 set @Tmp_Money=abs(@CostMoney) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,3,@Tmp_Money) if @@error<>0 goto Error end if @TaxMoney0<>0 begin insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,100,@TaxMoney0) if @@error<>0 goto Error end goto Success end if @BillType=252 and @s_Syb=0 begin if @DisMoney0>0 begin if @Act_Money<=@DisMoney0 begin set @Tmp_Money=-abs(@Act_Money) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,@Act_ID,@Tmp_Money) if @@error<>0 goto Error if @Act_Money<@DisMoney0 begin set @Tmp_Money=-abs(@DisMoney0-@Act_Money) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,11,@Tmp_Money) if @@error<>0 goto Error end end if @Act_Money>@DisMoney0 begin set @Tmp_Money=-abs(@Act_Money) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,@Act_ID,@Tmp_Money) if @@error<>0 goto Error if @Act_Money>@DisMoney0 begin set @Tmp_Money=abs(@DisMoney0-@Act_Money) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,11,@Tmp_Money) if @@error<>0 goto Error end end end if @DisMoney0<=0 begin if @Act_Money>0 begin set @Tmp_Money=-abs(@Act_Money) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,@Act_ID,@Tmp_Money) if @@error<>0 goto Error end if abs(abs(@DisMoney0)+abs(@Act_Money))>0 begin set @Tmp_Money=abs(abs(@DisMoney0)+abs(@Act_Money)) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,11,@Tmp_Money) if @@error<>0 goto Error end end if @TaxMoney0<>0 begin insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,101,@TaxMoney0) if @@error<>0 goto Error end goto Success end if @BillType=1 and @s_Syb=0 begin if @YH_Money<>0 begin insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,48,@YH_Money) if @@error<>0 goto Error end if @Act_Money<>0 begin insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,@Act_ID,@Act_Money) if @@error<>0 goto Error end if @YUS_YUF_Money<>0 begin set @Tmp_Money=-@YUS_YUF_Money insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,57,@Tmp_Money) if @@error<>0 goto Error end if @VIP_SwapIntegralM<>0 begin insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,54,@VIP_SwapIntegralM) if @@error<>0 goto Error end if @Card_Money<>0 begin set @Tmp_Money=-abs(@Card_Money) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,52,@Tmp_Money) if @@error<>0 goto Error end if @CostMoney<>0 begin set @Tmp_Money=-abs(@CostMoney) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,3,@Tmp_Money) if @@error<>0 goto Error set @CostMoney=abs(@CostMoney) end if abs(@TaxMoney)-abs(@TaxMoney0)<>0 Begin set @Tmp_Money=abs(@TaxMoney)-abs(@TaxMoney0) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,24,@Tmp_Money) if @@error<>0 goto Error end if @CostMoney<>0 begin insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,40,@CostMoney) if @@error<>0 goto Error end if @TaxMoney0<>0 begin insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,21,@TaxMoney0) if @@error<>0 goto Error end if isnull(@Thirdpayment,0)>0 and isnull(@ThirdPaymentMoney,0)>0 Begin set @Tmp_Money=@ThirdPaymentMoney insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID, @BillSN,@BillType, @Thirdpayment, @User_ID,@Audit_ID,@Oper_ID,@Period, 11,@Tmp_Money) if @@error<>0 goto Error end if abs(@TaxMoney)-(abs(@Act_Money)+@YH_Money+@Card_Money+@YUS_YUF_Money+@VIP_SwapIntegralM+@ThirdPaymentMoney)>0 Begin set @Tmp_Money=abs(@TaxMoney)-abs(@Act_Money)-@YH_Money-@Card_Money-@YUS_YUF_Money-@VIP_SwapIntegralM-@ThirdPaymentMoney insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, 11,@Tmp_Money) if @@error<>0 goto Error end if abs(@TaxMoney)-(abs(@Act_Money)+@YH_Money+@Card_Money+@YUS_YUF_Money+@VIP_SwapIntegralM+@ThirdPaymentMoney)<0 Begin set @Tmp_Money=-(abs(@TaxMoney)-abs(@Act_Money)-@YH_Money-@Card_Money-@YUS_YUF_Money-@VIP_SwapIntegralM-@ThirdPaymentMoney) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,19,@Tmp_Money) if @@error<>0 goto Error end if @CostMoney_1<>0 begin insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,43,@CostMoney_1) if @@error<>0 goto Error end if @CostMoney_1<>0 begin set @CostMoney_1=-abs(@CostMoney_1) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,3,@CostMoney_1) if @@error<>0 goto Error set @CostMoney_1=abs(@CostMoney_1) end goto Success end if @BillType=4 and @s_Syb=0 begin if @YH_Money<>0 begin set @Tmp_Money=-@YH_Money insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,48,@Tmp_Money) if @@error<>0 goto Error end if @Act_Money<>0 begin set @Act_Money=-abs(@Act_Money) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,@Act_ID,@Act_Money) if @@error<>0 goto Error set @Act_Money=abs(@Act_Money) end if @VIP_SwapIntegralM<>0 begin set @Tmp_Money=-@VIP_SwapIntegralM insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,54,@Tmp_Money) if @@error<>0 goto Error end if @Card_Money<>0 begin set @Tmp_Money=@Card_Money insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,52,@Tmp_Money) if @@error<>0 goto Error end if @CostMoney<>0 begin insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,3,@CostMoney) if @@error<>0 goto Error end if abs(@TaxMoney)-abs(@TaxMoney0)<>0 Begin set @Tmp_Money=-(abs(@TaxMoney)-abs(@TaxMoney0)) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,24,@Tmp_Money) if @@error<>0 goto Error end if @CostMoney<>0 begin set @CostMoney=-abs(@CostMoney) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @Bill, Date, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,40,@CostMoney) if @@error<>0 goto Error set @CostMoney=abs(@CostMoney) end if @TaxMoney0<>0 begin set @TaxMoney0=-Abs(@TaxMoney0) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,21,@TaxMoney0) if @@error<>0 goto Error set @TaxMoney0=Abs(@TaxMoney0) end if abs(@TaxMoney)-(abs(@Act_Money)+abs(@VIP_SwapIntegralM)+@Card_Money+@YH_Money)>0 Begin set @Tmp_Money=abs(@TaxMoney)-abs(@Act_Money)-abs(@VIP_SwapIntegralM)-@Card_Money-@YH_Money insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,19,@Tmp_Money) if @@error<>0 goto Error end if abs(@TaxMoney)-(abs(@Act_Money)+abs(@VIP_SwapIntegralM)+@YH_Money+@Card_Money)<0 Begin set @Tmp_Money=-(abs(@TaxMoney)-abs(@Act_Money)-abs(@VIP_SwapIntegralM)-@YH_Money-@Card_Money) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, 11,@Tmp_Money) if @@error<>0 goto Error end if @CostMoney_1<>0 begin set @Tmp_Money=-@CostMoney_1 insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,43,@Tmp_Money) if @@error<>0 goto Error end if @CostMoney_1<>0 begin set @Tmp_Money=@CostMoney_1 insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,3,@Tmp_Money) if @@error<>0 goto Error end goto Success end if @BillType=14 and @s_Syb=0 begin if @YH_Money<>0 begin insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,48,@YH_Money) if @@error<>0 goto Error end if @Act_Money<>0 begin insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,@Act_ID,@Act_Money) if @@error<>0 goto Error end if @CostMoney_1-@CostMoney<>0 begin set @Tmp_Money=@CostMoney_1-@CostMoney insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,3,@Tmp_Money) if @@error<>0 goto Error end if @CostMoney-@CostMoney_1<>0 begin set @Tmp_Money=@CostMoney-@CostMoney_1 insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,40,@Tmp_Money) if @@error<>0 goto Error end if abs(@DisMoney)-abs(@DisMoney_1)<>0 Begin set @Tmp_Money=abs(@DisMoney)-abs(@DisMoney_1) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,24,@Tmp_Money) if @@error<>0 goto Error end if @TaxMoney0-@TaxMoney0_1<>0 begin set @Tmp_Money=@TaxMoney0-@TaxMoney0_1 insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,21,@Tmp_Money) if @@error<>0 goto Error end if (abs(@TaxMoney)-abs(@TaxMoney_1))-(@Act_Money+@YH_Money)>0 Begin set @Tmp_Money=(abs(@TaxMoney)-abs(@TaxMoney_1))-(@Act_Money+@YH_Money) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, 11,@Tmp_Money) if @@error<>0 goto Error end if (abs(@TaxMoney)-abs(@TaxMoney_1))-(@Act_Money+@YH_Money)<0 Begin set @Tmp_Money=-((abs(@TaxMoney)-abs(@TaxMoney_1))-(@Act_Money+@YH_Money)) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,19,@Tmp_Money) if @@error<>0 goto Error end if @CostMoney_1_out<>0 begin set @Tmp_Money=@CostMoney_1_out insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,43,@Tmp_Money) if @@error<>0 goto Error end if @CostMoney_1_out<>0 begin set @Tmp_Money=-@CostMoney_1_out insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,3,@Tmp_Money) if @@error<>0 goto Error end if @CostMoney_2_in<>0 begin set @Tmp_Money=-@CostMoney_2_in insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,43,@Tmp_Money) if @@error<>0 goto Error end if @CostMoney_2_in<>0 begin set @Tmp_Money=@CostMoney_2_in insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,3,@Tmp_Money) if @@error<>0 goto Error end goto Success end if @BillType=0 and @s_Syb=0 begin if @YH_Money<>0 begin set @Tmp_Money=-@YH_Money insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,48,@Tmp_Money) if @@error<>0 goto Error end if @YUS_YUF_Money<>0 begin set @Tmp_Money=-@YUS_YUF_Money insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,56,@Tmp_Money) if @@error<>0 goto Error end if @Act_Money<>0 begin set @Tmp_Money=-@Act_Money insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,@Act_ID,@Tmp_Money) if @@error<>0 goto Error end if @CostMoney<>0 begin set @CostMoney=abs(@CostMoney) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,3,@CostMoney) if @@error<>0 goto Error set @CostMoney=abs(@CostMoney) end if @TaxMoney0<>0 begin set @TaxMoney0=-Abs(@TaxMoney0) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,21,@TaxMoney0) if @@error<>0 goto Error set @TaxMoney0=Abs(@TaxMoney0) end if abs(@TaxMoney)-(abs(@Act_Money)+@YH_Money+@YUS_YUF_Money)>0 Begin set @Tmp_Money=abs(@TaxMoney)-abs(@Act_Money)-@YH_Money-@YUS_YUF_Money insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, 19,@Tmp_Money) if @@error<>0 goto Error end if abs(@TaxMoney)-(abs(@Act_Money)+@YH_Money+@YUS_YUF_Money)<0 Begin set @Tmp_Money=-(abs(@TaxMoney)-abs(@Act_Money)-@YH_Money-@YUS_YUF_Money) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,11,@Tmp_Money) if @@error<>0 goto Error end if @CostMoney_1-@SumShippingMoney_List_Z<>0 begin set @Tmp_Money=@CostMoney_1-@SumShippingMoney_List_Z insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,27,@Tmp_Money) if @@error<>0 goto Error end if @CostMoney_1<>0 begin insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,3,@CostMoney_1) if @@error<>0 goto Error end if @SRAcount_ID>0 and @SRAcount_Money>0 begin set @Tmp_Money=-@SRAcount_Money insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,@SRAcount_ID,@Tmp_Money) if @@error<>0 goto Error end if @SumShippingMoney-@SRAcount_Money>0 Begin set @Tmp_Money=@SumShippingMoney-@SRAcount_Money insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID, @BillSN,@BillType, @SRUnit, @User_ID,@Audit_ID,@Oper_ID,@Period, 19,@Tmp_Money) if @@error<>0 goto Error end goto Success end if @BillType=3 and @s_Syb=0 begin if @YH_Money<>0 begin insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,48,@YH_Money) if @@error<>0 goto Error end if @Act_Money<>0 begin insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,@Act_ID,@Act_Money) if @@error<>0 goto Error end if @CostMoney<>0 begin set @CostMoney=-abs(@CostMoney) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,3,@CostMoney) if @@error<>0 goto Error set @CostMoney=abs(@CostMoney) end if abs(@TaxMoney)-abs(@CostMoney)-abs(@TaxMoney0)<>0 Begin set @Tmp_Money=abs(@TaxMoney)-abs(@CostMoney)-abs(@TaxMoney0) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,29,@Tmp_Money) if @@error<>0 goto Error end if @TaxMoney0<>0 begin insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,21,@TaxMoney0) if @@error<>0 goto Error end if abs(@TaxMoney)-(abs(@Act_Money)+@YH_Money)>0 Begin set @Tmp_Money=abs(@TaxMoney)-abs(@Act_Money)-@YH_Money insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, 11,@Tmp_Money) if @@error<>0 goto Error end if abs(@TaxMoney)-(abs(@Act_Money)+@YH_Money)<0 Begin set @Tmp_Money=-(abs(@TaxMoney)-abs(@Act_Money)-@YH_Money) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,19,@Tmp_Money) if @@error<>0 goto Error end if @CostMoney_1<>0 begin set @Tmp_Money=-@CostMoney_1 insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,27,@Tmp_Money) if @@error<>0 goto Error end if @CostMoney_1<>0 begin set @Tmp_Money=-@CostMoney_1 insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,3,@Tmp_Money) if @@error<>0 goto Error end goto Success end if @BillType=61 and @s_Syb=0 begin if @YH_Money<>0 begin set @Tmp_Money=-@YH_Money insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,48,@Tmp_Money) if @@error<>0 goto Error end if @Act_Money<>0 begin set @Tmp_Money=-(@Act_Money) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,@Act_ID,@Tmp_Money) if @@error<>0 goto Error end if @CostMoney_1-@CostMoney<>0 begin set @Tmp_Money=@CostMoney_1-@CostMoney insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,3,@Tmp_Money) if @@error<>0 goto Error end if abs(@TaxMoney)-abs(@CostMoney)-abs(@TaxMoney0)<>0 Begin set @Tmp_Money=abs(@TaxMoney)-abs(@CostMoney)-abs(@TaxMoney0) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,29,@Tmp_Money) if @@error<>0 goto Error end if @TaxMoney0_1-@TaxMoney0<>0 begin set @Tmp_Money=-(@TaxMoney0_1-@TaxMoney0) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,21,@Tmp_Money) if @@error<>0 goto Error end if (@TaxMoney_1-@TaxMoney)-(@Act_Money+@YH_Money)>0 Begin set @Tmp_Money=(@TaxMoney_1-@TaxMoney)-@Act_Money-@YH_Money insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, 19,@Tmp_Money) if @@error<>0 goto Error end if (@TaxMoney_1-@TaxMoney)-(@Act_Money+@YH_Money)<0 Begin set @Tmp_Money=-((@TaxMoney_1-@TaxMoney)-@Act_Money-@YH_Money) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,11,@Tmp_Money) if @@error<>0 goto Error end if @CostMoney_1_out<>0 begin set @Tmp_Money=-@CostMoney_1_out insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,27,@Tmp_Money) if @@error<>0 goto Error end if @CostMoney_1_out<>0 begin set @Tmp_Money=-@CostMoney_1_out insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,3,@Tmp_Money) if @@error<>0 goto Error end if @CostMoney_2_in<>0 begin set @Tmp_Money=@CostMoney_2_in insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,27,@Tmp_Money) if @@error<>0 goto Error end if @CostMoney_2_in<>0 begin set @Tmp_Money=@CostMoney_2_in insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,3,@Tmp_Money) if @@error<>0 goto Error end goto Success end if @BillType=55 and @s_Syb=0 begin if @CostMoney<>0 begin insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,3,@CostMoney) if @@error<>0 goto Error end if @CostMoney<>0 begin insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,22,@CostMoney) if @@error<>0 goto Error end goto Success end if @BillType=56 and @s_Syb=0 begin if @CostMoney<>0 begin set @CostMoney=-abs(@CostMoney) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,3,@CostMoney) if @@error<>0 goto Error set @CostMoney=abs(@CostMoney) end if @DisMoney<>0 begin set @Tmp_Money=-@DisMoney insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,22,@Tmp_Money) if @@error<>0 goto Error end if @CostMoney-@DisMoney<>0 begin set @Tmp_Money=@CostMoney-@DisMoney insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,40,@Tmp_Money) if @@error<>0 goto Error end goto Success end if @BillType=57 and @s_Syb=0 begin if @Act_Money<>0 begin set @Act_Money=-abs(@Act_Money) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,@Act_ID,@Act_Money) if @@error<>0 goto Error set @Act_Money=abs(@Act_Money) end if @TaxMoney0<>0 begin set @Tmp_Money=-Abs(@TaxMoney0) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,21,@Tmp_Money) if @@error<>0 goto Error end if @TaxMoney-@TaxMoney0<>0 begin set @Tmp_Money=-(abs(@TaxMoney)-@TaxMoney0) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,22,@Tmp_Money) if @@error<>0 goto Error end if abs(@TaxMoney)-abs(@Act_Money)>0 Begin set @Tmp_Money=abs(@TaxMoney)-abs(@Act_Money) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,19,@Tmp_Money) if @@error<>0 goto Error end if abs(@TaxMoney)-abs(@Act_Money)<0 Begin set @Tmp_Money=-(abs(@TaxMoney)-abs(@Act_Money)) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, 11,@Tmp_Money) if @@error<>0 goto Error end goto Success end if @BillType=58 and @s_Syb=0 begin if @DisMoney-@CostMoney<>0 begin set @Tmp_Money=(@DisMoney)-(@CostMoney) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,40,@Tmp_Money) if @@error<>0 goto Error end if @DisMoney-@CostMoney<>0 begin set @Tmp_Money=(@DisMoney)-(@CostMoney) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,22,@Tmp_Money) if @@error<>0 goto Error end goto Success end if @BillType=59 and @s_Syb=0 begin if @PD_Money<>0 begin insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_, Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,3,@PD_Money) if @@error<>0 goto Error end if @PD_Money>0 begin insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,26,@PD_Money) if @@error<>0 goto Error end else if @PD_Money<0 begin set @Tmp_Money=abs(@PD_Money) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,42,@Tmp_Money) if @@error<>0 goto Error end goto Success end if @BillType=15 and @s_Syb=0 begin set @LS_Money_Other_Tmp=0 set @LS_Money_DJJ_Tmp=0 if @YH_Money<>0 begin insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,48,@YH_Money) if @@error<>0 goto Error end Declare curMoney Cursor Local Scroll for select Act_ID,isnull(PayMoney,0) from ListSaleAcount where Bill_ID=@Bill_ID Open curMoney Fetch next from CurMoney into @Act_ID_List,@Act_Money_List while @@Fetch_Status=0 begin if @Act_ID_List<>17 set @LS_Money_Other_Tmp=isnull(@LS_Money_Other_Tmp,0)+@Act_Money_List else set @LS_Money_DJJ_Tmp=isnull(@LS_Money_DJJ_Tmp,0)+@Act_Money_List if @Act_ID_List=52 set @Tmp_Money=-(@Act_Money_List) else set @Tmp_Money=@Act_Money_List insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,@Act_ID_List,@Tmp_Money) if @@error<>0 goto Error Fetch next from CurMoney into @Act_ID_List,@Act_Money_List end Close curMoney deallocate curMoney if @LS_Money_DJJ_Tmp-@TaxMoney+@YH_Money+@LS_Money_Other_Tmp>0 begin set @Tmp_Money=@LS_Money_DJJ_Tmp-@TaxMoney+@YH_Money+@LS_Money_Other_Tmp insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,34,@Tmp_Money) if @@error<>0 goto Error end if @CostMoney<>0 begin set @CostMoney=-abs(@CostMoney) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,3,@CostMoney) if @@error<>0 goto Error set @CostMoney=abs(@CostMoney) end if abs(@TaxMoney)-abs(@TaxMoney0)<>0 Begin set @Tmp_Money=abs(@TaxMoney)-abs(@TaxMoney0) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,24,@Tmp_Money) if @@error<>0 goto Error end if @CostMoney<>0 begin insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,40,@CostMoney) if @@error<>0 goto Error end if @TaxMoney0<>0 begin insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,21,@TaxMoney0) if @@error<>0 goto Error end if @CostMoney_1<>0 begin insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,43,@CostMoney_1) if @@error<>0 goto Error end if @CostMoney_1<>0 begin set @CostMoney_1=-abs(@CostMoney_1) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,3,@CostMoney_1) if @@error<>0 goto Error set @CostMoney_1=abs(@CostMoney_1) end goto Success end if @BillType=16 and @s_Syb=0 begin set @LS_Money_Other_Tmp=0 set @LS_Money_DJJ_Tmp=0 if @YH_Money<>0 begin set @Tmp_Money=-@YH_Money insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,48,@Tmp_Money) if @@error<>0 goto Error end Declare curMoney Cursor Local Scroll for select Act_ID,isnull(PayMoney,0) from ListSaleAcount where Bill_ID=@Bill_ID Open curMoney Fetch next from CurMoney into @Act_ID_List,@Act_Money_List while @@Fetch_Status=0 begin if @Act_ID_List<>17 set @LS_Money_Other_Tmp=@LS_Money_Other_Tmp+@Act_Money_List else set @LS_Money_DJJ_Tmp=@LS_Money_DJJ_Tmp+@Act_Money_List if @Act_ID_List=52 set @Tmp_Money=@Act_Money_List else set @Tmp_Money=-@Act_Money_List insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,@Act_ID_List,@Tmp_Money) if @@error<>0 goto Error Fetch next from CurMoney into @Act_ID_List,@Act_Money_List end Close curMoney deallocate curMoney if @LS_Money_DJJ_Tmp-@TaxMoney+@YH_Money+@LS_Money_Other_Tmp>0 begin set @Tmp_Money=-(@LS_Money_DJJ_Tmp-@TaxMoney+@YH_Money+@LS_Money_Other_Tmp) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,34,@Tmp_Money) if @@error<>0 goto Error end if @CostMoney<>0 begin insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,3,@CostMoney) if @@error<>0 goto Error end if abs(@TaxMoney)-abs(@TaxMoney0)<>0 Begin set @Tmp_Money=-(abs(@TaxMoney)-abs(@TaxMoney0)) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,24,@Tmp_Money) if @@error<>0 goto Error end if @CostMoney<>0 begin set @CostMoney=-abs(@CostMoney) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,40,@CostMoney) if @@error<>0 goto Error set @CostMoney=abs(@CostMoney) end if @TaxMoney0<>0 begin set @TaxMoney0=-Abs(@TaxMoney0) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,21,@TaxMoney0) if @@error<>0 goto Error set @TaxMoney0=Abs(@TaxMoney0) end if @CostMoney_1<>0 begin set @Tmp_Money=-@CostMoney_1 insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,43,@Tmp_Money) if @@error<>0 goto Error end if @CostMoney_1<>0 begin set @Tmp_Money=@CostMoney_1 insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,3,@Tmp_Money) if @@error<>0 goto Error end goto Success end if @BillType=51 and @s_Syb=0 begin if @CostMoney<>0 begin insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,15,@CostMoney) if @@error<>0 goto Error end if @CostMoney<>0 begin set @CostMoney=-abs(@CostMoney) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,3,@CostMoney) if @@error<>0 goto Error set @CostMoney=abs(@CostMoney) end goto Success end if @BillType=52 and @s_Syb=0 begin if @CostMoney<>0 begin set @CostMoney=-abs(@CostMoney) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,15,@CostMoney) if @@error<>0 goto Error set @CostMoney=abs(@CostMoney) end if @CostMoney<>0 begin insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,3,@CostMoney) if @@error<>0 goto Error end goto Success end if @BillType=53 and @s_Syb=0 begin if @CostMoney_1<>0 begin insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,43,@CostMoney_1) if @@error<>0 goto Error end if @CostMoney_1<>0 begin set @CostMoney_1=-abs(@CostMoney_1) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,15,@CostMoney_1) if @@error<>0 goto Error set @CostMoney_1=abs(@CostMoney_1) end if @Act_Money<>0 begin insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,@Act_ID,@Act_Money) if @@error<>0 goto Error end if @CostMoney<>0 begin set @CostMoney=-abs(@CostMoney) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,15,@CostMoney) if @@error<>0 goto Error set @CostMoney=abs(@CostMoney) end if abs(@TaxMoney)-abs(@TaxMoney0)<>0 Begin set @Tmp_Money=abs(@TaxMoney)-abs(@TaxMoney0) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,24,@Tmp_Money) if @@error<>0 goto Error end if @CostMoney<>0 begin insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,40,@CostMoney) if @@error<>0 goto Error end if @TaxMoney0<>0 begin insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,21,@TaxMoney0) if @@error<>0 goto Error end if abs(@TaxMoney)-abs(@Act_Money)>0 Begin set @Tmp_Money=abs(@TaxMoney)-abs(@Act_Money) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, 11,@Tmp_Money) if @@error<>0 goto Error end if abs(@TaxMoney)-abs(@Act_Money)<0 Begin set @Tmp_Money=-(abs(@TaxMoney)-abs(@Act_Money)) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,19,@Tmp_Money) if @@error<>0 goto Error end goto Success end if @BillType=2 and @s_Syb=0 begin if Abs(@DisMoney)-Abs(@CostMoney)<>0 begin set @Tmp_Money= Abs(@DisMoney)-Abs(@CostMoney) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,28,@Tmp_Money) if @@error<>0 goto Error end if Abs(@DisMoney)-Abs(@CostMoney)<>0 begin set @Tmp_Money= Abs(@DisMoney)-Abs(@CostMoney) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,3,@Tmp_Money) if @@error<>0 goto Error end goto Success end if @BillType=8 and @s_Syb=0 begin set @TaxMoney=@DisMoney if abs(@TaxMoney)>abs(@CostMoney) Begin set @Tmp_Money=abs(@TaxMoney-@CostMoney) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,30,@Tmp_Money) if @@error<>0 goto Error end else Begin set @Tmp_Money=-abs(@TaxMoney-@CostMoney) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,30,@Tmp_Money) if @@error<>0 goto Error end if abs(@TaxMoney)>abs(@CostMoney) Begin set @Tmp_Money=abs(@TaxMoney-@CostMoney) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,3,@Tmp_Money) if @@error<>0 goto Error end else Begin set @Tmp_Money=-abs(@TaxMoney-@CostMoney) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,3,@Tmp_Money) if @@error<>0 goto Error end goto Success end if @BillType=9 and @s_Syb=0 begin if @CostMoney<>0 begin insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,42,@CostMoney) if @@error<>0 goto Error end if @CostMoney<>0 begin set @CostMoney=-abs(@CostMoney) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,3,@CostMoney) if @@error<>0 goto Error set @CostMoney=abs(@CostMoney) end goto Success end if @BillType=10 and @s_Syb=0 begin if @CostMoney<>0 begin insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,26,@CostMoney) if @@error<>0 goto Error end if @CostMoney<>0 begin insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,3,@CostMoney) if @@error<>0 goto Error end goto Success end if @BillType=11 and @s_Syb=0 begin if @CostMoney<>0 begin insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,43,@CostMoney) if @@error<>0 goto Error end if @CostMoney<>0 begin set @CostMoney=-abs(@CostMoney) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,3,@CostMoney) if @@error<>0 goto Error set @CostMoney=abs(@CostMoney) end goto Success end if @BillType=12 and @s_Syb=0 begin if @CostMoney<>0 begin insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,27,@CostMoney) if @@error<>0 goto Error end if @CostMoney<>0 begin insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,3,@CostMoney) if @@error<>0 goto Error end goto Success end if @BillType=13 and @s_Syb=0 begin if abs(@CostMoney_1)-abs(@CostMoney)<>0 begin set @Tmp_Money=abs(@CostMoney_1)-abs(@CostMoney) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,31,@Tmp_Money) if @@error<>0 goto Error end if abs(@CostMoney_1)-abs(@CostMoney)<>0 begin set @Tmp_Money=abs(@CostMoney_1)-abs(@CostMoney) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,3,@Tmp_Money) if @@error<>0 goto Error end goto Success end if @BillType=17 and @s_Syb=0 begin if @CostMoney<>0 begin insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,@Act_ID,@CostMoney) if @@error<>0 goto Error end if @CostMoney<>0 begin insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,3,@CostMoney) if @@error<>0 goto Error end goto Success end if @BillType=18 and @s_Syb=0 begin if @CostMoney<>0 begin insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,@Act_ID,@CostMoney) if @@error<>0 goto Error end if @CostMoney<>0 begin set @CostMoney=-abs(@CostMoney) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,3,@CostMoney) if @@error<>0 goto Error set @CostMoney=abs(@CostMoney) end goto Success end if @BillType=242 and @s_Syb=0 begin if @CostMoney<>0 begin set @Tmp_Money=-abs(@CostMoney) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,3,@Tmp_Money) if @@error<>0 goto Error end if @CostMoney<>0 begin insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,16,@CostMoney) if @@error<>0 goto Error end goto Success end if @BillType=243 and @s_Syb=0 begin if @CostMoney<>0 begin set @Tmp_Money=-abs(@CostMoney) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,16,@Tmp_Money) if @@error<>0 goto Error end if @CostMoney<>0 begin insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,3,@CostMoney) if @@error<>0 goto Error end goto Success end if @BillType=244 and @s_Syb=0 begin if @CostMoney<>0 begin set @Tmp_Money=-abs(@CostMoney) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,16,@Tmp_Money) if @@error<>0 goto E, rror end if @CostMoney<>0 begin insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,44,@CostMoney) if @@error<>0 goto Error end goto Success end if @BillType=245 and @s_Syb=0 begin if @CostMoney<>0 begin set @Tmp_Money=-abs(@CostMoney) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,16,@Tmp_Money) if @@error<>0 goto Error end if @PCMoney<>0 begin insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,33,@PCMoney) if @@error<>0 goto Error end if @PCMoney<>0 begin insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,6,@PCMoney) if @@error<>0 goto Error end if @CostMoney<>0 begin insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,44,@CostMoney) if @@error<>0 goto Error end goto Success end if @s_Syb<>0 and @Bill_ID_Old not in(-100,-200,-300) and @BillType<>251 begin Declare curMoney Cursor Local Scroll for SELECT BillDate, BillSN, BillType, Unit_ID, User_ID, Audit_ID,Oper_ID, Period,Act_ID, -Act_Money FROM MoneyList where Bill_ID=@Bill_ID_Old Open curMoney Fetch next from curMoney into @BillDate,@BillSN,@BillType,@Unit_ID,@User_ID,@Audit_ID,@Oper_ID,@Period,@Act_ID,@Act_Money while @@Fetch_Status=0 begin insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) select @s_Syb,@BillDate,@Bill_ID,@BillSN,@BillType,@Unit_ID,@User_ID,@Audit_ID,@Oper_ID,@Period,@Act_ID,@Act_Money if @@error<>0 goto Error_Cur Fetch next from curMoney into @BillDate,@BillSN,@BillType,@Unit_ID,@User_ID,@Audit_ID,@Oper_ID,@Period,@Act_ID,@Act_Money end Close curMoney deallocate curMoney update MoneyList set s_Syb=-2 where Bill_ID=@Bill_ID_Old and @Bill_ID_Old<>-100 and s_Syb=0 if @@error<>0 goto Error goto Success end end if (@BillType>=100 and @BillType<=121) begin select @Act_Money_List_Tot=Isnull(Sum((Money)),0), @Act_Money_List1_Tot=Isnull(Sum((Money1)),0) from ListMoney where Bill_ID=@Bill_ID and Act_ID>1 if @Bill_ID_Old not in (-100,-200,-300) update MoneyList set s_Syb=-2 where Bill_ID=@Bill_ID_Old and s_Syb=0 if @Bill_ID_Old in(-100,-200,-300) and @s_Syb=0 begin if @BillType=118 begin if @Bill_ID_Old in(-100,-200) begin Select @JSMoney=isnull(sum(Money_JS),0) from JS_Bill where QL_BillID_Gat=@Bill_ID and WL_Red=0 and QL_Red=0 and IfGZ=0 if @JSMoney<>0 Begin set @Tmp_Money=-@JSMoney insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money],[GL_JS_YUSYUF] ) values (@s_Syb, @BillDate, @Bill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, 57,@Tmp_Money,1) if @@error<>0 goto Error insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ,[GL_JS_YUSYUF]) values (@s_Syb, @BillDate, @Bill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, 11,@Tmp_Money,1) if @@error<>0 goto Error end end if @Bill_ID_Old in(-300) begin Select @JSMoney=isnull(sum(Money_JS),0) from JS_Bill where QL_BillID_Gat=@Bill_ID and WL_Red=0 and QL_Red=0 and IfGZ=1 and IfJH_XS_CD=0 if @JSMoney<>0 Begin set @Tmp_Money=@JSMoney insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money],[GL_JS_YUSYUF] ) values (@s_Syb, @BillDate, @Bill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, 57,@Tmp_Money,-1) if @@error<>0 goto Error insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money],[GL_JS_YUSYUF] ) values (@s_Syb, @BillDate, @Bill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, 11,@Tmp_Money,-1) if @@error<>0 goto Error end update moneylist set GL_JS_YUSYUF=-1 where Bill_ID=@Bill_ID and GL_JS_YUSYUF=1 if @@error<>0 goto Error end end if @BillType=119 begin if @Bill_ID_Old in(-100,-200) begin Select @JSMoney=isnull(sum(Money_JS),0) from JS_Bill where QL_BillID_Pay=@Bill_ID and WL_Red=0 and QL_Red=0 and IfGZ=0 if @JSMoney<>0 Begin set @Tmp_Money=-@JSMoney insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money],[GL_JS_YUSYUF] ) values (@s_Syb, @BillDate, @Bill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, 56,@Tmp_Money,1) if @@error<>0 goto Error insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money],[GL_JS_YUSYUF] ) values (@s_Syb, @BillDate, @Bill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, 19,@Tmp_Money,1) if @@error<>0 goto Error end end if @Bill_ID_Old in(-300) begin Select @JSMoney=isnull(sum(Money_JS),0) from JS_Bill where QL_BillID_Pay=@Bill_ID and WL_Red=0 and QL_Red=0 and IfGZ=1 and IfJH_XS_CD=0 if @JSMoney<>0 Begin set @Tmp_Money=@JSMoney insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money],[GL_JS_YUSYUF] ) values (@s_Syb, @BillDate, @Bill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, 56,@Tmp_Money,-1) if @@error<>0 goto Error insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money],[GL_JS_YUSYUF] ) values (@s_Syb, @BillDate, @Bill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, 19,@Tmp_Money,-1) if @@error<>0 goto Error end update moneylist set GL_JS_YUSYUF=-1 where Bill_ID=@Bill_ID and GL_JS_YUSYUF=1 if @@error<>0 goto Error end end end if @s_Syb in(0,-1,-2) and @Bill_ID_Old<>-200 and @Bill_ID_Old<>-300 begin if @BillType=100 begin if @Act_Money_List_Tot<>0 Begin if @s_Syb=0 set @Tmp_Money=@Act_Money_List_Tot+@YH_Money else set @Tmp_Money=(@Act_Money_List_Tot+@YH_Money) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, 11,@Tmp_Money) if @@error<>0 goto Error end if @YH_Money<>0 begin set @YH_Money=-@YH_Money insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,48,@YH_Money) if @@error<>0 goto Error set @YH_Money=-@YH_Money end end if @BillType=101 begin if @Act_Money_List_Tot<>0 Begin if @s_Syb=0 set @Tmp_Money=@Act_Money_List_Tot+@YH_Money else set @Tmp_Money=(@Act_Money_List_Tot+@YH_Money) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, 19,@Tmp_Money) if @@error<>0 goto Error end if @YH_Money<>0 begin insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,48,@YH_Money) if @@error<>0 goto Error end end if @BillType=102 begin if @Act_Money_List_Tot<>0 Begin if isnull(@Act_ID,0)=0 set @Act_ID=6 if @s_Syb=0 set @Tmp_Money=-abs(@Act_Money_List_Tot) else set @Tmp_Money=abs(@Act_Money_List_Tot) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, @Act_ID,@Tmp_Money) if @@error<>0 goto Error end end if @BillType=103 begin if @Act_Money<>0 Begin if @s_Syb=0 set @Tmp_Money=-abs(@Act_Money) else set @Tmp_Money=abs(@Act_Money) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, @Act_ID,@Tmp_Money) if @@error<>0 goto Error end if abs(@Act_Money)>abs(@Act_Money_List_Tot) Begin if @s_Syb=0 set @Tmp_Money=@Act_Money-@Act_Money_List_Tot else set @Tmp_Money=-(Abs(@Act_Money)-Abs(@Act_Money_List_Tot)) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, 11,@Tmp_Money) if @@error<>0 goto Error end if abs(@Act_Money)<abs(@Act_Money_List_Tot) begin if @s_Syb=0 set @Tmp_Money=@Act_Money_List_Tot-@Act_Money else set @Tmp_Money=-(Abs(@Act_Money_List_Tot)-Abs(@Act_Money)) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, 19,@Tmp_Money) if @@error<>0 goto Error end end if @BillType=104 begin if @Act_Money<>0 Begin if @s_Syb=0 set @Tmp_Money=abs(@Act_Money) else set @Tmp_Money=-abs(@Act_Money) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, @Act_ID,@Tmp_Money) if @@error<>0 goto Error end if abs(@Act_Money_List_Tot)>abs(@Act_Money) Begin if @s_Syb=0 set @Tmp_Money=@Act_Money_List_Tot-@Act_Money else set @Tmp_Money=-(Abs(@Act_Money_List_Tot)-Abs(@Act_Money)) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, 11,@Tmp_Money) if @@error<>0 goto Error end if abs(@Act_Money_List_Tot)<abs(@Act_Money) begin if @s_Syb=0 set @Tmp_Money=abs(@Act_Money_List_Tot-@Act_Money) else set @Tmp_Money=-abs(@Act_Money_List_Tot-@Act_Money) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, 19,@Tmp_Money) if @@error<>0 goto Error end end if @BillType=105 begin if @Act_Money<>0 and @Act_Money=@Act_Money_List_Tot Begin if @s_Syb=0 set @Tmp_Money=-abs(@Act_Money) else set @Tmp_Money=abs(@Act_Money) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, @Act_ID,@Tmp_Money) if @@error<>0 goto Error end end if @BillType=106 begin if @Act_Money<>0 Begin if @s_Syb=0 set @Tmp_Money=-abs(@Act_Money) else set @Tmp_Money=abs(@Act_Money) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, @Act_ID,@Tmp_Money) if @@error<>0 goto Error end if abs(@Act_Money_List_Tot)>abs(@Act_Money) Begin if @s_Syb=0 set @Tmp_Money=@Act_Money_List_Tot-@Act_Money else set @Tmp_Money=-(Abs(@Act_Money_List_Tot)-Abs(@Act_Money)) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, 19,@Tmp_Money) if @@error<>0 goto Error end if abs(@Act_Money_List_Tot)<abs(@Act_Money) begin if @s_Syb=0 set @Tmp_Money=abs(@Act_Money_List_Tot-@Act_Money) else set @Tmp_Money=-abs(@Act_Money_List_Tot-@Act_Money) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, 11,@Tmp_Money) if @@error<>0 goto Error end end if @BillType=107 begin if @Act_Money_List_Tot<>0 Begin if @s_Syb=0 set @Tmp_Money=abs(@Act_Money_List_Tot) else set @Tmp_Money=-abs(@Act_Money_List_Tot) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, 47,@Tmp_Money) if @@error<>0 goto Error end end if @BillType=108 begin if @Act_Money<>0 Begin if @s_Syb=0 set @Tmp_Money=abs(@Act_Money) else set @Tmp_Money=-abs(@Act_Money) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, @Act_ID,@Tmp_Money) if @@error<>0 goto Error end if abs(@Act_Money_List_Tot)>abs(@Act_Money) Begin if @s_Syb=0 set @Tmp_Money=@Act_Money_List_Tot-@Act_Money else set @Tmp_Money=-(Abs(@Act_Money_List_Tot)-Abs(@Act_Money)) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, 11,@Tmp_Money) if @@error<>0 goto Error end if abs(@Act_Money_List_Tot)<abs(@Act_Money) begin if @s_Syb=0 set @Tmp_Money=abs(@Act_Money_List_Tot-@Act_Money) else set @Tmp_Money=-abs(@Act_Money_List_Tot-@Act_Money) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, 19,@Tmp_Money) if @@error<>0 goto Error end end if @BillType=109 begin if @Act_Money_List_Tot<>0 Begin if @s_Syb=0 set @Tmp_Money=@Act_Money_List_Tot else set @Tmp_Money=-abs(@Act_Money_List_Tot) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, 11,@Tmp_Money) if @@error<>0 goto Error end end if @BillType=110 begin if @Act_Money_List_Tot<>0 Begin if @s_Syb=0 set @Tmp_Money=-abs(@Act_Money_List_Tot) else set @Tmp_Money=abs(@Act_Money_List_Tot) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, 11,@Tmp_Money) if @@error<>0 goto Error end end if @BillType=111 begin if @Act_Money_List_Tot<>0 Begin if @s_Syb=0 set @Tmp_Money=abs(@Act_Money_List_Tot) else set @Tmp_Money=-abs(@Act_Money_List_Tot) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, 19,@Tmp_Money) if @@error<>0 goto Error end end if @BillType=112 begin if @Act_Money_List_Tot<>0 Begin if @s_Syb=0 set @Tmp_Money=-abs(@Act_Money_List_Tot) else set @Tmp_Money=abs(@Act_Money_List_Tot) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, 19,@Tmp_Money) if @@error<>0 goto Error end end if @BillType=113 begin if @Act_Money<>0 and @Act_Money=@Act_Money_List_Tot Begin if @s_Syb=0 set @Tmp_Money=abs(@Act_Money) else set @Tmp_Money=-abs(@Act_Money) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, @Act_ID,@Tmp_Money) if @@error<>0 goto Error end end if @BillType=114 begin if @Act_Money<>0 and @Act_Money=@Act_Money_List_Tot Begin if @s_Syb=0 set @Tmp_Money=-abs(@Act_Money) else set @Tmp_Money=abs(@Act_Money) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, @Act_ID,@Tmp_Money) if @@error<>0 goto Error end end if @BillType=115 begin if @Act_Money_List_Tot<>0 Begin if @s_Syb=0 set @Tmp_Money=abs(@Act_Money_List_Tot) else set @Tmp_Money=-abs(@Act_Money_List_Tot) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, 13,@Tmp_Money) if @@error<>0 goto Error end end if @BillType=116 begin if @Act_Money_List_Tot<>0 Begin if @s_Syb=0 set @Tmp_Money=-abs(@Act_Money_List_Tot) else set @Tmp_Money=abs(@Act_Money_List_Tot) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, 13,@Tmp_Money) if @@error<>0 goto Error end end if @BillType=118 begin if @Act_Money_List_Tot<>0 Begin if @s_Syb=0 set @Tmp_Money=@Act_Money_List_Tot else set @Tmp_Money=(@Act_Money_List_Tot) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, 57,@Tmp_Money) if @@error<>0 goto Error if @s_Syb<>0 begin select @OrderId=isnull(Order_ID,-1) from Masterbill where AutoID=@Bill_ID_Old if @OrderId>0 begin update MasterOrder set JSMoney=0,Act_ID=-1,Act_Money=0 where s_ID=@OrderId if @@error<>0 goto Error end end end end if @BillType=119 begin if @Act_Money_List_Tot<>0 Begin if @s_Syb=0 set @Tmp_Money=@Act_Money_List_Tot else set @Tmp_Money=(@Act_Money_List_Tot) insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, 56,@Tmp_Money) if @@error<>0 goto Error if @s_Syb<>0 begin select @OrderId=isnull(Order_ID,-1) from Masterbill where AutoID=@Bill_ID_Old if @OrderId>0 begin update MasterOrder set JSMoney=0,Act_ID=-1,Act_Money=0 where s_ID=@OrderId if @@error<>0 goto Error end end end end if @BillType=120 begin select @Act_Money_List_Tot=-sum(isnull(BackMoney,0)) from ListYsyf where bill_ID=@Bill_ID if @Act_Money_List_Tot<>0 Begin set @Tmp_Money=@Act_Money_List_Tot insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, 57,@Tmp_Money) if @@error<>0 goto Error end if @Act_Money<>0 Begin set @Tmp_Money=-@Act_Money insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, @Act_ID,@Tmp_Money) if @@error<>0 goto Error end end if @BillType=121 begin select @Act_Money_List_Tot=-sum(isnull(BackMoney,0)) from ListYsyf where bill_ID=@Bill_ID if @Act_Money_List_Tot<>0 Begin set @Tmp_Money=@Act_Money_List_Tot insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, 56,@Tmp_Money) if @@error<>0 goto Error end if @Act_Money<>0 Begin set @Tmp_Money=@Act_Money insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, @Act_ID,@Tmp_Money) if @@error<>0 goto Error end end if (@BillType>=100 and @BillType<=116) or (@BillType in (118,119)) begin Declare curMoney Cursor Local Scroll for select Act_ID,Money from ListMoney where Bill_ID=@Bill_ID Open curMoney Fetch next from CurMoney into @Act_ID_List,@Act_Money_List while @@Fetch_Status=0 begin if @BillType in (100,115,107,108,119) set @Act_Money_List=-@Act_Money_List insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period,@Act_ID_List,@Act_Money_List) if @@Error<>0 goto Error_Cur Fetch next from CurMoney into @Act_ID_List,@Act_Money_List end Close curMoney deallocate curMoney end else if @BillType=117 begin Declare curMoney Cursor Local Scroll for select substring(a.s_FullId,1,5) as Sys_FullId,isnull(b.Act_ID,0) as Act_ID,isnull(b.Unit_ID,0) as Unit_ID ,isnull(b.Money,0) as Money,isnull(b.Money1,0) as , Money1 from MoneyAccount a,ListMoney b where a.s_id=b.Act_ID and b.Bill_ID=@Bill_ID Open curMoney Fetch next from curMoney into @ActFullID_ZZ,@Act_ID_List,@Unit_ID_List,@Money_JF,@Money_DF while @@Fetch_Status=0 begin if (@ActFullID_ZZ='00001' or @ActFullID_ZZ='00004') begin if @Money_JF>0 begin insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID_List, @User_ID,@Audit_ID,@Oper_ID,@Period,@Act_ID_List,@Money_JF) if @@error<>0 goto Error_Cur end if @Money_DF>0 begin set @Money_DF=-@Money_DF insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID_List, @User_ID,@Audit_ID,@Oper_ID,@Period,@Act_ID_List,@Money_DF) if @@error<>0 goto Error_Cur set @Money_DF=-@Money_DF end end if @ActFullID_ZZ='00002' or @ActFullID_ZZ='00003' begin if @Money_JF>0 begin set @Money_JF=-@Money_JF insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID_List, @User_ID,@Audit_ID,@Oper_ID,@Period,@Act_ID_List,@Money_JF) if @@error<>0 goto Error_Cur set @Money_JF=-@Money_JF end if @Money_DF>0 begin insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN], [BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID,@BillSN,@BillType, @Unit_ID_List, @User_ID,@Audit_ID,@Oper_ID,@Period,@Act_ID_List,@Money_DF) if @@error<>0 goto Error_Cur end end Fetch next from curMoney into @ActFullID_ZZ,@Act_ID_List,@Unit_ID_List,@Money_JF,@Money_DF end Close curMoney deallocate curMoney end else if @BillType in (120,121) begin Declare curMoney Cursor Local Scroll for Select a.ysyf_id,a.BackMoney,b.order_id from ListYsyf a inner join masterbill b on a.ysyf_ID=b.autoid where Bill_ID=@Bill_ID Open curMoney Fetch next from CurMoney into @ysyf_id ,@BackMoney,@order_id while @@Fetch_Status=0 begin select @Act_Money=isnull(sumtaxmoney,0),@JSMoney=isnull(JSMoney,0),@BackYsyfMoney=isnull(BackYsyfMoney,0) from masterbill where autoid=@ysyf_id if @BackYsyfMoney+@JSMoney+@BackMoney>@Act_Money return -907 update masterbill set BackYsyfMoney=isnull(BackYsyfMoney,0)+@BackMoney where autoid=@ysyf_id if @@Error<>0 goto Error_Cur update masterorder set BackYsyfMoney=isnull(BackYsyfMoney,0)+@BackMoney where s_ID=@order_id if @@Error<>0 goto Error_Cur Fetch next from CurMoney into @ysyf_id ,@BackMoney,@order_id end Close curMoney deallocate curMoney end end if @s_Syb <>0 and @Bill_ID_Old not in(-100,-200,-300 ) and @BillType in(103,106,104,108,118,119,120,121) begin --预收、预付被核销的单据红冲时需要更新账户,收付款单据核销的不影响账户,直接在结算存储过程里修改。此处是核销的钱流单据。 if @BillType in(103,106,104,108) and exists(select * from JS_Bill where WL_BillID=@Bill_ID_Old and WL_Red=0 and QL_Red=0 and IfGZ=1 and BillType_QL in (118,119)) begin Declare curMoney Cursor Local Scroll for Select WL_BillID,isnull(Money_JS,0) as Money_JS,BillType,QL_BillID,BillType_QL from JS_Bill where WL_BillID=@Bill_ID_Old and WL_Red=0 and QL_Red=0 and IfGZ=1 and BillType_QL in (118,119) Open curMoney Fetch next from curMoney into @TmpWLBill_ID,@JSMoney,@BillType,@TmpQLBill_ID,@BillType_QL while @@Fetch_Status=0 begin set @YU_Money_JS_List=0 if @BillType_QL=118 begin update MasterBill set JSMoney=isnull(JSMoney,0)-isnull(@JSMoney,0), WriteJSBill=isnull(WriteJSBill,0)-1 where AutoID=@TmpWLBill_ID and JSMoney<>0 if @@error<>0 goto Error_Cur if exists(select * from JS_Bill where WL_BillID=@TmpWLBill_ID and QL_BillID_Gat<>@TmpQLBill_ID and WL_Red=0 and QL_Red=0 and IfGZ=1 ) begin select @RecPayDate=min(QL_Date) from JS_Bill where WL_BillID=@TmpWLBill_ID and QL_BillID_Gat<>@TmpQLBill_ID and WL_Red=0 and QL_Red=0 and IfGZ=1 update MasterBill set FirstDate=@RecPayDate where AutoID=@TmpWLBill_ID if @@error<>0 goto Error_Cur end else begin update MasterBill set FirstDate=null where AutoID=@TmpWLBill_ID if @@error<>0 goto Error_Cur end if @JSMoney<>0 Begin select @s_Syb=s_Syb, @BillDate=BillDate, @BillSN=BillSN, @Unit_ID=isnull(Unit_ID,-1), @User_ID=Emp_ID, @Audit_ID=Audit_ID, @Oper_ID=Oper_ID, @Period=Period, @Act_ID=Act_ID, @Act_Money=case when Act_ID>1 then isnull(Act_Money,0) else 0 end, @Card_Money=isnull(Card_Money,0), @YH_Money=isnull(YH_Money,0), @PCMoney=abs(PCMoney),@PD_Money=isnull(SumTaxMoney,0) from MasterBill where AutoID=@TmpQLBill_ID set @Tmp_Money=@JSMoney insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @TmpQLBill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, 57,@Tmp_Money) if @@error<>0 goto Error_Cur insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @TmpQLBill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, 11,@Tmp_Money) if @@error<>0 goto Error_Cur end update MasterBill set JSMoney=isnull(JSMoney,0)-isnull(@JSMoney,0), WriteJSBill=isnull(WriteJSBill,0)-1 where AutoID=@TmpQLBill_ID if @@error<>0 goto Error_Cur select @OrderId=isnull(Order_ID,-1) from Masterbill where AutoID=@TmpQLBill_ID if @OrderId>0 begin update MasterOrder set JSMoney=isnull(JSMoney,0)-isnull(@JSMoney,0) where s_ID=@OrderId if @@error<>0 goto Error_Cur end update JS_Bill set WL_Red=1 where WL_BillID=@Bill_ID_Old if @@error<>0 goto Error_Cur end if @BillType_QL=119 begin update MasterBill set JSMoney=isnull(JSMoney,0)-isnull(@JSMoney,0), WriteJSBill=isnull(WriteJSBill,0)-1 where AutoID=@TmpWLBill_ID and JSMoney<>0 if @@error<>0 goto Error_Cur if exists(select * from JS_Bill where WL_BillID=@TmpWLBill_ID and QL_BillID_Pay<>@TmpQLBill_ID and WL_Red=0 and QL_Red=0 and IfGZ=1) begin select @RecPayDate=min(QL_Date) from JS_Bill where WL_BillID=@TmpWLBill_ID and QL_BillID_Pay<>@TmpQLBill_ID and WL_Red=0 and QL_Red=0 and IfGZ=1 update MasterBill set FirstDate=@RecPayDate where AutoID=@TmpWLBill_ID if @@error<>0 goto Error end else begin update MasterBill set FirstDate=null where AutoID=@TmpWLBill_ID if @@error<>0 goto Error_Cur end if @JSMoney<>0 Begin select @s_Syb=s_Syb, @BillDate=BillDate, @BillSN=BillSN, @Unit_ID=isnull(Unit_ID,-1), @User_ID=Emp_ID, @Audit_ID=Audit_ID, @Oper_ID=Oper_ID, @Period=Period, @Act_ID=Act_ID, @Act_Money=case when Act_ID>1 then isnull(Act_Money,0) else 0 end, @Card_Money=isnull(Card_Money,0), @YH_Money=isnull(YH_Money,0), @PCMoney=abs(PCMoney),@PD_Money=isnull(SumTaxMoney,0) from MasterBill where AutoID=@TmpQLBill_ID set @Tmp_Money=@JSMoney insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @TmpQLBill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, 56,@Tmp_Money) if @@error<>0 goto Error insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @TmpQLBill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, 19,@Tmp_Money) if @@error<>0 goto Error end update MasterBill set JSMoney=isnull(JSMoney,0)-isnull(@JSMoney,0), WriteJSBill=isnull(WriteJSBill,0)-1 where AutoID=@TmpQLBill_ID if @@error<>0 goto Error_Cur select @OrderId=isnull(Order_ID,-1) from Masterbill where AutoID=@TmpQLBill_ID if @OrderId>0 begin update MasterOrder set JSMoney=isnull(JSMoney,0)-isnull(@JSMoney,0) where s_ID=@OrderId if @@error<>0 goto Error_Cur end update JS_Bill set WL_Red=1 where WL_BillID=@Bill_ID_Old if @@error<>0 goto Error_Cur end Fetch next from curMoney into @TmpWLBill_ID,@JSMoney,@BillType,@TmpQLBill_ID,@BillType_QL end Close curMoney deallocate curMoney end if @BillType=118 and exists(select * from JS_Bill where QL_BillID_Gat=@Bill_ID_Old and WL_Red=0 and QL_Red=0 and IfGZ=1) begin Declare curMoney Cursor Local Scroll for Select WL_BillID,isnull(Money_JS,0),BillType from JS_Bill where QL_BillID_Gat=@Bill_ID_Old and WL_Red=0 and QL_Red=0 and IfGZ=1 Open curMoney Fetch next from curMoney into @TmpWLBill_ID,@JSMoney,@BillType while @@Fetch_Status=0 begin set @YU_Money_JS_List=isnull(@YU_Money_JS_List,0)+isnull(@JSMoney,0) update MasterBill set JSMoney=isnull(JSMoney,0)-isnull(@JSMoney,0), WriteJSBill=isnull(WriteJSBill,0)-1 where AutoID=@TmpWLBill_ID and JSMoney<>0 if @@error<>0 goto Error_Cur if exists(select * from JS_Bill where WL_BillID=@TmpWLBill_ID and QL_BillID_Gat<>@Bill_ID_Old and WL_Red=0 and QL_Red=0 and IfGZ=1) begin select @RecPayDate=min(QL_Date) from JS_Bill where WL_BillID=@TmpWLBill_ID and QL_BillID_Gat<>@Bill_ID_Old and WL_Red=0 and QL_Red=0 and IfGZ=1 update MasterBill set FirstDate=@RecPayDate where AutoID=@TmpWLBill_ID if @@error<>0 goto Error_Cur end else begin update MasterBill set FirstDate=null where AutoID=@TmpWLBill_ID if @@error<>0 goto Error_Cur end Fetch next from curMoney into @TmpWLBill_ID,@JSMoney,@BillType end Close curMoney deallocate curMoney update MasterBill set JSMoney=isnull(JSMoney,0)-isnull(@YU_Money_JS_List,0), WriteJSBill=isnull(WriteJSBill,0)-1 where AutoID=@Bill_ID_Old and @s_Syb=-2 if @@error<>0 goto Error update JS_Bill set WL_Red=1, QL_Red=1 where QL_BillID_Gat=@Bill_ID_Old if @@error<>0 goto Error if @YU_Money_JS_List<>0 Begin set @Tmp_Money=@YU_Money_JS_List insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, 57,@Tmp_Money) if @@error<>0 goto Error insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, 11,@Tmp_Money) if @@error<>0 goto Error end end if @BillType=119 and exists(select * from JS_Bill where QL_BillID_Pay=@Bill_ID_Old and WL_Red=0 and QL_Red=0 and IfGZ=1) begin Declare curMoney Cursor Local Scroll for Select WL_BillID,isnull(Money_JS,0),BillType from JS_Bill where QL_BillID_Pay=@Bill_ID_Old and WL_Red=0 and QL_Red=0 and IfGZ=1 Open curMoney Fetch next from curMoney into @TmpWLBill_ID,@JSMoney,@BillType while @@Fetch_Status=0 begin set @YU_Money_JS_List=isnull(@YU_Money_JS_List,0)+isnull(@JSMoney,0) update MasterBill set JSMoney=isnull(JSMoney,0)-isnull(@JSMoney,0), WriteJSBill=isnull(WriteJSBill,0)-1 where AutoID=@TmpWLBill_ID and JSMoney<>0 if @@error<>0 goto Error_Cur if exists(select * from JS_Bill where WL_BillID=@TmpWLBill_ID and QL_BillID_Pay<>@Bill_ID_Old and WL_Red=0 and QL_Red=0 and IfGZ=1) begin select @RecPayDate=min(QL_Date) from JS_Bill where WL_BillID=@TmpWLBill_ID and QL_BillID_Pay<>@Bill_ID_Old and WL_Red=0 and QL_Red=0 and IfGZ=1 update MasterBill set FirstDate=@RecPayDate where AutoID=@TmpWLBill_ID if @@error<>0 goto Error end else begin update MasterBill set FirstDate=null where AutoID=@TmpWLBill_ID if @@error<>0 goto Error_Cur end Fetch next from curMoney into @TmpWLBill_ID,@JSMoney,@BillType end Close curMoney deallocate curMoney update MasterBill set JSMoney=isnull(JSMoney,0)-isnull(@YU_Money_JS_List,0), WriteJSBill=isnull(WriteJSBill,0)-1 where AutoID=@Bill_ID_Old and @s_Syb=-2 if @@error<>0 goto Error update JS_Bill set WL_Red=1, QL_Red=1 where QL_BillID_Pay=@Bill_ID_Old if @@error<>0 goto Error if @YU_Money_JS_List<>0 Begin set @Tmp_Money=@YU_Money_JS_List insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, 56,@Tmp_Money) if @@error<>0 goto Error insert into MoneyList ([s_Syb], [BillDate], [Bill_ID], [BillSN],[BillType], [Unit_ID], [User_ID], [Audit_ID], [Oper_ID], [Period], [Act_ID], [Act_Money] ) values (@s_Syb, @BillDate, @Bill_ID, @BillSN,@BillType, @Unit_ID, @User_ID,@Audit_ID,@Oper_ID,@Period, 19,@Tmp_Money) if @@error<>0 goto Error end end end goto Success end Success: select @Tmp_ZC=isnull(Sum(Act_Tot),0) from MoneyAccount where s_FullID like '00001%' select @Tmp_FZ=isnull(Sum(Act_Tot),0) from MoneyAccount where s_FullID like '00002%' select @Tmp_QY=isnull(Sum(Act_Tot),0) from MoneyAccount where s_FullID like '00005%' select @Money_XS= convert(int, isnull(IfAllow,8)) from setsysteminfo where s_FullID='0000600003' -- if ROUND(@Tmp_ZC,@Money_XS, 0)= ROUND(@Tmp_FZ+@Tmp_QY,@Money_XS, 0) return 0 else return -999 return 0 Error: return -1 Error_Cur: Close curMoney deallocate curMoney return -1
![用友u8总账报价](https://www.kuaiji66.com/u8/zb_users/plugin/MiniTu/noimg.png)
用友u8总账报价用友u8总账报价:QQ4009908488 <a style="background:none" href="http://wpa.b.qq.com/cgi/wpa.php?ln=1&key=XzkzODA1MzI2Ml8xOTQ2NjJfNDAwOTkwODQ4OF8yXw target="_blank">在线咨询>>
财务会计1-及以上站点:([点数]-1)*6000元
总账13000元
应收管理7800元
应付管理7800元
固定资产7000元
UFO报表5600元
费用预算30000元
网上银行20000元
出纳管理5000元
医药费用管理59800元
网上报销1-及以上站点:([点数]-1)*2300+20000元
管理会计1-及以上站点:([点数]-1)*23000元资金管理62800元
成本管理69000元
标准成本42800元
项目成本48800元
成本分项管理49800元
预算管理-企1-及以上站点:([点数]-1)*23000+69000元
供应链1-及以上站点:([点数]-1)*11000元采购管理16800元
销售管理16800元
库存管理16800元
存货核算16800元
合同管理32000元
售前分析25800元
质量管理32000元
委外管理26800元
GSP质量管理42800元
进口管理29800元
出口管理29800元
VMI管理34800元
序列号15800元
部门用料计划35800元
进程管理45000元
服装行业样品管理49800元
服装行业销售业务62000元
服装行业采购委外业务18000元
服装行业库存业务46000元
按质计价49800元
质量管理-流程58000元
售后服务35800元
品控报表12800元
采购询报价管理11800元
借用归还12800元
农户收购62800元
运输管理58000元
寄售29800元
服装行业二维表单9600元
电商订单中心69600元
库存条码—PC版42800元
库存条码-无线版1-及以上站点:([点数]-1)*15000+52800元
GMP基础应用42800元
会员管理39800元
生产制造1-及以上站点:([点数]-1)*21600元物料清单36000元
主生产计划47800元
需求规划47800元
产能管理47800元
生产订单47800元
车间管理62800元
设备管理48800元
工程变更管理48800元
工序委外管理35800元
服装行业车间管理56000元
服装行业生产计划通知86000元
服装行业计件工资38000元
有限排产200000元
有限排产模具算法100000元
模具管理79800元
生产用料分摊32800元
物料重计39800元
LED分光分选39800元
生产线日计划29800元
GMP管理150000元
人力资源1-及以上站点:([点数]-1)*9600元人事管理12800元
人事合同管理12800元
薪资管理12800元
计件工资22000元
集体计件22000元
保险福利管理13800元
考勤休假管理43800元
招聘管理22000元
培训管理22000元
员工自助1-30站点:22000元
31-及以上站点:([点数]-30)*500+22000元
经理自助1-10站点:20000元
11-及以上站点:([点数]-10)*800+20000元
绩效管理1-及以上站点:([点数]-1)*9800+88000元
集团管理1-及以上站点:([点数]-1)*21000元集团财务56000元
合并报表56000元
结算中心56000元
预算管理-集90000元
网上结算1-及以上站点:([点数]-1)*8000+12000元
内部审计1-及以上站点:([点数]-1)*20000+98000元
CRM0元CRM营销管理1-及以上站点:([点数]-1)*9800+59800元
CRM服务管理1-及以上站点:([点数]-1)*9800+51800元
呼叫中心-坐席端1-及以上站点:([点数]-1)*6000+100000元
呼叫中心集成0元
PLM0元PDM-Professional7.x1-760站点:0元
PDM包5-及以上站点:([点数]-1)*13000元
基础功能包30000元
文档管理20000元
零部件管理20000元
产品结构管理30000元
变更管理40000元
PLM项目管理60000元
产品工艺管理60000元
军工行业插件150000元
AutoCAD集成1-及以上站点:([点数]-1)*1000+10000元
CAXA集成1-及以上站点:([点数]-1)*1000+10000元
SolidWorks集成1-及以上站点:([点数]-1)*2000+20000元
CATIA集成1-及以上站点:([点数]-1)*2000+20000元
SolidEdge集成1-及以上站点:([点数]-1)*2000+20000元
Pro/E集成1-及以上站点:([点数]-1)*2000+20000元
UG集成1-及以上站点:([点数]-1)*2000+20000元
Inventor集成1-及以上站点:([点数]-1)*2000+20000元
Protel集成1-及以上站点:([点数]-1)*2000+20000元
PADS集成1-及以上站点:([点数]-1)*2000+20000元
Project集成1-及以上站点:[点数]*3000+30000元
CAD集成平台30000元
![用友u810.0报价](https://www.kuaiji66.com/u8/zb_users/plugin/MiniTu/noimg.png)
用友u810.0报价用友u810.0报价:QQ4009908488 在线咨询>>
财务会计 1-及以上站点: ([点数]-1)*6000元
总账 13000元
应收管理 7800元
应付管理 7800元
固定资产 7000元
UFO报表 5600元
费用预算 30000元
网上银行 20000元
出纳管理 5000元
医药费用管理 59800元
网上报销 1-及以上站点: ([点数]-1)*2300+20000元
管理会计 1-及以上站点: ([点数]-1)*23000元 资金管理 62800元
成本管理 69000元
标准成本 42800元
项目成本 48800元
成本分项管理 49800元
预算管理-企 1-及以上站点: ([点数]-1)*23000+69000元
供应链 1-及以上站点: ([点数]-1)*11000元 采购管理 16800元
销售管理 16800元
库存管理 16800元
存货核算 16800元
合同管理 32000元
售前分析 25800元
质量管理 32000元
委外管理 26800元
GSP质量管理 42800元
进口管理 29800元
出口管理 29800元
VMI管理 34800元
序列号 15800元
部门用料计划 35800元
进程管理 45000元
服装行业样品管理 49800元
服装行业销售业务 62000元
服装行业采购委外业务 18000元
服装行业库存业务 46000元
按质计价 49800元
质量管理-流程 58000元
售后服务 35800元
品控报表 12800元
采购询报价管理 11800元
借用归还 12800元
农户收购 62800元
运输管理 58000元
寄售 29800元
服装行业二维表单 9600元
电商订单中心 69600元
库存条码—PC版 42800元
库存条码-无线版 1-及以上站点: ([点数]-1)*15000+52800元
GMP基础应用 42800元
会员管理 39800元
生产制造 1-及以上站点: ([点数]-1)*21600元 物料清单 36000元
主生产计划 47800元
需求规划 47800元
产能管理 47800元
生产订单 47800元
车间管理 62800元
设备管理 48800元
工程变更管理 48800元
工序委外管理 35800元
服装行业车间管理 56000元
服装行业生产计划通知 86000元
服装行业计件工资 38000元
有限排产 200000元
有限排产模具算法 100000元
模具管理 79800元
生产用料分摊 32800元
物料重计 39800元
LED分光分选 39800元
生产线日计划 29800元
GMP管理 150000元
人力资源 1-及以上站点: ([点数]-1)*9600元 人事管理 12800元
人事合同管理 12800元
薪资管理 12800元
计件工资 22000元
集体计件 22000元
保险福利管理 13800元
考勤休假管理 43800元
招聘管理 22000元
培训管理 22000元
员工自助 1-30站点: 22000元
31-及以上站点: ([点数]-30)*500+22000元
经理自助 1-10站点: 20000元
11-及以上站点: ([点数]-10)*800+20000元
绩效管理 1-及以上站点: ([点数]-1)*9800+88000元
集团管理 1-及以上站点: ([点数]-1)*21000元 集团财务 56000元
合并报表 56000元
结算中心 56000元
预算管理-集 90000元
网上结算 1-及以上站点: ([点数]-1)*8000+12000元
内部审计 1-及以上站点: ([点数]-1)*20000+98000元
CRM 0元 CRM营销管理 1-及以上站点: ([点数]-1)*9800+59800元
CRM服务管理 1-及以上站点: ([点数]-1)*9800+51800元
呼叫中心-坐席端 1-及以上站点: ([点数]-1)*6000+100000元
呼叫中心集成 0元
PLM 0元 PDM-Professional7.x 1-760站点: 0元
PDM包 5-及以上站点: ([点数]-1)*13000元
基础功能包 30000元
文档管理 20000元
零部件管理 20000元
产品结构管理 30000元
变更管理 40000元
PLM项目管理 60000元
产品工艺管理 60000元
军工行业插件 150000元
AutoCAD集成 1-及以上站点: ([点数]-1)*1000+10000元
CAXA集成 1-及以上站点: ([点数]-1)*1000+10000元
SolidWorks集成 1-及以上站点: ([点数]-1)*2000+20000元
CATIA集成 1-及以上站点: ([点数]-1)*2000+20000元
SolidEdge集成 1-及以上站点: ([点数]-1)*2000+20000元
Pro/E集成 1-及以上站点: ([点数]-1)*2000+20000元
UG集成 1-及以上站点: ([点数]-1)*2000+20000元
Inventor集成 1-及以上站点: ([点数]-1)*2000+20000元
Protel集成 1-及以上站点: ([点数]-1)*2000+20000元
PADS集成 1-及以上站点: ([点数]-1)*2000+20000元
Project集成 1-及以上站点: [点数]*3000+30000元
CAD集成平台 30000元
![采购系统每到月中或月末的时候,采购入库的单价会改变?](https://www.kuaiji66.com/u8/zb_users/plugin/MiniTu/noimg.png)
对应产品线:供应链
对应模块:采购管理模块
问题现象:采购系统数据每到月中或月末的时候,采购入库的单价会改变,与当初录入时单价对不上,有当时打印单为据每月都会发生。
问题原因:经检查发现该数据是采购入库单当月做结算处理,暂估价被改写为结算价格。流程如此该数据正确无误。
解决方案:流程如此该数据正确无误。
![win8如何下载用友软件](https://www.kuaiji66.com/u8/zb_users/plugin/MiniTu/noimg.png)
win8如何下载用友软件win8如何下载用友软件:点击下载
- 物料清单,相同两个母件,版号为10与20 ,其中10版本日期比较20早,那么系统算采购计划时,系统怎么识别是要用版号为10或20的呢
- t6 6.1,提示
- 用友U8签约光电医用
- 用友U8助华测搭建强大敏捷经营平台
- ufo报表注意事项
- 对于用友软件进行SQL跟踪器时,应注意什么问题
- 用品种法核算,现有上月入库的产成品,需要在本月返工重新修改产品结构,这其中,需要耗用材料,也就是该产品成本发生变化
- 5月底结账时提示辅助帐与明细帐对账不平这个怎么处理?
- 有没有 一键备份 恢复所有账套的 工具,求解?
- 核算管理反结账到四月,提示有凭证未处理,处理核算管理中的凭证后【取消记账和审核】,凭证无法删除,提示月末已结账,但是总账系统已经反结账到3月且进行了反记账
![进入U8软件需要sa的口令](https://www.kuaiji66.com/u8/zb_users/plugin/MiniTu/noimg.png)
进入U8软件需要sa的口令进入U8软件需要sa的口令
问题描述:安装后进入软件提示:需要sa的口令。
解决办法:U8软件提示SA口令问题:㈠:对于SQL2000可能是安装时安全性选项中没有选择Windows和SQL Server集成验证方式。 解决方案:(1)从企业管理器中属性的安全性页中选择Windows和SQL Server集成验证方式(2)在查询分析器中运行 xp_instance_regwrite N\'HKEY_LOCAL_MACHINE\',N\'SOFTWARE\\Microsoft\\MSSQLServer\\MSSQLServer\', \'LoginMode\',N\'REG_DWORD\',2(3)修改注册表运行regedit命令修改HKEY_LOCAL_MACHINE\\ SOFTWARE\\Microsoft\\MSSQLServer\\MSSQLServer下LoginMode项目为 2 重新启动MSSQLServer服务和用友U8服务,最好用第一种方法解决。
使用技巧
热点文章
财务管理
成本管理中所有录入表及报表都需要增加工序说明
对应版本:用友U8.61
对应产品线:供应链
对应模块:库存管理模块
问题现象:成本核算方法为:启用生产制造数据来源,核算工序成本。问题:成本管理模块中所有的报表均只有工序行号,而没有工序说明,该单位目前的产成品品种多达3种,每种产品的工艺路线不同,因此成本模块中的报表只有工序行号,而没有工序说明谁都看不懂是代表哪道工序的工序品。
问题原因:成本管理中所有录入表及报表都需要增加工序说明,改动工作量大,在870版本以后考虑
解决方案:成本管理中所有录入表及报表都需要增加工序说明,改动工作量大,在870版本以后考虑降级品成本应该如何分配
对应版本:用友U8.61
对应产品线:供应链
对应模块:库存管理模块
问题现象:1、客户需求,在生产订单报检后产生不良品处理单,不良品存在降级处理流程。降级处理产生的另外一种产品入库,在不良品处理单上即指定了该不良品的价格,希望能够在这个订单得成本中扣除已不良品的价格,并分摊到成品中,得出正确的成品成本。E.G.001号生产订单生产A产品120KG消耗材料成本1200元通过产成品检验生成100KGA成品,报废5KG,降级处理A成品15KG,转换成B产品15KG入库,手工指定每公斤B的入库成本为7元。由于生产订单的完工数量也包括降级入库的数量,在成本管理中,计算A的成本为1200/(100+15)。但是由于在生产中B还可以利用,手工指定了他的入库成本为7元,希望能够在成本计算A的单位成本的时候可以刨去B的价钱,即A的成本为【1200-(15×7)】/100。B的数量和单价(金额)从不良品入库单取
问题原因:用户提供了一种降级品成本分配的具体方法,值得借鉴,但861版本暂时无法考虑。涉及质检、库存、存货、成本四个模块的贯通处理,接口及成本计算的逻辑都要发生一定的变化,870发版或以后版本考虑。
解决方案:用户提供了一种降级品成本分配的具体方法,值得借鉴,但861版本暂时无法考虑。涉及质检、库存、存货、成本四个模块的贯通处理,接口及成本计算的逻辑都要发生一定的变化,870发版或以后版本考虑。
用友热销产品
用友论坛
追“本”溯“源”
追“本”溯“源”
追“本”溯“源”:307
追“本”溯“源”
《信息化大视野》2009年第19期(总第53期)
在当前的经济形势下,对于中国大部分企业来说,利润微小的同时还要实现成长,不实行低成本运营就难以生存,可谓成本决定存亡。低成本创新,提高企业盈利水平,增强产品竞争力,扩大市场占有率,已成为众多企业不二之选。而要降低成本,除了要有科学的管理手段,更重要是要控制企业运营中成本产生的源头--采购成本。其实,成本控制是一门花钱的艺术,如何将企业的每一分钱花得恰到好处,是现代企业在商业时代成本控制之源。尤其对于以原材料采购为企业生产运营起点的制造型企业,原材料和服务的采购成本占到了总成本的50%~80%,采购成本控制成为企业中成本控制最重要的部分,追“本”溯“源”势在必行。
应收帐龄管理
应收帐龄管理
应收帐龄管理:505
应收帐龄管理
《信息化大视野》2010年第22期(总第104期)
企业应收帐款管理中的一个难点就是应收帐款的帐龄管理。
按照会计制度要求,很多企业是依据销售发票核算应收帐款,财务部门根据已开发票分析帐龄,这样势必造成回款不力、帐龄不准,甚至造成经营风险。在现实中,很多企业先发货后开票,销售部门按照发货单核算应收。这样就形成了业务、财务两个应收数据,因此就需要有很好的工具来管理应收帐款。
用友T3-业务通为客户提供了发货立账功能,使用户在发货时即确定应收,很好地管理了应收帐款,甚至可以作为业务员考核的基础、客户返利的基础。
- 最新文章排行
- 热门文章排行
知识库
T3卸载就会跳到安装界面去,用360工具也卸载不了。请问这种情况哪位老师遇见过,我们应该如何处理。谢谢、在线等。
T3卸载就会跳到安装界面去,用360工具也卸载不了。请问这种情况哪位老师遇见过,我们应该如何处理。谢谢、在线等。 T3卸载就会跳到安装界面去,用360工具也卸载不了。请问这种情况哪位老师遇见过,我们应该如何处理。谢谢、在线等。[]
备份好账套,这种情况只能强制删除了,请备份好账套之后,停止数据库服务和T3产品服务,自动备份服务;然后删除T3安装路径以及C盘下ufcomsql文件夹,然后使用360清除无用注册表,最后重启电脑即可;T1记账宝。无法反记账。提示3015错误。 _0
T1记账宝。无法反记账。提示3015错误。 _0T1记账宝。无法反记账。提示3015错误。
上条信息中已答复,请查看