简体   繁体   English

QuickBooks API发票 <DueDate> 标签

[英]QuickBooks API Invoice <DueDate> tag

I wrote a custom integration between a SQL Server based system and QuickBooks many years ago which automatically creates invoices in QuickBooks from data in SQL Server. 多年前,我在基于SQL Server的系统和QuickBooks之间编写了自定义集成,该集成可以根据SQL Server中的数据自动在QuickBooks中创建发票。 The XML string to create the invoices is quite simple: 用于创建发票的XML字符串非常简单:

<QBXML>
    <QBXMLMsgsRq newMessageSetID="10025027" onError="continueOnError">
        <InvoiceAddRq requestID="10025027">
            <InvoiceAdd>
                <CustomerRef>
                    <FullName>Acme Corporation, Inc.</FullName>
                </CustomerRef>
                <TxnDate>2014-02-05</TxnDate>
                <RefNumber>124</RefNumber>
                <ShipAddress>
                    <Addr1>16-01 16th Avenue, Dock 3</Addr1>
                    <Addr2/>
                    <Addr3/>
                    <Addr4/>
                    <City>Astoria</City>
                    <State>NY</State>
                    <PostalCode>11105</PostalCode>
                </ShipAddress>
                <PONumber> 6028019</PONumber>
                <SalesRepRef>
                    <FullName>H</FullName>
                </SalesRepRef>
                <Memo>1401106</Memo>
                <InvoiceLineAdd>
                    <ItemRef>
                        <FullName>SALES</FullName>
                    </ItemRef>
                    <Desc> Semi Annual Sampling - M1; Day 1</Desc>
                    <Rate>5580</Rate>
                </InvoiceLineAdd>
            </InvoiceAdd>
        </InvoiceAddRq>
    </QBXMLMsgsRq>
</QBXML>

The SQL Server based system actually prints detailed invoices which are delivered to the customer, QuickBooks is only used to keep track of account balances and payments. 基于SQL Server的系统实际上会打印发送给客户的详细发票,QuickBooks仅用于跟踪帐户余额和付款。 I am now trying to add the DueDate to the invoice by adding the following XML tag: 我现在尝试通过添加以下XML标签将DueDate添加到发票:

<DueDate>2014-03-07</DueDate>

I have tried to place this tag in several places in the XML string but QuickBooks rejects the request with the following error: 我试图将此标记放置在XML字符串的多个位置,但是QuickBooks拒绝请求并出现以下错误:

"QuickBooks found an error when parsing the provided XML text stream." “ QuickBooks在解析提供的XML文本流时发现错误。”

The bookkeeper is able to manually change the due date on the invoices after they are created, but for some reason I can't specify the due date when creating the invoices with the QuickBooks API. 记账员可以在发票创建后手动更改到期日,但是由于某些原因,在使用QuickBooks API创建发票时,我无法指定到期日。 Any Ideas? 有任何想法吗?

Thanks. 谢谢。

A few things to note here: 这里需要注意的几件事:

  1. This is an incomplete qbXML request. 这是一个不完整的qbXML请求。 There should be an XML and qbXML header tag as the very first two lines, and you're missing them. 前两行应该有一个XML和qbXML标头标记,而您却错过了它们。 They should look like this: 它们应如下所示:

    <?xml version="1.0" encoding="utf-8"?>

    <?qbxml version="13.0"?>

  2. That version="..." bit should be set to something your version of QuickBooks supports (generally your QuickBooks version - 1, eg QuickBooks 2012 supports qbXML version 11.0, QuickBooks 2013 supports qbXML version 12.0, QuickBooks 2014 supports qbXML version 13.0, etc.) version="..."位应设置为您的QuickBooks版本支持的内容(通常是您的QuickBooks版本-1,例如QuickBooks 2012支持qbXML版本11.0,QuickBooks 2013支持qbXML版本12.0,QuickBooks 2014支持qbXML版本13.0,等等。 )

  3. Your post doesn't even show the DueDate field in the XML, so it's a little hard to tell what's actually wrong, but... 您的帖子甚至都没有在XML中显示DueDate字段,因此很难分辨出实际的错误,但是...

  4. Keep in mind that the order of tags in qbXML is important. 请记住,qbXML中标签的顺序重要。 So if the OSR shows the DueDate field after PONumber , you better make darn sure to put it after the PONumber field. 因此,如果OSR显示DueDate后场PONumber ,你最好做织补确保把它放在后PONumber字段。 If you put it before it, you're going to get exactly the error you described. 如果将其放在前面,将完全得到您所描述的错误。

  5. Did you use the OSR to find the correct place? 您是否使用OSR查找正确的位置? There shouldn't be any guess-work here - it tells you exactly where to put it. 这里不应该有任何猜测-它会告诉您确切的放置位置。

      ... <State>NY</State> <PostalCode>11105</PostalCode> </ShipAddress> <PONumber> 6028019</PONumber> <DueDate>2014-02-12</DueDate <SalesRepRef> <FullName>H</FullName> </SalesRepRef> <Memo>1401106</Memo> ... 

I think the missing header tags were the problem. 我认为缺少标题标签就是问题所在。 (I also added the <TermsRef> tag) (我还添加了<TermsRef>标签)

Here is the XML that did the trick: 这是达到目的的XML:

<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="11.0"?>
<QBXML>
    <QBXMLMsgsRq newMessageSetID="10025079" onError="continueOnError">
        <InvoiceAddRq requestID="10025079">
        <InvoiceAdd>
            <CustomerRef>
                <FullName>Acme Corporation</FullName>
            </CustomerRef>
            <TxnDate>2014-02-13</TxnDate>
            <RefNumber>168</RefNumber>
            <ShipAddress>
                <Addr1>Acme Corporation</Addr1>
                <Addr2>1587-43 Veteran's Highway</Addr2>
                <Addr3/>
                <Addr4/>
                <City>Islandia</City>
                <State>NY</State>
                <PostalCode>11749</PostalCode>
            </ShipAddress>
            <PONumber>5A873929B</PONumber>
            <TermsRef>
                <FullName>30 Days</FullName>
            </TermsRef>
            <DueDate>2014-03-15</DueDate>
            <SalesRepRef>
                <FullName>H</FullName>
            </SalesRepRef>
            <Memo>1402016</Memo>
            <InvoiceLineAdd>
                <ItemRef>
                    <FullName>SALES</FullName>
                </ItemRef>
                <Desc> OBAR Auto Parts, 279 South Street, Oyster Bay, NY 11771</Desc>
                <Rate>1760</Rate>
            </InvoiceLineAdd>
        </InvoiceAdd>
    </InvoiceAddRq>
</QBXMLMsgsRq>
</QBXML>

Thank you again! 再次感谢你!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM