I want to find out all transactions of a selected job and its balance. In order to determine whether the transaction is income or expense, I need the account type.
I looked into the QBXml documentation for CustomDetailReportQueryRq. I use IncomeAndExpense as Account Type filter and include column Account. However, there is no column for account type.
I tried to use Account Query and match Name to find the type; however, Name is not unique and Account from the report may not displayed the same way as Name in Account Query.
Is there a different way to find the account type for the transaction I got in the report?
There is no transactional report that I know of that will also display the account types. You're on the right track by using an AccountQuery to match the account name, but because the Account column does not display the full account name (Even if you run the report in QuickBooks) you'll need to slightly change your approach.
If you change your report SummarizeRowsBy value to summarize by Account, you can use the RowData.value.GetValue() of a DataRow to get the full name.
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);
}
}
}
Keep in mind that if account numbers are turned on, it will include them in the name, for example:
4100 · Contract Revenue:4110 · Temporary Revenue
I'm not sure how that will effect the matching when comparing to your AccountQuery.