打开多栏式明细账,多栏账方案选择制造费用报错,多栏账方案选择管理费用和销售费用没有报错。
报错内容如下:
Insert Into TMPF6DBA66EA48111E59042C4346BB(
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=132412
and v.FInvalid='0' and v.FDOCUMENTSTATUS<>'Z'
and v.FPosted='1'
and (FYear=2015 And FPeriod =8)
and e.FCurrencyID=1
and a.FACCTID=125318
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=100004
) flex inner join T_BD_FlexItem t on flex.FDETAILID=t.FDETAILID inner join (select FFLEXNUMBER,min(FID) as FID,FNUMBER,FNAME from (
select 'FFLEX5' as FFLEXNUMBER,TO_CHAR(t.FMASTERID) as FID,TO_CHAR(t.FNUMBER) as FNUMBER,TO_CHAR(RTrim(t1.FNAME)) as FNAME from T_BD_DEPARTMENT t left join T_BD_DEPARTMENT_L t1 on t.FDEPTID=t1.FDEPTID and t1.FLOCALEID=2052 and t.FDEPTID=t.FMASTERID where t.FDEPTID=t.FMASTERID AND t.FDocumentStatus='C' GROUP By t.FMASTERID,t.FNUMBER,t1.FNAME union select 'FFLEX5' as FFLEXNUMBER, TO_CHAR('0') 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 TMPF6DBA66EA48111E59042C4346BB 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 TMPF6DBA66EA48111E59042C4346BB set FDataType=-3 where FISMULTICOLLECT='0'
Insert Into TMPF6DBA66EA48111E59042C4346BB(
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=125318
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=100004
) flex inner join T_BD_FlexItem t on flex.FDETAILID=t.FDETAILID inner join (select FFLEXNUMBER,min(FID) as FID,FNUMBER,FNAME from (
select 'FFLEX5' as FFLEXNUMBER,TO_CHAR(t.FMASTERID) as FID,TO_CHAR(t.FNUMBER) as FNUMBER,TO_CHAR(RTrim(t1.FNAME)) as FNAME from T_BD_DEPARTMENT t left join T_BD_DEPARTMENT_L t1 on t.FDEPTID=t1.FDEPTID and t1.FLOCALEID=2052 and t.FDEPTID=t.FMASTERID where t.FDEPTID=t.FMASTERID AND t.FDocumentStatus='C' GROUP By t.FMASTERID,t.FNUMBER,t1.FNAME union select 'FFLEX5' as FFLEXNUMBER, TO_CHAR('0') 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=132412
and v.FInvalid='0' and v.FDOCUMENTSTATUS<>'Z'
and v.FPosted='1'
and (FYear=2015 And FPeriod =8)
and e.FCurrencyID=1
and a.FACCTID=125318
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=100004
) flex inner join T_BD_FlexItem t on flex.FDETAILID=t.FDETAILID inner join (select FFLEXNUMBER,min(FID) as FID,FNUMBER,FNAME from (
select 'FFLEX5' as FFLEXNUMBER,TO_CHAR(t.FMASTERID) as FID,TO_CHAR(t.FNUMBER) as FNUMBER,TO_CHAR(RTrim(t1.FNAME)) as FNAME from T_BD_DEPARTMENT t left join T_BD_DEPARTMENT_L t1 on t.FDEPTID=t1.FDEPTID and t1.FLOCALEID=2052 and t.FDEPTID=t.FMASTERID where t.FDEPTID=t.FMASTERID AND t.FDocumentStatus='C' GROUP By t.FMASTERID,t.FNUMBER,t1.FNAME union select 'FFLEX5' as FFLEXNUMBER, TO_CHAR('0') 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:
at Kingdee.BOS.App.Data.Sql.SqlDatabase.ExecuteBatch(List`1 sqlArray, Int32 batchSize, Int32 commandTimeout)
at Kingdee.BOS.App.Data.DBUtils.ExecuteBatch(Context ctx, List`1 sqlArray, Int32 batchSize)
at Kingdee.K3.FIN.GL.App.Report.MultiColumnLedgerService.GetVoucherData(IRptParams filter, DataRow dr, String RptTempTable, String detailTempTable)
at Kingdee.K3.FIN.GL.App.Report.MultiColumnLedgerService.DataDeal(IRptParams filter, DataRow drPageInfo, String RptTempTable)
at Kingdee.K3.FIN.GL.App.Report.MultiColumnLedgerService.BuilderSql(IRptParams filter, String BosTempTable)
at Kingdee.BOS.Core.Report.PlugIn.AbstractSysReportServicePlugIn.CreateTempTable(IRptParams filter, String tablename)
at Kingdee.BOS.Core.Report.PlugIn.AbstractSysReportServicePlugIn.GetDataForVirtual(IRptParams filter)
at Kingdee.BOS.Core.Report.PlugIn.AbstractSysReportServicePlugIn.GetListAndReportData(IRptParams filter)
at Kingdee.BOS.App.Core.PlugInProxy.SysReportServicePlugInProxy.GetListAndReportData(MoveReportServiceParameter parameter)
at Kingdee.BOS.App.Core.SysReportService.GetListAndReportData(MoveReportServiceParameter parameter)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Kingdee.BOS.Contracts.ISysReportService.GetListAndReportData(MoveReportServiceParameter parameter)
at Kingdee.BOS.ServiceHelper.SysReportServiceHelper.GetListAndReportData(MoveReportServiceParameter parameter)
at Kingdee.BOS.Model.Report.MoveReportModel.GetData(Int32 start, Int32 rows)
at Kingdee.BOS.Web.Report.SysReportView.GetListData()
at Kingdee.BOS.Web.Report.SysReportView.<>c__DisplayClass3d.
推荐阅读