2017-10-21 100 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

相關問題