1

在 Quickbooks 桌面版中,当我为发票的交易类型运行交易详细报告时,我显示了 5 个帐户:应收帐款、库存资产、应付销售税、销售额和销售成本。

但是,当我通过 .NET IPP DevKit v2 运行此程序时,我只看到其中的 3 个帐户:应收帐款、应付销售税和销售额。因此,缺少库存和已售商品成本。

代码:

CustomTxnDetail detail = new CustomTxnDetail();
detail.OfferingId = offeringId.ipp;
detail.OfferingIdSpecified = true;
detail.ReportBasis = ReportBasisEnum.Accrual;
detail.ReportBasisSpecified = true;

detail.ItemsElementName = new ItemsChoiceType6[] { 
    ItemsChoiceType6.StartTransactionDate, 
    ItemsChoiceType6.EndTransactionDate,
};
detail.Items = new object[] { 
    new DateTime(2013, 1, 1), 
    new DateTime(2013, 12, 31),
};

detail.Columns = new[] {
    DetailColumnsEnum.AccountId,
    DetailColumnsEnum.AccountName,
    DetailColumnsEnum.Amount,
    DetailColumnsEnum.DocNum,
    DetailColumnsEnum.ItemId,
    DetailColumnsEnum.ItemName,
    DetailColumnsEnum.ItemType,
    DetailColumnsEnum.TxnDate,
    DetailColumnsEnum.TxnId,
    DetailColumnsEnum.TxnLineId,
    DetailColumnsEnum.TxnType,
    DetailColumnsEnum.UnitPrice, 
};
detail.TxnType = new[] { 
    TxnTypeEnum.Invoice,
};

ReportingServices rptSvc = new ReportingServices(context);
Report rpt = rptSvc.CustomTxnDetailsReport(detail);

要求:

<?xml version="1.0" encoding="utf-8"?>
<AdvancedReportQuery xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.intuit.com/sb/cdm/v2">
    <CustomTxnDetail>
        <OfferingId>ipp</OfferingId>
        <StartTransactionDate>2013-01-01T00:00:00</StartTransactionDate>
        <EndTransactionDate>2013-12-31T00:00:00</EndTransactionDate>
        <TxnType>Invoice</TxnType>
        <ReportBasis>Accrual</ReportBasis>
        <Columns>AccountId</Columns>
        <Columns>AccountName</Columns>
        <Columns>Amount</Columns>
        <Columns>DocNum</Columns>
        <Columns>ItemId</Columns>
        <Columns>ItemName</Columns>
        <Columns>ItemType</Columns>
        <Columns>TxnDate</Columns>
        <Columns>TxnId</Columns>
        <Columns>TxnLineId</Columns>
        <Columns>TxnType</Columns>
        <Columns>UnitPrice</Columns>
    </CustomTxnDetail>
</AdvancedReportQuery>

回复:

