1

我正在尝试使用以下 XML 创建采购订单

    <?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 而不是 tax,但出现错误

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

“非资本商品及服务税”在澳大利亚版本中是自动创建的税款。但我也尝试过手动创建税收。

4

1 回答 1

0

您是否在此处检查了 IPP 提供的 xml - https://developer.intuit.com/docs/0025_quickbooksapi/0050_data_services/v3/030_entity_services_reference/purchaseorder

它既有请求又有响应。

您能否包含 TxnTaxDetail 行而不是为每个项目添加。我将不得不与工程团队核实是否支持。

于 2013-10-22T06:21:01.523 回答