【发布时间】: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