插入 QuickBooks 发票行时出错

发布于 2024-12-27 20:20:34 字数 1109 浏览 0 评论 0 原文

我正在编写代码,使用 QODBC 驱动程序将自定义应用程序中创建的发票导入到 QuickBooks 中。我的事情几乎可以正常工作,但是我遇到了添加实际发票记录的 INSERT 问题。我的整体代码基于 http://support.flexquarters.com/esupport/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=10726&nav=0,58,64

在这种特殊情况下,InvoiceLine 表中的插入操作正常,但发票中的插入操作失败并出现以下错误:

[QODBC] 错误:3140 - 发票行中存在对 QuickBooks 项目“”的无效引用。

以下是我在本例中发送的 INSERT 命令:

INSERT INTO Invoice (CustomerRefListID, ARAccountRefFullName, TxnDate, RefNumber, TermsRefFullName, TemplateRefFullName, SalesRepRefListID, ClassRefListID)
  VALUES ('80000855-1326914216', 'Receivables', {d '2012-01-17'}, '12-1005', '30 days', 'Customized Invoice', '30000-1034349330', '8F70000-912629594')

CustomerRefListID、SalesRepListID 和 ClassRefListID 的值都是通过查找相应的表来确定的。我还确认“条款”表中出现“30 天”。

生成此命令的代码的早期版本几天前正在使用不同的数据。它使用 SalesRepRefFullName 和 ClassRefFullName。由于本例失败,我修改了它,认为也许我可用的字符串并不总是与全名完全匹配。

欢迎任何建议。

添马舰

I'm working on code to import invoices created in a custom application into QuickBooks using the QODBC driver. I have things nearly working, but I'm running into a problem with the INSERT that adds the actual invoice record. My overall code is based on the model laid out at http://support.flexquarters.com/esupport/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=10726&nav=0,58,64.

In this particular case, the INSERTs into the InvoiceLine table are working, but the INSERT into Invoice fails with this error:

[QODBC] Error: 3140 - There is an invalid reference to QuickBooks Item "" in the Invoice line.

Here's the INSERT command that I'm sending in this case:

INSERT INTO Invoice (CustomerRefListID, ARAccountRefFullName, TxnDate, RefNumber, TermsRefFullName, TemplateRefFullName, SalesRepRefListID, ClassRefListID)
  VALUES ('80000855-1326914216', 'Receivables', {d '2012-01-17'}, '12-1005', '30 days', 'Customized Invoice', '30000-1034349330', '8F70000-912629594')

The values for CustomerRefListID, SalesRepListID, and ClassRefListID are all determined by doing look-ups into the respective tables. I've also confirmed that '30 days' occurs in the Terms table.

An earlier version of the code that generates this command was working a few days ago with different data. It used SalesRepRefFullName and ClassRefFullName. I modified it because of the failure of this case, thinking that perhaps the strings I had available didn't always exactly match the fullnames.

Any suggestions welcomed.

Tamar

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

望她远 2025-01-03 20:20:34

解决了。事实证明,引用的项目位于其中一个行项目中,而不是发票本身。我没有注意到其中一个订单项中的 RefID 为空。

绝对不是有用的错误消息。

Solved it. It turned out that the Item referenced was in one of the line items, not the invoice itself. I'd missed noticing that a RefID in one of the line items was empty.

Definitely not a useful error message.

绝影如岚 2025-01-03 20:20:34

Quickbooks 中不存在项目。首先在 Quickbooks 中创建它,然后您才能在发票中引用它。

Item does not exist in Quickbooks . first create it in Quickbooks and only then you can reference it in invoice .

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文