从Quickbooks数据库中获取所有账单支付支票

时间:2015-01-26 08:28:13

标签: php quickbooks

我想从quickbooks数据库中获取所有账单支付支票。我使用PHP Quickbooks dev kit 2.0。我创建了这样的请求查询,但是web连接器显示错误。

  function _quickbooks_billpaymentcheck_query_request($requestID, $user,       $action, $ID, $extra, &$err, $last_action_time, $last_actionident_time, $version, $locale)
  {

 $xml = '<?xml version="1.0" encoding="utf-8"?>
     <?qbxml version="2.0"?>
     <QBXML>
        <QBXMLMsgsRq onError="stopOnError">
    <BillPaymentCheckQueryRq  requestID="' . $requestID . '">

               <FromModifiedDate>1990-01-01T00:00:00</FromModifiedDate>
                <OwnerID>0</OwnerID>
            </BillPaymentCheckQueryRq>  
        </QBXMLMsgsRq>
      </QBXML>';

  return $xml;
  }   

请求代码如下: -

       function _quickbooks_billpaymentcheck_query_response($requestID, $user,  $action, $ID, $extra, &$err, $last_action_time, $last_actionident_time, $xml, $idents)
     {  
          $errnum = 0;
          $errmsg = '';
          $Parser = new QuickBooks_XML_Parser($xml);
        if ($Doc = $Parser->parse($errnum, $errmsg))
         {
           $Root = $Doc->getRoot();
          $List = $Root->getChildAt('QBXML/QBXMLMsgsRs/BillPaymentCheckRs');
             foreach($List->children() as $BillPaymentCheck)
               {
        $TxnID=$BillPaymentCheck->getChildDataAt('BillPaymentCheckRet  TxnID');



    }
       }

return true;

}

他们的代码有什么问题吗?请帮忙??

1 个答案:

答案 0 :(得分:1)

K ......我知道了,在响应代码中

$List = $Root->getChildAt('QBXML/QBXMLMsgsRs/BillPaymentCheckRs');

更改为

$List = $Root->getChildAt('QBXML/QBXMLMsgsRs/BillPaymentCheckQueryRs');

工作得很好......