持有至到期投资测算表
2017-3-18 0:0:0 用友T1小编持有至到期投资测算表
持有至到期投资测算表
如果您的问题还没有解决,可以到 T+搜索>>上找一下答案
相关阅读
- 餐饮业要交的税种以及税率2017-3-26 0:0:0
- 餐饮业该如何做好成本控制2017-3-26 0:0:0
- 餐饮业销售外购食品是否缴增值税2017-3-26 0:0:0
- 餐饮业非现场消费的三方两税斗争史2017-3-26 0:0:0
- 餐饮企业主要会计问题及处理2017-3-26 0:0:0
- 餐饮企业会计流程(2)2017-3-26 0:0:0
- 餐饮企业会计流程(3)2017-3-26 0:0:0
- 餐饮企业利润提升方案2017-3-26 0:0:0
- 餐饮企业制作及销售成本的管理2017-3-26 0:0:0
- 餐饮企业合法规避各种餐饮税的方法要点及案例2017-3-26 0:0:0
最新信息
- 还没开票的做到预收科目,那成本可以先做进去吗?
- 进入总账提示所选行业性质与科目不相符,去检查表提示数据库严重损坏,修复数据提示成功,再去检测又是严重错误
- 进入总账正常,打开报表,选择报表文件,提示正在使用或被锁定。另存为后,打开正常,但是点打印时提示内容如图。点确定,重新进入财务报表时就提示报表为试用版。重新打补丁后又可以进入,还是一样问题循环。求解??
- 进入报表系统显示
- 进入界面提示:请使用系统维护工具修复数据库:k:-记账宝-zwset.mdb! 是4G的 _0
- 进入系统是提示无法连接服务器
- 进入财务报表模块,总是提示当前运行的是试用版 ,多次注册了还有提示。-报表最多追加4页,-报表不能打印,总是保存下来在打印。-财务报表数据不准,,有时候对,有时候不对,
- 进入账套后,点击编制凭证,出现动态库JZBComp.dll加载失败,点确定,记账宝就退出了。怎么办?我的邮箱为<span class="__cf_email__" data-cfemail="b381858385808385878184f3c2c29dd0dcde">[email protected]</span>
- 进入软件总是要密码,但是在安装数据库的时候没有密码。
- 进入软件提示这个问题 11.5的版本 打了最新补丁。已经成功注册。
会计账簿中常见的会计错弊 会计账簿中常见的会计错弊
(1)无据记账,凭空记账。
即账簿中所列的业务不是根据经审核无误的原始凭证填制记账凭证并逐笔登录的,而是会计人员凭空捏造出来的,或者在合法的凭证中插入一些不合法的业务内容。
(2)涂改、销毁、遗失、损坏会计账簿以掩盖其造假行为。
如用类似涂改凭证的方法来篡改有关账簿,有的则制造事故,造成账簿不慎被毁的假相,从而将不法行为掩盖于一般的过失当中,使审查人员的线索中断。例如某市纪检部门在决定对某企业进行审查时,该企业发生了火灾,烧毁了部分财务资料,事后经查发现,这是一个典型的想借此来掩盖会计舞弊的案例。
T310.8.1打了和服务器一样的补丁就是登陆不了,一直提示需要升级补丁,点升级也没反应,客户端和服务器的版本号都是一样的 T310.8.1打了和服务器一样的补丁就是登陆不了,一直提示需要升级补丁,点升级也没反应,客户端和服务器的版本号都是一样的
您好,您在服务器上打开补丁脚本执行器,对帐套执行一下升级脚本。@畅捷服务闫新华: 执行过了,还是一样的@畅捷服务闫新华: 补丁打错了,不好意思@a锋:您可以尝试重新下载最新补丁重新安装一下。
- 经常出现账套年度演示期限已到期,怎么办?
- 麻烦问下,T3升级T6,是不是要先安装6.1,用工具升级,再导出帐套,安装6.5,再升级到6.5?
- 麻烦问下,账簿交接怎么操作
- 麻烦问下:增值税普票次月开了负数发票,做账时是否都要把财务联和发票联附在记账凭证后,另外当月作废的增值税普票怎么处理呢?谢谢!
- 黄色的加密狗驱动不了,在服务社区下载的驱动安装后也是不行,win2003的系统
- 黄色部分的最新成本错了,如何修改
- (-0.2)的2009次方乘(-5)的2010次方
- (时间是11点多的时候还没吃饭)体育考试立定跳远 和跑完50米后 然后走20几分钟去车站搭车
- ,小额纳税企业在营业大厅开增值税专用发票税点是多少
- 1。T3升级上来,增加了 人事管理模块 ,加密狗刷新了 薪资管理还是系那是演示版……--2.还有就是 登录进去经常会出现登录子系统失败,退出再登录进去就行-请教
请问,考会从的电算化现在用的什么软件? 请问,考会从的电算化现在用的什么软件?[]
广东一般是通用软件,不分用友还是金蝶了。亲 你可以来我的群哦 群里面有很多资料 而且会不定时通知免费公开课地址。公开课是在腾讯课堂开课的 专业的讲师 有问题可以在群里或者课堂讨论 91077380 这是群号22333333
- 请问:修改制单人后以前做账的制单人不能同步修改吗?以前做好的账的制单人姓名?
- 请问,我们缴纳的税款入库到哪里了?在哪里可以看出入哪个金库了?三方协议上能看出吗?
- 请问,我先前收到一笔货款,不知道是谁付的,借:银行存款,贷:应收账款-未知;现在确认是谁付的后,我该怎样调账
- 请问,我公司是一般纳税人,供应商开给我们的进项名字开错了,已经被我们认证了,但是客户那边作废重开了一张,重开的未认证,这种进项转出要怎么做的?直接做一张红字红冲就可以了么?
- 请问,我看她写的期限是一年,那么一年以后,现在建立的帐套还在么
- 请问,我进项一个东西含税价是62元,税负率算1.2%,进销都是17%的税钱收,卖出去我要卖多少钱才不会亏呢?有公式吗
- 请问,新版的国税季报利润表里,本期金额和上期金额怎么填,取哪个数呢,谢谢
- 请问,用友建账建筑行业行业性质选哪个?
- 请问,财务做帐时后面附的合同必须是原件吗?
- 请问:店铺转让费10万元放在什么科目核算?新店。如果要摊消,几年摊完比较合理。坐得各位高手解答。谢谢。
我10月份暂估入库螺母10个单价0.5元,11月收到发票单价是0.6元,我在做采购发票的时候开业把暂估的单价0.5改成0.6吗?直接在采购发票选单里改可以吗? 我10月份暂估入库螺母10个单价0.5元,11月收到发票单价是0.6元,我在做采购发票的时候开业把暂估的单价0.5改成0.6吗?直接在采购发票选单里改可以吗?[]
是的,直接在采购发票上改如果是以发票立账的话,通过进货单生成的发票时直接把价格改了就可以了,会根据选项-核算中斩估入库选项进行相关的生成单据。不用在费用里做调整吗不需要的,暂估入库,软件会自动生成红蓝回冲单
- 钱流信息-现金银行收支查询-查询结果的明细列表会出现以下错误:-如果收款单中填写了2个收款账户,在查询列表中会出现相同的两条数据。-例,收款单001 账户A 1000元 账户B2000元-明细列表是 :-单号001 账户A 1000元-单号001 账户B 2000元-单号001 账户A 1000元-单号001 账户B 2000元
- 销售业务-业务场景 客户是卖布艺的 材料是平方 购进 卖的时候是以长-宽 得出来的平方,但是软件中 只能填一个数量 能否 把 数量设定公式 =长-宽的值 这样 数量-单价就是最终的金额了
- 销售出库单怎么新增?为何没有增加按钮?是账套有问题?还是操作问题?
- 销售成本明细表里边折后价(只有一个商品)显示0,其他的的都正常,是哪里出了问题
- 销售时,仓库有100个商品,客户购买了50个商品,并支付了50个商品的钱,那我仓库就应该出库50,还剩50。但他是分批拿走货的,我还要知道仓库还剩多少,他拿走了多少,还有多少没拿走?业务流程应该怎么弄?怎么做?
- 采购单据进行正常单据记账生成凭证,销售单据不想生成凭证,手工做凭证,月底核算模块可以正常结账吗?
- 采购订单做完,审核后,新增采购入库单参照订单生成时,含税单价会自动多出0.01分钱,含税总金额就多出好多,与订单就不一样了,这是怎么回事?数量都是完全一样。
- 采购订单流转生成采购入库单时,流转是灰色的,不可用,怎么办?
- 采购退货的红字采购入库单审核提示现存量不足,有什么办法可以把单据审核掉呢?
- 重新计价后好不好恢复
T3普及版10.9,注册成功但是登录系统管理提示“产品未检测到合法胡license授权请重新进行产品加密狗注册“ T3普及版10.9,注册成功但是登录系统管理提示“产品未检测到合法胡license授权请重新进行产品加密狗注册“[]
搜索C盘下是否有*.cjt文件,如果没有说明没有注册成功,注册加密狗要求使用IE8-IE10的32位浏览器,重新设置IE浏览器;具体可以参考服务社区-知识库中的文档http://service.chanjet.com/zhi ... 74a46;重新注册请严格按照上面的操作;如果有cjt文件,32位系统查看cjt文件是否在system32文件夹中,如果不在请拷贝到对应文件夹中;如果是64位系统,查看cjt文件是否在syswow64文件夹中,如果不在,拷贝到syswow64文件夹中,然后再看是否正常[/微笑]@服务社区_郝瑞然_:这个链接好像不对啊,能不能重新发个你链接,谢谢了就是浏览器的问题@服务社区_郝瑞然_:这边操作系统是win10 64位ie是11的重新安装个ie10安装不了啊@李淑军v6b: 请参考加密狗注册流程,根据加密狗注册流程设置进行设置下。
http://service.chanjet.com/zhi ... 002d4@李淑军v6b: win10操作系统可以使用360 安全浏览器进行注册,一定要兼容IE进行注册就可以了。@服务社区_郝瑞然_:但是兼容模式进入注册的网站会卡死@李淑军v6b: 只能使用360兼容IE浏览器进行注册。
- 销售订单,联查都已经没有后续单据了,但是还是一直提示单据已后续执行,不能弃审。
- 销售订单,表头,字段的位置可以移动吗?如何移动控件位置? _0
- 销售费用分摊单,什么情况下适合进行分摊,我方付运费时?还是客户方付运费我方暂时垫付时?
- 销货单已经部分出库,做了出库单,现在想要在不删除出库单的前提下将销货单弃审后修改价格再重新审核能实现吗?还是说一定要把出库单删除后才能够弃审销货单?
- 销售报表上怎么把单据的备注显示出来
- 销售排行榜报表和图表怎么显示
- 销售排行榜统计的数据是扣除退货的吗?
- 销售统计表想某一自定义数值型要显示但不做合计可以吗?
- 销售订单上能不能显示客户应收款?
- 销售订单如何自动带出最新的销售单价?
用友U8.61UFPMP_17U8.61UFPMP
U8.61-UFPMP
自动编号: | 2335 | 产品版本: | U8.61 |
产品模块: | 固定资产 | 所属行业: | 通用 |
适用产品: | U861--供应链--16 | 关 键 字: | 日常操作 |
问题名称: | UFPMP | ||
问题现象: | 在仓库期末处理时,如果选择了"数量为零金额不为零自动生成出库调整单"时,在生成调整单时,有自由项的存货无法指定自由项,系统出不作提示,导致在收发存汇总表中按自由项汇总时显示成2条记录了(1条是有自由项的,1条是无自由项的)。 | ||
原因分析: | 同解决方案 | ||
解决方案: | 861系统不支持按自由项核算,因此会出现以上的问题。 87016增加了按自由项核算的功能,可以解决此问题。 温馨提示:如果您的问题还没有解决,欢迎进入用友云基地。 |
用友U8.61平整打印不断重复第一张U8.61平整打印不断重复第一张
U8.61-平整打印不断重复第一张
自动编号: | 3082 | 产品版本: | U8.61 |
产品模块: | 总账 | 所属行业: | 通用 |
适用产品: | 8.5x 8.6x | 关 键 字: | 打印凭证 |
问题名称: | 平整打印不断重复第一张 | ||
问题现象: | 打印凭证时,选好了凭证范围,但打印出来的全部都是第一张,后面的不能打印出来 | ||
原因分析: | 打印设置问题 | ||
解决方案: | 在打印设置中,选择左边装订,垂直方向,不要选择横向压缩到一页 温馨提示:如果您的问题还没有解决,欢迎进入用友云基地。 |
上解单位 上解单位
直接负责税款的征收、上解业务的税务机关。它不负责与金库核对入库税款和从金库办理税款退库业务,它是相对独立的会计主体,一般指基层税务所。其特点是:它是入库单位的基层核算单位,无下属核算单位,所以也称为二级核算单位;它核算税收资金从实现到上解的过程,即税金申报和征收两个阶段,为了满足上解单位考核税收收入任务的需要,它还必须将税款的提退也纳入其核算范围,以便提供税款上解净额资料;侧重于按纳税户进行明细核算,重点反映每个纳税户的税款申报和征纳情况。
用友U8 销售系统中进销存统计表与销售毛利分析不一致。正常时进销存统计表中的销售数量、销售金额应分别与销售毛利分析中的本期数量、毛利变动扩影响分析售价影响一致,但在用户处11月份不一致用友U8 销售系统中进销存统计表与销售毛利分析不一致。正常时进销存统计表中的销售数量、销售金额应分别与销售毛利分析中的本期数量、毛利变动扩影响分析/售价影响一致,但在用户处11月份不一致。
问题原因:软件设计问题,Sa_moveSRMDetail存储过程其日期过滤条件的判断为大于起始日期。 解决方法:查询其他账表并与此两张表对比,发现销售毛利分析中数据是正确的,而进销存统计表数据不对。用SQL跟踪发现进销存统计表是调用存储过程Sa_moveSRMDetail进行数据查询的,仔细分析Sa_moveSRMDetail存储过程,发现其日期过滤条件的判断为大于起始日期,小于等于结束日期,也就是起始日期这一天给舍弃了,导致统计数据不对,改成大于等于起始日期后查询正确。if exists(select * from sysobjects where name='sa_MoveSRMDetail' and type='P')drop PROCEDURE sa_MoveSRMDetailgo-- U821版-- 2003.12.5-- 南京用友 丁德安-- 销售系统中进销存统计表的销售数量、销售收入不等于销售毛利分析中的本期数量和售价影响-- 经分析后发现是起始日期判断条件为'>',应为'>='CREATE PROCEDURE sa_MoveSRMDetail ( @chrtablename varchar (50) = null , @chrWhere varchar (255 ) = null , @chrStartDate varchar(20) = null , @chrendDate varchar(20) = null , @chrChecker varchar(40) = null , @chrDep varchar(50) = null , @chrWareHouse varchar(20) ) ASdeclare @chrsql varchar(4000) declare @chrCost varchar(40) declare @chrSaleDate varchar (50)-- 删除临时表 if exists (select name from tempdb..sysobjects where name ='tmp_srm') drop table tempdb..tmp_srm --删除进销存明细账--1 组织期初数据 --1.1 计算所有发出成本 if exists (select name from tempdb..sysobjects where name ='tmp_srmcost' ) drop table tempdb..tmp_srmcost --删除成本明细 --从成本明细账中取得销售成本和其他出库成本 set @chrsql= ' Select dkeepdate as ddate , cVouType AS cvoutype,cInvcode, cAccDep ,ia_subsidiary.cDepCode, bMoneyFlag, bSale, iMonth , Warehouse.cWhValueStyle AS cWhValueStyle , ia_subsidiary.cWhcode , iAOutQuantity , case when (cWhvaluestyle=''计划价法''or cWhvalueStyle=''售价法'') and bMoneyFlag=1 then isnull(iAOutPrice,0)- isnull(iDebitDifCost,0) + isnull(iCreditDifCost,0) else isnull ( iAOutPrice,0 ) end as iAOutPrice into tempdb..tmp_srmcost from ia_subsidiary inner join warehouse on ia_subsidiary.cwhcode = warehouse.cwhcodewhere brdflag = 0 ' if ltrim(rtrim(@chrwhere )) <> '' and not ( @chrwhere is null ) set @chrsql = @chrsql + ' and ' + @chrwhere if ltrim(rtrim(@chrdep )) <> '' and not ( @chrdep is null ) set @chrsql = @chrsql + ' and cAccdep ' + @chrdep if ltrim(rtrim(@chrenddate )) <> '' and not (@chrenddate is null ) set @chrsql = @chrsql + ' and dkeepdate<='''+ @chrenddate +''''if ltrim(rtrim(@chrWareHouse)) <> '' and not (@chrWareHouse is null ) set @chrsql = @chrsql +' and ia_subsidiary.cwhcode='''+ ltrim(rtrim(@chrWareHouse)) +''''exec (@chrsql )--计算非自填成本 set @chrCost=(SELECT cValue FROM AccInformation WHERE (cSysID = 'ia') AND (cName = 'cvaluestyle')) if @chrCost ='按部门核算'begin update tempdb..tmp_srmcost set tempdb..tmp_srmcost.iAOutPrice=case when (tempdb..tmp_srmcost.cWhvalueStyle='售价法' ) then tempdb..tmp_srmcost.iAoutPrice*(1 - isnull(ia_summary.iDifRate,0)) else tempdb..tmp_srmcost.iAoutPrice*(1 + isnull(ia_summary.iDifRate,0)) end from tempdb..tmp_srmcost inner join ia_summary on tempdb..tmp_srmcost.iMonth = ia_summary.iMonth and tempdb..tmp_srmcost.cDepCode = ia_summary.cDepCode and tempdb..tmp_srmcost.cInvCode = ia_summary.cInvCode where (tempdb..tmp_srmcost.cWhvaluestyle='计划价法'or tempdb..tmp_srmcost.cWhvalueStyle='售价法') and tempdb..tmp_srmcost.bMoneyFlag=0 and tempdb..tmp_srmcost.bSale<> 1 endelse begin update tempdb..tmp_srmcost set tempdb..tmp_srmcost.iAOutPrice=case when (tempdb..tmp_srmcost.cWhvalueStyle='售价法' ) then tempdb..tmp_srmcost.iAoutPrice*(1 - isnull(ia_summary.iDifRate,0)) else tempdb..tmp_srmcost.iAoutPrice*(1 + isnull(ia_summary.iDifRate,0)) end from tempdb..tmp_srmcost inner join ia_summary on tempdb..tmp_srmcost.iMonth = ia_summary.iMonth and tempdb..tmp_srmcost.cWhCode = ia_summary.cWhCode and tempdb..tmp_srmcost.cInvCode = ia_summary.cInvCode where (tempdb..tmp_srmcost.cWhvaluestyle='计划价法'or tempdb..tmp_srmcost.cWhvalueStyle='售价法') and tempdb..tmp_srmcost.bMoneyFlag=0 and tempdb..tmp_srmcost.bSale<> 1 end--完成成本计算所有的出库成本保存在临时文件 tempdb..tmp_srccost中 --1.3计算期初入库金额 --创建临时表tmp_srm保存查询统计的临时结果 --临时表结构 存货编号 ,部门编号 ,期初数量,期初金额,采购数量,采购金额 -- 暂诂数量,暂诂金额,其他入库数量,其他入库金额,销售数量 -- 销售金额,其他出库数量,其他出库金额,调拨数量,调拨金额 -- 收入金额,出库数量,成本 set @chrsql = 'Select cInvCode , caccdep ,iAinQuantity as qc_iQuantity , (iAinPrice + isnull( iDebitDifCost,0) -isnull(iCreditDifCost,0) ) as qc_imoney ,(iAinPrice - iAinPrice) as iQuantityCG , (iAinPrice - iAinPrice) as iMoneyCG , (iAinPrice - iAinPrice) as iQuantityZG, (iAinPrice - iAinPrice) as iMoneyZG , (iAinPrice - iAinPrice) as iQuantityQTRK , (iAinPrice - iAinPrice) as iMoneyQTRK , (iAinPrice - iAinPrice) as iQuantityXS , (iAinPrice - iAinPrice) as iMoneyXS , (iAinPrice - iAinPrice) as iQuantityQTCK , (iAinPrice - iAinPrice) as iMoneyQTCK , (iAinPrice - iAinPrice) as iQuantityDB , (iAinPrice - iAinPrice) as iMoneyDB ,(iAinPrice - iAinPrice) as iMoneySR , (iAinPrice - iAinPrice) as iQuantityCK , (iAinPrice - iAinPrice) as iMoneyCB ,cwhcode into tempdb..tmp_srm from ia_subsidiary 'if ltrim(rtrim(@chrstartdate)) = '' or @chrstartdate is null begin --无期初日期时只计算上年结转 set @chrsql = @chrsql + ' where iMonth=0 and brdflag = 1 and cVoutype <>''33'' 'end else begin--有期初日期时的情况 set @chrsql = @chrsql + ' where brdflag = 1 and ( (iMonth = 0 and cVoutype <>''33'' ) or dkeepdate <='''+@chrstartdate +''' and ( cVoutype in (''01'',''24'',''30'',''08'',''20'',''22'',''10'') or (cvoutype =''20'' and cbustype=''暂估报销'' ) ) ) 'end --加入日期和部门条件 if ltrim(rtrim(@chrwhere )) <> '' and not (@chrwhere is null ) set @chrsql = @chrsql + ' and ' + @chrwhere if ltrim(rtrim(@chrdep )) <> '' and not ( @chrdep is null ) set @chrsql = @chrsql + ' and cAccdep ' + @chrdep --加入仓库条件 if ltrim(rtrim(@chrWareHouse)) <> '' and not (@chrWareHouse is null ) set @chrsql = @chrsql +' and ia_subsidiary.cwhcode='''+ ltrim(rtrim(@chrWareHouse)) +''''exec ( @chrsql )--1.2 生成期初出库成本 if ltrim(rtrim(@chrstartdate)) <> '' and not ( @chrstartdate is null ) begin --如果无期初日期不应该计算期初发出内容 set @chrsql = 'insert into tempdb..tmp_srm Select cInvCode , caccdep ,- iAoutQuantity as qc_iQuantity , - iAoutPrice as qc_imoney ,0 as iQuantityCG , 0 as iMoneyCG , 0 as iQuantityZG, 0 as iMoneyZG , 0 as iQuantityQTRK , 0 as iMoneyQTRK , 0 as iQuantityXS , 0 as iMoneyXS , 0 as iQuantityQTCK , 0 as iMoneyQTCK , 0 as iQuantityDB , 0 as iMoneyDB ,0 as iMoneySR , 0 as iQuantityCK , 0 as iMoneyCB , cWhcode from tempdb..tmp_srmcost where cvoutype in (''09'',''11'',''21'',''26'',''27'',''28'',''29'',''32'') 'set @chrsql = @chrsql + ' and ddate <=''' + @chrstartdate + '''' exec(@chrsql )end --完成期初数据的准备 --2 组织本期数据 --2.1 统计本期采购入库数据:采购入库数量,采购入库金额,暂诂入库数量,暂诂入库金额,其它入库数量,其他入库金额set @chrsql = 'insert into tempdb..tmp_srm Select cInvCode , caccdep ,0 as qc_iQuantity ,0 as qc_imoney ,case when cvoutype in(''01'',''24'',''30'') or (cvoutype =''20'' and cbustype=''暂估报销'' ) then iAinQuantity else 0end iQuantityCG , case when cvoutype in(''01'',''24'',''30'') or (cvoutype =''20'' and cbustype=''暂估报销'' ) then iAinPrice + isnull( iDebitDifCost,0) -isnull(iCreditDifCost,0) else 0end as iMoneyCG , case when ( cvoutype = ''01'' and bflag = 1 ) or cvoutype in(''24'',''30'') or (cvoutype =''20'' and cbustype=''暂估报销'' ) then iAinQuantity else 0end as iQuantityZG, case when ( cvoutype = ''01'' and bflag = 1 ) or cvoutype in(''24'',''30'') or (cvoutype =''20'' and cbustype=''暂估报销'' ) then iAinPrice + isnull( iDebitDifCost,0) -isnull(iCreditDifCost,0) else 0end as iMoneyZG , case when cVoutype in (''08'',''20'',''22'',''10'') then iAinQuantity else 0 end as iQuantityQTRK , case when cVoutype in (''08'',''20'',''22'',''10'') then iAinPrice + isnull( iDebitDifCost,0) -isnull(iCreditDifCost,0) else 0 end as iMoneyQTRK , 0 as iQuantityXS , 0 as iMoneyXS , 0 as iQuantityQTCK , 0 as iMoneyQTCK , 0 as iQuantityDB , 0 as iMoneyDB ,0 as iMoneySR , 0 as iQuantityCK , 0 as iMoneyCB , cWhcode from ia_subsidiary Where bRdflag = 1 and iMonth > 0 and ( cVoutype in (''01'',''24'',''30'',''08'',''20'',''22'',''10'') or (cvoutype =''20'' and cbustype=''暂估报销'' ) ) '--追加开始日期条件 if ltrim(rtrim(@chrstartdate)) <> '' and not ( @chrstartdate is null ) set @chrsql = @chrsql + ' and dkeepdate>''' + @chrstartdate + ''''--追加结束日期条件 if ltrim(rtrim(@chrenddate)) <> ''and not ( @chrenddate is null ) set @chrsql = @chrsql + ' and dkeepdate<=''' + @chrenddate + ''''--追加其他条件 if ltrim(rtrim(@chrwhere)) <> '' and not @chrwhere is null set @chrsql = @chrsql + ' and ' + @chrwhere if ltrim(rtrim(@chrdep )) <> '' and not ( @chrdep is null ) set @chrsql = @chrsql + ' and cAccdep ' + @chrdep --加入仓库条件 if ltrim(rtrim(@chrWareHouse)) <> '' and not (@chrWareHouse is null ) set @chrsql = @chrsql +' and ia_subsidiary.cwhcode='''+ ltrim(rtrim(@chrWareHouse)) +''''exec(@chrsql ) --end 本期采购部分计算结束 --2.3 统计本期销售数量,销售金额,销售调拨数量,销售调拨金额 -- 取得销售系统启用日期 set @chrsaledate = (select isnull(cValue,'1900-01-01') from accinformation where cSysid='Sa' and cName='dStartDate' ) if @chrsaledate <> '' begin if len(ltrim(rtrim(@chrsaledate))) <= 8 set @chrsaledate = convert(varchar(10),convert(smalldatetime,@chrsaledate,2),121)set @chrsaleDate = ' and SalebillVouch.dDate>=''' + @chrsaledate + ''''end --计算本期销售数据 set @chrsql = 'insert into tempdb..tmp_srm Select cInvCode , cdepcode as caccdep ,0 as qc_iQuantity , 0 as qc_imoney ,0 as iQuantityCG , 0 as iMoneyCG , 0 as iQuantityZG, 0 as iMoneyZG , 0 as iQuantityQTRK , 0 as iMoneyQTRK , iQuantity as iQuantityXS , iNatSum as iMoneyXS , 0 as iQuantityQTCK , 0 as iMoneyQTCK , case when cvouchtype = ''28'' then iQuantity else 0 end as iQuantityDB , case when cvouchtype =''28'' then iNatMoney else 0 end as iMoneyDB ,iNatMoney as iMoneySR , 0 as iQuantityCK , 0 as iMoneyCB , Salebillvouchs.cWhcode From Salebillvouchs inner join Salebillvouch on salebillvouchs.sbvid = salebillvouch.sbvid where isnull(Salebillvouch.cinvalider ,'''')='''' ' + @chrsaledate --增加审核条件 if ltrim(rtrim(@chrchecker)) <> '' and not (@chrchecker is null ) set @chrsql = @chrsql + ' and ' + @chrchecker --增加开始日期条件 if ltrim(rtrim(@chrstartdate)) <> '' and not (@chrstartdate is null ) -- 2003.12.5 丁德安--set @chrsql = @chrsql + ' and ddate >''' + @chrstartdate + ''''set @chrsql = @chrsql + ' and ddate >=''' + @chrstartdate + ''''--增加结束日期条件 if ltrim(rtrim(@chrenddate )) <> '' and not (@chrenddate is null )set @chrsql = @chrsql + ' and ddate <=''' + @chrenddate + '''' --增加一般条件 if ltrim(rtrim(@chrwhere)) <> '' and not (@chrwhere is null )set @chrsql = @chrsql + ' and ' + @chrwhere if ltrim(rtrim(@chrdep )) <> '' and not ( @chrdep is null ) set @chrsql = @chrsql + ' and cdepCode ' + @chrdep --加入仓库条件 if ltrim(rtrim(@chrWareHouse)) <> '' and not (@chrWareHouse is null ) set @chrsql = @chrsql +' and Salebillvouchs.cwhcode='''+ ltrim(rtrim(@chrWareHouse)) +''''exec (@chrsql )--本期收入计算终止 --2.4 统计本期销售成本,销售收入,出库数量 set @chrsql = 'insert into tempdb..tmp_srm Select cInvCode , caccdep ,0 as qc_iQuantity , 0 as qc_imoney ,0 as iQuantityCG , 0 as iMoneyCG , 0 as iQuantityZG, 0 as iMoneyZG , 0 as iQuantityQTRK , 0 as iMoneyQTRK , 0 as iQuantityXS , 0 as iMoneyXS , case when cvoutype =''09'' or cvoutype =''11'' or (cvoutype = ''21'' and bSale = 0 ) then iAoutQuantity else 0 end as iQuantityQTCK , case when cvoutype =''09'' or cvoutype =''11'' or (cVoutype =''21'' and bSale = 0 ) then iAoutPrice else 0 end as iMoneyQTCK , 0 as iQuantityDB , 0 as iMoneyDB , 0 as iMoneySR ,case when cvoutype in (''26'',''27'',''28'',''29'',''32'') or ( cvoutype =''21'' and bsale=1) then iAoutQuantity else 0 end as iQuantityCK , case when cvoutype in (''26'',''27'',''28'',''29'',''32'') or ( cvoutype =''21'' and bsale=1) then iAoutPrice else 0 end as iMoneyCB , cwhcode from tempdb..tmp_srmcost Where iMonth > 0 and cvoutype in (''09'',''11'',''21'',''26'',''27'',''28'',''29'',''32'') ' if ltrim(rtrim(@chrstartdate)) <> '' and not (@chrstartdate is null ) set @chrsql = @chrsql + ' and ddate >'''+ @chrstartdate + '''' exec( @chrsql )--3 按存货分类展开处理 /*存货分类按编码级次展开 */declare @chrfieldlist varchar(4000)declare @chrInner varchar (4000)declare @chrbmjc varchar(20)declare @i int declare @n int /*存货分类按编码级次展开 *//*取得存货分类编码级次 */set @chrbmjc = ''set @chrbmjc = (select cValue from accInformation where cName ='cGoodClass')/*连接展开字符串*/set @chrfieldlist = ''set @chrInner = '' set @i =1 set @n = 0 while (@i <= 8 )begin set @n = @n + substring(@chrbmjc,@i,1) /* 分解级次 *//* 组合字段列表 */set @chrfieldlist = @chrfieldlist +'c'+ ltrim(rtrim(str(@i))) + '.cInvCName as cInvCName' + ltrim(rtrim(@i)) +','/* 组合关联 */if (@i <= len(@chrbmjc))begin set @chrinner = @chrinner + ' left join inventoryClass c'+ ltrim(rtrim(str(@i)))+ ' on c'+ ltrim(rtrim(str(@i)))+'.cInvCCode = left( b.cInvCCode,'+ltrim(rtrim(str(@n)))+')'end else begin set @chrinner = @chrinner + ' left join inventoryClass c' + ltrim(rtrim(str(@i)))+ ' on b.cInvCCode = c'+ ltrim(rtrim(str(@i)))+ '.cInvCCode 'end set @i = @i +1 end --4 生成最终的临时表if exists(select name from tempdb..sysobjects where name = @chrtablename ) exec ('drop table tempdb..' + @chrtablename )set @chrsql = 'Select a.* ,Department.cDepName , b.cinvname , b.cinvStd , b.cinvM_Unit ,'+@chrfieldlist +'b.cInvDefine1 , b.cInvDefine2 ,b.cInvDefine3 , 0 as iProfit , 0 as iProfittax, 0 as qm_iQuantity ,0 as qm_iMoney , 0 as iPrice , 0 as iPriceTax ,vendor.cvenname , warehouse.cWhname into tempdb..'+@chrtablename+'from tempdb..tmp_srm a left join inventory b on a.cInvCode = b.cInvCode left join Department on a.caccdep = department.cDepcode left join vendor on b.cvencode = vendor.cvencode left join warehouse on a.cwhcode = warehouse.cwhcode ' + @chrInner exec(@chrsql)
解决方案:
问题原因:软件设计问题,Sa_moveSRMDetail存储过程其日期过滤条件的判断为大于起始日期。 解决方法:查询其他账表并与此两张表对比,发现销售毛利分析中数据是正确的,而进销存统计表数据不对。用SQL跟踪发现进销存统计表是调用存储过程Sa_moveSRMDetail进行数据查询的,仔细分析Sa_moveSRMDetail存储过程,发现其日期过滤条件的判断为大于起始日期,小于等于结束日期,也就是起始日期这一天给舍弃了,导致统计数据不对,改成大于等于起始日期后查询正确。if exists(select * from sysobjects where name='sa_MoveSRMDetail' and type='P')drop PROCEDURE sa_MoveSRMDetailgo-- U821版-- 2003.12.5-- 南京用友 丁德安-- 销售系统中进销存统计表的销售数量、销售收入不等于销售毛利分析中的本期数量和售价影响-- 经分析后发现是起始日期判断条件为'>',应为'>='CREATE PROCEDURE sa_MoveSRMDetail ( @chrtablename varchar (50) = null , @chrWhere varchar (255 ) = null , @chrStartDate varchar(20) = null , @chrendDate varchar(20) = null , @chrChecker varchar(40) = null , @chrDep varchar(50) = null , @chrWareHouse varchar(20) ) ASdeclare @chrsql varchar(4000) declare @chrCost varchar(40) declare @chrSaleDate varchar (50)-- 删除临时表 if exists (select name from tempdb..sysobjects where name ='tmp_srm') drop table tempdb..tmp_srm --删除进销存明细账--1 组织期初数据 --1.1 计算所有发出成本 if exists (select name from tempdb..sysobjects where name ='tmp_srmcost' ) drop table tempdb..tmp_srmcost --删除成本明细 --从成本明细账中取得销售成本和其他出库成本 set @chrsql= ' Select dkeepdate as ddate , cVouType AS cvoutype,cInvcode, cAccDep ,ia_subsidiary.cDepCode, bMoneyFlag, bSale, iMonth , Warehouse.cWhValueStyle AS cWhValueStyle , ia_subsidiary.cWhcode , iAOutQuantity , case when (cWhvaluestyle=''计划价法''or cWhvalueStyle=''售价法'') and bMoneyFlag=1 then isnull(iAOutPrice,0)- isnull(iDebitDifCost,0) + isnull(iCreditDifCost,0) else isnull ( iAOutPrice,0 ) end as iAOutPrice into tempdb..tmp_srmcost from ia_subsidiary inner join warehouse on ia_subsidiary.cwhcode = warehouse.cwhcodewhere brdflag = 0 ' if ltrim(rtrim(@chrwhere )) <> '' and not ( @chrwhere is null ) set @chrsql = @chrsql + ' and ' + @chrwhere if ltrim(rtrim(@chrdep )) <> '' and not ( @chrdep is null ) set @chrsql = @chrsql + ' and cAccdep ' + @chrdep if ltrim(rtrim(@chrenddate )) <> '' and not (@chrenddate is null ) set @chrsql = @chrsql + ' and dkeepdate<='''+ @chrenddate +''''if ltrim(rtrim(@chrWareHouse)) <> '' and not (@chrWareHouse is null ) set @chrsql = @chrsql +' and ia_subsidiary.cwhcode='''+ ltrim(rtrim(@chrWareHouse)) +''''exec (@chrsql )--计算非自填成本 set @chrCost=(SELECT cValue FROM AccInformation WHERE (cSysID = 'ia') AND (cName = 'cvaluestyle')) if @chrCost ='按部门核算'begin update tempdb..tmp_srmcost set tempdb..tmp_srmcost.iAOutPrice=case when (tempdb..tmp_srmcost.cWhvalueStyle='售价法' ) then tempdb..tmp_srmcost.iAoutPrice*(1 - isnull(ia_summary.iDifRate,0)) else tempdb..tmp_srmcost.iAoutPrice*(1 + isnull(ia_summary.iDifRate,0)) end from tempdb..tmp_srmcost inner join ia_summary on tempdb..tmp_srmcost.iMonth = ia_summary.iMonth and tempdb..tmp_srmcost.cDepCode = ia_summary.cDepCode and tempdb..tmp_srmcost.cInvCode = ia_summary.cInvCode where (tempdb..tmp_srmcost.cWhvaluestyle='计划价法'or tempdb..tmp_srmcost.cWhvalueStyle='售价法') and tempdb..tmp_srmcost.bMoneyFlag=0 and tempdb..tmp_srmcost.bSale<> 1 endelse begin update tempdb..tmp_srmcost set tempdb..tmp_srmcost.iAOutPrice=case when (tempdb..tmp_srmcost.cWhvalueStyle='售价法' ) then tempdb..tmp_srmcost.iAoutPrice*(1 - isnull(ia_summary.iDifRate,0)) else tempdb..tmp_srmcost.iAoutPrice*(1 + isnull(ia_summary.iDifRate,0)) end from tempdb..tmp_srmcost inner join ia_summary on tempdb..tmp_srmcost.iMonth = ia_summary.iMonth and tempdb..tmp_srmcost.cWhCode = ia_summary.cWhCode and tempdb..tmp_srmcost.cInvCode = ia_summary.cInvCode where (tempdb..tmp_srmcost.cWhvaluestyle='计划价法'or tempdb..tmp_srmcost.cWhvalueStyle='售价法') and tempdb..tmp_srmcost.bMoneyFlag=0 and tempdb..tmp_srmcost.bSale<> 1 end--完成成本计算所有的出库成本保存在临时文件 tempdb..tmp_srccost中 --1.3计算期初入库金额 --创建临时表tmp_srm保存查询统计的临时结果 --临时表结构 存货编号 ,部门编号 ,期初数量,期初金额,采购数量,采购金额 -- 暂诂数量,暂诂金额,其他入库数量,其他入库金额,销售数量 -- 销售金额,其他出库数量,其他出库金额,调拨数量,调拨金额 -- 收入金额,出库数量,成本 set @chrsql = 'Select cInvCode , caccdep ,iAinQuantity as qc_iQuantity , (iAinPrice + isnull( iDebitDifCost,0) -isnull(iCreditDifCost,0) ) as qc_imoney ,(iAinPrice - iAinPrice) as iQuantityCG , (iAinPrice - iAinPrice) as iMoneyCG , (iAinPrice - iAinPrice) as iQuantityZG, (iAinPrice - iAinPrice) as iMoneyZG , (iAinPrice - iAinPrice) as iQuantityQTRK , (iAinPrice - iAinPrice) as iMoneyQTRK , (iAinPrice - iAinPrice) as iQuantityXS , (iAinPrice - iAinPrice) as iMoneyXS , (iAinPrice - iAinPrice) as iQuantityQTCK , (iAinPrice - iAinPrice) as iMoneyQTCK , (iAinPrice - iAinPrice) as iQuantityDB , (iAinPrice - iAinPrice) as iMoneyDB ,(iAinPrice - iAinPrice) as iMoneySR , (iAinPrice - iAinPrice) as iQuantityCK , (iAinPrice - iAinPrice) as iMoneyCB ,cwhcode into tempdb..tmp_srm from ia_subsidiary 'if ltrim(rtrim(@chrstartdate)) = '' or @chrstartdate is null begin --无期初日期时只计算上年结转 set @chrsql = @chrsql + ' where iMonth=0 and brdflag = 1 and cVoutype <>''33'' 'end else begin--有期初日期时的情况 set @chrsql = @chrsql + ' where brdflag = 1 and ( (iMonth = 0 and cVoutype <>''33'' ) or dkeepdate <='''+@chrstartdate +''' and ( cVoutype in (''01'',''24'',''30'',''08'',''20'',''22'',''10'') or (cvoutype =''20'' and cbustype=''暂估报销'' ) ) ) 'end --加入日期和部门条件 if ltrim(rtrim(@chrwhere )) <> '' and not (@chrwhere is null ) set @chrsql = @chrsql + ' and ' + @chrwhere if ltrim(rtrim(@chrdep )) <> '' and not ( @chrdep is null ) set @chrsql = @chrsql + ' and cAccdep ' + @chrdep --加入仓库条件 if ltrim(rtrim(@chrWareHouse)) <> '' and not (@chrWareHouse is null ) set @chrsql = @chrsql +' and ia_subsidiary.cwhcode='''+ ltrim(rtrim(@chrWareHouse)) +''''exec ( @chrsql )--1.2 生成期初出库成本 if ltrim(rtrim(@chrstartdate)) <> '' and not ( @chrstartdate is null ) begin --如果无期初日期不应该计算期初发出内容 set @chrsql = 'insert into tempdb..tmp_srm Select cInvCode , caccdep ,- iAoutQuantity as qc_iQuantity , - iAoutPrice as qc_imoney ,0 as iQuantityCG , 0 as iMoneyCG , 0 as iQuantityZG, 0 as iMoneyZG , 0 as iQuantityQTRK , 0 as iMoneyQTRK , 0 as iQuantityXS , 0 as iMoneyXS , 0 as iQuantityQTCK , 0 as iMoneyQTCK , 0 as iQuantityDB , 0 as iMoneyDB ,0 as iMoneySR , 0 as iQuantityCK , 0 as iMoneyCB , cWhcode from tempdb..tmp_srmcost where cvoutype in (''09'',''11'',''21'',''26'',''27'',''28'',''29'',''32'') 'set @chrsql = @chrsql + ' and ddate <=''' + @chrstartdate + '''' exec(@chrsql )end --完成期初数据的准备 --2 组织本期数据 --2.1 统计本期采购入库数据:采购入库数量,采购入库金额,暂诂入库数量,暂诂入库金额,其它入库数量,其他入库金额set @chrsql = 'insert into tempdb..tmp_srm Select cInvCode , caccdep ,0 as qc_iQuantity ,0 as qc_imoney ,case when cvoutype in(''01'',''24'',''30'') or (cvoutype =''20'' and cbustype=''暂估报销'' ) then iAinQuantity else 0end iQuantityCG , case when cvoutype in(''01'',''24'',''30'') or (cvoutype =''20'' and cbustype=''暂估报销'' ) then iAinPrice + isnull( iDebitDifCost,0) -isnull(iCreditDifCost,0) else 0end as iMoneyCG , case when ( cvoutype = ''01'' and bflag = 1 ) or cvoutype in(''24'',''30'') or (cvoutype =''20'' and cbustype=''暂估报销'' ) then iAinQuantity else 0end as iQuantityZG, case when ( cvoutype = ''01'' and bflag = 1 ) or cvoutype in(''24'',''30'') or (cvoutype =''20'' and cbustype=''暂估报销'' ) then iAinPrice + isnull( iDebitDifCost,0) -isnull(iCreditDifCost,0) else 0end as iMoneyZG , case when cVoutype in (''08'',''20'',''22'',''10'') then iAinQuantity else 0 end as iQuantityQTRK , case when cVoutype in (''08'',''20'',''22'',''10'') then iAinPrice + isnull( iDebitDifCost,0) -isnull(iCreditDifCost,0) else 0 end as iMoneyQTRK , 0 as iQuantityXS , 0 as iMoneyXS , 0 as iQuantityQTCK , 0 as iMoneyQTCK , 0 as iQuantityDB , 0 as iMoneyDB ,0 as iMoneySR , 0 as iQuantityCK , 0 as iMoneyCB , cWhcode from ia_subsidiary Where bRdflag = 1 and iMonth > 0 and ( cVoutype in (''01'',''24'',''30'',''08'',''20'',''22'',''10'') or (cvoutype =''20'' and cbustype=''暂估报销'' ) ) '--追加开始日期条件 if ltrim(rtrim(@chrstartdate)) <> '' and not ( @chrstartdate is null ) set @chrsql = @chrsql + ' and dkeepdate>''' + @chrstartdate + ''''--追加结束日期条件 if ltrim(rtrim(@chrenddate)) <> ''and not ( @chrenddate is null ) set @chrsql = @chrsql + ' and dkeepdate<=''' + @chrenddate + ''''--追加其他条件 if ltrim(rtrim(@chrwhere)) <> '' and not @chrwhere is null set @chrsql = @chrsql + ' and ' + @chrwhere if ltrim(rtrim(@chrdep )) <> '' and not ( @chrdep is null ) set @chrsql = @chrsql + ' and cAccdep ' + @chrdep --加入仓库条件 if ltrim(rtrim(@chrWareHouse)) <> '' and not (@chrWareHouse is null ) set @chrsql = @chrsql +' and ia_subsidiary.cwhcode='''+ ltrim(rtrim(@chrWareHouse)) +''''exec(@chrsql ) --end 本期采购部分计算结束 --2.3 统计本期销售数量,销售金额,销售调拨数量,销售调拨金额 -- 取得销售系统启用日期 set @chrsaledate = (select isnull(cValue,'1900-01-01') from accinformation where cSysid='Sa' and cName='dStartDate' ) if @chrsaledate <> '' begin if len(ltrim(rtrim(@chrsaledate))) <= 8 set @chrsaledate = convert(varchar(10),convert(smalldatetime,@chrsaledate,2),121)set @chrsaleDate = ' and SalebillVouch.dDate>=''' + @chrsaledate + ''''end --计算本期销售数据 set @chrsql = 'insert into tempdb..tmp_srm Select cInvCode , cdepcode as caccdep ,0 as qc_iQuantity , 0 as qc_imoney ,0 as iQuantityCG , 0 as iMoneyCG , 0 as iQuantityZG, 0 as iMoneyZG , 0 as iQuantityQTRK , 0 as iMoneyQTRK , iQuantity as iQuantityXS , iNatSum as iMoneyXS , 0 as iQuantityQTCK , 0 as iMoneyQTCK , case when cvouchtype = ''28'' then iQuantity else 0 end as iQuantityDB , case when cvouchtype =''28'' then iNatMoney else 0 end as iMoneyDB ,iNatMoney as iMoneySR , 0 as iQuantityCK , 0 as iMoneyCB , Salebillvouchs.cWhcode From Salebillvouchs inner join Salebillvouch on salebillvouchs.sbvid = salebillvouch.sbvid where isnull(Salebillvouch.cinvalider ,'''')='''' ' + @chrsaledate --增加审核条件 if ltrim(rtrim(@chrchecker)) <> '' and not (@chrchecker is null ) set @chrsql = @chrsql + ' and ' + @chrchecker --增加开始日期条件 if ltrim(rtrim(@chrstartdate)) <> '' and not (@chrstartdate is null ) -- 2003.12.5 丁德安--set @chrsql = @chrsql + ' and ddate >''' + @chrstartdate + ''''set @chrsql = @chrsql + ' and ddate >=''' + @chrstartdate + ''''--增加结束日期条件 if ltrim(rtrim(@chrenddate )) <> '' and not (@chrenddate is null )set @chrsql = @chrsql + ' and ddate <=''' + @chrenddate + '''' --增加一般条件 if ltrim(rtrim(@chrwhere)) <> '' and not (@chrwhere is null )set @chrsql = @chrsql + ' and ' + @chrwhere if ltrim(rtrim(@chrdep )) <> '' and not ( @chrdep is null ) set @chrsql = @chrsql + ' and cdepCode ' + @chrdep --加入仓库条件 if ltrim(rtrim(@chrWareHouse)) <> '' and not (@chrWareHouse is null ) set @chrsql = @chrsql +' and Salebillvouchs.cwhcode='''+ ltrim(rtrim(@chrWareHouse)) +''''exec (@chrsql )--本期收入计算终止 --2.4 统计本期销售成本,销售收入,出库数量 set @chrsql = 'insert into tempdb..tmp_srm Select cInvCode , caccdep ,0 as qc_iQuantity , 0 as qc_imoney ,0 as iQuantityCG , 0 as iMoneyCG , 0 as iQuantityZG, 0 as iMoneyZG , 0 as iQuantityQTRK , 0 as iMoneyQTRK , 0 as iQuantityXS , 0 as iMoneyXS , case when cvoutype =''09'' or cvoutype =''11'' or (cvoutype = ''21'' and bSale = 0 ) then iAoutQuantity else 0 end as iQuantityQTCK , case when cvoutype =''09'' or cvoutype =''11'' or (cVoutype =''21'' and bSale = 0 ) then iAoutPrice else 0 end as iMoneyQTCK , 0 as iQuantityDB , 0 as iMoneyDB , 0 as iMoneySR ,case when cvoutype in (''26'',''27'',''28'',''29'',''32'') or ( cvoutype =''21'' and bsale=1) then iAoutQuantity else 0 end as iQuantityCK , case when cvoutype in (''26'',''27'',''28'',''29'',''32'') or ( cvoutype =''21'' and bsale=1) then iAoutPrice else 0 end as iMoneyCB , cwhcode from tempdb..tmp_srmcost Where iMonth > 0 and cvoutype in (''09'',''11'',''21'',''26'',''27'',''28'',''29'',''32'') ' if ltrim(rtrim(@chrstartdate)) <> '' and not (@chrstartdate is null ) set @chrsql = @chrsql + ' and ddate >'''+ @chrstartdate + '''' exec( @chrsql )--3 按存货分类展开处理 /*存货分类按编码级次展开 */declare @chrfieldlist varchar(4000)declare @chrInner varchar (4000)declare @chrbmjc varchar(20)declare @i int declare @n int /*存货分类按编码级次展开 *//*取得存货分类编码级次 */set @chrbmjc = ''set @chrbmjc = (select cValue from accInformation where cName ='cGoodClass')/*连接展开字符串*/set @chrfieldlist = ''set @chrInner = '' set @i =1 set @n = 0 while (@i <= 8 )begin set @n = @n + substring(@chrbmjc,@i,1) /* 分解级次 *//* 组合字段列表 */set @chrfieldlist = @chrfieldlist +'c'+ ltrim(rtrim(str(@i))) + '.cInvCName as cInvCName' + ltrim(rtrim(@i)) +','/* 组合关联 */if (@i <= len(@chrbmjc))begin set @chrinner = @chrinner + ' left join inventoryClass c'+ ltrim(rtrim(str(@i)))+ ' on c'+ ltrim(rtrim(str(@i)))+'.cInvCCode = left( b.cInvCCode,'+ltrim(rtrim(str(@n)))+')'end else begin set @chrinner = @chrinner + ' left join inventoryClass c' + ltrim(rtrim(str(@i)))+ ' on b.cInvCCode = c'+ ltrim(rtrim(str(@i)))+ '.cInvCCode 'end set @i = @i +1 end --4 生成最终的临时表if exists(select name from tempdb..sysobjects where name = @chrtablename ) exec ('drop table tempdb..' + @chrtablename )set @chrsql = 'Select a.* ,Department.cDepName , b.cinvname , b.cinvStd , b.cinvM_Unit ,'+@chrfieldlist +'b.cInvDefine1 , b.cInvDefine2 ,b.cInvDefine3 , 0 as iProfit , 0 as iProfittax, 0 as qm_iQuantity ,0 as qm_iMoney , 0 as iPrice , 0 as iPriceTax ,vendor.cvenname , warehouse.cWhname into tempdb..'+@chrtablename+'from tempdb..tmp_srm a left join inventory b on a.cInvCode = b.cInvCode left join Department on a.caccdep = department.cDepcode left join vendor on b.cvencode = vendor.cvencode left join warehouse on a.cwhcode = warehouse.cwhcode ' + @chrInner exec(@chrsql)
银行存款如何清查 银行存款如何清查
银行存款的清查,采用核对法,即将开户银行定期送来的对账单与本单位的银行存款日记账逐笔进行核对,以查明银行存款收、付及余额是否正确相符。
在与银行对账之前,应先检查本单位的银行存款日记账的正确性与完整性。通过核对,往往会发现双方账目不相符。其主要原因有二:
一是双方记账可能有差错,如错账漏账等,这是不正常的,应及时查明更正;
二是存在未达账项,这是正常的。
为消除未达账项的影响,企业应根据核对后发现的未达账项,编制“银行存款余额调节表”。
- 经常出现账套年度演示期限已到期,怎么办?
- 麻烦问下,T3升级T6,是不是要先安装6.1,用工具升级,再导出帐套,安装6.5,再升级到6.5?
- 麻烦问下,账簿交接怎么操作
- 麻烦问下:增值税普票次月开了负数发票,做账时是否都要把财务联和发票联附在记账凭证后,另外当月作废的增值税普票怎么处理呢?谢谢!
- 黄色的加密狗驱动不了,在服务社区下载的驱动安装后也是不行,win2003的系统
- 黄色部分的最新成本错了,如何修改
- (-0.2)的2009次方乘(-5)的2010次方
- (时间是11点多的时候还没吃饭)体育考试立定跳远 和跑完50米后 然后走20几分钟去车站搭车
- ,小额纳税企业在营业大厅开增值税专用发票税点是多少
- 1。T3升级上来,增加了 人事管理模块 ,加密狗刷新了 薪资管理还是系那是演示版……--2.还有就是 登录进去经常会出现登录子系统失败,退出再登录进去就行-请教