2013-10-21 51 views
1

我试图创建一个具有以下XMLQBO-V3-创建采购订单与项目和税收

<?xml version="1.0"?> 
    <PurchaseOrder xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schema.intuit.com/finance/v3"> 
     <DocNumber>4</DocNumber> 
     <TxnDate>2013-10-22T06:45:16.327227</TxnDate> 
     <Line> 
     <Id>3</Id> 
     <Description>test</Description> 
     <Amount>15.4</Amount> 
     <DetailType>ItemBasedExpenseLineDetail</DetailType> 
     <ItemBasedExpenseLineDetail> 
      <ItemRef name="Ext Prod 2">4</ItemRef> 
      <UnitPrice>7</UnitPrice> 
      <Qty>2</Qty> 
      <TaxCodeRef type="TaxCode" name="GST on non-capital">2</TaxCodeRef> 
     </ItemBasedExpenseLineDetail> 
     </Line> 
     <VendorRef name="Ext Sup 1">9</VendorRef> 
    </PurchaseOrder> 

采购订单,但我收到以下错误

<IntuitResponse xmlns="http://schema.intuit.com/finance/v3" time="2013-10-21T14:17:31.468-07:00"> 
     <Fault type="ValidationFault"> 
      <Error code="6000" element=""> 
       <Message>A business validation error has occurred while processing your request</Message> 
       <Detail>Business Validation Error: We're sorry, QuickBooks encountered an error while calculating tax. Try reselecting the tax rate or reentering the product/service item and saving the form again. &lt;a href='https://support.qbo.intuit.com/support/help-article.cfm?faq_id=5558&amp;locale=en_AU' target="_blank" title="Help"&gt;Please click here for more information&lt;/a&gt;</Detail> 
      </Error> 
     </Fault> 
    </IntuitResponse> 

有人可以帮助我在这。创建发票非常相似的XML工作正常。

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
    <Invoice xmlns="http://schema.intuit.com/finance/v3"> 
     <DocNumber>b2980</DocNumber> 
     <TxnDate>2013-09-05</TxnDate> 
     <Line> 
      <Id>3</Id> 
      <Description>test</Description> 
      <Amount>10000</Amount> 
      <DetailType>SalesItemLineDetail</DetailType> 
      <SalesItemLineDetail> 
       <ItemRef name="Ext Prod 2">4</ItemRef> 
       <UnitPrice>7</UnitPrice> 
       <Qty>2</Qty> 
       <TaxCodeRef name="Input tax">6</TaxCodeRef> 
      </SalesItemLineDetail> 
     </Line> 
     <CustomerRef name="TestDataCustomer620d5Sample1">1</CustomerRef> 
    </Invoice> 

一个有效的XML示例创建采购订单的项目,数量和税收将不胜感激。

更新2

试图指定的,而不是在该行税收TxnTaxDetail,但得到了错误

<IntuitResponse xmlns="http://schema.intuit.com/finance/v3" time="2013-10-22T00:14:45.815-07:00"> 
     <Fault type="ValidationFault"> 
     <Error code="6000" element=""> 
      <Message>A business validation error has occurred while processing your request</Message> 
      <Detail>Business Validation Error: One or more charge lines do not have a tax code associated with it. Please assign a tax code for those lines.</Detail> 
     </Error> 
     </Fault> 
    </IntuitResponse> 

为了完整,这是我测试

<?xml version="1.0"?> 
<PurchaseOrder xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schema.intuit.com/finance/v3"> 
    <DocNumber>5</DocNumber> 
    <TxnDate>2013-10-22T12:33:01.117104</TxnDate> 
    <PrivateNote /> 
    <Line> 
    <Amount>15</Amount> 
    <DetailType>ItemBasedExpenseLineDetail</DetailType> 
    <ItemBasedExpenseLineDetail> 
     <ItemRef name="Ext Prod 2">4</ItemRef> 
     <UnitPrice>5</UnitPrice> 
     <Qty>3</Qty> 
    </ItemBasedExpenseLineDetail> 
    </Line> 
    <VendorRef name="Ext Sup 1">9</VendorRef> 
    <TotalAmt>15</TotalAmt> 
    <GlobalTaxCalculation>TaxExcluded</GlobalTaxCalculation> 
    <SalesTermRef>4</SalesTermRef> 
    <DueDate>2013-12-21T12:33:01.117104</DueDate> 
    <TxnTaxDetail> 
    <DefaultTaxCodeRef name="GST on non-capital">2</DefaultTaxCodeRef> 
    <TotalTax>0</TotalTax> 
    </TxnTaxDetail> 
</PurchaseOrder> 

“消费税的要求非资本“在澳大利亚版本中自动创建税款。但我也尝试使用手动创建税收。

回答