版本:5.0
补丁:PT094171
曾经看到过一个帖子,关于会计科目的,若是已经使用的会计科目,可以直接新增核算维度。于是在演示账套中将银行存款科目新增了核算维度(原本是没有挂核算维度的),同时录入了一笔银行存款带核算项目的凭证。
查询科目余额表时,只选择对应的银行存款科目,若勾选显示核算维度明细,则报错,不勾选的话,可以正常打开。
报错如下图所示:
其中报错显示的代码信息如下:
CREATE Table TMP6B17CEA5963E11E480E3000C290
(
FBalanceTotal int null,
FACCTID int null,
FBALANCEID nvarchar(80) null,
FBALANCENAME nvarchar(800) null,
FLEVEL int null,
FDC int null,
FITEMDETAILID int null,
FPARENTID int null,
FGROUPID int null,
FDETAILID int null,
FDETAILNUMBER varchar(4000) null,
FDETAILNAME nvarchar(2000) null,
FCyID int null,
FCyName nvarchar(80) null,
FISDETAIL char(1) null,
FAMOUNTDIGITS int null,
FBeginBalanceFor decimal(23,10) null,
FBeginBalanceLocal decimal(23,10) null,
FEndBalanceFor decimal(23,10) null,
FEndBalanceLocal decimal(23,10) null,
FDebit decimal(23,10) null,
FDebitLocal decimal(23,10) null,
FCredit decimal(23,10) null,
FCreditLocal decimal(23,10) null,
FYtdDebit decimal(23,10) null,
FYtdDebitLocal decimal(23,10) null,
FYtdCredit decimal(23,10) null,
FYtdCreditLocal decimal(23,10) null,
FBeginDebit decimal(23,10) null,
FBeginDebitLocal decimal(23,10) null,
FBeginCredit decimal(23,10) null,
FBeginCreditLocal decimal(23,10) null,
FEndDebit decimal(23,10) null,
FEndDebitLocal decimal(23,10) null,
FEndCredit decimal(23,10) null,
FEndCreditLocal decimal(23,10) null,
FDataType int null default 0,
FACCTBOOKFAMOUNTDIGITS int null,
FIDENTITYID int null
)
insert into TMP6B17CEA5963E11E480E3000C290 (FBalanceTotal,FACCTID,FBALANCEID,FBALANCENAME,FLEVEL,FDC,FITEMDETAILID,FPARENTID,FGROUPID,FDETAILID,
FDETAILNUMBER,FDETAILNAME,FCyID,FCyName,FISDETAIL,FAMOUNTDIGITS,FBeginBalanceFor,FBeginBalanceLocal,FEndBalanceFor,FEndBalanceLocal,FDebit,
FDebitLocal,FCredit,FCreditLocal,FYtdDebit,FYtdDebitLocal,FYtdCredit,FYtdCreditLocal,FBeginDebit,FBeginDebitLocal,
FBeginCredit,FBeginCreditLocal,FEndDebit,FEndDebitLocal,FEndCredit,FEndCreditLocal)
(select * from (SELECT 0 FBALANCETOTAL,a.FACCTID,a.FNUMBER AS FBALANCEID
,al.FNAME FBALANCENAME
,a.FLEVEL,a.FDC,a.FITEMDETAILID,a.FPARENTID,a.FGROUPID
,ISNULL(b.FDETAILID,0) FDETAILID
,ISNULL(b3.fnumber, '') AS FDETAILNUMBER
,ISNULL(b3.fname, '') AS FDETAILNAME
,b.FCURRENCYID AS FCyID
,N' ' AS FCyName
,a.FISDETAIL
,ISNULL(c.FAMOUNTDIGITS,2) FAMOUNTDIGITS
,ISNULL(b1.FBEGINBALANCEFOR,0) FBEGINBALANCEFOR
,ISNULL(B1.FBEGINBALANCE,0) FBEGINBALANCELOCAL
,(ISNULL(B1.FBEGINBALANCEFOR,0) + ISNULL(B.FDEBITFOR,0) - ISNULL(B.FCREDITFOR,0)) FENDBALANCEFOR,(ISNULL(B1.FBEGINBALANCE,0) + ISNULL(B.FDEBIT,0) - ISNULL(B.FCREDIT,0)) FENDBALANCELOCAL,ISNULL(B.FDEBITFOR,0) FDEBIT
,ISNULL(B.FDEBIT,0) FDEBITLOCAL
,ISNULL(B.FCREDITFOR,0) FCREDIT
,ISNULL(B.FCREDIT,0) FCREDITLOCAL
,ISNULL(B2.FYTDDEBITFOR,0) FYTDDEBIT
,ISNULL(B2.FYTDDEBIT,0) FYTDDEBITLOCAL
,ISNULL(B2.FYTDCREDITFOR,0) FYTDCREDIT
,ISNULL(B2.FYTDCREDIT,0) FYTDCREDITLOCAL
,ISNULL(CASE WHEN B1.FBEGINBALANCEFOR > 0 THEN B1.FBEGINBALANCEFOR END,0) FBEGINDEBIT
,ISNULL(CASE WHEN B1.FBEGINBALANCE > 0 THEN B1.FBEGINBALANCE END,0) FBEGINDEBITLOCAL
,ISNULL(CASE WHEN B1.FBEGINBALANCEFOR < 0 THEN B1.FBEGINBALANCEFOR * -1 END,0) FBEGINCREDIT
,ISNULL(CASE WHEN B1.FBEGINBALANCE < 0 THEN B1.FBEGINBALANCE * -1 END,0) FBEGINCREDITLOCAL
,ISNULL(CASE WHEN (ISNULL(B1.FBEGINBALANCEFOR,0) + ISNULL(B.FDEBITFOR,0) - ISNULL(B.FCREDITFOR,0))> 0 THEN (ISNULL(B1.FBEGINBALANCEFOR,0) + ISNULL(B.FDEBITFOR,0) - ISNULL(B.FCREDITFOR,0)) END,0) FENDDEBIT ,ISNULL(CASE WHEN (ISNULL(B1.FBEGINBALANCE,0) + ISNULL(B.FDEBIT,0) - ISNULL(B.FCREDIT,0))> 0 THEN (ISNULL(B1.FBEGINBALANCE,0) + ISNULL(B.FDEBIT,0) - ISNULL(B.FCREDIT,0)) END,0) FENDDEBITLOCAL ,ISNULL(CASE WHEN (ISNULL(B1.FBEGINBALANCEFOR,0) + ISNULL(B.FDEBITFOR,0) - ISNULL(B.FCREDITFOR,0)) < 0 THEN (ISNULL(B1.FBEGINBALANCEFOR,0) + ISNULL(B.FDEBITFOR,0) - ISNULL(B.FCREDITFOR,0)) * -1 END,0) FENDCREDIT ,ISNULL(CASE WHEN (ISNULL(B1.FBEGINBALANCE,0) + ISNULL(B.FDEBIT,0) - ISNULL(B.FCREDIT,0)) < 0 THEN(ISNULL(B1.FBEGINBALANCE,0) + ISNULL(B.FDEBIT,0) - ISNULL(B.FCREDIT,0)) * -1 END,0) FENDCREDITLOCAL From T_BD_ACCOUNT a
LEFT JOIN T_BD_ACCOUNT_L al ON al.FACCTID = a.FACCTID
Left Join (Select FACCOUNTBOOKID,FAccountID,FDetailID,FCURRENCYID,SUM(FDebitFor) FDebitFor,SUM(FDebit) FDebit,SUM(FCreditFor) FCreditFor,SUM(FCredit) FCredit
FROM TMP6B17CEA4963E11E480E3000C290 WHERE (FYearPeriod =201408) And FCURRENCYID=1 AND FACCOUNTBOOKID=100189group by FACCOUNTBOOKID,FAccountID,FDetailID,FCURRENCYID) B on B.FACCOUNTID=a.FACCTID
Left Join
(SELECT FACCOUNTBOOKID,FAccountID,FDetailID,FCURRENCYID,FBEGINBALANCEFOR,FBEGINBALANCE
FROM TMP6B17CEA4963E11E480E3000C290 WHERE FYearPeriod = 201408 And FCURRENCYID=1 AND FACCOUNTBOOKID=100189) B1 on b.FACCOUNTBOOKID=b1.FACCOUNTBOOKID and b.FACCOUNTID=b1.FACCOUNTID and b.FDETAILID=b1.FDETAILID and b.FCURRENCYID=b1.FCURRENCYID
Left Join (SELECT FACCOUNTBOOKID,FAccountID,FDetailID,FCURRENCYID
,sum(FYtdDebitFor) FYtdDebitFor
,sum(FYtdDebit) FYtdDebit
,sum(FYtdCreditFor) FYtdCreditFor
,sum(FYtdCredit) FYtdCredit
FROM TMP6B17CEA4963E11E480E3000C290 WHERE FYear = 2014 And FPERIOD = 8 And FCURRENCYID=1 AND FACCOUNTBOOKID=100189 Group by FACCOUNTBOOKID,FAccountID,FDetailID,FCURRENCYID
) b2 on b.FACCOUNTBOOKID=b2.FACCOUNTBOOKID and b.FACCOUNTID=b2.FACCOUNTID and b.FDETAILID=b2.FDETAILID and b.FCURRENCYID=b2.FCURRENCYID
Left Join (select t0.fid, substring( case when ISNULL(t1.FNUMBER, ' ')<>' ' then '/' || t1.FNUMBER else '' end || case when ISNULL(t2.FNUMBER, ' ')<>' ' then '/' || t2.FNUMBER else '' end || case when ISNULL(t3.FNUMBER, ' ')<>' ' then '/' || t3.FNUMBER else '' end || case when ISNULL(t4.FNUMBER, ' ')<>' ' then '/' || t4.FNUMBER else '' end || case when ISNULL(t5.FNUMBER, ' ')<>' ' then '/' || t5.FNUMBER else '' end || case when ISNULL(t6.FNUMBER, ' ')<>' ' then '/' || t6.FNUMBER else '' end || case when ISNULL(t7.FNUMBER, ' ')<>' ' then '/' || t7.FNUMBER else '' end || case when ISNULL(t8.FNUMBER, ' ')<>' ' then '/' || t8.FNUMBER else '' end || case when ISNULL(t9.FNUMBER, ' ')<>' ' then '/' || t9.FNUMBER else '' end || case when ISNULL(t10.FNUMBER, ' ')<>' ' then '/' || t10.FNUMBER else '' end || case when ISNULL(t11.FNUMBER, ' ')<>' ' then '/' || t11.FNUMBER else '' end || case when ISNULL(t12.FNUMBER, ' ')<>' ' then '/' || t12.FNUMBER else '' end || case when ISNULL(t13.FNUMBER, ' ')<>' ' then '/' || t13.FNUMBER else '' end || case when ISNULL(t14.FNUMBER, ' ')<>' ' then '/' || t14.FNUMBER else '' end || case when ISNULL(t15.FNUMBER, ' ')<>' ' then '/' || t15.FNUMBER else '' end || case when ISNULL(t16.FNUMBER, ' ')<>' ' then '/' || t16.FNUMBER else '' end || case when ISNULL(t17.FNUMBER, ' ')<>' ' then '/' || t17.FNUMBER else '' end || case when ISNULL(t18.FNUMBER, ' ')<>' ' then '/' || t18.FNUMBER else '' end , 2, 8000) fnumber, substring( case when ISNULL(t1_L.FNAME, ' ')<>' ' then '/' || t1_L.FNAME else '' end || case when ISNULL(t2_L.FNAME, ' ')<>' ' then '/' || t2_L.FNAME else '' end || case when ISNULL(t3_L.FNAME, ' ')<>' ' then '/' || t3_L.FNAME else '' end || case when ISNULL(t4_L.FNAME, ' ')<>' ' then '/' || t4_L.FNAME else '' end || case when ISNULL(t5_L.FNAME, ' ')<>' ' then '/' || t5_L.FNAME else '' end || case when ISNULL(t6_L.FNAME, ' ')<>' ' then '/' || t6_L.FNAME else '' end || case when ISNULL(t7_L.FNAME, ' ')<>' ' then '/' || t7_L.FNAME else '' end || case when ISNULL(t8_L.FNAME, ' ')<>' ' then '/' || t8_L.FNAME else '' end || case when ISNULL(t9_L.FNAME, ' ')<>' ' then '/' || t9_L.FNAME else '' end || case when ISNULL(t10_L.FNAME, ' ')<>' ' then '/' || t10_L.FNAME else '' end || case when ISNULL(t11_L.FNAME, ' ')<>' ' then '/' || t11_L.FNAME else '' end || case when ISNULL(t12_L.FNAME, ' ')<>' ' then '/' || t12_L.FNAME else '' end || case when ISNULL(t13_L.FNAME, ' ')<>' ' then '/' || t13_L.FNAME else '' end || case when ISNULL(t14_L.FNAME, ' ')<>' ' then '/' || t14_L.FNAME else '' end || case when ISNULL(t15_L.FNAME, ' ')<>' ' then '/' || t15_L.FNAME else '' end || case when ISNULL(t16_L.FNAME, ' ')<>' ' then '/' || t16_L.FNAME else '' end || case when ISNULL(t17_L.FNAME, ' ')<>' ' then '/' || t17_L.FNAME else '' end || case when ISNULL(t18_L.FNAME, ' ')<>' ' then '/' || t18_L.FNAME else '' end , 2, 4000) fname from t_bd_flexitemdetailv t0 left join t_BD_Supplier t1 on t0.FFLEX4 = t1.FSupplierId left join t_BD_Supplier_L t1_L on t0.FFLEX4 = t1_L.FSupplierId and t1_L.FLOCALEID = 2052 left join T_BD_DEPARTMENT t2 on t0.FFLEX5 = t2.FDEPTID left join T_BD_DEPARTMENT_L t2_L on t0.FFLEX5 = t2_L.FDEPTID and t2_L.FLOCALEID = 2052 left join T_BD_CUSTOMER t3 on t0.FFLEX6 = t3.FCUSTID left join T_BD_CUSTOMER_L t3_L on t0.FFLEX6 = t3_L.FCUSTID and t3_L.FLOCALEID = 2052 left join T_HR_EMPINFO t4 on t0.FFLEX7 = t4.FID left join T_HR_EMPINFO_L t4_L on t0.FFLEX7 = t4_L.FID and t4_L.FLOCALEID = 2052 left join T_BD_MATERIAL t5 on t0.FFLEX8 = t5.FMATERIALID left join T_BD_MATERIAL_L t5_L on t0.FFLEX8 = t5_L.FMATERIALID and t5_L.FLOCALEID = 2052 left join T_BD_EXPENSE t6 on t0.FFLEX9 = t6.FEXPID left join T_BD_EXPENSE_L t6_L on t0.FFLEX9 = t6_L.FEXPID and t6_L.FLOCALEID = 2052 left join T_FA_ASSETTYPE t7 on t0.FFLEX10 = t7.FID left join T_FA_ASSETTYPE_L t7_L on t0.FFLEX10 = t7_L.FID and t7_L.FLOCALEID = 2052 left join T_ORG_Organizations t8 on t0.FFLEX11 = t8.FOrgID left join T_ORG_Organizations_L t8_L on t0.FFLEX11 = t8_L.FOrgID and t8_L.FLOCALEID = 2052 left join t9 on t0.FF100002 = t9.FID left join _L t9_L on t0.FF100002 = t9_L.FID and t9_L.FLOCALEID = 2052 left join T_AP_BillingMatchScheme t10 on t0.FF100003 = t10.FMatchSchemeID left join T_AP_BillingMatchScheme_L t10_L on t0.FF100003 = t10_L.FMatchSchemeID and t10_L.FLOCALEID = 2052 left join T_AP_SOURCEFORMABLE t11 on t0.FF100004 = t11.FID left join T_AP_SOURCEFORMABLE_L t11_L on t0.FF100004 = t11_L.FID and t11_L.FLOCALEID = 2052 left join T_AP_FieldConfig t12 on t0.FF100005 = t12.FID left join T_AP_FieldConfig_L t12_L on t0.FF100005 = t12_L.FID and t12_L.FLOCALEID = 2052 left join V_AP_STKInStock t13 on t0.FF100006 = t13.FID left join V_AP_STKInStock_L t13_L on t0.FF100006 = t13_L.FID and t13_L.FLOCALEID = 2052 left join T_AP_MatchBill t14 on t0.FF100007 = t14.FID left join T_AP_MatchBill_L t14_L on t0.FF100007 = t14_L.FID and t14_L.FLOCALEID = 2052 left join T_AP_MatchConfig t15 on t0.FF100008 = t15.FID left join T_AP_MatchConfig_L t15_L on t0.FF100008 = t15_L.FID and t15_L.FLOCALEID = 2052 left join T_AP_MatchScheme t16 on t0.FF100009 = t16.FMatchSchemeID left join T_AP_MatchScheme_L t16_L on t0.FF100009 = t16_L.FMatchSchemeID and t16_L.FLOCALEID = 2052 left join T_AP_MatchScheme t17 on t0.FF100010 = t17.FMatchSchemeID left join T_AP_MatchScheme_L t17_L on t0.FF100010 = t17_L.FMatchSchemeID and t17_L.FLOCALEID = 2052 left join T_AP_PAYABLE t18 on t0.FF100011 = t18.FID left join T_AP_PAYABLE_L t18_L on t0.FF100011 = t18_L.FID and t18_L.FLOCALEID = 2052 ) b3 on b.FDETAILID = b3.fid Left join T_BD_CURRENCY c ON c.FCURRENCYID = b.FCURRENCYID
Where al.FLOCALEID=2052
AND (a.FNUMBER = '1002' OR a.FNUMBER like '1002.%')
And a.FLEVEL<= 1 And a.FACCTTBLID=2001) tt where ((FBeginCredit <> 0 OR FBeginDebit <> 0 OR FYtdCredit <> 0 OR FYtdDebit <> 0)
OR (FBeginCreditLocal <> 0 OR FBeginDebitLocal <> 0 OR FYtdCreditLocal <> 0 OR FYtdDebitLocal <> 0)
OR (FYtdDebit <> 0 OR FYtdCredit <> 0 OR FYtdDebitLocal <> 0 OR FYtdCreditLocal <> 0)
OR (FDebit <> 0 OR FCredit <> 0 OR FDebitLocal <> 0 OR FCreditLocal <> 0)) )
在 Kingdee.BOS.App.Data.Sql.SqlDatabase.ExecuteBatch(List`1 sqlArray, Int32 batchSize, Int32 commandTimeout)
在 Kingdee.BOS.App.Data.DBUtils.ExecuteBatchWithTime(Context ctx, List`1 sqlArray, Int32 batchSize, Int32 commandTimeout)
在 Kingdee.K3.FIN.GL.App.Core.AccountBalanceStatement.AccountBalanceExecute(Context ctx, String tableName, String filter, String orderby, Boolean isDelBalanceTable)
在 Kingdee.K3.FIN.GL.App.Report.AccountBalanceService.AccountBalanceDeal(String tableName, Int64 acctTableId, String filter, String orderby)
在 Kingdee.K3.FIN.GL.App.Report.AccountBalanceService.BuilderSql(IRptParams filter, 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.GetData(IRptParams filter)
在 Kingdee.BOS.Model.Report.SysReportModel.GetData(Int32 start, Int32 rows)
在 Kingdee.BOS.Web.Report.SysReportView.GetListData()
在 Kingdee.BOS.Web.Report.SysReportView.<>c__DisplayClass36.