QuickBooks 发票修改与创建的地址行为不同,如何补偿?
我正在编写一个函数来获取定义格式的发票文件并通过 qbXML 将其导入 QuickBooks。 要求之一是可以重新导入相同的发票编号,而不是修改现有发票,而不是创建具有相同编号的新发票。
我遇到的问题是 QuickBooks 如何处理地址。 我获得的地址可以是任何格式(6 种不同的内容),但不能保证遵守该区域设置的正确地址格式。
因此,创建发票非常简单,我在 xml 标记中指定帐单地址 addr1 到 addr5,QuickBooks 接受它没有问题。 但是它不会将地址存储为原始文本,而是尝试解析城市、州邮政编码和国家/地区。
发票修改,给定相同的地址信息,不会解析出城市州和邮政编码,而是保留地址行完整,并且保持城市州和邮政编码不变,在发票上创建重复行,自由格式文本之一,另一种是城市、州和邮政编码的组合。 解决方法是在发票修改时明确设置城市、州、邮政编码国家和备注为空白。 然而,这并没有完全解决问题。
有时,QuickBooks 会正确解析地址并在下一行添加随机数(内部表示在注释选项卡上)。
有时,QuickBooks 会拒绝该地址,即使它在创建时接受了该地址。 我假设因为它正在尝试解析 5 行地址并进行修改,因为城市州和邮政编码无处可去,所以它没有地方存储它们。
现在我唯一的解决方案是简单地保持地址不变,并告诉用户由于 QuickBooks 的限制,无法在重新导入发票时修改地址,只能修改发票行。
有人以前遇到过这个问题吗?如果是的话,你有更好的解决办法吗? 您是否知道有一个地址解析器可以合理地近似 Quickbooks 的功能,以便我可以在创建时以一致的方式向其发送城市州和邮政编码?
现在,在某种程度上(除了最后一个)QuickBooks 给了我一个响应,告诉我它在创建时解析了什么,所以理论上我可以存储它以了解我正在处理什么,但缺少编写一些耗时的地址解析例程是否有任何解决方案可以让 Quickbooks 重新解析新的地址。
这是请求和响应。 请注意,发票创建是相同的,并且我删除了一些标识信息,但保持字段长度相同。
请求:
<?xml version="1.0" encoding="UTF-8"?> <?qbxml version="7.0"?>
<QBXML>
<QBXMLMsgsRq newMessageSetID="243f42acf4011139b7a" onError="stopOnError">
<InvoiceModRq>
<InvoiceMod>
<TxnID>4E64-1242411202</TxnID>
<EditSequence>1242411202</EditSequence>
<CustomerRef>
<ListID>80000012-1242156814</ListID>
</CustomerRef>
<ARAccountRef>
<FullName>Accounts Receivable</FullName>
</ARAccountRef>
<TxnDate>2009-04-01</TxnDate>
<RefNumber>M-053491</RefNumber>
<BillAddress>
<Addr1>S & S ACME CO., INC.</Addr1>
<Addr2>MR. ABC ABCDEF</Addr2>
<Addr3>981 ABCD 761 ST</Addr3>
<Addr4>ABABC, AA 99999-3584</Addr4>
<Addr5>USA</Addr5>
<City/>
<State/>
<PostalCode/>
<Country/>
<Note/>
</BillAddress>
<TermsRef>
<FullName>NET 30</FullName>
</TermsRef>
<DueDate>2009-05-01</DueDate>
<InvoiceLineMod>
<TxnLineID>-1</TxnLineID>
<Desc/>
</InvoiceLineMod>
<InvoiceLineMod>
<TxnLineID>-1</TxnLineID>
<Desc>ABCDEFG ABC $3,000.00 *</Desc>
</InvoiceLineMod>
<InvoiceLineMod>
<TxnLineID>-1</TxnLineID>
<Desc/>
</InvoiceLineMod>
<InvoiceLineMod>
<TxnLineID>-1</TxnLineID>
<Desc>FOR:</Desc>
</InvoiceLineMod>
<InvoiceLineMod>
<TxnLineID>-1</TxnLineID>
<ItemRef>
<FullName>ANFEE</FullName>
</ItemRef>
<Desc>1 . #9999 S & S ABCD CO., INC., ABCDE, AA *</Desc>
<Amount>123456.72</Amount>
</InvoiceLineMod>
<InvoiceLineMod>
<TxnLineID>-1</TxnLineID>
<Desc/>
</InvoiceLineMod>
<InvoiceLineMod>
<TxnLineID>-1</TxnLineID>
<Desc>PLEASE NOTE: Blahh Someone sellificant repeats on July 31st, 2009.</Desc>
</InvoiceLineMod>
<InvoiceLineMod>
<TxnLineID>-1</TxnLineID>
<Desc>Sellifcan of your Someone Ssellificant to Jan. 31st, 2011 is contingent upon</Desc>
</InvoiceLineMod>
<InvoiceLineMod>
<TxnLineID>-1</TxnLineID>
<Desc>your satisfying all open invoices and all other/different issues.</Desc>
</InvoiceLineMod>
<InvoiceLineMod>
<TxnLineID>-1</TxnLineID>
<Desc/>
</InvoiceLineMod>
<InvoiceLineMod>
<TxnLineID>-1</TxnLineID>
<Desc/>
</InvoiceLineMod>
<InvoiceLineMod>
<TxnLineID>-1</TxnLineID>
<Desc>* PLUS expenses for some amount of service described here.</Desc>
</InvoiceLineMod>
</InvoiceMod>
</InvoiceModRq>
</QBXMLMsgsRq>
</QBXML>
响应:
<?xml version="1.0" ?> <QBXML>
<QBXMLMsgsRs newMessageSetID="243f42acf4011139b7a">
<InvoiceModRs statusCode="3210" statusSeverity="Error"
statusMessage="The "address" field has an invalid value "". QuickBooks error message: The parameter is incorrect. "/>
</QBXMLMsgsRs>
</QBXML>
I'm writting a function to take an invoice file in a defined format and import it into QuickBooks via qbXML. One of the requrements is that it be possible to reimport the same invoice number than that the existing invoice be modified rather than create a new one with the same number.
The problem I have is with how QuickBooks handles addresses. The addresses I'm getting can be in any format (In 6 different contenents), without any guarantee of adherence to a proper address format for that locale.
So creating the invoice is simple enough, I specify in the xml tag the billing address addr1 through addr5, and QuickBooks takes it no problem. HOWEVER it doesn't store the address as raw text, it attempts to parse out the city, state postal code and country.
Invoice modify, given the same address information, will not parse out the city state and zip, but rather leave the address line intact, and leave the city state and zip untouched, creating a duplicate line on the invoice, one of free form text, the other of the composite of city, state and postal code. The workaround for that was to explicity set city state zip country and note to blank on invoice modify. However, that hasn't fully solved the problem.
Sometimes QuickBooks will correctly parse the address and add a random number on the next line (internally represented on the note tab).
And sometimes QuickBooks will reject the address, even thought it accepted it on create. I assume because it is trying to parse a 5 line address and on modify since the city state and postal code have no where to go, it has no place to store them.
Right now my only solution is to simply leave the address untouched, and tell the user that due to QuickBooks limitations there is no way to modify the address on reimport of the invoice, only invoice lines.
Has anyone run into this before, and if so, do you have a better work around? Do you know of an address parser that can reasonably approximate what quickbooks does so I can send it city state and postal code on create in a consistent manner?
Now, to some degree (except for that last one) QuickBooks is giving me a response that tells me what it parsed on create, so I could theoretically store that to know what I am dealing with, but short of writing some time consuming address parsing routines is there any solution to get quickbooks to re parse the address from new.
Here is the request and the response. Note that the invoice create was identical, and that I removed some identifying information, but kept the field lengths the same.
Request:
<?xml version="1.0" encoding="UTF-8"?> <?qbxml version="7.0"?>
<QBXML>
<QBXMLMsgsRq newMessageSetID="243f42acf4011139b7a" onError="stopOnError">
<InvoiceModRq>
<InvoiceMod>
<TxnID>4E64-1242411202</TxnID>
<EditSequence>1242411202</EditSequence>
<CustomerRef>
<ListID>80000012-1242156814</ListID>
</CustomerRef>
<ARAccountRef>
<FullName>Accounts Receivable</FullName>
</ARAccountRef>
<TxnDate>2009-04-01</TxnDate>
<RefNumber>M-053491</RefNumber>
<BillAddress>
<Addr1>S & S ACME CO., INC.</Addr1>
<Addr2>MR. ABC ABCDEF</Addr2>
<Addr3>981 ABCD 761 ST</Addr3>
<Addr4>ABABC, AA 99999-3584</Addr4>
<Addr5>USA</Addr5>
<City/>
<State/>
<PostalCode/>
<Country/>
<Note/>
</BillAddress>
<TermsRef>
<FullName>NET 30</FullName>
</TermsRef>
<DueDate>2009-05-01</DueDate>
<InvoiceLineMod>
<TxnLineID>-1</TxnLineID>
<Desc/>
</InvoiceLineMod>
<InvoiceLineMod>
<TxnLineID>-1</TxnLineID>
<Desc>ABCDEFG ABC $3,000.00 *</Desc>
</InvoiceLineMod>
<InvoiceLineMod>
<TxnLineID>-1</TxnLineID>
<Desc/>
</InvoiceLineMod>
<InvoiceLineMod>
<TxnLineID>-1</TxnLineID>
<Desc>FOR:</Desc>
</InvoiceLineMod>
<InvoiceLineMod>
<TxnLineID>-1</TxnLineID>
<ItemRef>
<FullName>ANFEE</FullName>
</ItemRef>
<Desc>1 . #9999 S & S ABCD CO., INC., ABCDE, AA *</Desc>
<Amount>123456.72</Amount>
</InvoiceLineMod>
<InvoiceLineMod>
<TxnLineID>-1</TxnLineID>
<Desc/>
</InvoiceLineMod>
<InvoiceLineMod>
<TxnLineID>-1</TxnLineID>
<Desc>PLEASE NOTE: Blahh Someone sellificant repeats on July 31st, 2009.</Desc>
</InvoiceLineMod>
<InvoiceLineMod>
<TxnLineID>-1</TxnLineID>
<Desc>Sellifcan of your Someone Ssellificant to Jan. 31st, 2011 is contingent upon</Desc>
</InvoiceLineMod>
<InvoiceLineMod>
<TxnLineID>-1</TxnLineID>
<Desc>your satisfying all open invoices and all other/different issues.</Desc>
</InvoiceLineMod>
<InvoiceLineMod>
<TxnLineID>-1</TxnLineID>
<Desc/>
</InvoiceLineMod>
<InvoiceLineMod>
<TxnLineID>-1</TxnLineID>
<Desc/>
</InvoiceLineMod>
<InvoiceLineMod>
<TxnLineID>-1</TxnLineID>
<Desc>* PLUS expenses for some amount of service described here.</Desc>
</InvoiceLineMod>
</InvoiceMod>
</InvoiceModRq>
</QBXMLMsgsRq>
</QBXML>
Response:
<?xml version="1.0" ?> <QBXML>
<QBXMLMsgsRs newMessageSetID="243f42acf4011139b7a">
<InvoiceModRs statusCode="3210" statusSeverity="Error"
statusMessage="The "address" field has an invalid value "". QuickBooks error message: The parameter is incorrect. "/>
</QBXMLMsgsRs>
</QBXML>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
另一个潜在的解决方法是双重更新发票。 首先把地址删掉。 其次是发送五行,而不提及城市、州邮政编码等,就像创建时所做的那样。
我没有测试这个(用户接受地址不会改变,所以我不会尝试它),但我把它放在这里作为一个想法,所以如果有人有类似的问题,他们可以尝试一下如果可行的话也许可以在这里发表评论。
Another potential workaround here is to double-update the invoice. First blank out the address. Second is send the five lines without any mention of the city state zip, etc., as was done on create.
I didn't test this (the users accepted that the address won't change, so I'm not going to try it), but I'm putting this here as an idea so if someone has a similar problem they can try it and perhaps comment here if it works.