Operation not supported: Expense with BillableStatus should have CustomerRef for AccountBasedExpenseLineDetail Line in Purchase

帅比萌擦擦* 提交于 2021-01-29 10:15:31

问题


I have attempted to submit a Purchase as Check to QBD using PHP SDK with the below XML request content:

<?xml version="1.0" encoding="UTF-8"?>
<ns0:Purchase xmlns:ns0="http://schema.intuit.com/finance/v3" domain="QB">
  <ns0:TxnDate>2014-02-21</ns0:TxnDate>
  <ns0:PrivateNote>Test for QBD Purchase Check</ns0:PrivateNote>
  <ns0:Line>
    <ns0:Description>E1</ns0:Description>
    <ns0:Amount>10.00</ns0:Amount>
    <ns0:DetailType>AccountBasedExpenseLineDetail</ns0:DetailType>
    <ns0:AccountBasedExpenseLineDetail>
      <ns0:ClassRef name="Coffee and tea">QB:8</ns0:ClassRef>
      <ns0:AccountRef name="Computer and Internet Expenses">QB:10</ns0:AccountRef>
      <ns0:BillableStatus>NotBillable</ns0:BillableStatus>
      <ns0:TaxCodeRef>NON</ns0:TaxCodeRef>
    </ns0:AccountBasedExpenseLineDetail>
  </ns0:Line>
  <ns0:Line>
    <ns0:Description>E2</ns0:Description>
    <ns0:Amount>15.00</ns0:Amount>
    <ns0:DetailType>AccountBasedExpenseLineDetail</ns0:DetailType>
    <ns0:AccountBasedExpenseLineDetail>
      <ns0:CustomerRef name="Arnold Schwarzenegger">QB:3</ns0:CustomerRef>
      <ns0:ClassRef name="Alcoholic beverages">QB:2</ns0:ClassRef>
      <ns0:AccountRef name="Computer and Internet Expenses">QB:10</ns0:AccountRef>
      <ns0:BillableStatus>NotBillable</ns0:BillableStatus>
      <ns0:TaxCodeRef>NON</ns0:TaxCodeRef>
    </ns0:AccountBasedExpenseLineDetail>
  </ns0:Line>
  <ns0:AccountRef name="My Bank Account">QB:30</ns0:AccountRef>
  <ns0:PaymentType>Check</ns0:PaymentType>
  <ns0:EntityRef name="Herry Pilor">QB:9</ns0:EntityRef>
  <ns0:TotalAmt>25.00</ns0:TotalAmt>
</ns0:Purchase>

Since both lines have been marked BillableStatus=NotBillable, however, the first line comes without CustomerRef.

Submit that content should get this response message:

http://schema.intuit.com/finance/v3" time="2014-02-21T09:04:42.972Z">Operation failed with errors:
Operation not supported: Expense with BillableStatus should have CustomerRef for AccountBasedExpenseLineDetail Line in Purchase </Message></Error></Fault></IntuitResponse>

So the question is that why it requires Customer when BillableStatus=NotBillable?

But in the previous Java API version, there was no Customer expected when NotBillable

Please advice. Thanks


回答1:


BillableStatus must be excluded from the request if CustomerRef is not specified. This is a known issue.



来源:https://stackoverflow.com/questions/21985486/operation-not-supported-expense-with-billablestatus-should-have-customerref-for

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!