34,590
社区成员
发帖
与我相关
我的任务
分享
select distinct 源凭证号
from 基础表_财务类_记账凭证表 as a
inner join
( select c.会计电子账簿编号,c.会计科目编号
from 基础表_财务类_会计科目表
where (c.会计科目名称 like '%银行存款%' or c.会计科目名称 like '%财政存款%')
and c.会计科目级次=1
) as c
on a.会计科目编号=c.会计科目编号
and a.会计电子账簿编号=c.会计电子账簿名称
select
d.[会计年度] as [年度],c.[单位名称],d.[电子账簿简称]
,a.记账凭证摘要,a.[记账凭证日期],a.[记账凭证编号]
,a.[借方发生额]-a.[贷方发生额] as 现金收入金额
,a.[会计电子账簿编号],c.排序号
from #借现金贷非银行存款凭证 as a
inner join 基础表_财务类_电子账簿信息表 as d
on a.会计电子账簿编号=d.会计电子账簿编号
and a.会计年度=d.会计年度
and (d.会计年度 in (@年度+''))
inner join 基础表_资料类_单位信息表 as c
on a.会计年度=c.年份
and a.单位代码=c.单位代码
and (c.单位代码 IN (@单位名称+'') or '999999999999' in (@单位名称+''))
select distinct 源凭证号
from 基础表_财务类_记账凭证表 as a
inner join
( select 会计电子账簿编号,会计科目编号
from 基础表_财务类_会计科目表
where (会计科目名称 like '%银行存款%' or 会计科目名称 like '%财政存款%')
and 会计科目级次=1
) as c
on a.会计科目编号=c.会计科目编号
and a.会计电子账簿编号=c.会计电子账簿名称