SUMSEN

Oracle&Sql爱好者,用友NC管理员

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
原创:无锡NC-DENGYF
改编:me
需求:天津风之羽
NC5.02不能用,55以后才有的表。

select   bd_corp.unitcode,
       gl_detail.yearv as 会计年度,
       bd_invcl.invclassname as 类别名称,
       bd_cubasdoc.custname as 客商名称,
       bd_deptdoc.deptname as 部门名称,
       bd_accsubj.DISPNAME as 科目名称,
       sum(gl_detail.localcreditamount) as 收入,
        sum(gl_detail.localdebitamount) 成本
  from gl_detail
  left outer join bd_accsubj
    on gl_detail.pk_accsubj = bd_accsubj.pk_accsubj
  left outer join gl_fixtmpfreevalue
    on gl_detail.assid = gl_fixtmpfreevalue.assid
  left outer join bd_invcl
    on gl_fixtmpfreevalue.def3 = bd_invcl.pk_invcl
  left outer join bd_cubasdoc
    on gl_fixtmpfreevalue.def2 = bd_cubasdoc.pk_cubasdoc
    left outer join bd_deptdoc
    on gl_fixtmpfreevalue.def1 = bd_deptdoc.pk_deptdoc
    left outer join bd_corp
    on gl_detail.pk_corp=bd_corp.pk_corp
 where ((bd_accsubj.subjcode like '6001%') OR (bd_accsubj.subjcode like '6401%') )
  
      and bd_corp.UNITCODE='0092'
      AND gl_detail.DR = 0
 group by gl_detail.pk_corp,
          gl_detail.yearv,
          bd_invcl.invclassname,
          bd_cubasdoc.custname,
           bd_deptdoc.deptname,
          BD_CORP.UNITCODE,
          bd_accsubj.DISPNAME
ORDER BY bd_accsubj.DISPNAME
 
GLFS(6001,,,'[部门档案='+k('部门')+'][客商辅助核算='+k('钢口')+'][存货分类='+k('存货分类')+']','',,'Y')

posted on 2012-05-29 21:54  sumsen  阅读(818)  评论(0编辑  收藏  举报