我正在使用 Quickbooks Online v3 API 的 PHP SDK。 我正在通过 DataService 和 QueryMessage 运行查询,该查询返回一个对象数组,其中包含整个特定于客户的记录。 姓名/地址/电话号码/到期余额/逾期余额等
一切正常,但是一个键被赋予"总收入",其值始终返回为"NULL"。 我玩过QuickBooks Online上的测试数据,创建了几个早于日期的交易,无论如何它总是空的。 但是,我可以操纵余额、逾期余额和其他与会计相关的字段。 总收入有什么问题? 我怀疑Quickbooks出于某种原因已经关闭了它...但我想确认:)
编辑:我检查了Quickbooks的在线API资源管理器,在他们的回报中,它在查询客户表时根本不返回"总收入"。
法典:
// 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"
...
V3 PHP devkit 是 QBD 和 QBO API 之上的包装器。
"总收入"适用于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
谢谢