EAS查询科目余额表一级科目的脚本

按公司、年、期间id、当前期间id、科目、币别、期初余额、借贷金额、期末余额,查询科目余额表情况

select
co.fnumber as EntityCode
,co.fname_l2 as EntityName
,pd.fperiodyear as Year
,bal.FPERIODID as PrdId
,( select ctrl.fcurrentperiodid from T_BD_SystemStatusCtrol ctrl where ctrl.fsystemstatusid =‘e45c1988-00fd-1000-e000-33d8c0a8100d02A5514C’ and ctrl.fcompanyid= bal.forgunitid)as CrtPrdId ----取当前总账会计期间
,ac.fnumber as AccountCode
,ac.fname_l2 as AccountName
,cur.fname_l2 as cur
, bal.FBeginBalanceLocal as BeginBalanceLocal
,bal.FDebitLocal as DebitLocal
,bal.FCreditLocal as CreditLocal
, bal.FEndBalanceLocal as EndBalanceLocal
from T_GL_AccountBalance bal
left outer join t_org_company co on bal.forgunitid=co.fid
left outer join T_BD_AccountView ac on bal.faccountid=ac.fid
left outer join t_bd_period pd on bal.fperiodid=pd.fid
left outer join t_bd_currency cur on bal.fcurrencyid=cur.fid
where cur.fnumber not in (‘GLC’,‘GRC’) and bal.FBALTYPE=1 and ac.flevel=1
order by EntityCode,Year,AccountCode

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值