土地使用税在做账的时候应该填应交税费的,填成管理费用了,都两个月了,已经报过税,怎么更改? _0
2018-5-2 0:0:0 wondial土地使用税在做账的时候应该填应交税费的,填成管理费用了,都两个月了,已经报过税,怎么更改? _0
土地使用税在做账的时候应该填应交税费的,填成管理费用了,都两个月了,已经报过税,怎么更改?[]是应该计入管理费用有借必有贷啊,计提是计入管理费用的企业计提时执行企业会计准则的要计入管理费用,执行小企业会计准则的要计入营业税金及附加中没必要改了吧。不用更改,就算是用大小准则核算都对利润表没影响。
填成管理费用了----借:管理费用 贷:银行存款
小准则:借:营业税金及附加 贷:应交税费-土地使用税 借:应交税费-土地使用税 贷:银行存款
大准则:借:管理费用 贷:应交税费-土地使用税 借:应交税费-土地使用税 贷:银行存款
最终分录借贷应交税费-土地使用税冲平了,损益类科目管理费用或营业税金及附加那个结转到本年利润都是一样利润没有减少。
下次做账认真点@谭Tracy:计提的时候填过管理费用了,报税的时候该填应交税费,又填成管理费用,这样管理费用都有两次土地使用税费用了
如果您的问题还没有解决,可以到 T+搜索>>上找一下答案
相关阅读
- 实物返利所得税如何核算2021-5-27 9:26:23
- 门户已运行问题详解2021-3-31 21:43:52
- T3如何查询客户科目余额表的累计数图文教程2021-3-15 9:47:42
- T3各模块反年结操作图文教程2020-11-9 10:32:53
- T3如何删除新年度的人员档案,工资项目等信息图文教程2020-11-5 9:3:54
- T3如何清空年度账图文教程2020-11-4 8:48:4
- T3如何设置存货总账的格式图文教程2020-7-15 8:20:18
- 用友T3如何按供应商进行账龄分析图文教程2020-6-29 10:3:26
- T3如何按供应商进行账龄分析图文教程2020-6-27 19:43:53
- T3供应商往来对账单如何录入图文教程2020-6-27 19:27:41
最新信息
#财税实务# @戴崇恩你好! 我12月份收到一些增值税专用发票,我本月不想认证,我是先在账上挂着,走应交税金-待抵扣增值税,还是我直接挂暂估入库,待2016年再把这些增值税发票先从暂估然后再2016年正式入库,直接进应交税金-进项税额,我有点拿不定。我怕这些发票虽然在2016年能抵扣但开票日期是2015年的日期,进不了2016年的账,请指教! _0#财税实务# @戴崇恩你好! 我12月份收到一些增值税专用发票,我本月不想认证,我是先在账上挂着,走应交税金-待抵扣增值税,还是我直接挂暂估入库,待2016年再把这些增值税发票先从暂估然后再2016年正式入库,直接进应交税金-进项税额,我有点拿不定。我怕这些发票虽然在2016年能抵扣但开票日期是2015年的日期,进不了2016年的账,请指教![]
正常记账就可以啊,不想认证就通过 应交税金-待认证进项税额过渡一下@赵秀苹:还有一个问题:我的 应缴税费-进项税额519365.54元;应缴税费-销项税额1743.59;应缴税费-进项税额转出 515334.56元,到年末了我应该将应缴税费-销项税额、进项税额转出怎样结转呀,这两个明细科目肯定不能带到下个会计年度吧,一定在12月末结转后为零吧,请麻烦写一下具体结转的会计分录?@zchIV7:年末余额可以带着,也可以结转为0,没有必然的要求。如果年底结转为0 的话,借:应交税费-应交增值税-销项税 1743.59 应交税费-应交增值税-进项税转出 515334.56 贷:应交税额-应交增值税-进项税 517078.15 对于你企业这样的情况应交税额-应交增值税-进项税是还有余额的,不用处理,留抵继续用就可以。@赵秀苹:谢谢了!我不困惑了![/抱拳]@赵秀苹:我还想请教,你现在是用的什么财务软件做账?我是刚刚用的用友t+普及版。@zchIV7:易代账 嘿嘿 T+普及版是网络版的,很方面。[/微笑]@赵秀苹:易代账需要花钱购买吗?@zchIV7:免费得代帐软件,小公司用的,就是咱们家园的软件我以为我购买的t+软件赠送会计家园这个平台呢。平台很好有些拿不准的问题,家园像你这样的老师就指点迷津了。赵秀苹,我可不可以先不做账,放到下个月在做账,也可以吧。@博洋:不做账对账就对不起来啊,当然也可以先不做账。下个月可就是下一年啦,16年的账里可以出现15年的票据吗?@赵秀苹:我觉得不做账下个月可就是下一年啦,16年的账里可以出现15年的库存或原材料的票据吗?这样行吗
用友T3用友通批次参照时同批次的存货不汇总显示--用友T3用友通批次参照时同批次的存货不汇总显示用友T3用友通批次参照时同批次的存货不汇总显示">用友T3用友通批次参照时同批次的存货不汇总显示
客户在启用批次管理后,如果同一批次有多次入库则出库时不能汇总出库。这次在问题在前初时我向服务部确认时他们说是可以的,但是现在我在给客户使用这个功能时却不能,请问怎么办?客户急用这个功能。同一批次多次出入库是不可以汇总的,软件认为的批次管理是其在出入库时数据库里存储的ID为准的,不同次的出入库,其数据库里的ID是不同的,所以是不能汇总的。
电子商务时代的网络财务(上) 电子商务时代的网络财务(上)
20世纪90年代以来,基于Internet的电子商务的发展为各种新的更加高效的财务与管理模式提供了广阔的空间和可能。互联网使企业成为全球网络供应链中的一个节点,新的企业系统开始出现,如网上企业、网际企业、虚拟企业等。同时新的经济形态也逐步形成,如直接经济、网络经济等。这些伴随电子商务而来的新的组织与经济形式,形成了企业间基于项目的完全富有弹性的动态联盟。
互联网技术对会计理论和实务的冲击,促进会计软件必须适应未来会计复杂化、多样化以及网络化的需求。互联网的普及和发展将推动企业经营走向电子商务,使电子商务成为网络时代的商业方式和企业生存方式。Web技术使“大企业变小,小企业变大”,财务软件必须适应新的网络环境。回顾我国财务软件的发展,在技术上已经走过了PC单机、PC局域网、Windows平台几个阶段,现在正在迈向互联网阶段。在上述背景之下,基于互联网的电子商务对财务软件的影响将是最深远的,是财务软件发展过程中最大的一次浪潮。它不同于以往的几次变革,不仅影响软件产品的形态,同时改变用户的应用形态,更带来厂商业务形态和方式的变革。
设置期间损益结转定义时,提示“凭证类别未定义”?原因分析:月末结转会生成一张凭证,那么首先需要定义凭证的类别。问题解答:点击“初始化”--“设置凭证类别”,选择凭证分类或凭证不分类,选择好后再去设置期间损益结转定义。
- 月末在产成品批量录入中没有产成品的明细,之前做过产成品入库单也都审核记账了
- 核算管理单据记账有好多单据提示“记账失败”,是什么原因呢-有些单子能正常记账,把单子删除了重新做也还一样的提示!系统只启用了总账和核算管理模块,
- 1、销售订单保存时提示这个。-2、发货单审核时提示如图:-最大单据工具执行过,还有单据还原工具也操作过。-看看是什么原因,谢谢!
- T3 10.3 版本 支持当产成品入库单的入库数量已经超过计划生产单的数量时还可以再用计划单领料生产!但升级为11.0版本的就不行了。这个应该是写在某个存取过程中判断的,现在我想在后台掉这个验证,麻烦大神们指点指点
- 业务员在T+下单手机端下销货单,业务员下单后 后台数据客户带不出业务员的信息,之前只有个别业务员操作出现这种情况, 昨天升级补丁后,没有做任何操作设置,现手机端全部带不出业务员信息
- 用用友财务软件后,再用T3 软件,注册信息会关闭,然后提示未注册,这是盗版软件,但软件狗灯是亮的,必须手动注册后和能使用,每次都是这样
- 电脑系统坏了 没有自动备份 账套数据是DBSERVER下面的物理备份,总共5个 有4个附加后都可以用 第5个账套附加成功后打开了 怎么看不到总账那些模块呢?
- 请大师们帮我看看这是什么问题?一:有采购入库,却在存货档案里库存信息没显示最新成本,在同一张卡片价格信息里有显示最新进价和售价。-二:销售单上有成本,为什么毛利预估没显示呢?
- 有没有物理文件删除T3软件的方法-
- 用友T3财务分析功能
用友T3用友通总账账簿打印时出错用友T3用友通总账账簿打印时出错 用友通10.3普及版在年底打印账簿的时候,在“总账->账簿打印”中打印各账簿,打印设置中选择了A4纸,边距调整好后,打印出来的账簿结果出现第一张打印出来是正确的,但是从第二张开始就出错,文字就出现向左靠了,打印不全。 解决方案:1、账簿打印中打印设置是设置为A4,检查”总账->选项->账簿”中勾上了”凭证、账簿套打”,检查“总账->套打工具->账簿”中纸型却显示为”Leagl”,并且不能修改。所以需要修改套打工具里的账簿纸型。 2、修改纸型在UFSMART\ZW\rep\tdlx\路径下的Tdprn.mdb ACCESS数据表中进行。所以在打开此表之前得先确保安装了OFFICE里的ACCESS。 3、打开表后将”上海套打非连续纸型、用友套打非连续纸型”中的”cfield_name”字段中的所有”5,0″改为“9,0” 4、再回到“总账->套打工具->账簿”中纸型显示为”A4″,这时账簿打印就不会在出错了,但这时最好再打个一下用友10.3普及版的最新补丁。
用友t3普及版财务软件用友t3普及版财务软件 :QQ4009908488 在线咨询>>
从客户实际需求出发,面向成长型企业开发设计,提高管理水平、优化运营流程,实现全面、精细化财务管理与业务控制的一体化管控信息平台,帮助企业
快速、准确应对市场变化,支持稳定、安全、成熟的长期可持续性发展;
同时满足企业决策者和管理者随时对内部信息的需求,提供方便快捷、高效率的实时动态信息交互,实现实时企业随时管理;
功能模块包括:总账、往来管理、现金银行、出纳通、报表、税务管家、网上银行、核算、跨帐套查询等模块。
用友通标准版的客户价值:
成长型企业管理整体解决方案,降低购置成本;
财务业务一体化设计,数据充分共享、及时精确;
丰富查询、智能分析、综合信息管理平台,辅助决策支持;
流程导航,方便易用,远程应用,部署灵活;
动态信息交互、实时企业随时管理;
保障投资、平滑安全升级;
简介:
总账
总账系统将财务核算和信息技术相融合,实现企业财务核算的自动化。企业以最少的人力投入、以最快的速度、以最优的准确度,及时、真实、可靠地进行
账务处理,为企业提供多角度、多方面的精细化财务数据;同时协助企业进行往来款管理、现金银行管理等。
灵活的凭证录入、查询、审核、过账及汇总;
多种账务处理、查询、输出;
期末汇总、自动结转损益、转账及结账;
完全支持成长型企业会计制度,系统预制成长型企业会计科目、财务报表;
部门、人员、项目、客户、供应商全面管理;
往来管理
客户和供应商是企业价值链上的两个重要环节。加强对单位往来的管理,不仅有利于加强对于往来款项的管理,减少坏账损失,加速资金周转,提高企业经
济效益,而且有利于营造一个高增值的价值链,为企业的长期、快速发展提供良好的经营环境。
实现多条件组合的往来款总账、明细账查询,及时掌握最新情况;
提供往来账龄分析,往来账清理等往来账管理工作,加速流动资金的周转;
现金银行
现金、银行存款是企业流动资产中最敏感的部分,借助“现金银行管理”,加强对现金和银行存款的控制和管理,随时掌握现金、银行存款收付的动态和库
存现金余额,确保现金和银行存款的安全。
实时查询银行日记账、现金日记账及资金日报表;
银行对账,系统自动编制余额调节表;
支票管理;
出纳通
是出纳人员使用的一款十分简便化工具,提供现金、银行业务的日常处理、自动核对数据、形成银行余额调节表、日记账和其他财务账表查询,同时支持支
票管理薄方式,集成了票据通出纳人员使用的各种支票,领用核销支票所产生数据可以自动生成日记账;进行全方位、全程化资金流变动情况的反映,帮助企业和
单位开展严格、及时的监督管理工作。
财务报表
财务报表是国内优秀的企业管理软件工具,与用友账务系统之间有完善的接口,在财经领域发挥着巨大的作用。总账子系统为企业财务核算提供了详尽、丰
富的凭证、账表信息,财务报表则是对这些分散信息进行归类、汇总,形成系统、概括性的报表信息。
预置工业、商业、事业单位等多行业的常用财务报表;
提供丰富的函数、公式,保证实时、快速、准确生成企业管理所需要各种会计报表;
核算管理:
主要针对企业商品收发存业务进行核算,掌握商品成本情况,为企业成本核算提供基础数据。并可动态反映库存资金的增减变动,为降低库存,减少资金积
压,加速资金周转提供决策依据。
支持移动平均、全月平均两种计价方式;
各种业务处理、业务单据自动生成凭证,进入总账系统,形成财务业务一体化流转。
用友T3普及版软件报价
用友T3普及版 总账(现金银行/往来管理/出纳)财务报表、出纳管理、税务管家 单用户 4980
核算管理 3280
网上银行 4000
用友T3工资模块银行代发一栏为空银行代发一览为空
问题版本:用友通标准版10.3
问题模块:工资管理
需求名称:银行代发一览为空
问题现象:打开工资模块,发现银行代发一览为空 原因分析:1.查看人员档案里面有没有相对应的银行账号
2.在银行代发里面有没有银行
解决方案:1.查看人员档案里面有没有相对应的银行账号
2.在银行代发里面有没有银行
- 如何删除T3系统固定资产模块结转的凭证?
- T3升级到G6产品,2016年正常使用,2015年以前年度报错“此帐套行业性质与科目设置中的科目分类不符,请调整”,点确定后提示没有设置数据库连接
- 其中一个账套,点击正常单据记账后点击确定,出现的界面是未记账单据一览表,
- 反结账反不了提示:当前月必须大于存货启用月才能恢复月末结账
- G3重装后提示出错-
- G6登录显示003-2016行业包设置与安装的行业包不一致
- T+12.1 开始作了一张进货单存货西瓜数量为104公斤,后来又删除此张进货单,月底的时候发现现存量里还显示这个存货数量104公斤,查看台帐页显示这个纪录,但是进货单列表里已经没有此张单据了,请问什么原因呢-
- 盘点时 如图提示 。
- 11.5客户端登录一直这样,服务器可以打开,地址可以ping通,端口也可以
- 卸载T3时总是提示安装,无法卸载是怎么回事呀?
t3,6个点需要主机什么配置? 内存4G或8G。硬盘500G。CPU处理速率:3.0GHZ以上。操作系统:WINDOWS sever 2008R2 。以上为建议配置i5以上 标压 8G [/坏笑] 预算够的话 买贵的觉对没错暂时i3,4G撑着呢。@熊安宁:够狠@西瓜zZ:好像也还行,也只是总账报表。@熊安宁: 做好备份 这种的有点危险 短期没有升级计划的话 把内存加到8@西瓜zZ:就是怕内存撑不住。暂时也不是同时6个都在线。会出现突然崩掉的情况吗?@熊安宁:会 。@西瓜zZ:感谢提醒。
用友T3如何增加和隐藏不要的功能模块用友T3如何增加和隐藏不要的功能模块
问:用友T3如何增加和隐藏不要的功能模块安装用友T3后新增帐套打开了很多功能觉得有些模块用不到 想隐藏起来但以后要用到 又如何添加
答:在系统里,用账套主管的身份进入,然后在账套里的启用就成黑色的字了,点开把不要的模块取消就可以了
问:财务软件按装完后,为什么没有科目出来零售单过账提示数据不正确资产负债表不平原因分析: 当软件计算金额与电子称打印金额不一致时,就会出现“数据不正确,资产负债表不平”的提示。例如:商品的电子秤识别码为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
用友T3软件凭证套打预览时不显示制单人和记账人的名字凭证套打预览时不显示制单人和记账人的名字
标题:凭证套打预览时不显示制单人和记账人的名字问题现象:凭证套打进行预览时,预览界面上不显示制单人和记账人的名字。原因分析:在软件中进行设置。问题答案:勾选总账-设置-选项中的“打印凭证页脚姓名”后,凭证制单人等可预览出来。
- 实物返利所得税如何核算
- 用友T3连续打印总账、明细账方法?
- 您好,请问下,T3普及版,客户端打开程序时提示如图,是什么原因?
- 您好:我想重装T3标10.8.2 。但卸载都卸载不了。双击T3安装程序,提示是否删除相关所有组件。确定后提示完成,是否重新启动计算机。但重启计算机后T3软件还是没有被卸载掉,再次双击安装程序又是重复的操作。在控制面板-程序里卸载也是一样的,用360软件管家下载也卸不掉。是什么原因呢????急!!!!!!
- 你好,咨询一下,我电脑重装系统之后,之前的账套怎么恢复?谢谢
- 你好,我财务电脑有问题,先从安装后出纳显示“系统未发现与总账对应的出纳帐套,是否要新建一个出纳帐套” _0
- 用友财务软件年末结转的具体操作步骤
- 年结时提示,[DBNETLIB][ConnectionOpen(connect())]SQL Server不存在或访问被拒绝_
- 用友T3软件如何连续打印总账、明细账?
- 用友软件T3工资管理操作流程
#财税实务#企业所得税汇算清缴前应该做哪些准备工作啊? #财税实务#企业所得税汇算清缴前应该做哪些准备工作啊?[]
我也没做过,关注看看业务招待费,福利费,广告宣传费等超过比例多少,能调整的提前调。要是享受税收优惠的,也要准备好资料。@六月虫:顺便咨询下你,招待费每年年报都要做调增的吗?我看他是按照60%扣除且不超过当年收入5‰,但是平时预交基本都是全额扣除的,那年报肯定要调增那个40%吧?查询涉及所得税调增调减项目,这些项目很多,网上可以搜,注意调增的项目,尽量少做,还有注意前期是否有未弥补的亏损,是否符合所得税减免政策等等,总的来说,季度报表最好做成亏损,第二年汇算清缴再交所得税,延迟所得税的缴纳,尽量少缴税@花未眠1448687784:可以季报的时候把招待费多做一些,然后在汇算的时候再调整,然后交税吗?别交冤枉税~企业所得税汇算清缴一本通可以看看,还有讲堂一些小视频也可以学习看看华艳老师的视频,你就知道了@Silence1440139133:对的,只要发生了业务费,都要调。
我公司在前几个月计提了房屋租金费用,款项从公户转给房东,但是发票开不进来。账务上该做什么处理,还是不用管所得税时调整呢 我公司在前几个月计提了房屋租金费用,款项从公户转给房东,但是发票开不进来。账务上该做什么处理,还是不用管所得税时调整呢[]
建议去税局代开租赁发票。@川邦:如果开不进来我该如何处理呢@多多1450146946: 不开就所得税调整@多多1450146946:根据合同和相关证件自行去地税代开,相比承担的租赁相关税费,所得税应该要多得多吧。
当然,有钱也可以任性[/龇牙]@安宝贝2015:是不是我照旧摊销租金,所得税时作调整就行啊@多多1450146946: 是的有发票才能进行摊销,没有就不能入账!@刘艳1446858084:但是是从公户付的,如果不做支付房租的话这笔款该怎么处理呢从公户付出去了,有没有发票都应该如实入账,但是没发票,你们单位又是查账征收企业所得税的话,汇缴时候就需要纳税调整啦