如何使用 quickbooks QBXML InvoiceQueryRq 查询多张发票?

How to query for multiple invoices with quickbooks QBXML InvoiceQueryRq?

我正在使用 PHP 生成 QBXML 来查询 quickbooks 以查找发票记录。这是工作。但是,现在我想查询两个不同的发票 RefNumbers。

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

$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 = $ID OR RefNumber = $ID2?

如果您参考 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"?>