如何从自定义事务报告查询中获取帐户类型?

时间:2014-01-22 21:33:46

标签: quickbooks intuit-partner-platform

我想查找所选作业的所有交易及其余额。为了确定交易是收入还是费用,我需要帐户类型。

我查看了CustomDetailReportQueryRq的QBXml文档。我使用IncomeAndExpense作为帐户类型过滤器并包含列帐户。但是,帐户类型没有列。

我尝试使用帐户查询并匹配名称来查找类型;但是,名称不是唯一的,报表中的帐户可能与帐户查询中的名称显示方式不同。

是否有不同的方法可以找到我在报告中获得的交易的帐户类型?

1 个答案:

答案 0 :(得分:1)

我知道没有任何交易报告也会显示帐户类型。通过使用AccountQuery匹配帐户名称,您处于正确的轨道,但由于“帐户”列未显示完整的帐户名称(即使您在QuickBooks中运行报表),您还需要稍微更改一下方法。 / p>

如果您将报告SummarizeRowsBy值更改为按帐户汇总,则可以使用DataRow的RowData.value.GetValue()来获取全名。

public void ParseReport(IReportRet report)
{
    for(int index = 0; index < report.ReportData.ORReportDataList.Count; index++)
    {
        IORReportData repData = report.ReportData.ORReportDataList.GetAt(index);

        if(repData.ortype == ENORReportData.orrdDataRow)
        {
            // This will be the full account name
            string fullAccountName = repData.DataRow.RowData.value.GetValue();

            // The rest of the row data (determined by the columns selected)
            // repData.DataRow.ColDataList.GetAt(xxx);
        }
    }
}

请注意,如果帐号已开启,则会将其包含在名称中,例如:

4100 · Contract Revenue:4110 · Temporary Revenue

我不确定与您的AccountQuery比较时,这将如何影响匹配。