QBXML 按需创建发票行添加项目
QBXML create InvoiceLineAdd items on-demand
是否可以在不解析 QBXMLMsgsRs
return 值的情况下创建包含一次性项目的发票或按需生成缺失的项目?
我正在尝试通过 QuickBooks Web 连接器将发票传输到 QuickBooks,但我无法确保这些项目已经存在。我知道 QuickBooks 本身可以按需创建项目。
我会收到以下 return 消息:
QBXMLMsgsRs:
There is an invalid reference to QuickBooks Item "1000000000" in the
Invoice line. QuickBooks error message: Invalid argument. The
specified record does not exist in the list.
作为回退,我会解析 return 值,创建项目并再次提交发票,但我正在寻找现有的实施。我已经检查了 Onscreen Reference (InvoiceAdd),没有任何有用的信息。
这是我的例子 QBXML
:
<?xml version="1.0" encoding="us-ascii"?>
<?qbxml version="13.0"?>
<QBXML>
<QBXMLMsgsRq onError="stopOnError">
<InvoiceAddRq requestID="bd4a0a4d-81ea-4f95-ae09-150f15a12423">
<InvoiceAdd>
<CustomerRef>
<ListID>80000004-1434444973</ListID>
<FullName>University of North Carolina</FullName>
</CustomerRef>
<TxnDate>1999-01-21</TxnDate>
<RefNumber>9668</RefNumber>
<BillAddress>
<Addr1>University of North Carolina</Addr1>
<Addr2>University City Blvd</Addr2>
<Addr3 />
<City>Charlotte</City>
<State>NC</State>
<PostalCode>9201</PostalCode>
<Country>United States</Country>
</BillAddress>
<InvoiceLineAdd>
<ItemRef>
<FullName>1000000000</FullName>
</ItemRef>
<Desc>Item 1 Description Goes Here</Desc>
<Quantity>1</Quantity>
<Rate>295</Rate>
</InvoiceLineAdd>
<InvoiceLineAdd>
<ItemRef>
<FullName>1000000001</FullName>
</ItemRef>
<Desc>Item 2 Description Goes Here</Desc>
<Quantity>5</Quantity>
<Rate>25</Rate>
</InvoiceLineAdd>
</InvoiceAdd>
</InvoiceAddRq>
</QBXMLMsgsRq>
</QBXML>
Is it possible to create an invoice with one-off items or to generate the missing items on-demand,
没有
I cannot ensure that the items already exist.
为什么不呢?其他人都这样做...
I knew that QuickBooks itself is able to create items on-demand.
这是不正确的,QuickBooks 无法按需创建项目。如果该项目不存在并且您尝试将其键入列表中,则 GUI 会提示您手动创建它。
As fallback, I would parse the return value, create the item and submit the invoice again, but I am looking for an existing implementation.
另一种选择是对您的请求进行批处理,并且总是尝试创建项目以确保它们存在。
例如:
<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="7.0"?>
<QBXML>
<QBXMLMsgsRq onError="continueOnError">
<ItemNonInventoryAdd>
... your item data here ...
</ItemNonInventoryAdd>
<InvoiceAdd>
... your invoice data here ...
</InvoiceAdd>
</QBXMLMsgsRq>
</QBXML>
更多示例:
- http://wiki.consolibyte.com/wiki/doku.php/quickbooks_qbxml_questions#how_can_i_send_more_than_one_request_at_once
- http://wiki.consolibyte.com/wiki/doku.php
通过这样做,如果项目尚不存在,将在发票之前创建该项目。如果该项目确实存在,QuickBooks 将跳过该部分请求并继续下一个。
是否可以在不解析 QBXMLMsgsRs
return 值的情况下创建包含一次性项目的发票或按需生成缺失的项目?
我正在尝试通过 QuickBooks Web 连接器将发票传输到 QuickBooks,但我无法确保这些项目已经存在。我知道 QuickBooks 本身可以按需创建项目。
我会收到以下 return 消息:
QBXMLMsgsRs:
There is an invalid reference to QuickBooks Item "1000000000" in the Invoice line. QuickBooks error message: Invalid argument. The specified record does not exist in the list.
作为回退,我会解析 return 值,创建项目并再次提交发票,但我正在寻找现有的实施。我已经检查了 Onscreen Reference (InvoiceAdd),没有任何有用的信息。
这是我的例子 QBXML
:
<?xml version="1.0" encoding="us-ascii"?>
<?qbxml version="13.0"?>
<QBXML>
<QBXMLMsgsRq onError="stopOnError">
<InvoiceAddRq requestID="bd4a0a4d-81ea-4f95-ae09-150f15a12423">
<InvoiceAdd>
<CustomerRef>
<ListID>80000004-1434444973</ListID>
<FullName>University of North Carolina</FullName>
</CustomerRef>
<TxnDate>1999-01-21</TxnDate>
<RefNumber>9668</RefNumber>
<BillAddress>
<Addr1>University of North Carolina</Addr1>
<Addr2>University City Blvd</Addr2>
<Addr3 />
<City>Charlotte</City>
<State>NC</State>
<PostalCode>9201</PostalCode>
<Country>United States</Country>
</BillAddress>
<InvoiceLineAdd>
<ItemRef>
<FullName>1000000000</FullName>
</ItemRef>
<Desc>Item 1 Description Goes Here</Desc>
<Quantity>1</Quantity>
<Rate>295</Rate>
</InvoiceLineAdd>
<InvoiceLineAdd>
<ItemRef>
<FullName>1000000001</FullName>
</ItemRef>
<Desc>Item 2 Description Goes Here</Desc>
<Quantity>5</Quantity>
<Rate>25</Rate>
</InvoiceLineAdd>
</InvoiceAdd>
</InvoiceAddRq>
</QBXMLMsgsRq>
</QBXML>
Is it possible to create an invoice with one-off items or to generate the missing items on-demand,
没有
I cannot ensure that the items already exist.
为什么不呢?其他人都这样做...
I knew that QuickBooks itself is able to create items on-demand.
这是不正确的,QuickBooks 无法按需创建项目。如果该项目不存在并且您尝试将其键入列表中,则 GUI 会提示您手动创建它。
As fallback, I would parse the return value, create the item and submit the invoice again, but I am looking for an existing implementation.
另一种选择是对您的请求进行批处理,并且总是尝试创建项目以确保它们存在。
例如:
<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="7.0"?>
<QBXML>
<QBXMLMsgsRq onError="continueOnError">
<ItemNonInventoryAdd>
... your item data here ...
</ItemNonInventoryAdd>
<InvoiceAdd>
... your invoice data here ...
</InvoiceAdd>
</QBXMLMsgsRq>
</QBXML>
更多示例:
- http://wiki.consolibyte.com/wiki/doku.php/quickbooks_qbxml_questions#how_can_i_send_more_than_one_request_at_once
- http://wiki.consolibyte.com/wiki/doku.php
通过这样做,如果项目尚不存在,将在发票之前创建该项目。如果该项目确实存在,QuickBooks 将跳过该部分请求并继续下一个。