dtlh12053 2014-01-27 21:48
浏览 36
已采纳

QuickBooks围绕id的Consolibytes,括号和连字符

I am using the Consolibytes QuickBooks Library; it's very helpful. Here is the link.

I noticed that, when pulling lists of customers, the ID number of the customer is surrounded by brackets and a hyphen.

Why is this the case?

Even in the supplied example that lists customers (example_customer_query.php), ID numbers are listed with brackets and a hyphen.

Would it be alright if I modified buildIDType() method within IDS.php and omitted the brackets and hyphen from the code?

  • 写回答

1条回答 默认 最新

  • duanfen1992 2014-01-27 22:36
    关注

    The v3 APIs can communicate with two different platforms:

    • QuickBooks for Windows

    • QuickBooks Online

    For QuickBooks for Windows, all of the Id values have two parts:

    • domain (this indicates whether or not the object is still in the "ng" not-yet-synced domain, or whether it's synced to QuickBooks and is now in the "qb" domain
    • id value (the actual integer value)

    For QuickBooks Online, the Id values only have one part:

    • id value (integer)

    To keep things consistent across both platforms, we have elected to make the library return a bracketed version of the Id values that gives you both the domain and the id value, so that regardless of whether you're talking to QuickBooks desktop or QuickBooks Online, the representation of the Ids is the same.

    You can strip the {-} stuff off with this method:

     $Id = '{-15}';
     $my_int = QuickBooks_IPP_IDS::usableIDType($Id);
     print($my_int);    // prints just 15
    

    You could certainly modify the code (it's all open-source after all) but it's not recommended as it will break your upgrade path. Also, note that if you ever start to offer QuickBooks for Windows syncing via v3 (or v4 or v5 or etc. etc. etc. when they are released) you're going to have to revert all of your changes.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥30 Unity接入微信SDK 无法开启摄像头
  • ¥20 有偿 写代码 要用特定的软件anaconda 里的jvpyter 用python3写
  • ¥20 cad图纸,chx-3六轴码垛机器人
  • ¥15 移动摄像头专网需要解vlan
  • ¥20 access多表提取相同字段数据并合并
  • ¥20 基于MSP430f5529的MPU6050驱动,求出欧拉角
  • ¥20 Java-Oj-桌布的计算
  • ¥15 powerbuilder中的datawindow数据整合到新的DataWindow
  • ¥20 有人知道这种图怎么画吗?
  • ¥15 pyqt6如何引用qrc文件加载里面的的资源