【问题标题】:TotalRevenue field returned by Quickbooks Online API is always NULLQuickbooks Online API 返回的 TotalRevenue 字段始终为 NULL
【发布时间】:2013-11-16 13:09:42
【问题描述】:

我正在为 Quickbooks Online v3 API 使用 PHP SDK。我正在通过 DataService 和 QueryMessage 运行查询,该查询返回一个对象数组,其中包含整个客户特定的记录。姓名/地址/电话号码/到期余额/逾期余额等。

一切正常,但是给定一个键“TotalRevenue”,其值始终返回为“NULL”。我玩过 QuickBooks Online 上的测试数据,创建了几个提前交易的交易,无论如何它始终为 NULL。但是,我可以操作 Balance、OverDueBalance 和其他与会计相关的字段。 TotalRevenue 有什么问题?我怀疑 Quickbooks 出于某种原因将其关闭了……但我想确认一下 :)

编辑:我检查了 Quickbooks 的 Online API Explorer,在他们的返回中,查询 Customer 表时它根本不返回“TotalRevenue”。

代码:

    // Prep Data Services
    $dataService = new DataService($serviceContext);

    // Build a query
    $oneQuery = new QueryMessage();
    $oneQuery->sql = "SELECT";
    $oneQuery->entity = "Customer";
    $oneQuery->orderByClause = "FamilyName";
    $oneQuery->startposition = "1";
    $oneQuery->maxresults = "50";

    // Run a query
    $queryString = $oneQuery->getString();
    $entities = $dataService->Query($queryString);

    // Echo some formatted output
    var_dump($entities);

var_dump 输出:

    [0]=>
  object(IPPCustomer)#29 (62) {
    ["Taxable"]=>
    string(4) "true"
    ["BillAddr"]=>
    object(IPPPhysicalAddress)#68 (16) {
      ["Id"]=>
      string(4) "55555"
      ["Line1"]=>
      string(22) "123 ABC St"
      }

      ...

    ["Notes"]=>
    string(20) "These are some notes"
    ["Job"]=>
    string(5) "false"
    ["BillWithParent"]=>
    string(5) "false"

    ... 

    ["Balance"]=>
    string(5) "40.00"
    ["OpenBalanceDate"]=>
    NULL
    ["BalanceWithJobs"]=>
    string(5) "40.00"
    ["CreditLimit"]=>
    NULL
    ["AcctNum"]=>
    NULL
    ["CurrencyRef"]=>
    NULL
    ["OverDueBalance"]=>
    NULL
    ["TotalRevenue"]=>
    NULL   //<-----Why is this always NULL if there are transactions (both expenses
           //      and revenue) made from and to the customers?

    ...

    ["GivenName"]=>
    string(4) "John"
    ["MiddleName"]=>
    string(6) "Middle"
    ["FamilyName"]=>
    string(10) "Doe"

    ...

【问题讨论】:

    标签: php quickbooks-online


    【解决方案1】:

    V3 PHP devkit 是 QBD 和 QBO API 之上的包装器。

    'TotalRevenue' 用于 QBD。 QBD REST API 已弃用。在未来的 PHP devkit 版本中,该字段将不存在。请忽略此字段。

    参考 - https://developer.intuit.com/docs/95_deprecated/qbd_v3/qbd_v3_reference/030_entity_services_reference/customer

    正如您所提到的,QBO V3 不存在此字段。

    参考 - https://developer.intuit.com/docs/0025_quickbooksapi/0050_data_services/030_entity_services_reference/customer

    谢谢

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-11-09
      • 1970-01-01
      • 2021-09-13
      相关资源
      最近更新 更多