Insert Into #TM_GL_VoucherDetailData(FDataType,FVoucherID,FACCTID,FYear,FPeriod,FBALANCEID,FBALANCENAME,
FDATE,FCREATEDATE,FVCHGROUPID,FVCHGROUPNO,FEXPLANATION,FSETTLETYPEID,FSETTLENO,
FSIDEBALANCEID,FSIDEBALANCENAME,FSIDEDETAILID,FSIDEDETAILNUMBER,
FSIDEDETAILNAME,FINTERNALIND,FCURRENCY,
FEXCHANGERATE,FAMOUNTFOR,FDEBIT,FDEBITFor,FCREDIT,FCREDITFor,
FDC,FBALANCES,FBALANCESFor,FAMOUNTDIGITS
)
select
1 as FDataType,-1 as FVoucherID,isnull(a.FACCTID,0),isnull(b.FYear,0),isnull(b.FPeriod,0),isnull(a.FNUMBER,' ') as FBALANCEID,
' ' as FBALANCENAME,ADD_SECONDS(ADD_DAYS(FDATE,1),-1) FDATE,NULL as FCREATEDATE,' ' as FVCHGROUPID,
0 as FVCHGROUPNO,'本日合计' as FEXPLANATION, ' ' as FSETTLETYPEID,' ' as FSETTLENO,
' ' as FSIDEBALANCEID, ' ' as FSIDEBALANCENAME,
0 as FSIDEDETAILID,' ' as FSIDEDETAILNUMBER,' ' as FSIDEDETAILNAME,
' ' as FINTERNALIND,' ' as FCURRENCY,
0 as FEXCHANGERATE,
isnull(Sum(b.FAMOUNTFOR),0) as FAMOUNTFOR,isnull(Sum(b.FDEBIT),0) as FDEBIT,
isnull(Sum(b.FDEBITFor),0) as FDEBITFor,
isnull(Sum(b.FCREDIT),0) as FCREDIT,isnull(Sum(b.FCREDITFor),0) as FCREDITFor,
a.FDC as FDC,
(isnull(Sum(b.FDEBIT),0)-isnull(Sum(b.FCREDIT),0)) as FBALANCES,
(isnull(Sum(b.FDEBITFor),0)-isnull(Sum(b.FCREDITFor),0)) as FBALANCESFor,
ISNULL(Avg(b.FAMOUNTDIGITS),2) as FAMOUNTDIGITS
from #TM_GL_VoucherDetailData b join T_BD_ACCOUNT a on a.facctID=100030 where b.FVoucherID>0 and (a.FISCASH=1 or a.FISBANK=1)
group by a.facctID,A.FNUMBER,b.FYear,b.FPeriod,FDATE,a.FDC
Server stack trace:
在 Kingdee.BOS.App.Data.Sql.SqlDatabase.ExecuteBatch(List`1 sqlArray, Int32 batchSize, Int32 commandTimeout)
在 Kingdee.BOS.App.Data.DBUtils.ExecuteBatch(Context ctx, List`1 sqlArray, Int32 batchSize)
在 Kingdee.K3.FIN.GL.App.Report.SubLedgerService.PackageQuerySql(IRptParams filter, DataRow dr, String tempTableName)
在 Kingdee.K3.FIN.GL.App.Report.SubLedgerService.GetMoveReportDate(IRptParams filter, DataRow dr, String tableName)
在 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__DisplayClass3d.
推荐阅读