<?xml version="1.0" encoding="UTF-8"?>
<!--XML GENERATED by IntuitDataSyncEngine (IDS) using \\SBDomainServices\CDM\branches\3.9.0-rel-1-->
<RestResponse xmlns="http://www.intuit.com/sb/cdm/v2"
xmlns:xdb          ="http://xmlns.oracle.com/xdb"
xmlns:xsi          ="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation ="http://www.intuit.com/sb/cdm/v2 RestDataFilter.xsd">
    <Report name="CustomerTxnDetail">
        <ColDesc>
            <ColTitle>AccountId</ColTitle>
            <ColType>ids_IdType</ColType>
        </ColDesc>
        <ColDesc>
            <ColTitle>AccountName</ColTitle>
            <ColType>ids_String</ColType>
        </ColDesc>
        <ColDesc>
            <ColTitle>Amount</ColTitle>
            <ColType>ids_Amount</ColType>
        </ColDesc>
        <ColDesc>
            <ColTitle>DocNum</ColTitle>
            <ColType>ids_String</ColType>
        </ColDesc>
        <ColDesc>
            <ColTitle>ItemId</ColTitle>
            <ColType>ids_IdType</ColType>
        </ColDesc>
        <ColDesc>
            <ColTitle>ItemName</ColTitle>
            <ColType>ids_String</ColType>
        </ColDesc>
        <ColDesc>
            <ColTitle>ItemType</ColTitle>
            <ColType>ids_String</ColType>
        </ColDesc>
        <ColDesc>
            <ColTitle>TxnDate</ColTitle>
            <ColType>ids_Date</ColType>
        </ColDesc>
        <ColDesc>
            <ColTitle>TxnId</ColTitle>
            <ColType>ids_IdType</ColType>
        </ColDesc>
        <ColDesc>
            <ColTitle>TxnLineId</ColTitle>
            <ColType>ids_IdType</ColType>
        </ColDesc>
        <ColDesc>
            <ColTitle>TxnType</ColTitle>
            <ColType>ids_String</ColType>
        </ColDesc>
        <ColDesc>
            <ColTitle>UnitPriceQnty</ColTitle>
            <ColType>ids_Amount</ColType>
        </ColDesc>
        <Data>
            <DataRow>
                <ColData>6</ColData>
                <ColData>Sales</ColData>
                <ColData>-524.85</ColData>
                <ColData/>
                <ColData>39</ColData>
                <ColData>201</ColData>
                <ColData>Inventory</ColData>
                <ColData>2013-09-18</ColData>
                <ColData/>
                <ColData/>
                <ColData>Invoice</ColData>
                <ColData>34.99</ColData>
            </DataRow>
            <DataRow>
                <ColData>6</ColData>
                <ColData>Sales</ColData>
                <ColData>-174.95</ColData>
                <ColData/>
                <ColData>40</ColData>
                <ColData>200</ColData>
                <ColData>Inventory</ColData>
                <ColData>2013-09-18</ColData>
                <ColData/>
                <ColData/>
                <ColData>Invoice</ColData>
                <ColData>34.99</ColData>
            </DataRow>
            <DataRow>
                <ColData>6</ColData>
                <ColData>Sales</ColData>
                <ColData>-209.94</ColData>
                <ColData/>
                <ColData>37</ColData>
                <ColData>203</ColData>
                <ColData>Inventory</ColData>
                <ColData>2013-09-18</ColData>
                <ColData/>
                <ColData/>
                <ColData>Invoice</ColData>
                <ColData>34.99</ColData>
            </DataRow>
            <DataRow>
                <ColData>32</ColData>
                <ColData>Sales Tax Payable</ColData>
                <ColData>0</ColData>
                <ColData/>
                <ColData>1</ColData>
                <ColData>Out of State</ColData>
                <ColData>Sales Tax Item</ColData>
                <ColData>2013-09-18</ColData>
                <ColData/>
                <ColData/>
                <ColData>Invoice</ColData>
                <ColData/>
            </DataRow>
            <DataRow>
                <ColData>32</ColData>
                <ColData>Sales Tax Payable</ColData>
                <ColData>0</ColData>
                <ColData/>
                <ColData>1</ColData>
                <ColData>Out of State</ColData>
                <ColData>Sales Tax Item</ColData>
                <ColData>2013-09-18</ColData>
                <ColData/>
                <ColData/>
                <ColData>Invoice</ColData>
                <ColData/>
            </DataRow>
            <DataRow>
                <ColData>35</ColData>
                <ColData>Accounts Receivable</ColData>
                <ColData>734.79</ColData>
                <ColData/>
                <ColData/>
                <ColData/>
                <ColData/>
                <ColData>2013-09-18</ColData>
                <ColData/>
                <ColData/>
                <ColData>Invoice</ColData>
                <ColData/>
            </DataRow>
            <DataRow>
                <ColData>35</ColData>
                <ColData>Accounts Receivable</ColData>
                <ColData>174.95</ColData>
                <ColData/>
                <ColData/>
                <ColData/>
                <ColData/>
                <ColData>2013-09-18</ColData>
                <ColData/>
                <ColData/>
                <ColData>Invoice</ColData>
                <ColData/>
            </DataRow>
        </Data>
    </Report>
</RestResponse>

有什么想法吗?我完全被困住了:(

4

3 回答 3

0

您能否检查那些丢失的帐户(库存和已售商品成本)是否处于错误状态。

您可以通过执行查询并设置 ErroredObjectsOnly=true 来检查。

http://docs.developer.intuit.com/0025_Intuit_Anywhere/0050_Data_Services/v2/0500_QuickBooks_Windows/0100_Calling_Data_Services/0015_Retrieving_Objects#Objects_in_Error_State

如果实体处于错误状态,您可以使用 SyncStatus API 查询具体原因:

http://docs.developer.intuit.com/0025_Intuit_Anywhere/0050_Data_Services/v2/0500_QuickBooks_Windows/0600_Object_Reference/SyncStatus

从那里,您将需要删除或恢复处于错误状态的对象,具体取决于是否发生了同步。

ApiExplorer - https://developer.intuit.com/apiexplorer?apiname=V2QBD

谢谢

于 2013-09-19T06:00:43.290 回答
0

请查询 DetailColumnsEnum.AccountType。它应该有 COGS 帐户。库存应归入固定资产参考: https ://developer.intuit.com/docs/0025_quickbooksapi/0050_data_services/v2/0500_quickbooks_windows/064_reports/customtxndetail

SDK 仅支持以下帐户子类型 - 用于对 QuickBooks 中的帐户进行分类的帐户子类型枚举。值:银行、应收账款、其他流动资产、固定资产、其他资产、应付账款、信用卡、其他流动负债、长期负债、权益、收入、销售成本、费用、其他收入、其他费用、非发帖

有关所有帐户子类型的说明,请参阅: https ://developer.intuit.com/docs/0025_quickbooksapi/0050_data_services/v2/0500_quickbooks_windows/0600_object_reference/account

于 2013-09-19T06:29:39.350 回答
0

事实证明,这是 Quickbooks API 中的一个已知错误。我用 Intuit 开了一张票。他们非常有帮助,他们的一位开发人员能够重现此问题。

但是,目前没有解决方法。而且,我的印象是它不会很快得到修复。

QBD V2:Intuit 承认这是一个错误。(CustomTxnDetail 不返回 COGS 交易)

QBD V3:截至本文发布时,V3 中没有可用的 ReportingServices

如果其他人找到了一种解决方法来检索可以追溯到发票/销售收据的实际成本交易,我将非常感谢您了解您是如何做到的。

于 2013-09-27T14:34:00.327 回答