2017-10-21 69 views
1

我正在使用PHP生成QBXML来查询quickbooks以查找发票记录。这是行得通的。但是,现在我想查询两个不同的发票RefNumbers。如何使用quickbooks查询多个发票QBXML InvoiceQueryRq?

这是我当前的代码来查询一张发票:

$qbxml = '<?xml version="1.0" encoding="utf-8"?> 
<?qbxml version="2.0"?> 
<QBXML> 
    <QBXMLMsgsRq onError="stopOnError"> 
     <InvoiceQueryRq requestID="' . $requestID . '"> 
      <RefNumber>' . $ID . '</RefNumber> 
      <IncludeLineItems>true</IncludeLineItems> 
     </InvoiceQueryRq> 
    </QBXMLMsgsRq> 
</QBXML>'; 

我将如何格式化搜索RefNumber = $身份证或RefNumber = $ ID2?

回答

1

如果你指的是QuickBooks的OSR文档:

https://developer-static.intuit.com/qbsdk-current/common/newosr/index.html

你可以看到,RefNumber记录为:

<RefNumber >STRTYPE</RefNumber> <!-- optional, may repeat --> 

主要有词:

may repeat 

所以:

<?xml version="1.0" encoding="utf-8"?> 
<?qbxml version="11.0"?> 
<QBXML> 
    <QBXMLMsgsRq onError="stopOnError"> 
     <InvoiceQueryRq requestID="abc1234"> 
      <RefNumber>1</RefNumber> 
      <RefNumber>2</RefNumber> 
      <RefNumber>3</RefNumber> 
      <IncludeLineItems>true</IncludeLineItems> 
     </InvoiceQueryRq> 
    </QBXMLMsgsRq> 
</QBXML> 

边注,qbXML版本2.0是从QuickBooks 2003(例如14岁以上),所以你可能需要将它提升一些:

<?qbxml version="2.0"?> 
+0

感谢您的回答!我没有意识到XMLOps选项卡显示您发布的信息。我正在查看OSR上的请求标签。很高兴知道检查示例XML代码的XMLOps选项卡。 – user1855093

相关问题