SalesOrderQuery in QuickBooks Desktop does not returning All order information

152 views Asked by At

I am making SalesOrderQuery to fetch Sales Orders created in Quickbooks Desktop.

I have created some sales orders in QB Desktop and process them like picked, packed and shipped. So now i want to do query to get all information of order like status is picked, is packed with all items. i am doing like this:-

<?xml version="1.0" encoding="utf-8"?>
 <?qbxml version="7.0"?>
  <QBXML>
   <QBXMLMsgsRq onError="stopOnError">
       <SalesOrderQueryRq requestID="2">
       <IncludeLineItems>true</IncludeLineItems>
       </SalesOrderQueryRq>
   </QBXMLMsgsRq>
</QBXML>

So now i am getting this response without any current order status and item status like is its picked, packed or shipped.

<?xml version="1.0" ?>
 <QBXML>
<QBXMLMsgsRs>
    <SalesOrderQueryRs requestID="3" statusCode="0">
        <SalesOrderRet>
            <TxnID>2672D-1671085403</TxnID>
            <TimeCreated>2022-12-15T06:23:23+00:00</TimeCreated>
            <TimeModified>2022-12-15T06:23:23+00:00</TimeModified>
            <EditSequence>1671085403</EditSequence>
            <TxnNumber>1778</TxnNumber>
            <CustomerRef>
                <ListID>800000D0-1182061376</ListID>
                <FullName>Allard, Robert</FullName>
            </CustomerRef>
            <TemplateRef>
                <ListID>120000-1071512690</ListID>
                <FullName>Custom Sales Order</FullName>
            </TemplateRef>
            <TxnDate>2022-12-15</TxnDate>
            <RefNumber>7005</RefNumber>
            <BillAddress>
                <Addr1>Robert Allard</Addr1>
                <Addr2>92834 Chandler St.</Addr2>
                <City>Millbrae</City>
                <State>CA</State>
                <PostalCode>94030</PostalCode>
            </BillAddress>
            <BillAddressBlock>
                <Addr1>Robert Allard</Addr1>
                <Addr2>92834 Chandler St.</Addr2>
                <Addr3>Millbrae, CA 94030</Addr3>
            </BillAddressBlock>
            <ShipAddress>
                <Addr1>Robert Allard</Addr1>
                <Addr2>92834 Chandler St.</Addr2>
                <City>Millbrae</City>
                <State>CA</State>
                <PostalCode>94030</PostalCode>
            </ShipAddress>
            <ShipAddressBlock>
                <Addr1>Robert Allard</Addr1>
                <Addr2>92834 Chandler St.</Addr2>
                <Addr3>Millbrae, CA 94030</Addr3>
            </ShipAddressBlock>
            <PONumber>123456</PONumber>
            <DueDate>2022-12-15</DueDate>
            <ShipDate>2022-12-15</ShipDate>
            <Subtotal>192.00</Subtotal>
            <ItemSalesTaxRef>
                <ListID>2E0000-933272656</ListID>
                <FullName>San Tomas</FullName>
            </ItemSalesTaxRef>
            <SalesTaxPercentage>7.75</SalesTaxPercentage>
            <SalesTaxTotal>14.88</SalesTaxTotal>
            <TotalAmount>206.88</TotalAmount>
            <IsManuallyClosed>false</IsManuallyClosed>
            <IsFullyInvoiced>false</IsFullyInvoiced>
            <CustomerMsgRef>
                <ListID>8000000A-1671085397</ListID>
                <FullName>Test Order 2 having Wood Doors in order.</FullName>
            </CustomerMsgRef>
            <IsToBePrinted>true</IsToBePrinted>
            <IsToBeEmailed>false</IsToBeEmailed>
            <CustomerSalesTaxCodeRef>
                <ListID>10000-999022286</ListID>
                <FullName>Tax</FullName>
            </CustomerSalesTaxCodeRef>
             <SalesOrderLineRet>
              <TxnLineID>1D2122-1551440932</TxnLineID>
              <ItemRef>
              <ListID>8000051F-1549043481</ListID>
              <FullName>1022</FullName>
              </ItemRef>
              <Desc>Asher Dark Chocolate Marzipan 6lbs</Desc>
              <Quantity>1</Quantity>
              <Rate>49.86</Rate>
              <Amount>49.86</Amount>
              <InventorySiteRef>
                <ListID>80000001-1552335210</ListID>
                <FullName>717 Fellowship Rd</FullName>
              </InventorySiteRef>
              <InventorySiteLocationRef>
                <ListID>80000009-1552500146</ListID>
                <FullName>717 Fellowship Rd:F19C4</FullName>
              </InventorySiteLocationRef>
              <SalesTaxCodeRef>
                <ListID>80000002-1548687341</ListID>
                <FullName>Non</FullName>
              </SalesTaxCodeRef>
              <Invoiced>0</Invoiced>
              <IsManuallyClosed>false</IsManuallyClosed>
            </SalesOrderLineRet>
        </SalesOrderRet>
    </SalesOrderQueryRs>
</QBXMLMsgsRs>

1

There are 1 answers

0
jjthebig1 On

Quickbooks tracks shipped/invoiced line items via a linking the transaction to an invoice.

If you include the following in the request XML, you will get a list of linked invoices that you can then traverse to sum quantity shipped/invoiced and deduct that from quantity ordered to extrapolate quantity remaining.

<IncludeLinkedTxns>true</IncludeLinkedTxns>