quickbooks desktop web connector qbxml: add invoice with CLASS field

核能气质少年 提交于 2019-12-11 13:38:25

问题


I'm trying to add an invoice and populate its CLASS field with a value (I can't post a screenshot of the invoice "CLASS" field because I don't have the reputation, its the field just to the right of "PRICE EACH" field), I don't know how to add the CLASS value in the qbxml. Here is the xml I'm using and it works:

$xml = '<?xml version="1.0" encoding="utf-8"?>
            <?qbxml version="2.0"?>
            <QBXML>
              <QBXMLMsgsRq onError="stopOnError">
                <InvoiceAddRq requestID="xxxxxxxx">
                  <InvoiceAdd>
                    <CustomerRef>
                      <FullName>Some company:12 street gotham</FullName>
                    </CustomerRef>
                    <TxnDate>2015-01-23</TxnDate>
                    <RefNumber>TPY125</RefNumber>
                    <BillAddress>
                      <Addr1>some bill address</Addr1>
                      <City>some bill city</City>
                      <State>some bill state</State>
                      <PostalCode>some bill zip</PostalCode>
                      <Country>United States</Country>
                    </BillAddress>
                    <ShipAddress>
                        <Addr1>some ship address</Addr1>
                        <City>some ship address</City>
                        <State>some ship state</State>
                        <PostalCode>some ship zip</PostalCode>
                        <Country>United States</Country>
                    </ShipAddress>
                    <PONumber></PONumber>
                    <TermsRef>
            <FullName>Net 120</FullName>
                    </TermsRef>
                    <Memo></Memo>

                    <InvoiceLineAdd>
                      <ItemRef>
                        <FullName>16 Electrical and Lighting</FullName>
                      </ItemRef>
                      <Desc>Item 1 Description Goes Here</Desc>
                      <Quantity>1</Quantity>
                      <Rate>33.00</Rate>                      
                    </InvoiceLineAdd>

                  </InvoiceAdd>
                </InvoiceAddRq>
              </QBXMLMsgsRq>
            </QBXML>';

I'm using QuickBooks Enterprise, Web connector ver: 2.1.0.30. So what do I have to add in the xml for the "CLASS" field? Thanks in advance.


回答1:


You can always refer to the QuickBooks OSR for XML reference for QuickBooks desktop:

  • https://developer-static.intuit.com/qbSDK-current/Common/newOSR/index.html

In this specific case, you can set the Class on a per line item basis like this:

                ...
                <InvoiceLineAdd>
                  <ItemRef>
                    <FullName>16 Electrical and Lighting</FullName>
                  </ItemRef>
                  <Desc>Item 1 Description Goes Here</Desc>
                  <Quantity>1</Quantity>
                  <Rate>33.00</Rate>   

                  <ClassRef>
                    <ListID> ... specify a ListID here ...</ListID
                     <!-- Or, instead of ListID you can specify: -->
                    <FullName> ... specify Class FullName here ...</FullName>

                </InvoiceLineAdd>
                ...


来源:https://stackoverflow.com/questions/28125103/quickbooks-desktop-web-connector-qbxml-add-invoice-with-class-field

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!