查询多栏式明细账时出错
金蝶云社区-云社区用户5e961234
云社区用户5e961234
0人赞赏了该文章 1,070次浏览 未经作者许可,禁止转载编辑于2015年08月05日 11:27:49

cloud5.0 7月30日补丁打开财务多栏式明细账时出现错误提示如图


Insert Into TMPF7E327A33B2011E580F540F2E93(
FDataType,FConstant,FSIGN,FVoucherID,FENTRYID,FACCTID,FNUMBER,FYEAR,FPERIOD,FCurrencyID,FCURRENCYNAME,FDETAILID,
FDATE,FVCHGROUPID,FVCHGROUPNO,FEXPLANATION,FEXCHANGERATE,FAMOUNTFOR,FDEBIT,FDEBITFor,
FCREDIT,FCREDITFor,FDC,FBALANCES,FBALANCESFor,FAMOUNTDIGITS,FISMULTICOLLECT
)
select FDataType,FConstant,FSIGN,FVoucherID,FENTRYID,FACCOUNTID,FNUMBER,FYEAR,FPERIOD,FCurrencyID,FCURRENCYNAME,
FDETAILID,
FDATE,FVCHGROUPID,FVCHGROUPNO,FEXPLANATION,FEXCHANGERATE,
SUM(FAMOUNTFOR) as FAMOUNTFOR,
SUM(FDEBIT) as FDEBIT,
SUM(FDEBITFor) as FDEBITFor,
SUM(FCREDIT) as FCREDIT,
SUM(FCREDITFor) as FCREDITFor,FDC,
SUM(FENDBALANCE) as FENDBALANCE,
SUM(FENDBALANCEFor) as FENDBALANCEFor,
FAMOUNTDIGITS,FISMULTICOLLECT
from (
select distinct -1 FDataType,0 FConstant,0 FSIGN,v.FVoucherID,e.FENTRYID,e.FACCOUNTID,a.FNUMBER,v.FYEAR,v.FPERIOD,
e.FCurrencyID,cy_l.FNAME as FCURRENCYNAME,e.FDETAILID,v.FDATE,vchgrp_l.FNAME as FVCHGROUPID,
v.FVOUCHERGROUPNO as FVCHGROUPNO,e.FEXPLANATION as FEXPLANATION,
e.FEXCHANGERATE as FEXCHANGERATE,e.FAMOUNTFOR,
(case e.FDC when 1 then e.FAmount else 0 end) as FDEBIT ,
(case e.FDC when 1 then e.FAmountFor else 0 end) as FDEBITFor ,
(case e.FDC when -1 then e.FAmount else 0 end) as FCREDIT ,
(case e.FDC when -1 then e.FAmountFor else 0 end) as FCREDITFor , a.FDC,
(case e.FDC when 1 then e.FAmount else 0 end)-(case e.FDC when -1 then e.FAmount else 0 end) as FENDBALANCE,
(case e.FDC when 1 then e.FAmountFor else 0 end)-(case e.FDC when -1 then e.FAmountFor else 0 end) as FENDBALANCEFor,
c.FAMOUNTDIGITS, e.FISMULTICOLLECT
From T_GL_Voucher v inner join #TM_GL_MULTIVOUCHERENTRY e on v.FVoucherID=e.FVoucherID inner join T_BD_Account a on e.FAccountID=a.FACCTID
left join T_BD_VOUCHERGROUP_L vchgrp_l on v.FVOUCHERGROUPID=vchgrp_l.FVCHGROUPID
and vchgrp_l.FLOCALEID=2052
left join T_BD_CURRENCY c on c.FCURRENCYID=e.FCURRENCYID
Left JOIN T_BD_CURRENCY_L cy_l on c.FCURRENCYID=cy_l.FCURRENCYID and cy_l.FLOCALEID=2052
where v.FACCOUNTBOOKID=111550
and v.FInvalid='0' and v.FDOCUMENTSTATUS<>'Z'
and (FYear=2015 And FPeriod>=1 And FPeriod<=7)
and e.FCurrencyID=1
and a.FACCTID=4084
and e.FDETAILID in( select t.FDETAILID from
( select t.FDATAFIELDNAME,t.FDETAILID,t.FITEMID from T_GL_MULTICOLUMNLEDGER mcl
left join T_GL_MULTICOLUMN mc on mcl.FLEDGERID=mc.FLEDGERID
left join T_BD_FLEXITEMPROPERTY f on mcl.FDETAIL=f.FVALUESOURCE
left join T_BD_FlexItem t on f.FFLEXNUMBER=t.FDATAFIELDNAME
where t.FITEMID=mc.FITEMID and mcl.FLEDGERID=100003
) flex inner join T_BD_FlexItem t on flex.FDETAILID=t.FDETAILID inner join (select FFLEXNUMBER,min(FID) as FID,FNUMBER,FNAME from (
select 'FFLEX9' as FFLEXNUMBER,TO_CHAR(t.FMasterId) as FID,TO_CHAR(t.FNUMBER) as FNUMBER,TO_CHAR(RTrim(t1.FNAME)) as FNAME from T_BD_EXPENSE t join T_BD_EXPENSE_L t1 on t.FEXPID=t1.FEXPID and t1.FLOCALEID=2052 and t.FEXPID=t.FMasterId where t.FDocumentStatus='C'
GROUP By t.FMasterId,t.FNUMBER,t1.FNAME union select 'FFLEX9' as FFLEXNUMBER, TO_CHAR('1') as FID,'ZZZZZZ' as FNUMBER,'【未录入】' as FNAME
) item group by FFLEXNUMBER,FNUMBER,FNAME
) d on t.FITEMID=d.FID )

)tbl
group by FDataType,FConstant,FSIGN,FVoucherID,FENTRYID,FACCOUNTID,FNUMBER,FYEAR,FPERIOD,FCurrencyID,FCURRENCYNAME,FISMULTICOLLECT,
FDETAILID,
FDATE,FVCHGROUPID,FVCHGROUPNO,FEXPLANATION,FEXCHANGERATE,FDC,FAMOUNTDIGITS
order By FDATE
update TMPF7E327A33B2011E580F540F2E93 set FDataType=-3,FISMULTICOLLECT='0' where FENTRYID in (Select tmp.FENTRYID from #TM_GL_MULTIVOUCHERENTRY tmp
inner join T_GL_VOUCHERENTRY e on tmp.FVOUCHERID=e.FVOUCHERID and tmp.FENTRYID=e.FENTRYID
inner join T_GL_VOUCHER v on e.FVOUCHERID=v.FVOUCHERID
Left join T_GL_EXPLANATION_L exl on e.FEXPLANATION= exl.FNAME and exl.FLOCALEID=2052
Left join T_GL_EXPLANATION ex on ex.FID=exl.FID
where ex.FISMULTICOLLECT='1'
)
update #TM_GL_MULTIVOUCHERENTRY set FVOUCHERID=-1,FISMULTICOLLECT='0' where FENTRYID in (Select tmp.FENTRYID from #TM_GL_MULTIVOUCHERENTRY tmp
inner join T_GL_VOUCHERENTRY e on tmp.FVOUCHERID=e.FVOUCHERID and tmp.FENTRYID=e.FENTRYID
inner join T_GL_VOUCHER v on e.FVOUCHERID=v.FVOUCHERID
Left join T_GL_EXPLANATION_L exl on e.FEXPLANATION= exl.FNAME and exl.FLOCALEID=2052
Left join T_GL_EXPLANATION ex on ex.FID=exl.FID
where ex.FISMULTICOLLECT='1'
)
update TMPF7E327A33B2011E580F540F2E93 set FDataType=-3 where FISMULTICOLLECT='0'
Insert Into TMPF7E327A33B2011E580F540F2E93(
FDataType,FConstant,FSIGN,FVoucherID,FENTRYID,FACCTID,FNUMBER,FYEAR,FPERIOD,FCurrencyID,FCURRENCYNAME,
FDETAILID,FDATE,FVCHGROUPID,FVCHGROUPNO,
FEXPLANATION,FEXCHANGERATE,FAMOUNTFOR,FDEBIT,FDEBITFor,
FCREDIT,FCREDITFor,FDC,FBALANCES,FBALANCESFor,FAMOUNTDIGITS,FISMULTICOLLECT
)
select distinct -2 FDataType,0 FConstant,0 FSIGN,v.FVoucherID,-1 as FENTRYID,-1 FACCOUNTID,
'' FNUMBER,v.FYEAR,v.FPERIOD,e.FCurrencyID,cy_l.FNAME as FCURRENCYNAME,
0 FDETAILID,
v.FDATE,vchgrp_l.FNAME as FVCHGROUPID,v.FVOUCHERGROUPNO as FVCHGROUPNO,ee.FEXPLANATION,
e.FEXCHANGERATE,SUM(e.FDC*e.FAMOUNTFOR) as FAMOUNTFOR,
SUM((case e.FDC when 1 then e.FAmount else 0 end)) as FDEBIT,
SUM((case e.FDC when 1 then e.FAmountFor else 0 end)) as FDEBITFor,
SUM((case e.FDC when -1 then e.FAmount else 0 end)) as FCREDIT,
SUM((case e.FDC when -1 then e.FAmountFor else 0 end)) as FCREDITFor,
(case when SUM((case e.FDC when 1 then e.FAmount else 0 end)-(case e.FDC when -1 then e.FAmount else 0 end))>0 then 1
when SUM((case e.FDC when 1 then e.FAmount else 0 end)-(case e.FDC when -1 then e.FAmount else 0 end))=0 then 0 else -1 end) as FDC,
SUM((case e.FDC when 1 then e.FAmount else 0 end)-(case e.FDC when -1 then e.FAmount else 0 end)) as FENDBALANCE,
SUM((case e.FDC when 1 then e.FAmountFor else 0 end)-(case e.FDC when -1 then e.FAmountFor else 0 end)) as FENDBALANCEFor,
c.FAMOUNTDIGITS,e.FISMULTICOLLECT
From T_GL_Voucher v inner join #TM_GL_MULTIVOUCHERENTRY e on v.FVoucherID=e.FVoucherID
left join ( select ve.FVoucherID,ve.FEXPLANATION from #TM_GL_MULTIVOUCHERENTRY ve
inner join ( select FVoucherID,MIN(fentryseq) fentryseq from #TM_GL_MULTIVOUCHERENTRY et
inner join T_BD_Account att on et.FAccountID=att.FACCTID
and att.FACCTID=4084
and et.FDETAILID in( select t.FDETAILID from
( select t.FDATAFIELDNAME,t.FDETAILID,t.FITEMID from T_GL_MULTICOLUMNLEDGER mcl
left join T_GL_MULTICOLUMN mc on mcl.FLEDGERID=mc.FLEDGERID
left join T_BD_FLEXITEMPROPERTY f on mcl.FDETAIL=f.FVALUESOURCE
left join T_BD_FlexItem t on f.FFLEXNUMBER=t.FDATAFIELDNAME
where t.FITEMID=mc.FITEMID and mcl.FLEDGERID=100003
) flex inner join T_BD_FlexItem t on flex.FDETAILID=t.FDETAILID inner join (select FFLEXNUMBER,min(FID) as FID,FNUMBER,FNAME from (
select 'FFLEX9' as FFLEXNUMBER,TO_CHAR(t.FMasterId) as FID,TO_CHAR(t.FNUMBER) as FNUMBER,TO_CHAR(RTrim(t1.FNAME)) as FNAME from T_BD_EXPENSE t join T_BD_EXPENSE_L t1 on t.FEXPID=t1.FEXPID and t1.FLOCALEID=2052 and t.FEXPID=t.FMasterId where t.FDocumentStatus='C'
GROUP By t.FMasterId,t.FNUMBER,t1.FNAME union select 'FFLEX9' as FFLEXNUMBER, TO_CHAR('1') as FID,'ZZZZZZ' as FNUMBER,'【未录入】' as FNAME
) item group by FFLEXNUMBER,FNUMBER,FNAME
) d on t.FITEMID=d.FID )

group by FVoucherID ) me on ve.FVOUCHERID=me.FVOUCHERID and ve.fentryseq=me.fentryseq
) ee on e.FVoucherID=ee.FVoucherID
left join T_BD_Account a on e.FAccountID=a.FACCTID
left join T_BD_VOUCHERGROUP_L vchgrp_l on v.FVOUCHERGROUPID=vchgrp_l.FVCHGROUPID
and vchgrp_l.FLOCALEID=2052
left join T_BD_CURRENCY c on c.FCURRENCYID=e.FCURRENCYID
Left JOIN T_BD_CURRENCY_L cy_l on c.FCURRENCYID=cy_l.FCURRENCYID and cy_l.FLOCALEID=2052
where v.FACCOUNTBOOKID=111550
and v.FInvalid='0' and v.FDOCUMENTSTATUS<>'Z'
and (FYear=2015 And FPeriod>=1 And FPeriod<=7)
and e.FCurrencyID=1
and a.FACCTID=4084
and e.FDETAILID in( select t.FDETAILID from
( select t.FDATAFIELDNAME,t.FDETAILID,t.FITEMID from T_GL_MULTICOLUMNLEDGER mcl
left join T_GL_MULTICOLUMN mc on mcl.FLEDGERID=mc.FLEDGERID
left join T_BD_FLEXITEMPROPERTY f on mcl.FDETAIL=f.FVALUESOURCE
left join T_BD_FlexItem t on f.FFLEXNUMBER=t.FDATAFIELDNAME
where t.FITEMID=mc.FITEMID and mcl.FLEDGERID=100003
) flex inner join T_BD_FlexItem t on flex.FDETAILID=t.FDETAILID inner join (select FFLEXNUMBER,min(FID) as FID,FNUMBER,FNAME from (
select 'FFLEX9' as FFLEXNUMBER,TO_CHAR(t.FMasterId) as FID,TO_CHAR(t.FNUMBER) as FNUMBER,TO_CHAR(RTrim(t1.FNAME)) as FNAME from T_BD_EXPENSE t join T_BD_EXPENSE_L t1 on t.FEXPID=t1.FEXPID and t1.FLOCALEID=2052 and t.FEXPID=t.FMasterId where t.FDocumentStatus='C'
GROUP By t.FMasterId,t.FNUMBER,t1.FNAME union select 'FFLEX9' as FFLEXNUMBER, TO_CHAR('1') as FID,'ZZZZZZ' as FNUMBER,'【未录入】' as FNAME
) item group by FFLEXNUMBER,FNUMBER,FNAME
) d on t.FITEMID=d.FID )

group by v.FVoucherID,v.FYEAR,v.FPERIOD,v.FDATE,e.FCurrencyID,cy_l.FNAME,e.FISMULTICOLLECT,
vchgrp_l.FNAME,v.FVOUCHERGROUPNO,ee.FEXPLANATION,e.FEXCHANGERATE,c.FAMOUNTDIGITS
order By v.FDATE

Server stack trace:
在 Kingdee.BOS.App.Data.Sql.SqlDatabase.ExecuteBatch(List`1 sqlArray, Int32 batchSize, Int32 commandTimeout)
在 Kingdee.K3.FIN.GL.App.Report.MultiColumnLedgerService.GetVoucherData(IRptParams filter, DataRow dr, String RptTempTable, String detailTempTable)
在 Kingdee.K3.FIN.GL.App.Report.MultiColumnLedgerService.DataDeal(IRptParams filter, DataRow drPageInfo, String RptTempTable)
在 Kingdee.K3.FIN.GL.App.Report.MultiColumnLedgerService.BuilderSql(IRptParams filter, String BosTempTable)
在 Kingdee.BOS.Core.Report.PlugIn.AbstractSysReportServicePlugIn.CreateTempTable(IRptParams filter, String tablename)
在 Kingdee.BOS.Core.Report.PlugIn.AbstractSysReportServicePlugIn.GetDataForVirtual(IRptParams filter)
在 Kingdee.BOS.Core.Report.PlugIn.AbstractSysReportServicePlugIn.GetListAndReportData(IRptParams filter)
在 Kingdee.BOS.App.Core.PlugInProxy.SysReportServicePlugInProxy.GetListAndReportData(MoveReportServiceParameter parameter)
在 Kingdee.BOS.App.Core.SysReportService.GetListAndReportData(MoveReportServiceParameter parameter)
Exception rethrown at [0]:
在 System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
在 System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
在 Kingdee.BOS.Contracts.ISysReportService.GetListAndReportData(MoveReportServiceParameter parameter)
在 Kingdee.BOS.ServiceHelper.SysReportServiceHelper.GetListAndReportData(MoveReportServiceParameter parameter)
在 Kingdee.BOS.Model.Report.MoveReportModel.GetData(Int32 start, Int32 rows)
在 Kingdee.BOS.Web.Report.SysReportView.GetListData()
在 Kingdee.BOS.Web.Report.SysReportView.<>c__DisplayClass3b.b__37()