【科目余额表】取数逻辑整理
1、取数往期数据,只取已过账凭证数据,取表数据T_GL_BALANCE 即可
示例:
```
SELECT c.FNUMBER FACCOUNTNO,FYtdDebitFor BNJF,FYtdCreditFor BNDF
FROM T_GL_BALANCE a
INNER JOIN dbo.T_BD_ACCOUNTBOOK b ON a.FACCOUNTBOOKID = b.FBOOKID AND FACCTSYSTEMID=1 AND b.FACCTTABLEID = 119803792
AND B.FDOCUMENTSTATUS='C' AND B.FFORBIDSTATUS = 'A' AND b.FACCOUNTORGID='119803665'
INNER JOIN dbo.T_BD_ACCOUNT c ON c.FACCTID = a.FACCOUNTID AND c.FDOCUMENTSTATUS='C' AND c.FFORBIDSTATUS = 'A'
WHERE a.FYEAR = 2023 AND a.FPERIOD=6 AND a.FDETAILID=0 AND a.FCURRENCYID=0
```
2、取数当期数据,需包含未过账凭证数据,先获得临时表表名,再进行取数处理
临时表名获取方法见下图
执行SQL语句取科目数据如下
因为每次调用方法得到临时表名,故在方法最后应drop临时表
示例:
```
SELECT c.FNUMBER FACCOUNTNO,FYtdDebitFor BNJF,FYtdCreditFor BNDF
FROM TMPE1089299326B11EE856E1C1B0DA a
INNER JOIN dbo.T_BD_ACCOUNTBOOK b ON a.FACCOUNTBOOKID = b.FBOOKID AND FACCTSYSTEMID=1 AND b.FACCTTABLEID = 119803792
AND B.FDOCUMENTSTATUS='C' AND B.FFORBIDSTATUS = 'A' AND b.FACCOUNTORGID='119803665'
INNER JOIN dbo.T_BD_ACCOUNT c ON c.FACCTID = a.FACCOUNTID AND c.FDOCUMENTSTATUS='C' AND c.FFORBIDSTATUS = 'A'
WHERE a.FYEAR = 2023 AND a.FPERIOD=6 AND a.FDETAILID=0 AND a.FCURRENCYID=0
```
获取临时表名:
```
/// <summary>
/// 获取科目余额表临时表
/// </summary>
/// <param name="ctx"></param>
/// <param name="iStartYear">开始年份</param>
/// <param name="iStartPeriod">开始期间</param>
/// <param name="iEndYear">结束年份</param>
/// <param name="iEndPeriod">结束期间</param>
/// <param name="iAcctBookId">账表ID</param>
/// <param name="iCurrencyID">币别ID</param>
/// <param name="_lstAccountId">过滤科目列表,为空则查询全部</param>
/// <param name="ShowDetailItem">是否显示核算维度明细</param>
/// <param name="bExcludeAdjustVch">不包含调整期凭证</param>
/// <param name="blShowProfitBal">xx</param>
/// <returns></returns>
public static string GetGLBalance(Context ctx, int iStartYear, int iStartPeriod, int iEndYear, int iEndPeriod,
long iAcctBookId, long iCurrencyID, List<long> _lstAccountId, bool ShowDetailItem, bool bExcludeAdjustVch, bool blShowProfitBal)
{
#region 科目余额表,方法取数,包含未过账凭证
// Kingdee.K3.FIN.GL.Common.BusinessEntity.VirtualPostTemps
VirtualPostTemps voucherVirPostBalance = VoucherVirPostService.GetVoucherVirPostBalance(ctx, new VoucherPostParameters
{
PostType = GlVoucherPostType.PeriodScope,
BegingYear = iStartYear,
BegingPeriod = iStartPeriod,
EndYear = iEndYear,
EndPeriod = iEndPeriod,
IsCheckUncontinuity = false,
IsContinueWhenError = true,
IsContinueWhenUncontinuity = true,
BookId = iAcctBookId,
CurrencyId = iCurrencyID,
LstAccountIds = _lstAccountId,
IsContainDetailId = ShowDetailItem,
IsContainAdjustPeriod = !bExcludeAdjustVch,
IsNoContainProfit = !blShowProfitBal
});
return voucherVirPostBalance.BalanceTemp;
//hsTempTable.Add(strBalanceTable);
//if (blShowProfitBal)
//{
// strBalanceProfitTable = voucherVirPostBalance.ProfitBalanceTemp;
// hsTempTable.Add(strBalanceProfitTable);
//}
#endregion
}
```
调用语句:
string strBalanceTable = GLController.GetGLBalance(this.Context, year, period, year, period, bookId, 0, new List<long> { }, false, true, true);
请问楼主,这个VoucherVirPostService.GetVoucherVirPostBalance的方法,是哪个版本的云星空才有的?具体在哪个dll文件中啊?
【科目余额表】取数逻辑整理
1、取数往期数据,只取已过账凭证数据,取表数据T_GL_BALANCE 即可示例:```SELECT c.FNUMBER FACCOUNTNO,FYtdDebitFor BNJF,FYtdCredi...
点击下载文档
上一篇:流程表单中如何新增枚举下一篇:暂估应收单显示财务应收的生成情况具体字段
本文2024-09-16 17:35:49发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-16719.html
您需要登录后才可以发表评论, 登录登录 或者 注册
最新文档
热门文章