操作不受支持:BillableStatus的费用应该有CustomerRef用于AccountBasedExpenseLineDetail Line in Purchase

时间:2014-02-24 10:45:19

标签: java php quickbooks quickbooks-online intuit

我尝试使用PHP SDK向以下XML请求内容提交Purchase as Check to QBD:

<?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>

因为两行都标记为BillableStatus = NotBillable,所以第一行没有CustomerRef。

提交内容应该收到此回复消息:

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>

所以问题是,当BillableStatus = NotBillable时,为什么它需要客户?

但是在之前的Java API版本中,NotBillable

时没有客户期望

请指教。 感谢

1 个答案:

答案 0 :(得分:0)

如果未指定CustomerRef,则必须从请求中排除BillableStatus。这是一个众所周知的问题。