Quickbooks WebConnector如何添加带有项目位置/站点的发票

问题描述:

我正在尝试在具有Lineitem站点/位置的QuickBooks桌面中创建发票. 有没有一种方法可以将带有订单项的项目的位置与发票一起发送.

I am trying to Create Invoice in QuickBooks desktop with lineitem site/location. Is there a way we can send location of an item with lineitems along with Invoice.

我尝试了一些代码,但没有工作Web连接器报告错误 0x80040400:QuickBooks在解析提供的XML文本流时发现错误.

I tried some code but didn't work Web Connector report error 0x80040400: QuickBooks found an error when parsing the provided XML text stream.

我尝试了全部4个

<Site>location name</Site>

<Site>
    <FullName>location name</FullName>
</Site>

<Location>location name</Location>

<Location>
    <FullName>location name</FullName>
</Location>

但没有成功,它会给出解析错误, 请您能帮忙吗?

but no success it gives parsing error, Please can you help?

<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="7.0"?>
<QBXML>
    <QBXMLMsgsRq onError="continueOnError">
    <InvoiceAddRq requestID="' . $requestID . '">
        <InvoiceAdd>
        <CustomerRef>
            <ListID>' . $invoice['customer_id'] . '</ListID>
        </CustomerRef>
        <RefNumber>' . $invoice['ref_number'] . '</RefNumber>
        <BillAddress>
            <Addr1>' . $invoice['bill_addr1'] . '</Addr1>
            <Addr2>' . $invoice['bill_addr2'] . '</Addr2>
            <Addr3>' . $invoice['bill_addr3'] . '</Addr3>
            <Addr4>' . $invoice['bill_city'] . '</Addr4>
            <State>' . $invoice['bill_state'] . '</State>
            <PostalCode>' . $invoice['bill_postalcode'] . '</PostalCode>
        </BillAddress>
        <ShipAddress>
            <Addr1>' . $invoice['ship_addr1'] . '</Addr1>
            <Addr2>' . $invoice['ship_addr2'] . '</Addr2>
            <Addr3>' . $invoice['ship_addr3'] . '</Addr3>
            <Addr4>' . $invoice['ship_city'] . '</Addr4>
            <State>' . $invoice['ship_state'] . '</State>
            <PostalCode>' . $invoice['ship_postalcode'] . '</PostalCode>
        </ShipAddress>
        <PONumber>' . $invoice['po_number'] . '</PONumber>
        <DueDate>' . $invoice['due_date'] . '</DueDate>
        <ShipDate>' . $invoice['ship_date'] . '</ShipDate>
        <Memo>' . $invoice['memo'] . '</Memo>
        <InvoiceLineAdd>
            <ItemRef>
            <FullName>'.$line['item_name'].'</FullName>
            </ItemRef>
            <Quantity>'.$line['quantity'].'</Quantity>
            <Rate>'.$line['rate'].'</Rate>
                        <Amount>'.$line['amount'].'</Amount>
                        <Location>Floresville</Location>
            </InvoiceLineAdd>
    </InvoiceAdd>
</InvoiceAddRq>
</QBXMLMsgsRq>

`

我只需要知道如何为发票行项目中的项目添加位置/库存

I just need to know how we can add a location/stock for an item in Invoice lineitems

每当您对Windows版QuickBooks桌面有语法疑问时,都应参考QuickBooks OSR:

Whenever you have syntax questions about QuickBooks desktop for Windows, you should refer to the QuickBooks OSR:

Select Message下拉列表中选择InvoiceAdd,您将看到有关所有XML标记的文档.

Choose InvoiceAdd from the Select Message dropdown, and you'll see documentation about all of the XML tags.

您要寻找的是这个:

<InvoiceLineAdd>
    <ItemRef>
        <FullName>'.$line['item_name'].'</FullName>
    </ItemRef>
    <Quantity>'.$line['quantity'].'</Quantity>
    <Rate>'.$line['rate'].'</Rate>
    <Amount>'.$line['amount'].'</Amount>

    <InventorySiteRef>
        <ListID >IDTYPE</ListID>
        <FullName >STRTYPE</FullName>
    </InventorySiteRef>
    <InventorySiteLocationRef>
        <ListID >IDTYPE</ListID>
        <FullName >STRTYPE</FullName>
    </InventorySiteLocationRef>

</InvoiceLineAdd>

您应该为这两个节点中的每个节点指定 EITHER 一个ListIDFullName.

You should specify EITHER a ListID or a FullName for each of those two nodes.

此外,您应该在*上搜索以下消息:

Also, you should do a search on * for this message:

  • 0x80040400:QuickBooks在解析提供的XML文本流时发现错误.

如果这样做,您会得到一些有用的结果,例如下面的链接,它告诉您如何解决类似问题.例如:

If you do, you get some helpful results like the one linked below, which tell you how to troubleshoot things like that. For example: