|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册账号
×
--财务会计--总账--期末处理--关账
select distinct org_financeorg.code 财务组织编码,
org_financeorg.name 财务组织名称,
bd_accperiod.periodyear 会计年度,
bd_accperiodmonth.accperiodmth 会计月份,
substr(bd_accperiodmonth.begindate, 1, 10) 开始日期,
substr(bd_accperiodmonth.enddate, 1, 10) 结束日期,
org_closeacc.ispreclose 提前关账,
org_closeacc.isclose 关账,
sm_user_a.user_name 关账人,
substr(org_closeacc.closetime, 1, 10) 关账时间,
sm_user_b.user_name 反关账人,
substr(org_closeacc.unclosetime, 1, 10) 反关账时间,
sm_user_c.user_name 反提前关账人,
substr(org_closeacc.unpreclosetime, 1, 10) 反提前关账时间,
org_closeacc.isendacc 结账,
sm_user_d.user_name 结账人,
substr(org_closeacc.endacctime, 1, 10) 结账时间,
sm_user_e.user_name 反结账人,
substr(org_closeacc.unendacctime, 1, 10) 反结账时间,
case org_closeacc.moduleid
when '2002' then
'总账'
when '2006' then
'应收管理'
when '2008' then
'应付管理'
when '2012' then
'固定资产'
when '2014' then
'存货核算'
when '3830' then
'产品成本'
end 结账模块
from org_closeacc org_closeacc --账簿_组织关账
inner join org_financeorg org_financeorg --组织_业务单元_财务组织
on org_closeacc.pk_org = org_financeorg.pk_financeorg
--and org_closeacc.closeorgpks = org_financeorg.pk_financeorg
left join bd_accperiodmonth bd_accperiodmonth --会计月份
on org_closeacc.pk_accperiodmonth = bd_accperiodmonth.pk_accperiodmonth
left join bd_accperiod bd_accperiod --会计期间档案
on bd_accperiodmonth.pk_accperiod = bd_accperiod.pk_accperiod
and bd_accperiodmonth.pk_org = bd_accperiod.pk_org
left join sm_user sm_user_a
on org_closeacc.closeuser = sm_user_a.cuserid
left join sm_user sm_user_b
on org_closeacc.unprecloseuser = sm_user_b.cuserid
left join sm_user sm_user_c
on org_closeacc.unprecloseuser = sm_user_c.cuserid
left join sm_user sm_user_d
on org_closeacc.endaccuser = sm_user_d.cuserid
left join sm_user sm_user_e
on org_closeacc.unendaccuser = sm_user_e.cuserid
where nvl(org_closeacc.dr, 0) = 0
and org_closeacc.moduleid in
('2002', '2006', '2008', '2012', '2014', '3830')
--and org_financeorg.code = '108'
--and org_closeacc.isclose = 'Y'
--and org_closeacc.isendacc = 'Y'
order by org_financeorg.code,
case org_closeacc.moduleid
when '2002' then
'总账'
when '2006' then
'应收管理'
when '2008' then
'应付管理'
when '2012' then
'固定资产'
when '2014' then
'存货核算'
when '3830' then
'产品成本'
end,
bd_accperiod.periodyear,
bd_accperiodmonth.accperiodmth
|
|