VoucherQuery

Returns the vouchers specified in the filter criteria.


Request

Response

XMLOPS

VB.NET

C#

Tag Type Max length Implementation Required

IVoucherQuery

Returns the vouchers specified in the filter criteria.
       

metaData

This is used in a query to cause a count of query objects to be returned. You can specify that the count of query objects is to be returned with the returned objects, or you can specify that only a count and no data is returned. (The default is that no count is returned.) A common use of this feature is to specify a count with no data in order to determine how many objects to expect from the actual query. If you don’t want a query to return a count, either don’t use this feature, or specify the value NoMetaData. If you want only a count, specify the value MetaDataOnly. If you want data and a count, specify MetaDataAndResponseData. You should be aware that the count returned via this setting is not guaranteed to be exact: it could be off slightly due to new object creation or deletions.
IQBENmetaDataType   4.0|us.png|  

iterator

The iterator attribute provided with most query types also allows you to break down query results in smaller and more manageable chunks of data. An iterator results in responses that contain only the specified number of objects. Iterators are only valid for the application that starts them, and they are only valid for the current QuickBooks session.
IQBENiteratorType   5.0|us.png|  

iteratorID

The iterator query attribute is provided with most query types to allow you to break down query results into smaller and more manageable chunks of data. An iterator results in responses that contain only the specified number of objects. The iterator is created when a query contains the iterator attribute set to Start, along with a MaxReturn value specifying how many records are to be returned in each iteration. The response to that first query iteration contains, along with the response data, an IteratorID value that uniquely identifies that iterator. This is important because you can have many iterators active at the same time. Accordingly, in subsequent iterations of that query, you need to supply that returned iteratorID so the SDK knows where to resume the iteration.
IQBUUIDType   5.0|us.png|  

MaxReturned

This element is used for limiting the number of objects returned in the query to the number specified in MaxReturned. It is required if you use the Iterator attribute to iterate through large or potentially large query returns. When used with the Iterator, MaxReturned specifies the number of records returned in each iteration. It can be modified during the iteration. For details on the Iterator, please refer to the QBPOS SDK Programming Guide. A less optimal, but still possible way to use this element is as follows. You can use this element by itself to chunk up data, by initially using a range filter with the desired starting (From range) and ending range (To range). Then, in subsequent queries, leave the To range alone, but change the From range to coincide with the last object from the previous query.
IQBIntType      

OwnerIDList

The list of Owner IDs in the requests. An ownerID refers to the owner of a data extension:If OwnerID is 0, this is a public data extension. For example, if you intend to use this with a custom field that is supported in the UI, you must use an owner ID of 0.If OwnerID is a GUID, for example {6B063959-81B0-4622-85D6-F548C8CCB517}, this field is a private data extension defined by an integrated application. Note that OwnerID values are not case-sensitive, meaning that if you enter an OwnerID value with lower-case letters, the value will be saved and returned with upper-case letters. When you share a private data extension with another application, the other application must know both the OwnerID and the DataExtName, as these together form a data extension’s unique name.
IGUIDList      

TxnID

QuickBooks generates a unique TxnID for each transaction that is added to QuickBooks. A TxnID returned from a request can be used to refer to the transaction in subsequent requests. Notice that you cannot supply the TxnID of a TimeTracking transaction to TransactionQueryRq requests. If you do, you get an error stating that no such record could be found, even though the transaction is in QuickBooks. This behavior reflects the behavior in the QuicKBooks UI in the Find window.
IQBIDType      

ORTimeCreatedFilters

IORTimeCreatedFilters   1.1  

TimeCreatedFilter

Filters by the object’s time created value.
ITimeCreatedFilter      

MatchNumericCriterion

Specifies how the specified numeric value will filter the target objects, that is, specifies the the comparison that will be used.
IQBENMatchNumericCriterionType     Y

TimeCreated

The timestamp indicating the time when this object was created in QBPOS.
IQBDateTimeType     Y

TimeCreatedRangeFilter

Filters by a range of time created values.
ITimeCreatedRangeFilter      

FromTimeCreated

The beginning of the range.
IQBDateTimeType     Y

ToTimeCreated

The end of the range.
IQBDateTimeType     Y

ORTimeModifiedFilters

IORTimeModifiedFilters      

TimeModifiedFilter

Searches for objects that were modified before, at, or after the specified time.
ITimeModifiedFilter      

MatchNumericCriterion

Specifies how the specified numeric value will filter the target objects, that is, specifies the the comparison that will be used.
IQBENMatchNumericCriterionType     Y

TimeModified

The time when the object was modified by QBPOS.
IQBDateTimeType     Y

TimeModifiedRangeFilter

Searches for objects that were modified within the specified time range.
ITimeModifiedRangeFilter      

FromTimeModified

First time value possible in the range.
IQBDateTimeType     Y

ToTimeModified

Last time value of the range.
IQBDateTimeType     Y

ORAssociateFilters

IORAssociateFilters      

AssociateFilter

Filters by the specified associate name string or substring.
IAssociateFilter      

MatchStringCriterion

This specifies which part of the string is being looked at.
IQBENMatchStringCriterionType     Y

Associate

The employee making the adjustment transaction.
IQBStringType 40 chars   Y

AssociateRangeFilter

Filters by the specified range of name values.
IAssociateRangeFilter      

FromAssociate

Starting value in the range filter.
IQBStringType 40 chars   Y

ToAssociate

Ending value in the specified range.
IQBStringType 40 chars   Y

ORCommentsFilters

IORCommentsFilters      

CommentsFilter

Filters adjustments by the comments field using the specified string or substring.
ICommentsFilter      

MatchStringCriterion

This specifies which part of the string is being looked at.
IQBENMatchStringCriterionType     Y

Comments

The Comment field contains a description of the transaction, for example, why a memo was issued, or why cash was paid out (receipt).
IQBStringType 300 chars   Y

CommentsRangeFilter

Filters by the specified range of comments.
ICommentsRangeFilter      

FromComments

Specifies the beginning of the range in the filter.
IQBStringType 300 chars   Y

ToComments

Specifies the end of the range in the filter.
IQBStringType 300 chars   Y

ORCompanyNameFilters

IORCompanyNameFilters      

CompanyNameFilter

Filters objects by the customer or vendor’s company name value.
ICompanyNameFilter      

MatchStringCriterion

This specifies which part of the string is being looked at.
IQBENMatchStringCriterionType     Y

CompanyName

The name of the business.
IQBStringType 41 chars   Y

CompanyNameRangeFilter

Filters objects by a range of company name values.
ICompanyNameRangeFilter      

FromCompanyName

Start of the range of CompanyName values.
IQBStringType 41 chars   Y

ToCompanyName

End of the range of CompanyName values.
IQBStringType 41 chars   Y

ORDiscountFilters

IORDiscountFilters      

DiscountFilter

Filters vouchers by their discount value.
IDiscountFilter      

MatchNumericCriterion

Specifies how the specified numeric value will filter the target objects, that is, specifies the the comparison that will be used.
IQBENMatchNumericCriterionType     Y

Discount

Discount amount: Enter the amount of any discount applicable to the PO. Discounts are applied to the PO subtotal. Entering an amount causes the Disc % field to be automatically calculated.
IQBAmountType     Y

DiscountRangeFilter

Filters vouchers by a range of Discount values.
IDiscountRangeFilter      

FromDiscount

Start of the Discount range.
IQBAmountType     Y

ToDiscount

End of the Discount range.
IQBAmountType     Y

ORDiscountPercentFilters

IORDiscountPercentFilters      

DiscountPercentFilter

Filters vouchers by their discountpercent values.
IDiscountPercentFilter      

MatchNumericCriterion

Specifies how the specified numeric value will filter the target objects, that is, specifies the the comparison that will be used.
IQBENMatchNumericCriterionType     Y

DiscountPercent

Enter a percentage discount applicable to the PO. Discounts are applied to the PO subtotal. Entering a discount percentage causes the Disc $ field to be automatically calculated.
IQBFloatType     Y

DiscountPercentRangeFilter

Filters vouchers by a range of discountpercent values.
IDiscountPercentRangeFilter      

FromDiscountPercent

Start of the DiscountPercent range.
IQBFloatType     Y

ToDiscountPercent

End of the DiscountPercent range.
IQBFloatType     Y

ORFeeFilters

IORFeeFilters      

FeeFilter

Searches for POs with fee values specified by the filter.
IFeeFilter      

MatchNumericCriterion

Specifies how the specified numeric value will filter the target objects, that is, specifies the the comparison that will be used.
IQBENMatchNumericCriterionType     Y

Fee

You can enter a fee using this field. Notice that Fees entered on a PO (such as a special handling fee) are not spread over the cost of individual items. When a receiving voucher references a PO with a fee entered, the fee can be transferred to the voucher at that point.
IQBAmountType     Y

FeeRangeFilter

Searches for POs whose Fee values fall within the specified range.
IFeeRangeFilter      

FromFee

Start of the range.
IQBAmountType     Y

ToFee

End of the fee range.
IQBAmountType     Y

ORFreightFilters

IORFreightFilters      

FreightFilter

Filters transfer slips by their freight values.
IFreightFilter      

MatchNumericCriterion

Specifies how the specified numeric value will filter the target objects, that is, specifies the the comparison that will be used.
IQBENMatchNumericCriterionType     Y

Freight

Price charged by the shipping carrier to move the merchandise between the stores involved in the transaction. You can use this field to record freight charges associated with the transfer to provide a record of these charges to compare to a freight bill later.
IQBAmountType     Y

FreightRangeFilter

Filters transfer slips by a range of freight values.
IFreightRangeFilter      

FromFreight

Start of the range of Freight values.
IQBAmountType     Y

ToFreight

End of the range of Freight values.
IQBAmountType     Y

HistoryDocStatus

Indicates the current status of the cost memo created as a result of this request. Status of reversed means that this was an original memo that had to be corrected. Status of reversing means that this memo caused an older memo to be reversed. Status of regular means that the document has been corrected.
IQBENHistoryDocStatusType      

ORInvoiceDateFilters

IORInvoiceDateFilters      

InvoiceDateFilter

Filters vouchers by their invoice date value.
IInvoiceDateFilter      

MatchNumericCriterion

Specifies how the specified numeric value will filter the target objects, that is, specifies the the comparison that will be used.
IQBENMatchNumericCriterionType     Y

InvoiceDate

Specify the date shown on the vendor’s invoice.
IQBDateType     Y

InvoiceDateRangeFilter

Filters vouchers by a range of invoice date values.
IInvoiceDateRangeFilter      

FromInvoiceDate

Start of the range of Invoice date values.
IQBDateType     Y

ToInvoiceDate

End of the range of Invoice date values.
IQBDateType     Y

ORInvoiceDueDateFilters

IORInvoiceDueDateFilters   1.1  

InvoiceDueDateFilter

Filters by the invoice due date.
IInvoiceDueDateFilter      

MatchNumericCriterion

Specifies how the specified numeric value will filter the target objects, that is, specifies the the comparison that will be used.
IQBENMatchNumericCriterionType     Y

InvoiceDueDate

Specifies the date the invoice is due and payable.
IQBDateType     Y

InvoiceDueDateRangeFilter

Filters by a range of invoice due dates.
IInvoiceDueDateRangeFilter      

FromInvoiceDueDate

Beginning of the range.
IQBDateType     Y

ToInvoiceDueDate

End of the range.
IQBDateType     Y

ORInvoiceNumberFilters

IORInvoiceNumberFilters      

InvoiceNumberFilter

Filters vouchers by the vendor’s invoice number.
IInvoiceNumberFilter      

MatchStringCriterion

This specifies which part of the string is being looked at.
IQBENMatchStringCriterionType     Y

InvoiceNumber

Specify the vendor’s invoice number for the shipment.
IQBStringType 15 chars   Y

InvoiceNumberRangeFilter

Filters vouchers by a range of vendor invoice values.
IInvoiceNumberRangeFilter      

FromInvoiceNumber

Start of the range of Invoice number values.
IQBStringType 15 chars   Y

ToInvoiceNumber

End of the range of Invoice number values.
IQBStringType 15 chars   Y

ORItemsCountFilters

IORItemsCountFilters      

ItemsCountFilter

Filters adjustments by those with a specified number of line items.
IItemsCountFilter      

MatchNumericCriterion

Specifies how the specified numeric value will filter the target objects, that is, specifies the the comparison that will be used.
IQBENMatchNumericCriterionType     Y

ItemsCount

The number of line items in the adjustment add request that added the adjustment to QBPOS.
IQBIntType     Y

ItemsCountRangeFilter

Specifies a range of adjustment line items to search for.
IItemsCountRangeFilter      

FromItemsCount

Specifies the start of the range.
IQBIntType     Y

ToItemsCount

Specifies the end of the range.
IQBIntType     Y

ORPayeeCodeFilters

IORPayeeCodeFilters      

PayeeCodeFilter

Filters vouchers by their PayeeCode value.
IPayeeCodeFilter      

MatchStringCriterion

This specifies which part of the string is being looked at.
IQBENMatchStringCriterionType     Y

PayeeCode

Specify the vendor or agent to be paid for the merchandise.
IQBStringType 3 chars   Y

PayeeCodeRangeFilter

Filters vouchers by a range of PayeeCode values.
IPayeeCodeRangeFilter      

FromPayeeCode

Start of the range of PayeeCode values.
IQBStringType 3 chars   Y

ToPayeeCode

End of the range of PayeeCode values.
IQBStringType 3 chars   Y

PayeeListID

The list ID value of the vendor who is to be paid for the merchandise being received via this receiving voucher.
IQBIDType      

ORPayeeNameFilters

IORPayeeNameFilters      

PayeeNameFilter

Filters vouchers by their PayeeName value.
IPayeeNameFilter      

MatchStringCriterion

This specifies which part of the string is being looked at.
IQBENMatchStringCriterionType     Y

PayeeName

The full vendor or customer name returned from the QBPOS company that matches the PayeeCode value supplied in the VoucherAdd request.
IQBStringType 26 chars   Y

PayeeNameRangeFilter

Filters vouchers by a range of PayeeName values.
IPayeeNameRangeFilter      

FromPayeeName

Start of the PayeeName range.
IQBStringType 26 chars   Y

ToPayeeName

End of the PayeeName range.
IQBStringType 26 chars   Y

ORPurchaseOrderNumberFilters

IORPurchaseOrderNumberFilters      

PurchaseOrderNumberFilter

Filters vouchers by the PurchaseOrder received against.
IPurchaseOrderNumberFilter      

MatchStringCriterion

This specifies which part of the string is being looked at.
IQBENMatchStringCriterionType     Y

PurchaseOrderNumber

The number you want to assign to the purchase order. It should be unique. This number is automatically assigned to the PurchaseOrder by QBPOS if left empty during the creation process. An example of setting PO numbers is when you create a PO from a SalesOrder. You can use the SalesOrder number prefaced by PO, to show in the PO number the linkage between the sales order and the purchase order.
IQBStringType 20 chars   Y

PurchaseOrderNumberRangeFilter

Filters vouchers by a range of purchase orders.
IPurchaseOrderNumberRangeFilter      

FromPurchaseOrderNumber

Start of the PurchaseOrder number range.
IQBStringType 20 chars   Y

ToPurchaseOrderNumber

End of the PurchaseOrder number range.
IQBStringType 20 chars   Y

PurchaseOrderTxnID

In a receiving voucher, this field links the voucher to a purchase order so it can receive items against that purchase order.
IQBIDType      

QuickBooksFlag

This element is used only if QBPOS is being used with QuickBooks Financial Software. The value here displays the status of data export for a memo: NOT POSTED (not yet sent to QuickBooks), COMPLETE (sent to QuickBooks), or ERROR (attempting to send the memo to QuickBooks resulted in an error). Values: NotPosted, Completed, Error, UnbilledPurchases No default value.
IQBENQuickBooksFlagType      

StoreExchangeStatus

In multi store configurations, if the customer’s information has changed, this information is updated at the headquarters store. This response field indicates whether the information was successfully updated or not.
IQBENStoreExchangeStatusType      

ORStoreNumberFilters

IORStoreNumberFilters      

StoreNumberFilter

Available only for multi-store versions of QBPOS. Filters Quantity Adjustment Memos by the store number of the store originating the Quantity Adjustment Memo.
IStoreNumberFilter      

MatchNumericCriterion

Specifies how the specified numeric value will filter the target objects, that is, specifies the the comparison that will be used.
IQBENMatchNumericCriterionType     Y

StoreNumber

This is used only for multi-store versions of QBPOS. The value is between 1 and 10, since a maximum of 10 stores are currently supported.
IQBIntType     Y

StoreNumberRangeFilter

Available only for multi-store versions of QBPOS. Filters Quantity Adjustment Memos by the specified range of store numbers of the store originating the Quantity Adjustment Memo.
IStoreNumberRangeFilter      

FromStoreNumber

Available for multi-store versions of QBPOS. Specifies the starting value of the Store Number range. Only memos whose Store Number value is at this value level or higher will be returned in the query.
IQBIntType     Y

ToStoreNumber

Specifies the ending value of the Store Number range. Only memos whose Store Number value falls between the FromStoreNumber value and this value will be returned in the query.
IQBIntType     Y

ORSubtotalFilters

IORSubtotalFilters      

SubtotalFilter

Filters vouchers by their Subtotal value.
ISubtotalFilter      

MatchNumericCriterion

Specifies how the specified numeric value will filter the target objects, that is, specifies the the comparison that will be used.
IQBENMatchNumericCriterionType     Y

Subtotal

The total cost (sum of extended item costs) of the PO before applying any discounts or fees. This value is updated when a voucher that references the PO is updated.
IQBAmountType     Y

SubtotalRangeFilter

Filters vouchers by a range of Subtotal values.
ISubtotalRangeFilter      

FromSubtotal

Start of the Subtotal range.
IQBAmountType     Y

ToSubtotal

End of the Subtotal range.
IQBAmountType     Y

ORTermsDiscountFilters

IORTermsDiscountFilters   1.1  

TermsDiscountFilter

Filters by TermsDiscount.
ITermsDiscountFilter      

MatchNumericCriterion

Specifies how the specified numeric value will filter the target objects, that is, specifies the the comparison that will be used.
IQBENMatchNumericCriterionType     Y

TermsDiscount

The TermsDiscount field specifies the discount percentage. A discount is applied by the vendor if payment is received on or before the number of days specified in the TermsDiscountDays field for that vendor. Terms-related discounts for vendors are created or modified in the VendorAdd/VendorMod fields TermsDiscountDays and TermsDiscount.
IQBFloatType     Y

TermsDiscountRangeFilter

Filters by a range of TermsDiscount values.
ITermsDiscountRangeFilter      

FromTermsDiscount

Starting TermsDiscount value in the range of TermsDiscount values.
IQBFloatType     Y

ToTermsDiscount

Ending TermsDiscount value in the range of TermsDiscount values.
IQBFloatType     Y

ORTermsDiscountDaysFilters

IORTermsDiscountDaysFilters   1.1  

TermsDiscountDaysFilter

Filters by the TermsDiscountDays field.
ITermsDiscountDaysFilter      

MatchNumericCriterion

Specifies how the specified numeric value will filter the target objects, that is, specifies the the comparison that will be used.
IQBENMatchNumericCriterionType     Y

TermsDiscountDays

The TermsDiscountDays field specifies the number of days after the invoice date in which payment must be received in order to obtain the discount percentage. A discount is applied by the vendor if payment is received on or before the number of days specified in the TermsDiscountDays field for that vendor. Terms-related discounts for vendors are created or modified in the VendorAdd/VendorMod fields TermsDiscountDays and TermsDiscount.
IQBIntType     Y

TermsDiscountDaysRangeFilter

Filters by a range of TermsDiscountDays values.
ITermsDiscountDaysRangeFilter      

FromTermsDiscountDays

Starting TermsDiscountDays value in the range of TermsDiscountDays values.
IQBIntType     Y

ToTermsDiscountDays

Ending TermsDiscountDays value in the range of TermsDiscountDays values.
IQBIntType     Y

ORTermsNetDaysFilters

IORTermsNetDaysFilters   1.1  

TermsNetDaysFilter

Filters by the TermsNetDays field.
ITermsNetDaysFilter      

MatchNumericCriterion

Specifies how the specified numeric value will filter the target objects, that is, specifies the the comparison that will be used.
IQBENMatchNumericCriterionType     Y

TermsNetDays

This establishes the vendor’s payment due date, which is based on the vendor’s invoice date. The due date is established by the number of days specified in this field after the invoice date. Payment must be made within this number of days.
IQBIntType     Y

TermsNetDaysRangeFilter

Filters by a range of TermsNetDays values.
ITermsNetDaysRangeFilter      

FromTermsNetDays

Starting TermsNetDays value in the range of TermsNetDays values.
IQBIntType     Y

ToTermsNetDays

Ending TermsNetDays value in the range of TermsNetDays values.
IQBIntType     Y

ORTotalFilters

IORTotalFilters      

TotalFilter

Filters vouchers by their Total value.
ITotalFilter      

MatchNumericCriterion

Specifies how the specified numeric value will filter the target objects, that is, specifies the the comparison that will be used.
IQBENMatchNumericCriterionType     Y

Total

The total PO amount after discounts and fees are applied.Total = Subtotal - Disc $ + Fee This value is updated when a voucher that references the PO is updated.
IQBAmountType     Y

TotalRangeFilter

Filters vouchers by a range of Total values.
ITotalRangeFilter      

FromTotal

Start of the Total range.
IQBAmountType     Y

ToTotal

End of the Total range.
IQBAmountType     Y

ORTotalQtyFilters

IORTotalQtyFilters      

TotalQtyFilter

Filters transfer slips by their TotalQty value.
ITotalQtyFilter      

MatchNumericCriterion

Specifies how the specified numeric value will filter the target objects, that is, specifies the the comparison that will be used.
IQBENMatchNumericCriterionType     Y

TotalQty

Total quantity of items being transferred.
IQBQuanType     Y

TotalQtyRangeFilter

Filters transfer slips by a range of TotalQty values.
ITotalQtyRangeFilter      

FromTotalQty

Start of the range of TotalQty values.
IQBQuanType     Y

ToTotalQty

End of the range of TotalQty values.
IQBQuanType     Y

ORTxnDateFilters

IORTxnDateFilters      

TxnDateFilter

The ITxnDateFilter group object allows you to filter by transaction creation date.
ITxnDateFilter      

MatchNumericCriterion

Specifies how the specified numeric value will filter the target objects, that is, specifies the the comparison that will be used.
IQBENMatchNumericCriterionType     Y

TxnDate

The date of the transaction. In some cases, if you leave TxnDate out of an -Add message, QuickBooks will prefill TxnDate with the date of the last-saved transaction of the same type.
IQBDateType     Y

TxnDateRangeFilter

Filters according to the original transaction dates.
ITxnDateRangeFilter      

FromTxnDate

Selects transactions created on or after this date. Both FromTxnDate and ToTxnDate must be between 01/01/1901 and 12/31/9999.If you omit FromTxnDate, it will be set to 1970-01-01 (1969-12-31 PST).
IQBDateType     Y

ToTxnDate

Selects transactions created on or before this date. Both ToTxnDate and FromTxnDate must be between 01/01/1901 and 12/31/9999. If you omit ToTxnDate, it will be set to 2038-01-19 (2038-01-18 PST).
IQBDateType     Y

TxnState

Indicates whether the transaction is complete (Normal) or is a “held document” (Held) which means it is not yet finalized. For example, a saved draft pending while awaiting some work or decision.
IQBENTxnStateType   1.1  

ORVendorCodeFilters

IORVendorCodeFilters      

VendorCodeFilter

Filters items by their Vendor Code values.
IVendorCodeFilter      

MatchStringCriterion

This specifies which part of the string is being looked at.
IQBENMatchStringCriterionType     Y

VendorCode

The code assigned to the vendor specified for the item.
IQBStringType 3 chars   Y

VendorCodeRangeFilter

Filters items by the specified range of Vendor Code values.
IVendorCodeRangeFilter      

FromVendorCode

Start of the Vendor Code range.
IQBStringType 3 chars   Y

ToVendorCode

End of the Vendor Code range.
IQBStringType 3 chars   Y

VendorListID

The listID of the vendor being referenced in this object reference.
IQBIDType      

ORVoucherNumberFilters

IORVoucherNumberFilters      

VoucherNumberFilter

Filters vouchers by voucher number.
IVoucherNumberFilter      

MatchNumericCriterion

Specifies how the specified numeric value will filter the target objects, that is, specifies the the comparison that will be used.
IQBENMatchNumericCriterionType     Y

VoucherNumber

This is a unique number automatically assigned to the voucher at creation time by QBPOS.
IQBIntType     Y

VoucherNumberRangeFilter

Filters vouchers by a range of voucher numbers.
IVoucherNumberRangeFilter      

FromVoucherNumber

Start of the voucher number range.
IQBIntType     Y

ToVoucherNumber

End of the voucher number range.
IQBIntType     Y

VoucherType

Specify the type of voucher you are creating.
IQBENVoucherTypeType      

ORWorkstationFilters

IORWorkstationFilters      

WorkstationFilter

Retrieves adjustments by the workstation they originated from.
IWorkstationFilter      

MatchNumericCriterion

Specifies how the specified numeric value will filter the target objects, that is, specifies the the comparison that will be used.
IQBENMatchNumericCriterionType     Y

Workstation

Workstation from which the transaction was made.
IQBIntType     Y

WorkstationRangeFilter

Retrieves adjustments from the specified range of workstations.
IWorkstationRangeFilter      

FromWorkstation

Beginning of the range to search.
IQBIntType     Y

ToWorkstation

End of the range to search.
IQBIntType     Y

IncludeRetElementList

You can use the IncludeRetElement feature to restrict the data returned in the response to the specified qbposXML field here. If you do this, only those elements specified will be returned. To use this feature, you simply add the qbposXML element name to the IncludeRetElementList. The following example shows how to do this, specifying that only the CreatedBy and ClockOutTime elements are to be returned in the TimeEntryAdd response: Dim MyTimeEntry As ITimeEntryAdd Set MyTimeEntry = requestMsgSet.AppendTimeEntryAddRq MyTimeEntry.IncludeRetElementList.Add “CreatedBy” MyTimeEntry.IncludeRetElementList.Add “ClockOutTime” ‘ set the other properties as desired…
IBSTRList 50 chars 2.0  
Tag Type Max length Implementation Required

IResponse

Returns the vouchers specified in the filter criteria.
       

StatusCode

A number that corresponds to a statusSeverity and statusMessage. Five status codes relate directly to signon messages: 2000, 2010, 2020, 2030, and 2040. For details about these and other statusCode values that can be returned, see the statusCode table on the Error Codes page.
IQBIntType     Y

StatusSeverity

One of the following values: INFO The request was completed, and the results are consistent with what your application expected. WARNING The request was completed, but the results might not be consistent with what you expected. ERROR The request was not completed. No data will appear in the server’s response after the statusMessage.
IQBStringType     Y

StatusMessage

A user-readable explanation of the success or error condition that is indicated by the statusCode. For details about the statusMessage values that can be returned, see the “Explanation” column of the statusCode table on the Error Codes page.
IQBStringType     Y

retCount

The retCount is returned in a query if in the query request you specified the metaData attribute with a value of MetaDataOnly (in which case the retCount is the only data returned in the query response) or MetaDataAndResponseData (the query response contains object data AND the approximate count). The retCount value contains the approximate count of the objects that could be expected to be returned from the query. A common use of this feature is to specify a count with no data in order to determine how many objects to expect from the actual query. You should be aware that the count returned in retCount is not guaranteed to be exact: it could be off slightly due to new object creation or deletions.
IQBIntType   4.0|us.png| Y

iteratorRemainingCount

This attribute is provided in the response in a query using iterators, indicating the number of objects remaining in the iteration. This can help you specify a MaxReturn value tailored to the number of objects still to be iterated through in your query.
IQBIntType   5.0|us.png| Y

iteratorID

The iterator query attribute is provided with most query types to allow you to break down query results into smaller and more manageable chunks of data. An iterator results in responses that contain only the specified number of objects. The iterator is created when a query contains the iterator attribute set to Start, along with a MaxReturn value specifying how many records are to be returned in each iteration. The response to that first query iteration contains, along with the response data, an IteratorID value that uniquely identifies that iterator. This is important because you can have many iterators active at the same time. Accordingly, in subsequent iterations of that query, you need to supply that returned iteratorID so the SDK knows where to resume the iteration.
IQBUUIDType   5.0|us.png| Y

Detail

IVoucherRetList      

(List of IVoucherRet Objects)

       

TxnID

QuickBooks generates a unique TxnID for each transaction that is added to QuickBooks. A TxnID returned from a request can be used to refer to the transaction in subsequent requests. Notice that you cannot supply the TxnID of a TimeTracking transaction to TransactionQueryRq requests. If you do, you get an error stating that no such record could be found, even though the transaction is in QuickBooks. This behavior reflects the behavior in the QuicKBooks UI in the Find window.
IQBIDType      

TimeCreated

The timestamp indicating the time when this object was created in QBPOS.
IQBDateTimeType   1.1  

TimeModified

The time when the object was modified by QBPOS.
IQBDateTimeType      

Associate

The employee making the adjustment transaction.
IQBStringType 40 chars    

Comments

The Comment field contains a description of the transaction, for example, why a memo was issued, or why cash was paid out (receipt).
IQBStringType 2000 chars    

CompanyName

The name of the business.
IQBStringType 41 chars    

Discount

Discount amount: Enter the amount of any discount applicable to the PO. Discounts are applied to the PO subtotal. Entering an amount causes the Disc % field to be automatically calculated.
IQBAmountType      

DiscountPercent

Enter a percentage discount applicable to the PO. Discounts are applied to the PO subtotal. Entering a discount percentage causes the Disc $ field to be automatically calculated.
IQBFloatType      

Fee

You can enter a fee using this field. Notice that Fees entered on a PO (such as a special handling fee) are not spread over the cost of individual items. When a receiving voucher references a PO with a fee entered, the fee can be transferred to the voucher at that point.
IQBAmountType      

Freight

Price charged by the shipping carrier to move the merchandise between the stores involved in the transaction. You can use this field to record freight charges associated with the transfer to provide a record of these charges to compare to a freight bill later.
IQBAmountType      

HistoryDocStatus

Indicates the current status of the cost memo created as a result of this request. Status of reversed means that this was an original memo that had to be corrected. Status of reversing means that this memo caused an older memo to be reversed. Status of regular means that the document has been corrected.
IQBENHistoryDocStatusType      

InvoiceDate

Specify the date shown on the vendor’s invoice.
IQBDateType      

InvoiceDueDate

Specifies the date the invoice is due and payable.
IQBDateType   1.1  

InvoiceNumber

Specify the vendor’s invoice number for the shipment.
IQBStringType 15 chars    

ItemsCount

The number of line items in the adjustment add request that added the adjustment to QBPOS.
IQBIntType      

PayeeCode

Specify the vendor or agent to be paid for the merchandise.
IQBStringType 3 chars    

PayeeListID

The list ID value of the vendor who is to be paid for the merchandise being received via this receiving voucher.
IQBIDType      

PayeeName

The full vendor or customer name returned from the QBPOS company that matches the PayeeCode value supplied in the VoucherAdd request.
IQBStringType 26 chars    

PurchaseOrderNumber

The number you want to assign to the purchase order. It should be unique. This number is automatically assigned to the PurchaseOrder by QBPOS if left empty during the creation process. An example of setting PO numbers is when you create a PO from a SalesOrder. You can use the SalesOrder number prefaced by PO, to show in the PO number the linkage between the sales order and the purchase order.
IQBStringType 20 chars    

PurchaseOrderTxnID

In a receiving voucher, this field links the voucher to a purchase order so it can receive items against that purchase order.
IQBIDType      

QuickBooksFlag

This element is used only if QBPOS is being used with QuickBooks Financial Software. The value here displays the status of data export for a memo: NOT POSTED (not yet sent to QuickBooks), COMPLETE (sent to QuickBooks), or ERROR (attempting to send the memo to QuickBooks resulted in an error). Values: NotPosted, Completed, Error, UnbilledPurchases No default value.
IQBENQuickBooksFlagType      

StoreExchangeStatus

In multi store configurations, if the customer’s information has changed, this information is updated at the headquarters store. This response field indicates whether the information was successfully updated or not.
IQBENStoreExchangeStatusType      

StoreNumber

This is used only for multi-store versions of QBPOS. The value is between 1 and 10, since a maximum of 10 stores are currently supported.
IQBIntType      

Subtotal

The total cost (sum of extended item costs) of the PO before applying any discounts or fees. This value is updated when a voucher that references the PO is updated.
IQBAmountType      

TermsDiscount

The TermsDiscount field specifies the discount percentage. A discount is applied by the vendor if payment is received on or before the number of days specified in the TermsDiscountDays field for that vendor. Terms-related discounts for vendors are created or modified in the VendorAdd/VendorMod fields TermsDiscountDays and TermsDiscount.
IQBFloatType   1.1  

TermsDiscountDays

The TermsDiscountDays field specifies the number of days after the invoice date in which payment must be received in order to obtain the discount percentage. A discount is applied by the vendor if payment is received on or before the number of days specified in the TermsDiscountDays field for that vendor. Terms-related discounts for vendors are created or modified in the VendorAdd/VendorMod fields TermsDiscountDays and TermsDiscount.
IQBIntType   1.1  

TermsNetDays

This establishes the vendor’s payment due date, which is based on the vendor’s invoice date. The due date is established by the number of days specified in this field after the invoice date. Payment must be made within this number of days.
IQBIntType   1.1  

Total

The total PO amount after discounts and fees are applied.Total = Subtotal - Disc $ + Fee This value is updated when a voucher that references the PO is updated.
IQBAmountType      

TotalQty

Total quantity of items being transferred.
IQBQuanType      

TxnDate

The date of the transaction. In some cases, if you leave TxnDate out of an -Add message, QuickBooks will prefill TxnDate with the date of the last-saved transaction of the same type.
IQBDateType      

TxnState

Indicates whether the transaction is complete (Normal) or is a “held document” (Held) which means it is not yet finalized. For example, a saved draft pending while awaiting some work or decision.
IQBENTxnStateType   1.1  

VendorCode

The code assigned to the vendor specified for the item.
IQBStringType 3 chars    

VendorListID

The listID of the vendor being referenced in this object reference.
IQBIDType      

VoucherNumber

This is a unique number automatically assigned to the voucher at creation time by QBPOS.
IQBIntType      

VoucherType

Specify the type of voucher you are creating.
IQBENVoucherTypeType      

Workstation

Workstation from which the transaction was made.
IQBIntType      

VoucherItemRetList

The list of voucher line item objects returned in the response to the originating request.
IVoucherItemRetList      

(List of IVoucherItemRet Objects)

       

ListID

The unique ID returned by QBPOS for this object. If supplied in a request, the ListID is a reference to an object required in the request. For example, in a SalesOrder or PurchaseOrder line item, the ListID that is required is an Item list ID.
IQBIDType      

ALU

Alternate Lookup. A user-defined identifier to be used to look up an item. Typically, this field contains such as the manufacturer’s part number, but it can contain any text descriptions, catalog numbers, etc. Duplicate Alternate Lookups are not allowed. Do not duplicate the Item # or UPC in this field. This will adversely affect performance for item lookups.
IQBStringType 20 chars    

Attribute

A field used to describe an item characteristic, typically color, pattern, material, or a second size. One to eight characters.
IQBStringType 12 chars    

Cost

The average cost of the item. Cost is automatically updated by receiving vouchers or manually updated by adjustment memos.
IQBAmountType      

Desc1

The principal item description field. This description is printed on receipts. For some versions of QBPOS, (Pro), this must be the same for all members of a style. Changes to this field can be applied to an item or to an entire style.
IQBStringType 30 chars    

Desc2

Secondary description field usually used for any additional information to describe this particular item, such as a vendor’s catalog number. Also can be used for additional information at the point of sale.
IQBStringType      

ExtendedCost

For a line item, Extended cost is the quantity ordered multiplied by the item cost.
IQBAmountType      

ItemNumber

Unique number assigned to the item when it is added to QBPOS.
IQBIntType      

NumberOfBaseUnits

If you use multiple units of measure, rather than a single UOM, you need to select one of the UOMs as the base unit. This base unit should be the smallest unit that you sell by. Inventory quantities are always expressed in terms of this base unit.
IQBQuanType   2.0  

OriginalOrderQty

The quantity ordered in the purchase order that this voucher is receiving against.
IQBQuanType   2.0  

QtyReceived

The quantity of the PurchaseOrder line item received to date. In PO Item List: The item quantity received to date.In PO Totals and PO List: The total document quantity received to date.
IQBQuanType      

SerialNumber

Item serial numbers can be recorded in QBPOS for purposes of warranty tracking or meeting legal requirements. Once recorded, former documents can be quickly located by searching by serial number. To use serial number tracking: 1. In inventory, specify those items for which you want to record serial numbers by selecting PROMPT in the Serial # Tracking field. 2. When listing these items on documents (except purchase orders and cost memos), the QBPOS user is prompted to enter a unique serial number for each unit being processed. If listing several items on a document for which you have set the serial number requirement, the user is prompted to enter serial numbers for each unit of each of those items in sequence.
IQBStringType 25 chars    

Size

The size of an item; 1 to 8 characters. This field can also be used to describe a second item attribute other than size if desired.
IQBStringType 12 chars    

UnitOfMeasure

If the company is using only a single unit of measure, this specifies the unit of measure for the item. If the company is using multiple units of measure, this specifies the base unit of measure for the item. Inventory quantities are tracked and reported in terms of this base unit.
IQBStringType 20 chars 2.0  

UPC

Universal Product Code. The item’s unique UPC/EAN/ISBN identifier. This field must be 13 characters. If a shorter number is entered, QBPOS uses an appropriate algorithm to lengthen the entry to fill the 13-character field.
IQBStringType 18 chars    

DataExtRetList

If you specify any custom fields/private data extensions to be returned in the query request (in the OwnerIDList), then this Ret List will contain all of the data extensions that belong to each specified OwnerID. For example, if you specify an OwnerID value of 0 (custom fields), then the query will return all custom data for the returned records.
IDataExtRetList   1.2  

(List of IDataExtRet Objects)

       

OwnerID

OwnerID refers to the owner of a data extension, and must be 0 or a valid GUID. (Custom fields, which are visible in the QuickBooks UI, always have an OwnerID of 0. ) Usually you would keep your application’s GUID confidential to prevent other applications from accessing your data extensions. But if you want to share data extensions with another application, the applications need to use the same GUID. In this case, each application could use two GUIDs, one for shared data extensions and one for confidential data extensions. (An application can have any number of GUIDs.) When you share a data extension with another application, the other application must know both the OwnerID and the DataExtName, as these together form a data extension’s unique name.
IQBGUIDType     Y

DataExtName

The name of the data extension. If this is a custom field, DataExtName will be visible as a label in the QuickBooks user interface. Also because OwnerID and DataExtName together make the data extension unique, and because custom fields all have the same OwnerID of zero, the DataExtName must be a unique value among existing custom fields. In contrast, the DataExtName for private data extensions must be unique only for the specified OwnerID GUID.
IQBStringType     Y

DataExtType

b>DataExtType The type of the data extension.
IQBENDataExtTypeType     Y

DataExtValue

The data in this field. The maximum length of DataExtValue will depend on the DataExtType of this data extension. For example, if DataExtType is STR255TYPE, the maximum length of DataExtValue is 255 characters. If DataExtType is STR1024TYPE, the maximum size of DataExtValue is 1KB.
IQBStringType     Y

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
<?xml version="1.0" encoding="utf-8"?>
<?qbposxml version="4.0"?>
<QBPOSXML>
        <QBPOSXMLMsgsRq onError="stopOnError">
                <VoucherQueryRq metaData="ENUMTYPE" iterator="ENUMTYPE" iteratorID="UUIDTYPE">
                        <MaxReturned >INTTYPE</MaxReturned> <!-- optional -->
                        <OwnerID >GUIDTYPE</OwnerID> <!-- optional, may repeat -->
                        <TxnID >IDTYPE</TxnID> <!-- optional -->
                        <!-- BEGIN OR -->
                                <TimeCreatedFilter> <!-- optional -->
                                        <!-- MatchNumericCriterion may have one of the following values: LessThan, LessThanEqual, Equal, GreaterThan, GreaterThanEqual -->
                                        <MatchNumericCriterion >ENUMTYPE</MatchNumericCriterion> <!-- required -->
                                        <TimeCreated >DATETIMETYPE</TimeCreated> <!-- required -->
                                </TimeCreatedFilter>
                        <!-- OR -->
                                <TimeCreatedRangeFilter> <!-- optional -->
                                        <FromTimeCreated >DATETIMETYPE</FromTimeCreated> <!-- required -->
                                        <ToTimeCreated >DATETIMETYPE</ToTimeCreated> <!-- required -->
                                </TimeCreatedRangeFilter>
                        <!-- END OR -->
                        <!-- BEGIN OR -->
                                <TimeModifiedFilter> <!-- optional -->
                                        <!-- MatchNumericCriterion may have one of the following values: LessThan, LessThanEqual, Equal, GreaterThan, GreaterThanEqual -->
                                        <MatchNumericCriterion >ENUMTYPE</MatchNumericCriterion> <!-- required -->
                                        <TimeModified >DATETIMETYPE</TimeModified> <!-- required -->
                                </TimeModifiedFilter>
                        <!-- OR -->
                                <TimeModifiedRangeFilter> <!-- optional -->
                                        <FromTimeModified >DATETIMETYPE</FromTimeModified> <!-- required -->
                                        <ToTimeModified >DATETIMETYPE</ToTimeModified> <!-- required -->
                                </TimeModifiedRangeFilter>
                        <!-- END OR -->
                        <!-- BEGIN OR -->
                                <AssociateFilter> <!-- optional -->
                                        <!-- MatchStringCriterion may have one of the following values: Equal, StartsWith, Contains, EndsWith -->
                                        <MatchStringCriterion >ENUMTYPE</MatchStringCriterion> <!-- required -->
                                        <Associate >STRTYPE</Associate> <!-- required -->
                                </AssociateFilter>
                        <!-- OR -->
                                <AssociateRangeFilter> <!-- optional -->
                                        <FromAssociate >STRTYPE</FromAssociate> <!-- required -->
                                        <ToAssociate >STRTYPE</ToAssociate> <!-- required -->
                                </AssociateRangeFilter>
                        <!-- END OR -->
                        <!-- BEGIN OR -->
                                <CommentsFilter> <!-- optional -->
                                        <!-- MatchStringCriterion may have one of the following values: Equal, StartsWith, Contains, EndsWith -->
                                        <MatchStringCriterion >ENUMTYPE</MatchStringCriterion> <!-- required -->
                                        <Comments >STRTYPE</Comments> <!-- required -->
                                </CommentsFilter>
                        <!-- OR -->
                                <CommentsRangeFilter> <!-- optional -->
                                        <FromComments >STRTYPE</FromComments> <!-- required -->
                                        <ToComments >STRTYPE</ToComments> <!-- required -->
                                </CommentsRangeFilter>
                        <!-- END OR -->
                        <!-- BEGIN OR -->
                                <CompanyNameFilter> <!-- optional -->
                                        <!-- MatchStringCriterion may have one of the following values: Equal, StartsWith, Contains, EndsWith -->
                                        <MatchStringCriterion >ENUMTYPE</MatchStringCriterion> <!-- required -->
                                        <CompanyName >STRTYPE</CompanyName> <!-- required -->
                                </CompanyNameFilter>
                        <!-- OR -->
                                <CompanyNameRangeFilter> <!-- optional -->
                                        <FromCompanyName >STRTYPE</FromCompanyName> <!-- required -->
                                        <ToCompanyName >STRTYPE</ToCompanyName> <!-- required -->
                                </CompanyNameRangeFilter>
                        <!-- END OR -->
                        <!-- BEGIN OR -->
                                <DiscountFilter> <!-- optional -->
                                        <!-- MatchNumericCriterion may have one of the following values: LessThan, LessThanEqual, Equal, GreaterThan, GreaterThanEqual -->
                                        <MatchNumericCriterion >ENUMTYPE</MatchNumericCriterion> <!-- required -->
                                        <Discount >AMTTYPE</Discount> <!-- required -->
                                </DiscountFilter>
                        <!-- OR -->
                                <DiscountRangeFilter> <!-- optional -->
                                        <FromDiscount >AMTTYPE</FromDiscount> <!-- required -->
                                        <ToDiscount >AMTTYPE</ToDiscount> <!-- required -->
                                </DiscountRangeFilter>
                        <!-- END OR -->
                        <!-- BEGIN OR -->
                                <DiscountPercentFilter> <!-- optional -->
                                        <!-- MatchNumericCriterion may have one of the following values: LessThan, LessThanEqual, Equal, GreaterThan, GreaterThanEqual -->
                                        <MatchNumericCriterion >ENUMTYPE</MatchNumericCriterion> <!-- required -->
                                        <DiscountPercent >FLOATTYPE</DiscountPercent> <!-- required -->
                                </DiscountPercentFilter>
                        <!-- OR -->
                                <DiscountPercentRangeFilter> <!-- optional -->
                                        <FromDiscountPercent >FLOATTYPE</FromDiscountPercent> <!-- required -->
                                        <ToDiscountPercent >FLOATTYPE</ToDiscountPercent> <!-- required -->
                                </DiscountPercentRangeFilter>
                        <!-- END OR -->
                        <!-- BEGIN OR -->
                                <FeeFilter> <!-- optional -->
                                        <!-- MatchNumericCriterion may have one of the following values: LessThan, LessThanEqual, Equal, GreaterThan, GreaterThanEqual -->
                                        <MatchNumericCriterion >ENUMTYPE</MatchNumericCriterion> <!-- required -->
                                        <Fee >AMTTYPE</Fee> <!-- required -->
                                </FeeFilter>
                        <!-- OR -->
                                <FeeRangeFilter> <!-- optional -->
                                        <FromFee >AMTTYPE</FromFee> <!-- required -->
                                        <ToFee >AMTTYPE</ToFee> <!-- required -->
                                </FeeRangeFilter>
                        <!-- END OR -->
                        <!-- BEGIN OR -->
                                <FreightFilter> <!-- optional -->
                                        <!-- MatchNumericCriterion may have one of the following values: LessThan, LessThanEqual, Equal, GreaterThan, GreaterThanEqual -->
                                        <MatchNumericCriterion >ENUMTYPE</MatchNumericCriterion> <!-- required -->
                                        <Freight >AMTTYPE</Freight> <!-- required -->
                                </FreightFilter>
                        <!-- OR -->
                                <FreightRangeFilter> <!-- optional -->
                                        <FromFreight >AMTTYPE</FromFreight> <!-- required -->
                                        <ToFreight >AMTTYPE</ToFreight> <!-- required -->
                                </FreightRangeFilter>
                        <!-- END OR -->
                        <!-- HistoryDocStatus may have one of the following values: Regular, Reversed, Reversing -->
                        <HistoryDocStatus >ENUMTYPE</HistoryDocStatus> <!-- optional -->
                        <!-- BEGIN OR -->
                                <InvoiceDateFilter> <!-- optional -->
                                        <!-- MatchNumericCriterion may have one of the following values: LessThan, LessThanEqual, Equal, GreaterThan, GreaterThanEqual -->
                                        <MatchNumericCriterion >ENUMTYPE</MatchNumericCriterion> <!-- required -->
                                        <InvoiceDate >DATETYPE</InvoiceDate> <!-- required -->
                                </InvoiceDateFilter>
                        <!-- OR -->
                                <InvoiceDateRangeFilter> <!-- optional -->
                                        <FromInvoiceDate >DATETYPE</FromInvoiceDate> <!-- required -->
                                        <ToInvoiceDate >DATETYPE</ToInvoiceDate> <!-- required -->
                                </InvoiceDateRangeFilter>
                        <!-- END OR -->
                        <!-- BEGIN OR -->
                                <InvoiceDueDateFilter> <!-- optional -->
                                        <!-- MatchNumericCriterion may have one of the following values: LessThan, LessThanEqual, Equal, GreaterThan, GreaterThanEqual -->
                                        <MatchNumericCriterion >ENUMTYPE</MatchNumericCriterion> <!-- required -->
                                        <InvoiceDueDate >DATETYPE</InvoiceDueDate> <!-- required -->
                                </InvoiceDueDateFilter>
                        <!-- OR -->
                                <InvoiceDueDateRangeFilter> <!-- optional -->
                                        <FromInvoiceDueDate >DATETYPE</FromInvoiceDueDate> <!-- required -->
                                        <ToInvoiceDueDate >DATETYPE</ToInvoiceDueDate> <!-- required -->
                                </InvoiceDueDateRangeFilter>
                        <!-- END OR -->
                        <!-- BEGIN OR -->
                                <InvoiceNumberFilter> <!-- optional -->
                                        <!-- MatchStringCriterion may have one of the following values: Equal, StartsWith, Contains, EndsWith -->
                                        <MatchStringCriterion >ENUMTYPE</MatchStringCriterion> <!-- required -->
                                        <InvoiceNumber >STRTYPE</InvoiceNumber> <!-- required -->
                                </InvoiceNumberFilter>
                        <!-- OR -->
                                <InvoiceNumberRangeFilter> <!-- optional -->
                                        <FromInvoiceNumber >STRTYPE</FromInvoiceNumber> <!-- required -->
                                        <ToInvoiceNumber >STRTYPE</ToInvoiceNumber> <!-- required -->
                                </InvoiceNumberRangeFilter>
                        <!-- END OR -->
                        <!-- BEGIN OR -->
                                <ItemsCountFilter> <!-- optional -->
                                        <!-- MatchNumericCriterion may have one of the following values: LessThan, LessThanEqual, Equal, GreaterThan, GreaterThanEqual -->
                                        <MatchNumericCriterion >ENUMTYPE</MatchNumericCriterion> <!-- required -->
                                        <ItemsCount >INTTYPE</ItemsCount> <!-- required -->
                                </ItemsCountFilter>
                        <!-- OR -->
                                <ItemsCountRangeFilter> <!-- optional -->
                                        <FromItemsCount >INTTYPE</FromItemsCount> <!-- required -->
                                        <ToItemsCount >INTTYPE</ToItemsCount> <!-- required -->
                                </ItemsCountRangeFilter>
                        <!-- END OR -->
                        <!-- BEGIN OR -->
                                <PayeeCodeFilter> <!-- optional -->
                                        <!-- MatchStringCriterion may have one of the following values: Equal, StartsWith, Contains, EndsWith -->
                                        <MatchStringCriterion >ENUMTYPE</MatchStringCriterion> <!-- required -->
                                        <PayeeCode >STRTYPE</PayeeCode> <!-- required -->
                                </PayeeCodeFilter>
                        <!-- OR -->
                                <PayeeCodeRangeFilter> <!-- optional -->
                                        <FromPayeeCode >STRTYPE</FromPayeeCode> <!-- required -->
                                        <ToPayeeCode >STRTYPE</ToPayeeCode> <!-- required -->
                                </PayeeCodeRangeFilter>
                        <!-- END OR -->
                        <PayeeListID >IDTYPE</PayeeListID> <!-- optional -->
                        <!-- BEGIN OR -->
                                <PayeeNameFilter> <!-- optional -->
                                        <!-- MatchStringCriterion may have one of the following values: Equal, StartsWith, Contains, EndsWith -->
                                        <MatchStringCriterion >ENUMTYPE</MatchStringCriterion> <!-- required -->
                                        <PayeeName >STRTYPE</PayeeName> <!-- required -->
                                </PayeeNameFilter>
                        <!-- OR -->
                                <PayeeNameRangeFilter> <!-- optional -->
                                        <FromPayeeName >STRTYPE</FromPayeeName> <!-- required -->
                                        <ToPayeeName >STRTYPE</ToPayeeName> <!-- required -->
                                </PayeeNameRangeFilter>
                        <!-- END OR -->
                        <!-- BEGIN OR -->
                                <PurchaseOrderNumberFilter> <!-- optional -->
                                        <!-- MatchStringCriterion may have one of the following values: Equal, StartsWith, Contains, EndsWith -->
                                        <MatchStringCriterion >ENUMTYPE</MatchStringCriterion> <!-- required -->
                                        <PurchaseOrderNumber >STRTYPE</PurchaseOrderNumber> <!-- required -->
                                </PurchaseOrderNumberFilter>
                        <!-- OR -->
                                <PurchaseOrderNumberRangeFilter> <!-- optional -->
                                        <FromPurchaseOrderNumber >STRTYPE</FromPurchaseOrderNumber> <!-- required -->
                                        <ToPurchaseOrderNumber >STRTYPE</ToPurchaseOrderNumber> <!-- required -->
                                </PurchaseOrderNumberRangeFilter>
                        <!-- END OR -->
                        <PurchaseOrderTxnID >IDTYPE</PurchaseOrderTxnID> <!-- optional -->
                        <!-- QuickBooksFlag may have one of the following values: NotPosted, Completed, Error, UnbilledPurchases -->
                        <QuickBooksFlag >ENUMTYPE</QuickBooksFlag> <!-- optional -->
                        <!-- StoreExchangeStatus may have one of the following values: Modified, Sent, Acknowledged -->
                        <StoreExchangeStatus >ENUMTYPE</StoreExchangeStatus> <!-- optional -->
                        <!-- BEGIN OR -->
                                <StoreNumberFilter> <!-- optional -->
                                        <!-- MatchNumericCriterion may have one of the following values: LessThan, LessThanEqual, Equal, GreaterThan, GreaterThanEqual -->
                                        <MatchNumericCriterion >ENUMTYPE</MatchNumericCriterion> <!-- required -->
                                        <StoreNumber >INTTYPE</StoreNumber> <!-- required -->
                                </StoreNumberFilter>
                        <!-- OR -->
                                <StoreNumberRangeFilter> <!-- optional -->
                                        <FromStoreNumber >INTTYPE</FromStoreNumber> <!-- required -->
                                        <ToStoreNumber >INTTYPE</ToStoreNumber> <!-- required -->
                                </StoreNumberRangeFilter>
                        <!-- END OR -->
                        <!-- BEGIN OR -->
                                <SubtotalFilter> <!-- optional -->
                                        <!-- MatchNumericCriterion may have one of the following values: LessThan, LessThanEqual, Equal, GreaterThan, GreaterThanEqual -->
                                        <MatchNumericCriterion >ENUMTYPE</MatchNumericCriterion> <!-- required -->
                                        <Subtotal >AMTTYPE</Subtotal> <!-- required -->
                                </SubtotalFilter>
                        <!-- OR -->
                                <SubtotalRangeFilter> <!-- optional -->
                                        <FromSubtotal >AMTTYPE</FromSubtotal> <!-- required -->
                                        <ToSubtotal >AMTTYPE</ToSubtotal> <!-- required -->
                                </SubtotalRangeFilter>
                        <!-- END OR -->
                        <!-- BEGIN OR -->
                                <TermsDiscountFilter> <!-- optional -->
                                        <!-- MatchNumericCriterion may have one of the following values: LessThan, LessThanEqual, Equal, GreaterThan, GreaterThanEqual -->
                                        <MatchNumericCriterion >ENUMTYPE</MatchNumericCriterion> <!-- required -->
                                        <TermsDiscount >FLOATTYPE</TermsDiscount> <!-- required -->
                                </TermsDiscountFilter>
                        <!-- OR -->
                                <TermsDiscountRangeFilter> <!-- optional -->
                                        <FromTermsDiscount >FLOATTYPE</FromTermsDiscount> <!-- required -->
                                        <ToTermsDiscount >FLOATTYPE</ToTermsDiscount> <!-- required -->
                                </TermsDiscountRangeFilter>
                        <!-- END OR -->
                        <!-- BEGIN OR -->
                                <TermsDiscountDaysFilter> <!-- optional -->
                                        <!-- MatchNumericCriterion may have one of the following values: LessThan, LessThanEqual, Equal, GreaterThan, GreaterThanEqual -->
                                        <MatchNumericCriterion >ENUMTYPE</MatchNumericCriterion> <!-- required -->
                                        <TermsDiscountDays >INTTYPE</TermsDiscountDays> <!-- required -->
                                </TermsDiscountDaysFilter>
                        <!-- OR -->
                                <TermsDiscountDaysRangeFilter> <!-- optional -->
                                        <FromTermsDiscountDays >INTTYPE</FromTermsDiscountDays> <!-- required -->
                                        <ToTermsDiscountDays >INTTYPE</ToTermsDiscountDays> <!-- required -->
                                </TermsDiscountDaysRangeFilter>
                        <!-- END OR -->
                        <!-- BEGIN OR -->
                                <TermsNetDaysFilter> <!-- optional -->
                                        <!-- MatchNumericCriterion may have one of the following values: LessThan, LessThanEqual, Equal, GreaterThan, GreaterThanEqual -->
                                        <MatchNumericCriterion >ENUMTYPE</MatchNumericCriterion> <!-- required -->
                                        <TermsNetDays >INTTYPE</TermsNetDays> <!-- required -->
                                </TermsNetDaysFilter>
                        <!-- OR -->
                                <TermsNetDaysRangeFilter> <!-- optional -->
                                        <FromTermsNetDays >INTTYPE</FromTermsNetDays> <!-- required -->
                                        <ToTermsNetDays >INTTYPE</ToTermsNetDays> <!-- required -->
                                </TermsNetDaysRangeFilter>
                        <!-- END OR -->
                        <!-- BEGIN OR -->
                                <TotalFilter> <!-- optional -->
                                        <!-- MatchNumericCriterion may have one of the following values: LessThan, LessThanEqual, Equal, GreaterThan, GreaterThanEqual -->
                                        <MatchNumericCriterion >ENUMTYPE</MatchNumericCriterion> <!-- required -->
                                        <Total >AMTTYPE</Total> <!-- required -->
                                </TotalFilter>
                        <!-- OR -->
                                <TotalRangeFilter> <!-- optional -->
                                        <FromTotal >AMTTYPE</FromTotal> <!-- required -->
                                        <ToTotal >AMTTYPE</ToTotal> <!-- required -->
                                </TotalRangeFilter>
                        <!-- END OR -->
                        <!-- BEGIN OR -->
                                <TotalQtyFilter> <!-- optional -->
                                        <!-- MatchNumericCriterion may have one of the following values: LessThan, LessThanEqual, Equal, GreaterThan, GreaterThanEqual -->
                                        <MatchNumericCriterion >ENUMTYPE</MatchNumericCriterion> <!-- required -->
                                        <TotalQty >QUANTYPE</TotalQty> <!-- required -->
                                </TotalQtyFilter>
                        <!-- OR -->
                                <TotalQtyRangeFilter> <!-- optional -->
                                        <FromTotalQty >QUANTYPE</FromTotalQty> <!-- required -->
                                        <ToTotalQty >QUANTYPE</ToTotalQty> <!-- required -->
                                </TotalQtyRangeFilter>
                        <!-- END OR -->
                        <!-- BEGIN OR -->
                                <TxnDateFilter> <!-- optional -->
                                        <!-- MatchNumericCriterion may have one of the following values: LessThan, LessThanEqual, Equal, GreaterThan, GreaterThanEqual -->
                                        <MatchNumericCriterion >ENUMTYPE</MatchNumericCriterion> <!-- required -->
                                        <TxnDate >DATETYPE</TxnDate> <!-- required -->
                                </TxnDateFilter>
                        <!-- OR -->
                                <TxnDateRangeFilter> <!-- optional -->
                                        <FromTxnDate >DATETYPE</FromTxnDate> <!-- required -->
                                        <ToTxnDate >DATETYPE</ToTxnDate> <!-- required -->
                                </TxnDateRangeFilter>
                        <!-- END OR -->
                        <!-- TxnState may have one of the following values: Normal, Held -->
                        <TxnState >ENUMTYPE</TxnState> <!-- optional -->
                        <!-- BEGIN OR -->
                                <VendorCodeFilter> <!-- optional -->
                                        <!-- MatchStringCriterion may have one of the following values: Equal, StartsWith, Contains, EndsWith -->
                                        <MatchStringCriterion >ENUMTYPE</MatchStringCriterion> <!-- required -->
                                        <VendorCode >STRTYPE</VendorCode> <!-- required -->
                                </VendorCodeFilter>
                        <!-- OR -->
                                <VendorCodeRangeFilter> <!-- optional -->
                                        <FromVendorCode >STRTYPE</FromVendorCode> <!-- required -->
                                        <ToVendorCode >STRTYPE</ToVendorCode> <!-- required -->
                                </VendorCodeRangeFilter>
                        <!-- END OR -->
                        <VendorListID >IDTYPE</VendorListID> <!-- optional -->
                        <!-- BEGIN OR -->
                                <VoucherNumberFilter> <!-- optional -->
                                        <!-- MatchNumericCriterion may have one of the following values: LessThan, LessThanEqual, Equal, GreaterThan, GreaterThanEqual -->
                                        <MatchNumericCriterion >ENUMTYPE</MatchNumericCriterion> <!-- required -->
                                        <VoucherNumber >INTTYPE</VoucherNumber> <!-- required -->
                                </VoucherNumberFilter>
                        <!-- OR -->
                                <VoucherNumberRangeFilter> <!-- optional -->
                                        <FromVoucherNumber >INTTYPE</FromVoucherNumber> <!-- required -->
                                        <ToVoucherNumber >INTTYPE</ToVoucherNumber> <!-- required -->
                                </VoucherNumberRangeFilter>
                        <!-- END OR -->
                        <!-- VoucherType may have one of the following values: Receiving, Return -->
                        <VoucherType >ENUMTYPE</VoucherType> <!-- optional -->
                        <!-- BEGIN OR -->
                                <WorkstationFilter> <!-- optional -->
                                        <!-- MatchNumericCriterion may have one of the following values: LessThan, LessThanEqual, Equal, GreaterThan, GreaterThanEqual -->
                                        <MatchNumericCriterion >ENUMTYPE</MatchNumericCriterion> <!-- required -->
                                        <Workstation >INTTYPE</Workstation> <!-- required -->
                                </WorkstationFilter>
                        <!-- OR -->
                                <WorkstationRangeFilter> <!-- optional -->
                                        <FromWorkstation >INTTYPE</FromWorkstation> <!-- required -->
                                        <ToWorkstation >INTTYPE</ToWorkstation> <!-- required -->
                                </WorkstationRangeFilter>
                        <!-- END OR -->
                        <IncludeRetElement >STRTYPE</IncludeRetElement> <!-- optional, may repeat -->
                </VoucherQueryRq>

                <VoucherQueryRs statusCode="INTTYPE" statusSeverity="STRTYPE" statusMessage="STRTYPE" retCount="INTTYPE" iteratorRemainingCount="INTTYPE" iteratorID="UUIDTYPE">
                        <VoucherRet> <!-- optional, may repeat -->
                                <TxnID >IDTYPE</TxnID> <!-- optional -->
                                <TimeCreated >DATETIMETYPE</TimeCreated> <!-- optional -->
                                <TimeModified >DATETIMETYPE</TimeModified> <!-- optional -->
                                <Associate >STRTYPE</Associate> <!-- optional -->
                                <Comments >STRTYPE</Comments> <!-- optional -->
                                <CompanyName >STRTYPE</CompanyName> <!-- optional -->
                                <Discount >AMTTYPE</Discount> <!-- optional -->
                                <DiscountPercent >FLOATTYPE</DiscountPercent> <!-- optional -->
                                <Fee >AMTTYPE</Fee> <!-- optional -->
                                <Freight >AMTTYPE</Freight> <!-- optional -->
                                <!-- HistoryDocStatus may have one of the following values: Regular, Reversed, Reversing -->
                                <HistoryDocStatus >ENUMTYPE</HistoryDocStatus> <!-- optional -->
                                <InvoiceDate >DATETYPE</InvoiceDate> <!-- optional -->
                                <InvoiceDueDate >DATETYPE</InvoiceDueDate> <!-- optional -->
                                <InvoiceNumber >STRTYPE</InvoiceNumber> <!-- optional -->
                                <ItemsCount >INTTYPE</ItemsCount> <!-- optional -->
                                <PayeeCode >STRTYPE</PayeeCode> <!-- optional -->
                                <PayeeListID >IDTYPE</PayeeListID> <!-- optional -->
                                <PayeeName >STRTYPE</PayeeName> <!-- optional -->
                                <PurchaseOrderNumber >STRTYPE</PurchaseOrderNumber> <!-- optional -->
                                <PurchaseOrderTxnID >IDTYPE</PurchaseOrderTxnID> <!-- optional -->
                                <!-- QuickBooksFlag may have one of the following values: NotPosted, Completed, Error, UnbilledPurchases -->
                                <QuickBooksFlag >ENUMTYPE</QuickBooksFlag> <!-- optional -->
                                <!-- StoreExchangeStatus may have one of the following values: Modified, Sent, Acknowledged -->
                                <StoreExchangeStatus >ENUMTYPE</StoreExchangeStatus> <!-- optional -->
                                <StoreNumber >INTTYPE</StoreNumber> <!-- optional -->
                                <Subtotal >AMTTYPE</Subtotal> <!-- optional -->
                                <TermsDiscount >FLOATTYPE</TermsDiscount> <!-- optional -->
                                <TermsDiscountDays >INTTYPE</TermsDiscountDays> <!-- optional -->
                                <TermsNetDays >INTTYPE</TermsNetDays> <!-- optional -->
                                <Total >AMTTYPE</Total> <!-- optional -->
                                <TotalQty >QUANTYPE</TotalQty> <!-- optional -->
                                <TxnDate >DATETYPE</TxnDate> <!-- optional -->
                                <!-- TxnState may have one of the following values: Normal, Held -->
                                <TxnState >ENUMTYPE</TxnState> <!-- optional -->
                                <VendorCode >STRTYPE</VendorCode> <!-- optional -->
                                <VendorListID >IDTYPE</VendorListID> <!-- optional -->
                                <VoucherNumber >INTTYPE</VoucherNumber> <!-- optional -->
                                <!-- VoucherType may have one of the following values: Receiving, Return -->
                                <VoucherType >ENUMTYPE</VoucherType> <!-- optional -->
                                <Workstation >INTTYPE</Workstation> <!-- optional -->
                                <VoucherItemRet> <!-- optional, may repeat -->
                                        <ListID >IDTYPE</ListID> <!-- optional -->
                                        <ALU >STRTYPE</ALU> <!-- optional -->
                                        <Attribute >STRTYPE</Attribute> <!-- optional -->
                                        <Cost >AMTTYPE</Cost> <!-- optional -->
                                        <Desc1 >STRTYPE</Desc1> <!-- optional -->
                                        <Desc2 >STRTYPE</Desc2> <!-- optional -->
                                        <ExtendedCost >AMTTYPE</ExtendedCost> <!-- optional -->
                                        <ItemNumber >INTTYPE</ItemNumber> <!-- optional -->
                                        <NumberOfBaseUnits >QUANTYPE</NumberOfBaseUnits> <!-- optional -->
                                        <OriginalOrderQty >QUANTYPE</OriginalOrderQty> <!-- optional -->
                                        <QtyReceived >QUANTYPE</QtyReceived> <!-- optional -->
                                        <SerialNumber >STRTYPE</SerialNumber> <!-- optional -->
                                        <Size >STRTYPE</Size> <!-- optional -->
                                        <UnitOfMeasure >STRTYPE</UnitOfMeasure> <!-- optional -->
                                        <UPC >STRTYPE</UPC> <!-- optional -->
                                </VoucherItemRet>
                                <DataExtRet> <!-- optional, may repeat -->
                                        <OwnerID >GUIDTYPE</OwnerID> <!-- required -->
                                        <DataExtName >STRTYPE</DataExtName> <!-- required -->
                                        <!-- DataExtType may have one of the following values: INTTYPE, AMTTYPE, PRICETYPE, QUANTYPE, PERCENTTYPE, DATETIMETYPE, STR255TYPE, STR1024TYPE -->
                                        <DataExtType >ENUMTYPE</DataExtType> <!-- required -->
                                        <DataExtValue >STRTYPE</DataExtValue> <!-- required -->
                                </DataExtRet>
                        </VoucherRet>
                </VoucherQueryRs>
        </QBPOSXMLMsgsRq>
</QBPOSXML>

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
'The following sample code is generated as an illustration of
'Creating requests and parsing responses ONLY
'This code is NOT intended to show best practices or ideal code
'Use at your most careful discretion

imports System
imports System.Net
imports System.Drawing
imports System.Collections
imports System.ComponentModel
imports System.Windows.Forms
imports System.Data
imports System.IO
imports Interop.qbposfc4

        Public Class SampleVoucherQuery
                Public Sub  DoVoucherQuery()
                        Dim sessionBegun as Boolean
                        sessionBegun = False
                        Dim connectionOpen as Boolean
                        connectionOpen = False
                        Dim sessionManager as QBPOSSessionManager
                        sessionManager = nothing

                        Try
                                'Create the session Manager object
                                sessionManager = new QBPOSSessionManager

                                'Create the message set request object to hold our request
                                Dim requestMsgSet as IMsgSetRequest
                                requestMsgSet = sessionManager.CreateMsgSetRequest(4,0)
                                requestMsgSet.Attributes.OnError = ENRqOnError.roeContinue

                                BuildVoucherQueryRq(requestMsgSet)

                                'Connect to QuickBooks and begin a session
                                sessionManager.OpenConnection("","Sample Code from OSR")
                                connectionOpen = True
                                sessionManager.BeginSession("")
                                sessionBegun = True

                                'Send the request and get the response from QuickBooks
                                Dim responseMsgSet as IMsgSetResponse
                                responseMsgSet = sessionManager.DoRequests(requestMsgSet)

                                'End the session and close the connection to QuickBooks
                                sessionManager.EndSession()
                                sessionBegun = False
                                sessionManager.CloseConnection()
                                connectionOpen = False

                                WalkVoucherQueryRs(responseMsgSet)
                        Catch e as Exception
                                MessageBox.Show(e.Message, "Error")
                                if (sessionBegun) then
                                        sessionManager.EndSession()
                                End If
                                if (connectionOpen) then
                                        sessionManager.CloseConnection()
                                End If
                        End Try
                End Sub
                Public Sub BuildVoucherQueryRq(requestMsgSet as IMsgSetRequest)
                        Dim VoucherQueryRq as IVoucherQuery
                        VoucherQueryRq= requestMsgSet.AppendVoucherQueryRq()
                        'Set field value for MaxReturned
                        VoucherQueryRq.MaxReturned.SetValue(6)
                        'Set field value for OwnerIDList
                        'May create more than one of these if needed
                        VoucherQueryRq.OwnerIDList.Add(System.Guid.NewGuid().ToString())
                        'Set field value for TxnID
                        VoucherQueryRq.TxnID.SetValue("200000-1011023419")
                        Dim ORTimeCreatedFiltersElementType4851 as String
                        ORTimeCreatedFiltersElementType4851 = "TimeCreatedFilter"
                        if (ORTimeCreatedFiltersElementType4851 = "TimeCreatedFilter") then
                                'Set field value for MatchNumericCriterion
                                VoucherQueryRq.ORTimeCreatedFilters.TimeCreatedFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan)
                                'Set field value for TimeCreated
                                VoucherQueryRq.ORTimeCreatedFilters.TimeCreatedFilter.TimeCreated.SetValue(DateTime.Parse("12/15/2007 12:15:12"),false)
                        End If
                        if (ORTimeCreatedFiltersElementType4851 = "TimeCreatedRangeFilter") then
                                'Set field value for FromTimeCreated
                                VoucherQueryRq.ORTimeCreatedFilters.TimeCreatedRangeFilter.FromTimeCreated.SetValue(DateTime.Parse("12/15/2007 12:15:12"),false)
                                'Set field value for ToTimeCreated
                                VoucherQueryRq.ORTimeCreatedFilters.TimeCreatedRangeFilter.ToTimeCreated.SetValue(DateTime.Parse("12/15/2007 12:15:12"),false)
                        End If
                        Dim ORTimeModifiedFiltersElementType4852 as String
                        ORTimeModifiedFiltersElementType4852 = "TimeModifiedFilter"
                        if (ORTimeModifiedFiltersElementType4852 = "TimeModifiedFilter") then
                                'Set field value for MatchNumericCriterion
                                VoucherQueryRq.ORTimeModifiedFilters.TimeModifiedFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan)
                                'Set field value for TimeModified
                                VoucherQueryRq.ORTimeModifiedFilters.TimeModifiedFilter.TimeModified.SetValue(DateTime.Parse("12/15/2007 12:15:12"),false)
                        End If
                        if (ORTimeModifiedFiltersElementType4852 = "TimeModifiedRangeFilter") then
                                'Set field value for FromTimeModified
                                VoucherQueryRq.ORTimeModifiedFilters.TimeModifiedRangeFilter.FromTimeModified.SetValue(DateTime.Parse("12/15/2007 12:15:12"),false)
                                'Set field value for ToTimeModified
                                VoucherQueryRq.ORTimeModifiedFilters.TimeModifiedRangeFilter.ToTimeModified.SetValue(DateTime.Parse("12/15/2007 12:15:12"),false)
                        End If
                        Dim ORAssociateFiltersElementType4853 as String
                        ORAssociateFiltersElementType4853 = "AssociateFilter"
                        if (ORAssociateFiltersElementType4853 = "AssociateFilter") then
                                'Set field value for MatchStringCriterion
                                VoucherQueryRq.ORAssociateFilters.AssociateFilter.MatchStringCriterion.SetValue(ENMatchStringCriterion.mscEqual)
                                'Set field value for Associate
                                VoucherQueryRq.ORAssociateFilters.AssociateFilter.Associate.SetValue("ab")
                        End If
                        if (ORAssociateFiltersElementType4853 = "AssociateRangeFilter") then
                                'Set field value for FromAssociate
                                VoucherQueryRq.ORAssociateFilters.AssociateRangeFilter.FromAssociate.SetValue("ab")
                                'Set field value for ToAssociate
                                VoucherQueryRq.ORAssociateFilters.AssociateRangeFilter.ToAssociate.SetValue("ab")
                        End If
                        Dim ORCommentsFiltersElementType4854 as String
                        ORCommentsFiltersElementType4854 = "CommentsFilter"
                        if (ORCommentsFiltersElementType4854 = "CommentsFilter") then
                                'Set field value for MatchStringCriterion
                                VoucherQueryRq.ORCommentsFilters.CommentsFilter.MatchStringCriterion.SetValue(ENMatchStringCriterion.mscEqual)
                                'Set field value for Comments
                                VoucherQueryRq.ORCommentsFilters.CommentsFilter.Comments.SetValue("ab")
                        End If
                        if (ORCommentsFiltersElementType4854 = "CommentsRangeFilter") then
                                'Set field value for FromComments
                                VoucherQueryRq.ORCommentsFilters.CommentsRangeFilter.FromComments.SetValue("ab")
                                'Set field value for ToComments
                                VoucherQueryRq.ORCommentsFilters.CommentsRangeFilter.ToComments.SetValue("ab")
                        End If
                        Dim ORCompanyNameFiltersElementType4855 as String
                        ORCompanyNameFiltersElementType4855 = "CompanyNameFilter"
                        if (ORCompanyNameFiltersElementType4855 = "CompanyNameFilter") then
                                'Set field value for MatchStringCriterion
                                VoucherQueryRq.ORCompanyNameFilters.CompanyNameFilter.MatchStringCriterion.SetValue(ENMatchStringCriterion.mscEqual)
                                'Set field value for CompanyName
                                VoucherQueryRq.ORCompanyNameFilters.CompanyNameFilter.CompanyName.SetValue("ab")
                        End If
                        if (ORCompanyNameFiltersElementType4855 = "CompanyNameRangeFilter") then
                                'Set field value for FromCompanyName
                                VoucherQueryRq.ORCompanyNameFilters.CompanyNameRangeFilter.FromCompanyName.SetValue("ab")
                                'Set field value for ToCompanyName
                                VoucherQueryRq.ORCompanyNameFilters.CompanyNameRangeFilter.ToCompanyName.SetValue("ab")
                        End If
                        Dim ORDiscountFiltersElementType4856 as String
                        ORDiscountFiltersElementType4856 = "DiscountFilter"
                        if (ORDiscountFiltersElementType4856 = "DiscountFilter") then
                                'Set field value for MatchNumericCriterion
                                VoucherQueryRq.ORDiscountFilters.DiscountFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan)
                                'Set field value for Discount
                                VoucherQueryRq.ORDiscountFilters.DiscountFilter.Discount.SetValue(10.01)
                        End If
                        if (ORDiscountFiltersElementType4856 = "DiscountRangeFilter") then
                                'Set field value for FromDiscount
                                VoucherQueryRq.ORDiscountFilters.DiscountRangeFilter.FromDiscount.SetValue(10.01)
                                'Set field value for ToDiscount
                                VoucherQueryRq.ORDiscountFilters.DiscountRangeFilter.ToDiscount.SetValue(10.01)
                        End If
                        Dim ORDiscountPercentFiltersElementType4857 as String
                        ORDiscountPercentFiltersElementType4857 = "DiscountPercentFilter"
                        if (ORDiscountPercentFiltersElementType4857 = "DiscountPercentFilter") then
                                'Set field value for MatchNumericCriterion
                                VoucherQueryRq.ORDiscountPercentFilters.DiscountPercentFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan)
                                'Set field value for DiscountPercent
                                VoucherQueryRq.ORDiscountPercentFilters.DiscountPercentFilter.DiscountPercent.SetValue(12.34)
                        End If
                        if (ORDiscountPercentFiltersElementType4857 = "DiscountPercentRangeFilter") then
                                'Set field value for FromDiscountPercent
                                VoucherQueryRq.ORDiscountPercentFilters.DiscountPercentRangeFilter.FromDiscountPercent.SetValue(12.34)
                                'Set field value for ToDiscountPercent
                                VoucherQueryRq.ORDiscountPercentFilters.DiscountPercentRangeFilter.ToDiscountPercent.SetValue(12.34)
                        End If
                        Dim ORFeeFiltersElementType4858 as String
                        ORFeeFiltersElementType4858 = "FeeFilter"
                        if (ORFeeFiltersElementType4858 = "FeeFilter") then
                                'Set field value for MatchNumericCriterion
                                VoucherQueryRq.ORFeeFilters.FeeFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan)
                                'Set field value for Fee
                                VoucherQueryRq.ORFeeFilters.FeeFilter.Fee.SetValue(10.01)
                        End If
                        if (ORFeeFiltersElementType4858 = "FeeRangeFilter") then
                                'Set field value for FromFee
                                VoucherQueryRq.ORFeeFilters.FeeRangeFilter.FromFee.SetValue(10.01)
                                'Set field value for ToFee
                                VoucherQueryRq.ORFeeFilters.FeeRangeFilter.ToFee.SetValue(10.01)
                        End If
                        Dim ORFreightFiltersElementType4859 as String
                        ORFreightFiltersElementType4859 = "FreightFilter"
                        if (ORFreightFiltersElementType4859 = "FreightFilter") then
                                'Set field value for MatchNumericCriterion
                                VoucherQueryRq.ORFreightFilters.FreightFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan)
                                'Set field value for Freight
                                VoucherQueryRq.ORFreightFilters.FreightFilter.Freight.SetValue(10.01)
                        End If
                        if (ORFreightFiltersElementType4859 = "FreightRangeFilter") then
                                'Set field value for FromFreight
                                VoucherQueryRq.ORFreightFilters.FreightRangeFilter.FromFreight.SetValue(10.01)
                                'Set field value for ToFreight
                                VoucherQueryRq.ORFreightFilters.FreightRangeFilter.ToFreight.SetValue(10.01)
                        End If
                        'Set field value for HistoryDocStatus
                        VoucherQueryRq.HistoryDocStatus.SetValue(ENHistoryDocStatus.hdsRegular)
                        Dim ORInvoiceDateFiltersElementType4860 as String
                        ORInvoiceDateFiltersElementType4860 = "InvoiceDateFilter"
                        if (ORInvoiceDateFiltersElementType4860 = "InvoiceDateFilter") then
                                'Set field value for MatchNumericCriterion
                                VoucherQueryRq.ORInvoiceDateFilters.InvoiceDateFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan)
                                'Set field value for InvoiceDate
                                VoucherQueryRq.ORInvoiceDateFilters.InvoiceDateFilter.InvoiceDate.SetValue(DateTime.Parse("12/15/2007"))
                        End If
                        if (ORInvoiceDateFiltersElementType4860 = "InvoiceDateRangeFilter") then
                                'Set field value for FromInvoiceDate
                                VoucherQueryRq.ORInvoiceDateFilters.InvoiceDateRangeFilter.FromInvoiceDate.SetValue(DateTime.Parse("12/15/2007"))
                                'Set field value for ToInvoiceDate
                                VoucherQueryRq.ORInvoiceDateFilters.InvoiceDateRangeFilter.ToInvoiceDate.SetValue(DateTime.Parse("12/15/2007"))
                        End If
                        Dim ORInvoiceDueDateFiltersElementType4861 as String
                        ORInvoiceDueDateFiltersElementType4861 = "InvoiceDueDateFilter"
                        if (ORInvoiceDueDateFiltersElementType4861 = "InvoiceDueDateFilter") then
                                'Set field value for MatchNumericCriterion
                                VoucherQueryRq.ORInvoiceDueDateFilters.InvoiceDueDateFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan)
                                'Set field value for InvoiceDueDate
                                VoucherQueryRq.ORInvoiceDueDateFilters.InvoiceDueDateFilter.InvoiceDueDate.SetValue(DateTime.Parse("12/15/2007"))
                        End If
                        if (ORInvoiceDueDateFiltersElementType4861 = "InvoiceDueDateRangeFilter") then
                                'Set field value for FromInvoiceDueDate
                                VoucherQueryRq.ORInvoiceDueDateFilters.InvoiceDueDateRangeFilter.FromInvoiceDueDate.SetValue(DateTime.Parse("12/15/2007"))
                                'Set field value for ToInvoiceDueDate
                                VoucherQueryRq.ORInvoiceDueDateFilters.InvoiceDueDateRangeFilter.ToInvoiceDueDate.SetValue(DateTime.Parse("12/15/2007"))
                        End If
                        Dim ORInvoiceNumberFiltersElementType4862 as String
                        ORInvoiceNumberFiltersElementType4862 = "InvoiceNumberFilter"
                        if (ORInvoiceNumberFiltersElementType4862 = "InvoiceNumberFilter") then
                                'Set field value for MatchStringCriterion
                                VoucherQueryRq.ORInvoiceNumberFilters.InvoiceNumberFilter.MatchStringCriterion.SetValue(ENMatchStringCriterion.mscEqual)
                                'Set field value for InvoiceNumber
                                VoucherQueryRq.ORInvoiceNumberFilters.InvoiceNumberFilter.InvoiceNumber.SetValue("ab")
                        End If
                        if (ORInvoiceNumberFiltersElementType4862 = "InvoiceNumberRangeFilter") then
                                'Set field value for FromInvoiceNumber
                                VoucherQueryRq.ORInvoiceNumberFilters.InvoiceNumberRangeFilter.FromInvoiceNumber.SetValue("ab")
                                'Set field value for ToInvoiceNumber
                                VoucherQueryRq.ORInvoiceNumberFilters.InvoiceNumberRangeFilter.ToInvoiceNumber.SetValue("ab")
                        End If
                        Dim ORItemsCountFiltersElementType4863 as String
                        ORItemsCountFiltersElementType4863 = "ItemsCountFilter"
                        if (ORItemsCountFiltersElementType4863 = "ItemsCountFilter") then
                                'Set field value for MatchNumericCriterion
                                VoucherQueryRq.ORItemsCountFilters.ItemsCountFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan)
                                'Set field value for ItemsCount
                                VoucherQueryRq.ORItemsCountFilters.ItemsCountFilter.ItemsCount.SetValue(6)
                        End If
                        if (ORItemsCountFiltersElementType4863 = "ItemsCountRangeFilter") then
                                'Set field value for FromItemsCount
                                VoucherQueryRq.ORItemsCountFilters.ItemsCountRangeFilter.FromItemsCount.SetValue(6)
                                'Set field value for ToItemsCount
                                VoucherQueryRq.ORItemsCountFilters.ItemsCountRangeFilter.ToItemsCount.SetValue(6)
                        End If
                        Dim ORPayeeCodeFiltersElementType4864 as String
                        ORPayeeCodeFiltersElementType4864 = "PayeeCodeFilter"
                        if (ORPayeeCodeFiltersElementType4864 = "PayeeCodeFilter") then
                                'Set field value for MatchStringCriterion
                                VoucherQueryRq.ORPayeeCodeFilters.PayeeCodeFilter.MatchStringCriterion.SetValue(ENMatchStringCriterion.mscEqual)
                                'Set field value for PayeeCode
                                VoucherQueryRq.ORPayeeCodeFilters.PayeeCodeFilter.PayeeCode.SetValue("ab")
                        End If
                        if (ORPayeeCodeFiltersElementType4864 = "PayeeCodeRangeFilter") then
                                'Set field value for FromPayeeCode
                                VoucherQueryRq.ORPayeeCodeFilters.PayeeCodeRangeFilter.FromPayeeCode.SetValue("ab")
                                'Set field value for ToPayeeCode
                                VoucherQueryRq.ORPayeeCodeFilters.PayeeCodeRangeFilter.ToPayeeCode.SetValue("ab")
                        End If
                        'Set field value for PayeeListID
                        VoucherQueryRq.PayeeListID.SetValue("200000-1011023419")
                        Dim ORPayeeNameFiltersElementType4865 as String
                        ORPayeeNameFiltersElementType4865 = "PayeeNameFilter"
                        if (ORPayeeNameFiltersElementType4865 = "PayeeNameFilter") then
                                'Set field value for MatchStringCriterion
                                VoucherQueryRq.ORPayeeNameFilters.PayeeNameFilter.MatchStringCriterion.SetValue(ENMatchStringCriterion.mscEqual)
                                'Set field value for PayeeName
                                VoucherQueryRq.ORPayeeNameFilters.PayeeNameFilter.PayeeName.SetValue("ab")
                        End If
                        if (ORPayeeNameFiltersElementType4865 = "PayeeNameRangeFilter") then
                                'Set field value for FromPayeeName
                                VoucherQueryRq.ORPayeeNameFilters.PayeeNameRangeFilter.FromPayeeName.SetValue("ab")
                                'Set field value for ToPayeeName
                                VoucherQueryRq.ORPayeeNameFilters.PayeeNameRangeFilter.ToPayeeName.SetValue("ab")
                        End If
                        Dim ORPurchaseOrderNumberFiltersElementType4866 as String
                        ORPurchaseOrderNumberFiltersElementType4866 = "PurchaseOrderNumberFilter"
                        if (ORPurchaseOrderNumberFiltersElementType4866 = "PurchaseOrderNumberFilter") then
                                'Set field value for MatchStringCriterion
                                VoucherQueryRq.ORPurchaseOrderNumberFilters.PurchaseOrderNumberFilter.MatchStringCriterion.SetValue(ENMatchStringCriterion.mscEqual)
                                'Set field value for PurchaseOrderNumber
                                VoucherQueryRq.ORPurchaseOrderNumberFilters.PurchaseOrderNumberFilter.PurchaseOrderNumber.SetValue("ab")
                        End If
                        if (ORPurchaseOrderNumberFiltersElementType4866 = "PurchaseOrderNumberRangeFilter") then
                                'Set field value for FromPurchaseOrderNumber
                                VoucherQueryRq.ORPurchaseOrderNumberFilters.PurchaseOrderNumberRangeFilter.FromPurchaseOrderNumber.SetValue("ab")
                                'Set field value for ToPurchaseOrderNumber
                                VoucherQueryRq.ORPurchaseOrderNumberFilters.PurchaseOrderNumberRangeFilter.ToPurchaseOrderNumber.SetValue("ab")
                        End If
                        'Set field value for PurchaseOrderTxnID
                        VoucherQueryRq.PurchaseOrderTxnID.SetValue("200000-1011023419")
                        'Set field value for QuickBooksFlag
                        VoucherQueryRq.QuickBooksFlag.SetValue(ENQuickBooksFlag.qbfNotPosted)
                        'Set field value for StoreExchangeStatus
                        VoucherQueryRq.StoreExchangeStatus.SetValue(ENStoreExchangeStatus.sesModified)
                        Dim ORStoreNumberFiltersElementType4867 as String
                        ORStoreNumberFiltersElementType4867 = "StoreNumberFilter"
                        if (ORStoreNumberFiltersElementType4867 = "StoreNumberFilter") then
                                'Set field value for MatchNumericCriterion
                                VoucherQueryRq.ORStoreNumberFilters.StoreNumberFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan)
                                'Set field value for StoreNumber
                                VoucherQueryRq.ORStoreNumberFilters.StoreNumberFilter.StoreNumber.SetValue(6)
                        End If
                        if (ORStoreNumberFiltersElementType4867 = "StoreNumberRangeFilter") then
                                'Set field value for FromStoreNumber
                                VoucherQueryRq.ORStoreNumberFilters.StoreNumberRangeFilter.FromStoreNumber.SetValue(6)
                                'Set field value for ToStoreNumber
                                VoucherQueryRq.ORStoreNumberFilters.StoreNumberRangeFilter.ToStoreNumber.SetValue(6)
                        End If
                        Dim ORSubtotalFiltersElementType4868 as String
                        ORSubtotalFiltersElementType4868 = "SubtotalFilter"
                        if (ORSubtotalFiltersElementType4868 = "SubtotalFilter") then
                                'Set field value for MatchNumericCriterion
                                VoucherQueryRq.ORSubtotalFilters.SubtotalFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan)
                                'Set field value for Subtotal
                                VoucherQueryRq.ORSubtotalFilters.SubtotalFilter.Subtotal.SetValue(10.01)
                        End If
                        if (ORSubtotalFiltersElementType4868 = "SubtotalRangeFilter") then
                                'Set field value for FromSubtotal
                                VoucherQueryRq.ORSubtotalFilters.SubtotalRangeFilter.FromSubtotal.SetValue(10.01)
                                'Set field value for ToSubtotal
                                VoucherQueryRq.ORSubtotalFilters.SubtotalRangeFilter.ToSubtotal.SetValue(10.01)
                        End If
                        Dim ORTermsDiscountFiltersElementType4869 as String
                        ORTermsDiscountFiltersElementType4869 = "TermsDiscountFilter"
                        if (ORTermsDiscountFiltersElementType4869 = "TermsDiscountFilter") then
                                'Set field value for MatchNumericCriterion
                                VoucherQueryRq.ORTermsDiscountFilters.TermsDiscountFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan)
                                'Set field value for TermsDiscount
                                VoucherQueryRq.ORTermsDiscountFilters.TermsDiscountFilter.TermsDiscount.SetValue(12.34)
                        End If
                        if (ORTermsDiscountFiltersElementType4869 = "TermsDiscountRangeFilter") then
                                'Set field value for FromTermsDiscount
                                VoucherQueryRq.ORTermsDiscountFilters.TermsDiscountRangeFilter.FromTermsDiscount.SetValue(12.34)
                                'Set field value for ToTermsDiscount
                                VoucherQueryRq.ORTermsDiscountFilters.TermsDiscountRangeFilter.ToTermsDiscount.SetValue(12.34)
                        End If
                        Dim ORTermsDiscountDaysFiltersElementType4870 as String
                        ORTermsDiscountDaysFiltersElementType4870 = "TermsDiscountDaysFilter"
                        if (ORTermsDiscountDaysFiltersElementType4870 = "TermsDiscountDaysFilter") then
                                'Set field value for MatchNumericCriterion
                                VoucherQueryRq.ORTermsDiscountDaysFilters.TermsDiscountDaysFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan)
                                'Set field value for TermsDiscountDays
                                VoucherQueryRq.ORTermsDiscountDaysFilters.TermsDiscountDaysFilter.TermsDiscountDays.SetValue(6)
                        End If
                        if (ORTermsDiscountDaysFiltersElementType4870 = "TermsDiscountDaysRangeFilter") then
                                'Set field value for FromTermsDiscountDays
                                VoucherQueryRq.ORTermsDiscountDaysFilters.TermsDiscountDaysRangeFilter.FromTermsDiscountDays.SetValue(6)
                                'Set field value for ToTermsDiscountDays
                                VoucherQueryRq.ORTermsDiscountDaysFilters.TermsDiscountDaysRangeFilter.ToTermsDiscountDays.SetValue(6)
                        End If
                        Dim ORTermsNetDaysFiltersElementType4871 as String
                        ORTermsNetDaysFiltersElementType4871 = "TermsNetDaysFilter"
                        if (ORTermsNetDaysFiltersElementType4871 = "TermsNetDaysFilter") then
                                'Set field value for MatchNumericCriterion
                                VoucherQueryRq.ORTermsNetDaysFilters.TermsNetDaysFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan)
                                'Set field value for TermsNetDays
                                VoucherQueryRq.ORTermsNetDaysFilters.TermsNetDaysFilter.TermsNetDays.SetValue(6)
                        End If
                        if (ORTermsNetDaysFiltersElementType4871 = "TermsNetDaysRangeFilter") then
                                'Set field value for FromTermsNetDays
                                VoucherQueryRq.ORTermsNetDaysFilters.TermsNetDaysRangeFilter.FromTermsNetDays.SetValue(6)
                                'Set field value for ToTermsNetDays
                                VoucherQueryRq.ORTermsNetDaysFilters.TermsNetDaysRangeFilter.ToTermsNetDays.SetValue(6)
                        End If
                        Dim ORTotalFiltersElementType4872 as String
                        ORTotalFiltersElementType4872 = "TotalFilter"
                        if (ORTotalFiltersElementType4872 = "TotalFilter") then
                                'Set field value for MatchNumericCriterion
                                VoucherQueryRq.ORTotalFilters.TotalFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan)
                                'Set field value for Total
                                VoucherQueryRq.ORTotalFilters.TotalFilter.Total.SetValue(10.01)
                        End If
                        if (ORTotalFiltersElementType4872 = "TotalRangeFilter") then
                                'Set field value for FromTotal
                                VoucherQueryRq.ORTotalFilters.TotalRangeFilter.FromTotal.SetValue(10.01)
                                'Set field value for ToTotal
                                VoucherQueryRq.ORTotalFilters.TotalRangeFilter.ToTotal.SetValue(10.01)
                        End If
                        Dim ORTotalQtyFiltersElementType4873 as String
                        ORTotalQtyFiltersElementType4873 = "TotalQtyFilter"
                        if (ORTotalQtyFiltersElementType4873 = "TotalQtyFilter") then
                                'Set field value for MatchNumericCriterion
                                VoucherQueryRq.ORTotalQtyFilters.TotalQtyFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan)
                                'Set field value for TotalQty
                                VoucherQueryRq.ORTotalQtyFilters.TotalQtyFilter.TotalQty.SetValue(2)
                        End If
                        if (ORTotalQtyFiltersElementType4873 = "TotalQtyRangeFilter") then
                                'Set field value for FromTotalQty
                                VoucherQueryRq.ORTotalQtyFilters.TotalQtyRangeFilter.FromTotalQty.SetValue(2)
                                'Set field value for ToTotalQty
                                VoucherQueryRq.ORTotalQtyFilters.TotalQtyRangeFilter.ToTotalQty.SetValue(2)
                        End If
                        Dim ORTxnDateFiltersElementType4874 as String
                        ORTxnDateFiltersElementType4874 = "TxnDateFilter"
                        if (ORTxnDateFiltersElementType4874 = "TxnDateFilter") then
                                'Set field value for MatchNumericCriterion
                                VoucherQueryRq.ORTxnDateFilters.TxnDateFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan)
                                'Set field value for TxnDate
                                VoucherQueryRq.ORTxnDateFilters.TxnDateFilter.TxnDate.SetValue(DateTime.Parse("12/15/2007"))
                        End If
                        if (ORTxnDateFiltersElementType4874 = "TxnDateRangeFilter") then
                                'Set field value for FromTxnDate
                                VoucherQueryRq.ORTxnDateFilters.TxnDateRangeFilter.FromTxnDate.SetValue(DateTime.Parse("12/15/2007"))
                                'Set field value for ToTxnDate
                                VoucherQueryRq.ORTxnDateFilters.TxnDateRangeFilter.ToTxnDate.SetValue(DateTime.Parse("12/15/2007"))
                        End If
                        'Set field value for TxnState
                        VoucherQueryRq.TxnState.SetValue(ENTxnState.tsNormal)
                        Dim ORVendorCodeFiltersElementType4875 as String
                        ORVendorCodeFiltersElementType4875 = "VendorCodeFilter"
                        if (ORVendorCodeFiltersElementType4875 = "VendorCodeFilter") then
                                'Set field value for MatchStringCriterion
                                VoucherQueryRq.ORVendorCodeFilters.VendorCodeFilter.MatchStringCriterion.SetValue(ENMatchStringCriterion.mscEqual)
                                'Set field value for VendorCode
                                VoucherQueryRq.ORVendorCodeFilters.VendorCodeFilter.VendorCode.SetValue("ab")
                        End If
                        if (ORVendorCodeFiltersElementType4875 = "VendorCodeRangeFilter") then
                                'Set field value for FromVendorCode
                                VoucherQueryRq.ORVendorCodeFilters.VendorCodeRangeFilter.FromVendorCode.SetValue("ab")
                                'Set field value for ToVendorCode
                                VoucherQueryRq.ORVendorCodeFilters.VendorCodeRangeFilter.ToVendorCode.SetValue("ab")
                        End If
                        'Set field value for VendorListID
                        VoucherQueryRq.VendorListID.SetValue("200000-1011023419")
                        Dim ORVoucherNumberFiltersElementType4876 as String
                        ORVoucherNumberFiltersElementType4876 = "VoucherNumberFilter"
                        if (ORVoucherNumberFiltersElementType4876 = "VoucherNumberFilter") then
                                'Set field value for MatchNumericCriterion
                                VoucherQueryRq.ORVoucherNumberFilters.VoucherNumberFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan)
                                'Set field value for VoucherNumber
                                VoucherQueryRq.ORVoucherNumberFilters.VoucherNumberFilter.VoucherNumber.SetValue(6)
                        End If
                        if (ORVoucherNumberFiltersElementType4876 = "VoucherNumberRangeFilter") then
                                'Set field value for FromVoucherNumber
                                VoucherQueryRq.ORVoucherNumberFilters.VoucherNumberRangeFilter.FromVoucherNumber.SetValue(6)
                                'Set field value for ToVoucherNumber
                                VoucherQueryRq.ORVoucherNumberFilters.VoucherNumberRangeFilter.ToVoucherNumber.SetValue(6)
                        End If
                        'Set field value for VoucherType
                        VoucherQueryRq.VoucherType.SetValue(ENVoucherType.vtReceiving)
                        Dim ORWorkstationFiltersElementType4877 as String
                        ORWorkstationFiltersElementType4877 = "WorkstationFilter"
                        if (ORWorkstationFiltersElementType4877 = "WorkstationFilter") then
                                'Set field value for MatchNumericCriterion
                                VoucherQueryRq.ORWorkstationFilters.WorkstationFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan)
                                'Set field value for Workstation
                                VoucherQueryRq.ORWorkstationFilters.WorkstationFilter.Workstation.SetValue(6)
                        End If
                        if (ORWorkstationFiltersElementType4877 = "WorkstationRangeFilter") then
                                'Set field value for FromWorkstation
                                VoucherQueryRq.ORWorkstationFilters.WorkstationRangeFilter.FromWorkstation.SetValue(6)
                                'Set field value for ToWorkstation
                                VoucherQueryRq.ORWorkstationFilters.WorkstationRangeFilter.ToWorkstation.SetValue(6)
                        End If
                        'Set field value for IncludeRetElementList
                        'May create more than one of these if needed
                        VoucherQueryRq.IncludeRetElementList.Add("ab")
                End Sub




                Public Sub WalkVoucherQueryRs( responseMsgSet as IMsgSetResponse)
                        if (responseMsgSet is nothing) then
                                Exit Sub
                        End If

                        Dim responseList as IResponseList
                        responseList = responseMsgSet.ResponseList
                        if (responseList is nothing) then
                                Exit Sub
                        End If

                        'if we sent only one request, there is only one response, we'll walk the list for this sample
                        for j=0 to responseList.Count-1
                                Dim response as IResponse
                                response = responseList.GetAt(j)
                                'check the status code of the response, 0=ok, >0 is warning
                                if (response.StatusCode >= 0) then
                                        'the request-specific response is in the details, make sure we have some
                                        if (not response.Detail is nothing) then
                                                'make sure the response is the type we're expecting
                                                Dim responseType as ENResponseType
                                                responseType = CType(response.Type.GetValue(),ENResponseType)
                                                if (responseType = ENResponseType.rtVoucherQueryRs) then
                                                        'upcast to more specific type here, this is safe because we checked with response.Type check above
                                                        Dim VoucherRet as IVoucherRetList
                                                        VoucherRet = CType(response.Detail,IVoucherRetList)
                                                        for z=0 to VoucherRet.Count-1
                                                                WalkVoucherRet(VoucherRet.GetAt(z))
                                                        Next z
                                                End If
                                        End If
                                End If
                        Next j
                End Sub




                Public Sub WalkVoucherRet(VoucherRet as IVoucherRet)
                        if (VoucherRet is nothing) then
                                Exit Sub
                        End If

                        'Go through all the elements of IVoucherRetList
                        'Get value of TxnID
                        if ( not VoucherRet.TxnID is nothing) then
                                Dim TxnID4878 as String
                                TxnID4878 = VoucherRet.TxnID.GetValue()
                        End If
                        'Get value of TimeCreated
                        if ( not VoucherRet.TimeCreated is nothing) then
                                Dim TimeCreated4879 as DateTime
                                TimeCreated4879 = VoucherRet.TimeCreated.GetValue()
                        End If
                        'Get value of TimeModified
                        if ( not VoucherRet.TimeModified is nothing) then
                                Dim TimeModified4880 as DateTime
                                TimeModified4880 = VoucherRet.TimeModified.GetValue()
                        End If
                        'Get value of Associate
                        if ( not VoucherRet.Associate is nothing) then
                                Dim Associate4881 as String
                                Associate4881 = VoucherRet.Associate.GetValue()
                        End If
                        'Get value of Comments
                        if ( not VoucherRet.Comments is nothing) then
                                Dim Comments4882 as String
                                Comments4882 = VoucherRet.Comments.GetValue()
                        End If
                        'Get value of CompanyName
                        if ( not VoucherRet.CompanyName is nothing) then
                                Dim CompanyName4883 as String
                                CompanyName4883 = VoucherRet.CompanyName.GetValue()
                        End If
                        'Get value of Discount
                        if ( not VoucherRet.Discount is nothing) then
                                Dim Discount4884 as Double
                                Discount4884 = VoucherRet.Discount.GetValue()
                        End If
                        'Get value of DiscountPercent
                        if ( not VoucherRet.DiscountPercent is nothing) then
                                Dim DiscountPercent4885 as Single
                                DiscountPercent4885 = VoucherRet.DiscountPercent.GetValue()
                        End If
                        'Get value of Fee
                        if ( not VoucherRet.Fee is nothing) then
                                Dim Fee4886 as Double
                                Fee4886 = VoucherRet.Fee.GetValue()
                        End If
                        'Get value of Freight
                        if ( not VoucherRet.Freight is nothing) then
                                Dim Freight4887 as Double
                                Freight4887 = VoucherRet.Freight.GetValue()
                        End If
                        'Get value of HistoryDocStatus
                        if ( not VoucherRet.HistoryDocStatus is nothing) then
                                Dim HistoryDocStatus4888 as ENHistoryDocStatus
                                HistoryDocStatus4888 = VoucherRet.HistoryDocStatus.GetValue()
                        End If
                        'Get value of InvoiceDate
                        if ( not VoucherRet.InvoiceDate is nothing) then
                                Dim InvoiceDate4889 as DateTime
                                InvoiceDate4889 = VoucherRet.InvoiceDate.GetValue()
                        End If
                        'Get value of InvoiceDueDate
                        if ( not VoucherRet.InvoiceDueDate is nothing) then
                                Dim InvoiceDueDate4890 as DateTime
                                InvoiceDueDate4890 = VoucherRet.InvoiceDueDate.GetValue()
                        End If
                        'Get value of InvoiceNumber
                        if ( not VoucherRet.InvoiceNumber is nothing) then
                                Dim InvoiceNumber4891 as String
                                InvoiceNumber4891 = VoucherRet.InvoiceNumber.GetValue()
                        End If
                        'Get value of ItemsCount
                        if ( not VoucherRet.ItemsCount is nothing) then
                                Dim ItemsCount4892 as Integer
                                ItemsCount4892 = VoucherRet.ItemsCount.GetValue()
                        End If
                        'Get value of PayeeCode
                        if ( not VoucherRet.PayeeCode is nothing) then
                                Dim PayeeCode4893 as String
                                PayeeCode4893 = VoucherRet.PayeeCode.GetValue()
                        End If
                        'Get value of PayeeListID
                        if ( not VoucherRet.PayeeListID is nothing) then
                                Dim PayeeListID4894 as String
                                PayeeListID4894 = VoucherRet.PayeeListID.GetValue()
                        End If
                        'Get value of PayeeName
                        if ( not VoucherRet.PayeeName is nothing) then
                                Dim PayeeName4895 as String
                                PayeeName4895 = VoucherRet.PayeeName.GetValue()
                        End If
                        'Get value of PurchaseOrderNumber
                        if ( not VoucherRet.PurchaseOrderNumber is nothing) then
                                Dim PurchaseOrderNumber4896 as String
                                PurchaseOrderNumber4896 = VoucherRet.PurchaseOrderNumber.GetValue()
                        End If
                        'Get value of PurchaseOrderTxnID
                        if ( not VoucherRet.PurchaseOrderTxnID is nothing) then
                                Dim PurchaseOrderTxnID4897 as String
                                PurchaseOrderTxnID4897 = VoucherRet.PurchaseOrderTxnID.GetValue()
                        End If
                        'Get value of QuickBooksFlag
                        if ( not VoucherRet.QuickBooksFlag is nothing) then
                                Dim QuickBooksFlag4898 as ENQuickBooksFlag
                                QuickBooksFlag4898 = VoucherRet.QuickBooksFlag.GetValue()
                        End If
                        'Get value of StoreExchangeStatus
                        if ( not VoucherRet.StoreExchangeStatus is nothing) then
                                Dim StoreExchangeStatus4899 as ENStoreExchangeStatus
                                StoreExchangeStatus4899 = VoucherRet.StoreExchangeStatus.GetValue()
                        End If
                        'Get value of StoreNumber
                        if ( not VoucherRet.StoreNumber is nothing) then
                                Dim StoreNumber4900 as Integer
                                StoreNumber4900 = VoucherRet.StoreNumber.GetValue()
                        End If
                        'Get value of Subtotal
                        if ( not VoucherRet.Subtotal is nothing) then
                                Dim Subtotal4901 as Double
                                Subtotal4901 = VoucherRet.Subtotal.GetValue()
                        End If
                        'Get value of TermsDiscount
                        if ( not VoucherRet.TermsDiscount is nothing) then
                                Dim TermsDiscount4902 as Single
                                TermsDiscount4902 = VoucherRet.TermsDiscount.GetValue()
                        End If
                        'Get value of TermsDiscountDays
                        if ( not VoucherRet.TermsDiscountDays is nothing) then
                                Dim TermsDiscountDays4903 as Integer
                                TermsDiscountDays4903 = VoucherRet.TermsDiscountDays.GetValue()
                        End If
                        'Get value of TermsNetDays
                        if ( not VoucherRet.TermsNetDays is nothing) then
                                Dim TermsNetDays4904 as Integer
                                TermsNetDays4904 = VoucherRet.TermsNetDays.GetValue()
                        End If
                        'Get value of Total
                        if ( not VoucherRet.Total is nothing) then
                                Dim Total4905 as Double
                                Total4905 = VoucherRet.Total.GetValue()
                        End If
                        'Get value of TotalQty
                        if ( not VoucherRet.TotalQty is nothing) then
                                Dim TotalQty4906 as Double
                                TotalQty4906 = VoucherRet.TotalQty.GetValue()
                        End If
                        'Get value of TxnDate
                        if ( not VoucherRet.TxnDate is nothing) then
                                Dim TxnDate4907 as DateTime
                                TxnDate4907 = VoucherRet.TxnDate.GetValue()
                        End If
                        'Get value of TxnState
                        if ( not VoucherRet.TxnState is nothing) then
                                Dim TxnState4908 as ENTxnState
                                TxnState4908 = VoucherRet.TxnState.GetValue()
                        End If
                        'Get value of VendorCode
                        if ( not VoucherRet.VendorCode is nothing) then
                                Dim VendorCode4909 as String
                                VendorCode4909 = VoucherRet.VendorCode.GetValue()
                        End If
                        'Get value of VendorListID
                        if ( not VoucherRet.VendorListID is nothing) then
                                Dim VendorListID4910 as String
                                VendorListID4910 = VoucherRet.VendorListID.GetValue()
                        End If
                        'Get value of VoucherNumber
                        if ( not VoucherRet.VoucherNumber is nothing) then
                                Dim VoucherNumber4911 as Integer
                                VoucherNumber4911 = VoucherRet.VoucherNumber.GetValue()
                        End If
                        'Get value of VoucherType
                        if ( not VoucherRet.VoucherType is nothing) then
                                Dim VoucherType4912 as ENVoucherType
                                VoucherType4912 = VoucherRet.VoucherType.GetValue()
                        End If
                        'Get value of Workstation
                        if ( not VoucherRet.Workstation is nothing) then
                                Dim Workstation4913 as Integer
                                Workstation4913 = VoucherRet.Workstation.GetValue()
                        End If
                        if (not VoucherRet.VoucherItemRetList is nothing)
                                Dim i4914 as Integer
                                for i4914 = 0  to VoucherRet.VoucherItemRetList.Count - 1
                                        Dim VoucherItemRet as IVoucherItemRet
                                        VoucherItemRet = VoucherRet.VoucherItemRetList.GetAt(i4914)
                                        'Get value of ListID
                                        if ( not VoucherItemRet.ListID is nothing) then
                                                Dim ListID4915 as String
                                                ListID4915 = VoucherItemRet.ListID.GetValue()
                                        End If
                                        'Get value of ALU
                                        if ( not VoucherItemRet.ALU is nothing) then
                                                Dim ALU4916 as String
                                                ALU4916 = VoucherItemRet.ALU.GetValue()
                                        End If
                                        'Get value of Attribute
                                        if ( not VoucherItemRet.Attribute is nothing) then
                                                Dim Attribute4917 as String
                                                Attribute4917 = VoucherItemRet.Attribute.GetValue()
                                        End If
                                        'Get value of Cost
                                        if ( not VoucherItemRet.Cost is nothing) then
                                                Dim Cost4918 as Double
                                                Cost4918 = VoucherItemRet.Cost.GetValue()
                                        End If
                                        'Get value of Desc1
                                        if ( not VoucherItemRet.Desc1 is nothing) then
                                                Dim Desc14919 as String
                                                Desc14919 = VoucherItemRet.Desc1.GetValue()
                                        End If
                                        'Get value of Desc2
                                        if ( not VoucherItemRet.Desc2 is nothing) then
                                                Dim Desc24920 as String
                                                Desc24920 = VoucherItemRet.Desc2.GetValue()
                                        End If
                                        'Get value of ExtendedCost
                                        if ( not VoucherItemRet.ExtendedCost is nothing) then
                                                Dim ExtendedCost4921 as Double
                                                ExtendedCost4921 = VoucherItemRet.ExtendedCost.GetValue()
                                        End If
                                        'Get value of ItemNumber
                                        if ( not VoucherItemRet.ItemNumber is nothing) then
                                                Dim ItemNumber4922 as Integer
                                                ItemNumber4922 = VoucherItemRet.ItemNumber.GetValue()
                                        End If
                                        'Get value of NumberOfBaseUnits
                                        if ( not VoucherItemRet.NumberOfBaseUnits is nothing) then
                                                Dim NumberOfBaseUnits4923 as Double
                                                NumberOfBaseUnits4923 = VoucherItemRet.NumberOfBaseUnits.GetValue()
                                        End If
                                        'Get value of OriginalOrderQty
                                        if ( not VoucherItemRet.OriginalOrderQty is nothing) then
                                                Dim OriginalOrderQty4924 as Double
                                                OriginalOrderQty4924 = VoucherItemRet.OriginalOrderQty.GetValue()
                                        End If
                                        'Get value of QtyReceived
                                        if ( not VoucherItemRet.QtyReceived is nothing) then
                                                Dim QtyReceived4925 as Double
                                                QtyReceived4925 = VoucherItemRet.QtyReceived.GetValue()
                                        End If
                                        'Get value of SerialNumber
                                        if ( not VoucherItemRet.SerialNumber is nothing) then
                                                Dim SerialNumber4926 as String
                                                SerialNumber4926 = VoucherItemRet.SerialNumber.GetValue()
                                        End If
                                        'Get value of Size
                                        if ( not VoucherItemRet.Size is nothing) then
                                                Dim Size4927 as String
                                                Size4927 = VoucherItemRet.Size.GetValue()
                                        End If
                                        'Get value of UnitOfMeasure
                                        if ( not VoucherItemRet.UnitOfMeasure is nothing) then
                                                Dim UnitOfMeasure4928 as String
                                                UnitOfMeasure4928 = VoucherItemRet.UnitOfMeasure.GetValue()
                                        End If
                                        'Get value of UPC
                                        if ( not VoucherItemRet.UPC is nothing) then
                                                Dim UPC4929 as String
                                                UPC4929 = VoucherItemRet.UPC.GetValue()
                                        End If
                                Next i4914
                        End If
                        if (not VoucherRet.DataExtRetList is nothing)
                                Dim i4930 as Integer
                                for i4930 = 0  to VoucherRet.DataExtRetList.Count - 1
                                        Dim DataExtRet as IDataExtRet
                                        DataExtRet = VoucherRet.DataExtRetList.GetAt(i4930)
                                        'Get value of OwnerID
                                        Dim OwnerID4931 as String
                                        OwnerID4931 = DataExtRet.OwnerID.GetValue()
                                        'Get value of DataExtName
                                        Dim DataExtName4932 as String
                                        DataExtName4932 = DataExtRet.DataExtName.GetValue()
                                        'Get value of DataExtType
                                        Dim DataExtType4933 as ENDataExtType
                                        DataExtType4933 = DataExtRet.DataExtType.GetValue()
                                        'Get value of DataExtValue
                                        Dim DataExtValue4934 as String
                                        DataExtValue4934 = DataExtRet.DataExtValue.GetValue()
                                Next i4930
                        End If
                End Sub




        End Class

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
//The following sample code is generated as an illustration of
//Creating requests and parsing responses ONLY
//This code is NOT intended to show best practices or ideal code
//Use at your most careful discretion

using System;
using System.Net;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using Interop.qbposfc4;

namespace com.intuit.idn.samples
{
        public class SampleVoucherQuery
        {
                public void  DoVoucherQuery()
                {
                        bool sessionBegun = false;
                        bool connectionOpen = false;
                        QBPOSSessionManager sessionManager = null;

                        try
                        {
                                //Create the session Manager object
                                sessionManager = new QBPOSSessionManager();

                                //Create the message set request object to hold our request
                                IMsgSetRequest requestMsgSet = sessionManager.CreateMsgSetRequest(4,0);
                                requestMsgSet.Attributes.OnError = ENRqOnError.roeContinue;

                                BuildVoucherQueryRq(requestMsgSet);

                                //Connect to QuickBooks and begin a session
                                sessionManager.OpenConnection("","Sample Code from OSR");
                                connectionOpen = true;
                                sessionManager.BeginSession("");
                                sessionBegun = true;

                                //Send the request and get the response from QuickBooks
                                IMsgSetResponse responseMsgSet = sessionManager.DoRequests(requestMsgSet);

                                //End the session and close the connection to QuickBooks
                                sessionManager.EndSession();
                                sessionBegun = false;
                                sessionManager.CloseConnection();
                                connectionOpen = false;

                                WalkVoucherQueryRs(responseMsgSet);
                        }
                        catch (Exception e)
                        {
                                MessageBox.Show(e.Message, "Error");
                                if (sessionBegun)
                                {
                                        sessionManager.EndSession();
                                }
                                if (connectionOpen)
                                {
                                        sessionManager.CloseConnection();
                                }
                        }
                }
                void BuildVoucherQueryRq(IMsgSetRequest requestMsgSet)
                {
                        IVoucherQuery VoucherQueryRq= requestMsgSet.AppendVoucherQueryRq();
                        //Set attributes
                        //Set field value for metaData
                        VoucherQueryRq.metaData.SetValue(ENmetaData.mdMetaDataAndResponseData);
                        //Set field value for iterator
                        VoucherQueryRq.iterator.SetValue(ENiterator.itStart);
                        //Set field value for iteratorID
                        VoucherQueryRq.iteratorID.SetValue("{D7355385-A17B-4f5d-B34D-F34C79C3E6FC}");
                        //Set field value for MaxReturned
                        VoucherQueryRq.MaxReturned.SetValue(6);
                        //Set field value for OwnerIDList
                        //May create more than one of these if needed
                        VoucherQueryRq.OwnerIDList.Add(Guid.NewGuid().ToString());
                        //Set field value for TxnID
                        VoucherQueryRq.TxnID.SetValue("200000-1011023419");
                        string ORTimeCreatedFiltersElementType4935 = "TimeCreatedFilter";
                        if (ORTimeCreatedFiltersElementType4935 == "TimeCreatedFilter")
                        {
                                //Set field value for MatchNumericCriterion
                                VoucherQueryRq.ORTimeCreatedFilters.TimeCreatedFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan);
                                //Set field value for TimeCreated
                                VoucherQueryRq.ORTimeCreatedFilters.TimeCreatedFilter.TimeCreated.SetValue(DateTime.Parse("12/15/2007 12:15:12"),false);
                        }
                        if (ORTimeCreatedFiltersElementType4935 == "TimeCreatedRangeFilter")
                        {
                                //Set field value for FromTimeCreated
                                VoucherQueryRq.ORTimeCreatedFilters.TimeCreatedRangeFilter.FromTimeCreated.SetValue(DateTime.Parse("12/15/2007 12:15:12"),false);
                                //Set field value for ToTimeCreated
                                VoucherQueryRq.ORTimeCreatedFilters.TimeCreatedRangeFilter.ToTimeCreated.SetValue(DateTime.Parse("12/15/2007 12:15:12"),false);
                        }
                        string ORTimeModifiedFiltersElementType4936 = "TimeModifiedFilter";
                        if (ORTimeModifiedFiltersElementType4936 == "TimeModifiedFilter")
                        {
                                //Set field value for MatchNumericCriterion
                                VoucherQueryRq.ORTimeModifiedFilters.TimeModifiedFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan);
                                //Set field value for TimeModified
                                VoucherQueryRq.ORTimeModifiedFilters.TimeModifiedFilter.TimeModified.SetValue(DateTime.Parse("12/15/2007 12:15:12"),false);
                        }
                        if (ORTimeModifiedFiltersElementType4936 == "TimeModifiedRangeFilter")
                        {
                                //Set field value for FromTimeModified
                                VoucherQueryRq.ORTimeModifiedFilters.TimeModifiedRangeFilter.FromTimeModified.SetValue(DateTime.Parse("12/15/2007 12:15:12"),false);
                                //Set field value for ToTimeModified
                                VoucherQueryRq.ORTimeModifiedFilters.TimeModifiedRangeFilter.ToTimeModified.SetValue(DateTime.Parse("12/15/2007 12:15:12"),false);
                        }
                        string ORAssociateFiltersElementType4937 = "AssociateFilter";
                        if (ORAssociateFiltersElementType4937 == "AssociateFilter")
                        {
                                //Set field value for MatchStringCriterion
                                VoucherQueryRq.ORAssociateFilters.AssociateFilter.MatchStringCriterion.SetValue(ENMatchStringCriterion.mscEqual);
                                //Set field value for Associate
                                VoucherQueryRq.ORAssociateFilters.AssociateFilter.Associate.SetValue("ab");
                        }
                        if (ORAssociateFiltersElementType4937 == "AssociateRangeFilter")
                        {
                                //Set field value for FromAssociate
                                VoucherQueryRq.ORAssociateFilters.AssociateRangeFilter.FromAssociate.SetValue("ab");
                                //Set field value for ToAssociate
                                VoucherQueryRq.ORAssociateFilters.AssociateRangeFilter.ToAssociate.SetValue("ab");
                        }
                        string ORCommentsFiltersElementType4938 = "CommentsFilter";
                        if (ORCommentsFiltersElementType4938 == "CommentsFilter")
                        {
                                //Set field value for MatchStringCriterion
                                VoucherQueryRq.ORCommentsFilters.CommentsFilter.MatchStringCriterion.SetValue(ENMatchStringCriterion.mscEqual);
                                //Set field value for Comments
                                VoucherQueryRq.ORCommentsFilters.CommentsFilter.Comments.SetValue("ab");
                        }
                        if (ORCommentsFiltersElementType4938 == "CommentsRangeFilter")
                        {
                                //Set field value for FromComments
                                VoucherQueryRq.ORCommentsFilters.CommentsRangeFilter.FromComments.SetValue("ab");
                                //Set field value for ToComments
                                VoucherQueryRq.ORCommentsFilters.CommentsRangeFilter.ToComments.SetValue("ab");
                        }
                        string ORCompanyNameFiltersElementType4939 = "CompanyNameFilter";
                        if (ORCompanyNameFiltersElementType4939 == "CompanyNameFilter")
                        {
                                //Set field value for MatchStringCriterion
                                VoucherQueryRq.ORCompanyNameFilters.CompanyNameFilter.MatchStringCriterion.SetValue(ENMatchStringCriterion.mscEqual);
                                //Set field value for CompanyName
                                VoucherQueryRq.ORCompanyNameFilters.CompanyNameFilter.CompanyName.SetValue("ab");
                        }
                        if (ORCompanyNameFiltersElementType4939 == "CompanyNameRangeFilter")
                        {
                                //Set field value for FromCompanyName
                                VoucherQueryRq.ORCompanyNameFilters.CompanyNameRangeFilter.FromCompanyName.SetValue("ab");
                                //Set field value for ToCompanyName
                                VoucherQueryRq.ORCompanyNameFilters.CompanyNameRangeFilter.ToCompanyName.SetValue("ab");
                        }
                        string ORDiscountFiltersElementType4940 = "DiscountFilter";
                        if (ORDiscountFiltersElementType4940 == "DiscountFilter")
                        {
                                //Set field value for MatchNumericCriterion
                                VoucherQueryRq.ORDiscountFilters.DiscountFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan);
                                //Set field value for Discount
                                VoucherQueryRq.ORDiscountFilters.DiscountFilter.Discount.SetValue(10.01);
                        }
                        if (ORDiscountFiltersElementType4940 == "DiscountRangeFilter")
                        {
                                //Set field value for FromDiscount
                                VoucherQueryRq.ORDiscountFilters.DiscountRangeFilter.FromDiscount.SetValue(10.01);
                                //Set field value for ToDiscount
                                VoucherQueryRq.ORDiscountFilters.DiscountRangeFilter.ToDiscount.SetValue(10.01);
                        }
                        string ORDiscountPercentFiltersElementType4941 = "DiscountPercentFilter";
                        if (ORDiscountPercentFiltersElementType4941 == "DiscountPercentFilter")
                        {
                                //Set field value for MatchNumericCriterion
                                VoucherQueryRq.ORDiscountPercentFilters.DiscountPercentFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan);
                                //Set field value for DiscountPercent
                                VoucherQueryRq.ORDiscountPercentFilters.DiscountPercentFilter.DiscountPercent.SetValue(12.34F);
                        }
                        if (ORDiscountPercentFiltersElementType4941 == "DiscountPercentRangeFilter")
                        {
                                //Set field value for FromDiscountPercent
                                VoucherQueryRq.ORDiscountPercentFilters.DiscountPercentRangeFilter.FromDiscountPercent.SetValue(12.34F);
                                //Set field value for ToDiscountPercent
                                VoucherQueryRq.ORDiscountPercentFilters.DiscountPercentRangeFilter.ToDiscountPercent.SetValue(12.34F);
                        }
                        string ORFeeFiltersElementType4942 = "FeeFilter";
                        if (ORFeeFiltersElementType4942 == "FeeFilter")
                        {
                                //Set field value for MatchNumericCriterion
                                VoucherQueryRq.ORFeeFilters.FeeFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan);
                                //Set field value for Fee
                                VoucherQueryRq.ORFeeFilters.FeeFilter.Fee.SetValue(10.01);
                        }
                        if (ORFeeFiltersElementType4942 == "FeeRangeFilter")
                        {
                                //Set field value for FromFee
                                VoucherQueryRq.ORFeeFilters.FeeRangeFilter.FromFee.SetValue(10.01);
                                //Set field value for ToFee
                                VoucherQueryRq.ORFeeFilters.FeeRangeFilter.ToFee.SetValue(10.01);
                        }
                        string ORFreightFiltersElementType4943 = "FreightFilter";
                        if (ORFreightFiltersElementType4943 == "FreightFilter")
                        {
                                //Set field value for MatchNumericCriterion
                                VoucherQueryRq.ORFreightFilters.FreightFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan);
                                //Set field value for Freight
                                VoucherQueryRq.ORFreightFilters.FreightFilter.Freight.SetValue(10.01);
                        }
                        if (ORFreightFiltersElementType4943 == "FreightRangeFilter")
                        {
                                //Set field value for FromFreight
                                VoucherQueryRq.ORFreightFilters.FreightRangeFilter.FromFreight.SetValue(10.01);
                                //Set field value for ToFreight
                                VoucherQueryRq.ORFreightFilters.FreightRangeFilter.ToFreight.SetValue(10.01);
                        }
                        //Set field value for HistoryDocStatus
                        VoucherQueryRq.HistoryDocStatus.SetValue(ENHistoryDocStatus.hdsRegular);
                        string ORInvoiceDateFiltersElementType4944 = "InvoiceDateFilter";
                        if (ORInvoiceDateFiltersElementType4944 == "InvoiceDateFilter")
                        {
                                //Set field value for MatchNumericCriterion
                                VoucherQueryRq.ORInvoiceDateFilters.InvoiceDateFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan);
                                //Set field value for InvoiceDate
                                VoucherQueryRq.ORInvoiceDateFilters.InvoiceDateFilter.InvoiceDate.SetValue(DateTime.Parse("12/15/2007"));
                        }
                        if (ORInvoiceDateFiltersElementType4944 == "InvoiceDateRangeFilter")
                        {
                                //Set field value for FromInvoiceDate
                                VoucherQueryRq.ORInvoiceDateFilters.InvoiceDateRangeFilter.FromInvoiceDate.SetValue(DateTime.Parse("12/15/2007"));
                                //Set field value for ToInvoiceDate
                                VoucherQueryRq.ORInvoiceDateFilters.InvoiceDateRangeFilter.ToInvoiceDate.SetValue(DateTime.Parse("12/15/2007"));
                        }
                        string ORInvoiceDueDateFiltersElementType4945 = "InvoiceDueDateFilter";
                        if (ORInvoiceDueDateFiltersElementType4945 == "InvoiceDueDateFilter")
                        {
                                //Set field value for MatchNumericCriterion
                                VoucherQueryRq.ORInvoiceDueDateFilters.InvoiceDueDateFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan);
                                //Set field value for InvoiceDueDate
                                VoucherQueryRq.ORInvoiceDueDateFilters.InvoiceDueDateFilter.InvoiceDueDate.SetValue(DateTime.Parse("12/15/2007"));
                        }
                        if (ORInvoiceDueDateFiltersElementType4945 == "InvoiceDueDateRangeFilter")
                        {
                                //Set field value for FromInvoiceDueDate
                                VoucherQueryRq.ORInvoiceDueDateFilters.InvoiceDueDateRangeFilter.FromInvoiceDueDate.SetValue(DateTime.Parse("12/15/2007"));
                                //Set field value for ToInvoiceDueDate
                                VoucherQueryRq.ORInvoiceDueDateFilters.InvoiceDueDateRangeFilter.ToInvoiceDueDate.SetValue(DateTime.Parse("12/15/2007"));
                        }
                        string ORInvoiceNumberFiltersElementType4946 = "InvoiceNumberFilter";
                        if (ORInvoiceNumberFiltersElementType4946 == "InvoiceNumberFilter")
                        {
                                //Set field value for MatchStringCriterion
                                VoucherQueryRq.ORInvoiceNumberFilters.InvoiceNumberFilter.MatchStringCriterion.SetValue(ENMatchStringCriterion.mscEqual);
                                //Set field value for InvoiceNumber
                                VoucherQueryRq.ORInvoiceNumberFilters.InvoiceNumberFilter.InvoiceNumber.SetValue("ab");
                        }
                        if (ORInvoiceNumberFiltersElementType4946 == "InvoiceNumberRangeFilter")
                        {
                                //Set field value for FromInvoiceNumber
                                VoucherQueryRq.ORInvoiceNumberFilters.InvoiceNumberRangeFilter.FromInvoiceNumber.SetValue("ab");
                                //Set field value for ToInvoiceNumber
                                VoucherQueryRq.ORInvoiceNumberFilters.InvoiceNumberRangeFilter.ToInvoiceNumber.SetValue("ab");
                        }
                        string ORItemsCountFiltersElementType4947 = "ItemsCountFilter";
                        if (ORItemsCountFiltersElementType4947 == "ItemsCountFilter")
                        {
                                //Set field value for MatchNumericCriterion
                                VoucherQueryRq.ORItemsCountFilters.ItemsCountFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan);
                                //Set field value for ItemsCount
                                VoucherQueryRq.ORItemsCountFilters.ItemsCountFilter.ItemsCount.SetValue(6);
                        }
                        if (ORItemsCountFiltersElementType4947 == "ItemsCountRangeFilter")
                        {
                                //Set field value for FromItemsCount
                                VoucherQueryRq.ORItemsCountFilters.ItemsCountRangeFilter.FromItemsCount.SetValue(6);
                                //Set field value for ToItemsCount
                                VoucherQueryRq.ORItemsCountFilters.ItemsCountRangeFilter.ToItemsCount.SetValue(6);
                        }
                        string ORPayeeCodeFiltersElementType4948 = "PayeeCodeFilter";
                        if (ORPayeeCodeFiltersElementType4948 == "PayeeCodeFilter")
                        {
                                //Set field value for MatchStringCriterion
                                VoucherQueryRq.ORPayeeCodeFilters.PayeeCodeFilter.MatchStringCriterion.SetValue(ENMatchStringCriterion.mscEqual);
                                //Set field value for PayeeCode
                                VoucherQueryRq.ORPayeeCodeFilters.PayeeCodeFilter.PayeeCode.SetValue("ab");
                        }
                        if (ORPayeeCodeFiltersElementType4948 == "PayeeCodeRangeFilter")
                        {
                                //Set field value for FromPayeeCode
                                VoucherQueryRq.ORPayeeCodeFilters.PayeeCodeRangeFilter.FromPayeeCode.SetValue("ab");
                                //Set field value for ToPayeeCode
                                VoucherQueryRq.ORPayeeCodeFilters.PayeeCodeRangeFilter.ToPayeeCode.SetValue("ab");
                        }
                        //Set field value for PayeeListID
                        VoucherQueryRq.PayeeListID.SetValue("200000-1011023419");
                        string ORPayeeNameFiltersElementType4949 = "PayeeNameFilter";
                        if (ORPayeeNameFiltersElementType4949 == "PayeeNameFilter")
                        {
                                //Set field value for MatchStringCriterion
                                VoucherQueryRq.ORPayeeNameFilters.PayeeNameFilter.MatchStringCriterion.SetValue(ENMatchStringCriterion.mscEqual);
                                //Set field value for PayeeName
                                VoucherQueryRq.ORPayeeNameFilters.PayeeNameFilter.PayeeName.SetValue("ab");
                        }
                        if (ORPayeeNameFiltersElementType4949 == "PayeeNameRangeFilter")
                        {
                                //Set field value for FromPayeeName
                                VoucherQueryRq.ORPayeeNameFilters.PayeeNameRangeFilter.FromPayeeName.SetValue("ab");
                                //Set field value for ToPayeeName
                                VoucherQueryRq.ORPayeeNameFilters.PayeeNameRangeFilter.ToPayeeName.SetValue("ab");
                        }
                        string ORPurchaseOrderNumberFiltersElementType4950 = "PurchaseOrderNumberFilter";
                        if (ORPurchaseOrderNumberFiltersElementType4950 == "PurchaseOrderNumberFilter")
                        {
                                //Set field value for MatchStringCriterion
                                VoucherQueryRq.ORPurchaseOrderNumberFilters.PurchaseOrderNumberFilter.MatchStringCriterion.SetValue(ENMatchStringCriterion.mscEqual);
                                //Set field value for PurchaseOrderNumber
                                VoucherQueryRq.ORPurchaseOrderNumberFilters.PurchaseOrderNumberFilter.PurchaseOrderNumber.SetValue("ab");
                        }
                        if (ORPurchaseOrderNumberFiltersElementType4950 == "PurchaseOrderNumberRangeFilter")
                        {
                                //Set field value for FromPurchaseOrderNumber
                                VoucherQueryRq.ORPurchaseOrderNumberFilters.PurchaseOrderNumberRangeFilter.FromPurchaseOrderNumber.SetValue("ab");
                                //Set field value for ToPurchaseOrderNumber
                                VoucherQueryRq.ORPurchaseOrderNumberFilters.PurchaseOrderNumberRangeFilter.ToPurchaseOrderNumber.SetValue("ab");
                        }
                        //Set field value for PurchaseOrderTxnID
                        VoucherQueryRq.PurchaseOrderTxnID.SetValue("200000-1011023419");
                        //Set field value for QuickBooksFlag
                        VoucherQueryRq.QuickBooksFlag.SetValue(ENQuickBooksFlag.qbfNotPosted);
                        //Set field value for StoreExchangeStatus
                        VoucherQueryRq.StoreExchangeStatus.SetValue(ENStoreExchangeStatus.sesModified);
                        string ORStoreNumberFiltersElementType4951 = "StoreNumberFilter";
                        if (ORStoreNumberFiltersElementType4951 == "StoreNumberFilter")
                        {
                                //Set field value for MatchNumericCriterion
                                VoucherQueryRq.ORStoreNumberFilters.StoreNumberFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan);
                                //Set field value for StoreNumber
                                VoucherQueryRq.ORStoreNumberFilters.StoreNumberFilter.StoreNumber.SetValue(6);
                        }
                        if (ORStoreNumberFiltersElementType4951 == "StoreNumberRangeFilter")
                        {
                                //Set field value for FromStoreNumber
                                VoucherQueryRq.ORStoreNumberFilters.StoreNumberRangeFilter.FromStoreNumber.SetValue(6);
                                //Set field value for ToStoreNumber
                                VoucherQueryRq.ORStoreNumberFilters.StoreNumberRangeFilter.ToStoreNumber.SetValue(6);
                        }
                        string ORSubtotalFiltersElementType4952 = "SubtotalFilter";
                        if (ORSubtotalFiltersElementType4952 == "SubtotalFilter")
                        {
                                //Set field value for MatchNumericCriterion
                                VoucherQueryRq.ORSubtotalFilters.SubtotalFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan);
                                //Set field value for Subtotal
                                VoucherQueryRq.ORSubtotalFilters.SubtotalFilter.Subtotal.SetValue(10.01);
                        }
                        if (ORSubtotalFiltersElementType4952 == "SubtotalRangeFilter")
                        {
                                //Set field value for FromSubtotal
                                VoucherQueryRq.ORSubtotalFilters.SubtotalRangeFilter.FromSubtotal.SetValue(10.01);
                                //Set field value for ToSubtotal
                                VoucherQueryRq.ORSubtotalFilters.SubtotalRangeFilter.ToSubtotal.SetValue(10.01);
                        }
                        string ORTermsDiscountFiltersElementType4953 = "TermsDiscountFilter";
                        if (ORTermsDiscountFiltersElementType4953 == "TermsDiscountFilter")
                        {
                                //Set field value for MatchNumericCriterion
                                VoucherQueryRq.ORTermsDiscountFilters.TermsDiscountFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan);
                                //Set field value for TermsDiscount
                                VoucherQueryRq.ORTermsDiscountFilters.TermsDiscountFilter.TermsDiscount.SetValue(12.34F);
                        }
                        if (ORTermsDiscountFiltersElementType4953 == "TermsDiscountRangeFilter")
                        {
                                //Set field value for FromTermsDiscount
                                VoucherQueryRq.ORTermsDiscountFilters.TermsDiscountRangeFilter.FromTermsDiscount.SetValue(12.34F);
                                //Set field value for ToTermsDiscount
                                VoucherQueryRq.ORTermsDiscountFilters.TermsDiscountRangeFilter.ToTermsDiscount.SetValue(12.34F);
                        }
                        string ORTermsDiscountDaysFiltersElementType4954 = "TermsDiscountDaysFilter";
                        if (ORTermsDiscountDaysFiltersElementType4954 == "TermsDiscountDaysFilter")
                        {
                                //Set field value for MatchNumericCriterion
                                VoucherQueryRq.ORTermsDiscountDaysFilters.TermsDiscountDaysFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan);
                                //Set field value for TermsDiscountDays
                                VoucherQueryRq.ORTermsDiscountDaysFilters.TermsDiscountDaysFilter.TermsDiscountDays.SetValue(6);
                        }
                        if (ORTermsDiscountDaysFiltersElementType4954 == "TermsDiscountDaysRangeFilter")
                        {
                                //Set field value for FromTermsDiscountDays
                                VoucherQueryRq.ORTermsDiscountDaysFilters.TermsDiscountDaysRangeFilter.FromTermsDiscountDays.SetValue(6);
                                //Set field value for ToTermsDiscountDays
                                VoucherQueryRq.ORTermsDiscountDaysFilters.TermsDiscountDaysRangeFilter.ToTermsDiscountDays.SetValue(6);
                        }
                        string ORTermsNetDaysFiltersElementType4955 = "TermsNetDaysFilter";
                        if (ORTermsNetDaysFiltersElementType4955 == "TermsNetDaysFilter")
                        {
                                //Set field value for MatchNumericCriterion
                                VoucherQueryRq.ORTermsNetDaysFilters.TermsNetDaysFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan);
                                //Set field value for TermsNetDays
                                VoucherQueryRq.ORTermsNetDaysFilters.TermsNetDaysFilter.TermsNetDays.SetValue(6);
                        }
                        if (ORTermsNetDaysFiltersElementType4955 == "TermsNetDaysRangeFilter")
                        {
                                //Set field value for FromTermsNetDays
                                VoucherQueryRq.ORTermsNetDaysFilters.TermsNetDaysRangeFilter.FromTermsNetDays.SetValue(6);
                                //Set field value for ToTermsNetDays
                                VoucherQueryRq.ORTermsNetDaysFilters.TermsNetDaysRangeFilter.ToTermsNetDays.SetValue(6);
                        }
                        string ORTotalFiltersElementType4956 = "TotalFilter";
                        if (ORTotalFiltersElementType4956 == "TotalFilter")
                        {
                                //Set field value for MatchNumericCriterion
                                VoucherQueryRq.ORTotalFilters.TotalFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan);
                                //Set field value for Total
                                VoucherQueryRq.ORTotalFilters.TotalFilter.Total.SetValue(10.01);
                        }
                        if (ORTotalFiltersElementType4956 == "TotalRangeFilter")
                        {
                                //Set field value for FromTotal
                                VoucherQueryRq.ORTotalFilters.TotalRangeFilter.FromTotal.SetValue(10.01);
                                //Set field value for ToTotal
                                VoucherQueryRq.ORTotalFilters.TotalRangeFilter.ToTotal.SetValue(10.01);
                        }
                        string ORTotalQtyFiltersElementType4957 = "TotalQtyFilter";
                        if (ORTotalQtyFiltersElementType4957 == "TotalQtyFilter")
                        {
                                //Set field value for MatchNumericCriterion
                                VoucherQueryRq.ORTotalQtyFilters.TotalQtyFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan);
                                //Set field value for TotalQty
                                VoucherQueryRq.ORTotalQtyFilters.TotalQtyFilter.TotalQty.SetValue(2);
                        }
                        if (ORTotalQtyFiltersElementType4957 == "TotalQtyRangeFilter")
                        {
                                //Set field value for FromTotalQty
                                VoucherQueryRq.ORTotalQtyFilters.TotalQtyRangeFilter.FromTotalQty.SetValue(2);
                                //Set field value for ToTotalQty
                                VoucherQueryRq.ORTotalQtyFilters.TotalQtyRangeFilter.ToTotalQty.SetValue(2);
                        }
                        string ORTxnDateFiltersElementType4958 = "TxnDateFilter";
                        if (ORTxnDateFiltersElementType4958 == "TxnDateFilter")
                        {
                                //Set field value for MatchNumericCriterion
                                VoucherQueryRq.ORTxnDateFilters.TxnDateFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan);
                                //Set field value for TxnDate
                                VoucherQueryRq.ORTxnDateFilters.TxnDateFilter.TxnDate.SetValue(DateTime.Parse("12/15/2007"));
                        }
                        if (ORTxnDateFiltersElementType4958 == "TxnDateRangeFilter")
                        {
                                //Set field value for FromTxnDate
                                VoucherQueryRq.ORTxnDateFilters.TxnDateRangeFilter.FromTxnDate.SetValue(DateTime.Parse("12/15/2007"));
                                //Set field value for ToTxnDate
                                VoucherQueryRq.ORTxnDateFilters.TxnDateRangeFilter.ToTxnDate.SetValue(DateTime.Parse("12/15/2007"));
                        }
                        //Set field value for TxnState
                        VoucherQueryRq.TxnState.SetValue(ENTxnState.tsNormal);
                        string ORVendorCodeFiltersElementType4959 = "VendorCodeFilter";
                        if (ORVendorCodeFiltersElementType4959 == "VendorCodeFilter")
                        {
                                //Set field value for MatchStringCriterion
                                VoucherQueryRq.ORVendorCodeFilters.VendorCodeFilter.MatchStringCriterion.SetValue(ENMatchStringCriterion.mscEqual);
                                //Set field value for VendorCode
                                VoucherQueryRq.ORVendorCodeFilters.VendorCodeFilter.VendorCode.SetValue("ab");
                        }
                        if (ORVendorCodeFiltersElementType4959 == "VendorCodeRangeFilter")
                        {
                                //Set field value for FromVendorCode
                                VoucherQueryRq.ORVendorCodeFilters.VendorCodeRangeFilter.FromVendorCode.SetValue("ab");
                                //Set field value for ToVendorCode
                                VoucherQueryRq.ORVendorCodeFilters.VendorCodeRangeFilter.ToVendorCode.SetValue("ab");
                        }
                        //Set field value for VendorListID
                        VoucherQueryRq.VendorListID.SetValue("200000-1011023419");
                        string ORVoucherNumberFiltersElementType4960 = "VoucherNumberFilter";
                        if (ORVoucherNumberFiltersElementType4960 == "VoucherNumberFilter")
                        {
                                //Set field value for MatchNumericCriterion
                                VoucherQueryRq.ORVoucherNumberFilters.VoucherNumberFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan);
                                //Set field value for VoucherNumber
                                VoucherQueryRq.ORVoucherNumberFilters.VoucherNumberFilter.VoucherNumber.SetValue(6);
                        }
                        if (ORVoucherNumberFiltersElementType4960 == "VoucherNumberRangeFilter")
                        {
                                //Set field value for FromVoucherNumber
                                VoucherQueryRq.ORVoucherNumberFilters.VoucherNumberRangeFilter.FromVoucherNumber.SetValue(6);
                                //Set field value for ToVoucherNumber
                                VoucherQueryRq.ORVoucherNumberFilters.VoucherNumberRangeFilter.ToVoucherNumber.SetValue(6);
                        }
                        //Set field value for VoucherType
                        VoucherQueryRq.VoucherType.SetValue(ENVoucherType.vtReceiving);
                        string ORWorkstationFiltersElementType4961 = "WorkstationFilter";
                        if (ORWorkstationFiltersElementType4961 == "WorkstationFilter")
                        {
                                //Set field value for MatchNumericCriterion
                                VoucherQueryRq.ORWorkstationFilters.WorkstationFilter.MatchNumericCriterion.SetValue(ENMatchNumericCriterion.mncLessThan);
                                //Set field value for Workstation
                                VoucherQueryRq.ORWorkstationFilters.WorkstationFilter.Workstation.SetValue(6);
                        }
                        if (ORWorkstationFiltersElementType4961 == "WorkstationRangeFilter")
                        {
                                //Set field value for FromWorkstation
                                VoucherQueryRq.ORWorkstationFilters.WorkstationRangeFilter.FromWorkstation.SetValue(6);
                                //Set field value for ToWorkstation
                                VoucherQueryRq.ORWorkstationFilters.WorkstationRangeFilter.ToWorkstation.SetValue(6);
                        }
                        //Set field value for IncludeRetElementList
                        //May create more than one of these if needed
                        VoucherQueryRq.IncludeRetElementList.Add("ab");
                }




                void WalkVoucherQueryRs(IMsgSetResponse responseMsgSet)
                {
                        if (responseMsgSet == null) return;
                        IResponseList responseList = responseMsgSet.ResponseList;
                        if (responseList == null) return;
                        //if we sent only one request, there is only one response, we'll walk the list for this sample
                        for(int i=0; i < responseList.Count; i++)
                        {
                                IResponse response = responseList.GetAt(i);
                                //check the status code of the response, 0=ok, >0 is warning
                                if (response.StatusCode >= 0)
                                {
                                        //the request-specific response is in the details, make sure we have some
                                        if (response.Detail != null)
                                        {
                                                //make sure the response is the type we're expecting
                                                ENResponseType responseType = (ENResponseType)response.Type.GetValue();
                                                if (responseType == ENResponseType.rtVoucherQueryRs)
                                                {
                                                        //upcast to more specific type here, this is safe because we checked with response.Type check above
                                                        IVoucherRetList VoucherRet = (IVoucherRetList)response.Detail;
                                                        for(int z=0; z < VoucherRet.Count; z++)
                                                        {
                                                                WalkVoucherRet(VoucherRet.GetAt(z));
                                                        }
                                                }
                                        }
                                }
                        }
                }




                void WalkVoucherRet(IVoucherRet VoucherRet)
                {
                        if (VoucherRet == null) return;
                        //Go through all the elements of IVoucherRetList
                        //Get value of TxnID
                        if (VoucherRet.TxnID != null)
                        {
                                string TxnID4962 = (string)VoucherRet.TxnID.GetValue();
                        }
                        //Get value of TimeCreated
                        if (VoucherRet.TimeCreated != null)
                        {
                                DateTime TimeCreated4963 = (DateTime)VoucherRet.TimeCreated.GetValue();
                        }
                        //Get value of TimeModified
                        if (VoucherRet.TimeModified != null)
                        {
                                DateTime TimeModified4964 = (DateTime)VoucherRet.TimeModified.GetValue();
                        }
                        //Get value of Associate
                        if (VoucherRet.Associate != null)
                        {
                                string Associate4965 = (string)VoucherRet.Associate.GetValue();
                        }
                        //Get value of Comments
                        if (VoucherRet.Comments != null)
                        {
                                string Comments4966 = (string)VoucherRet.Comments.GetValue();
                        }
                        //Get value of CompanyName
                        if (VoucherRet.CompanyName != null)
                        {
                                string CompanyName4967 = (string)VoucherRet.CompanyName.GetValue();
                        }
                        //Get value of Discount
                        if (VoucherRet.Discount != null)
                        {
                                double Discount4968 = (double)VoucherRet.Discount.GetValue();
                        }
                        //Get value of DiscountPercent
                        if (VoucherRet.DiscountPercent != null)
                        {
                                float DiscountPercent4969 = (float)VoucherRet.DiscountPercent.GetValue();
                        }
                        //Get value of Fee
                        if (VoucherRet.Fee != null)
                        {
                                double Fee4970 = (double)VoucherRet.Fee.GetValue();
                        }
                        //Get value of Freight
                        if (VoucherRet.Freight != null)
                        {
                                double Freight4971 = (double)VoucherRet.Freight.GetValue();
                        }
                        //Get value of HistoryDocStatus
                        if (VoucherRet.HistoryDocStatus != null)
                        {
                                ENHistoryDocStatus HistoryDocStatus4972 = (ENHistoryDocStatus)VoucherRet.HistoryDocStatus.GetValue();
                        }
                        //Get value of InvoiceDate
                        if (VoucherRet.InvoiceDate != null)
                        {
                                DateTime InvoiceDate4973 = (DateTime)VoucherRet.InvoiceDate.GetValue();
                        }
                        //Get value of InvoiceDueDate
                        if (VoucherRet.InvoiceDueDate != null)
                        {
                                DateTime InvoiceDueDate4974 = (DateTime)VoucherRet.InvoiceDueDate.GetValue();
                        }
                        //Get value of InvoiceNumber
                        if (VoucherRet.InvoiceNumber != null)
                        {
                                string InvoiceNumber4975 = (string)VoucherRet.InvoiceNumber.GetValue();
                        }
                        //Get value of ItemsCount
                        if (VoucherRet.ItemsCount != null)
                        {
                                int ItemsCount4976 = (int)VoucherRet.ItemsCount.GetValue();
                        }
                        //Get value of PayeeCode
                        if (VoucherRet.PayeeCode != null)
                        {
                                string PayeeCode4977 = (string)VoucherRet.PayeeCode.GetValue();
                        }
                        //Get value of PayeeListID
                        if (VoucherRet.PayeeListID != null)
                        {
                                string PayeeListID4978 = (string)VoucherRet.PayeeListID.GetValue();
                        }
                        //Get value of PayeeName
                        if (VoucherRet.PayeeName != null)
                        {
                                string PayeeName4979 = (string)VoucherRet.PayeeName.GetValue();
                        }
                        //Get value of PurchaseOrderNumber
                        if (VoucherRet.PurchaseOrderNumber != null)
                        {
                                string PurchaseOrderNumber4980 = (string)VoucherRet.PurchaseOrderNumber.GetValue();
                        }
                        //Get value of PurchaseOrderTxnID
                        if (VoucherRet.PurchaseOrderTxnID != null)
                        {
                                string PurchaseOrderTxnID4981 = (string)VoucherRet.PurchaseOrderTxnID.GetValue();
                        }
                        //Get value of QuickBooksFlag
                        if (VoucherRet.QuickBooksFlag != null)
                        {
                                ENQuickBooksFlag QuickBooksFlag4982 = (ENQuickBooksFlag)VoucherRet.QuickBooksFlag.GetValue();
                        }
                        //Get value of StoreExchangeStatus
                        if (VoucherRet.StoreExchangeStatus != null)
                        {
                                ENStoreExchangeStatus StoreExchangeStatus4983 = (ENStoreExchangeStatus)VoucherRet.StoreExchangeStatus.GetValue();
                        }
                        //Get value of StoreNumber
                        if (VoucherRet.StoreNumber != null)
                        {
                                int StoreNumber4984 = (int)VoucherRet.StoreNumber.GetValue();
                        }
                        //Get value of Subtotal
                        if (VoucherRet.Subtotal != null)
                        {
                                double Subtotal4985 = (double)VoucherRet.Subtotal.GetValue();
                        }
                        //Get value of TermsDiscount
                        if (VoucherRet.TermsDiscount != null)
                        {
                                float TermsDiscount4986 = (float)VoucherRet.TermsDiscount.GetValue();
                        }
                        //Get value of TermsDiscountDays
                        if (VoucherRet.TermsDiscountDays != null)
                        {
                                int TermsDiscountDays4987 = (int)VoucherRet.TermsDiscountDays.GetValue();
                        }
                        //Get value of TermsNetDays
                        if (VoucherRet.TermsNetDays != null)
                        {
                                int TermsNetDays4988 = (int)VoucherRet.TermsNetDays.GetValue();
                        }
                        //Get value of Total
                        if (VoucherRet.Total != null)
                        {
                                double Total4989 = (double)VoucherRet.Total.GetValue();
                        }
                        //Get value of TotalQty
                        if (VoucherRet.TotalQty != null)
                        {
                                int TotalQty4990 = (int)VoucherRet.TotalQty.GetValue();
                        }
                        //Get value of TxnDate
                        if (VoucherRet.TxnDate != null)
                        {
                                DateTime TxnDate4991 = (DateTime)VoucherRet.TxnDate.GetValue();
                        }
                        //Get value of TxnState
                        if (VoucherRet.TxnState != null)
                        {
                                ENTxnState TxnState4992 = (ENTxnState)VoucherRet.TxnState.GetValue();
                        }
                        //Get value of VendorCode
                        if (VoucherRet.VendorCode != null)
                        {
                                string VendorCode4993 = (string)VoucherRet.VendorCode.GetValue();
                        }
                        //Get value of VendorListID
                        if (VoucherRet.VendorListID != null)
                        {
                                string VendorListID4994 = (string)VoucherRet.VendorListID.GetValue();
                        }
                        //Get value of VoucherNumber
                        if (VoucherRet.VoucherNumber != null)
                        {
                                int VoucherNumber4995 = (int)VoucherRet.VoucherNumber.GetValue();
                        }
                        //Get value of VoucherType
                        if (VoucherRet.VoucherType != null)
                        {
                                ENVoucherType VoucherType4996 = (ENVoucherType)VoucherRet.VoucherType.GetValue();
                        }
                        //Get value of Workstation
                        if (VoucherRet.Workstation != null)
                        {
                                int Workstation4997 = (int)VoucherRet.Workstation.GetValue();
                        }
                        if (VoucherRet.VoucherItemRetList != null)
                        {
                                for (int i4998 = 0; i4998 < VoucherRet.VoucherItemRetList.Count; i4998++)
                                {
                                        IVoucherItemRet VoucherItemRet = VoucherRet.VoucherItemRetList.GetAt(i4998);
                                        //Get value of ListID
                                        if (VoucherItemRet.ListID != null)
                                        {
                                                string ListID4999 = (string)VoucherItemRet.ListID.GetValue();
                                        }
                                        //Get value of ALU
                                        if (VoucherItemRet.ALU != null)
                                        {
                                                string ALU5000 = (string)VoucherItemRet.ALU.GetValue();
                                        }
                                        //Get value of Attribute
                                        if (VoucherItemRet.Attribute != null)
                                        {
                                                string Attribute5001 = (string)VoucherItemRet.Attribute.GetValue();
                                        }
                                        //Get value of Cost
                                        if (VoucherItemRet.Cost != null)
                                        {
                                                double Cost5002 = (double)VoucherItemRet.Cost.GetValue();
                                        }
                                        //Get value of Desc1
                                        if (VoucherItemRet.Desc1 != null)
                                        {
                                                string Desc15003 = (string)VoucherItemRet.Desc1.GetValue();
                                        }
                                        //Get value of Desc2
                                        if (VoucherItemRet.Desc2 != null)
                                        {
                                                string Desc25004 = (string)VoucherItemRet.Desc2.GetValue();
                                        }
                                        //Get value of ExtendedCost
                                        if (VoucherItemRet.ExtendedCost != null)
                                        {
                                                double ExtendedCost5005 = (double)VoucherItemRet.ExtendedCost.GetValue();
                                        }
                                        //Get value of ItemNumber
                                        if (VoucherItemRet.ItemNumber != null)
                                        {
                                                int ItemNumber5006 = (int)VoucherItemRet.ItemNumber.GetValue();
                                        }
                                        //Get value of NumberOfBaseUnits
                                        if (VoucherItemRet.NumberOfBaseUnits != null)
                                        {
                                                int NumberOfBaseUnits5007 = (int)VoucherItemRet.NumberOfBaseUnits.GetValue();
                                        }
                                        //Get value of OriginalOrderQty
                                        if (VoucherItemRet.OriginalOrderQty != null)
                                        {
                                                int OriginalOrderQty5008 = (int)VoucherItemRet.OriginalOrderQty.GetValue();
                                        }
                                        //Get value of QtyReceived
                                        if (VoucherItemRet.QtyReceived != null)
                                        {
                                                int QtyReceived5009 = (int)VoucherItemRet.QtyReceived.GetValue();
                                        }
                                        //Get value of SerialNumber
                                        if (VoucherItemRet.SerialNumber != null)
                                        {
                                                string SerialNumber5010 = (string)VoucherItemRet.SerialNumber.GetValue();
                                        }
                                        //Get value of Size
                                        if (VoucherItemRet.Size != null)
                                        {
                                                string Size5011 = (string)VoucherItemRet.Size.GetValue();
                                        }
                                        //Get value of UnitOfMeasure
                                        if (VoucherItemRet.UnitOfMeasure != null)
                                        {
                                                string UnitOfMeasure5012 = (string)VoucherItemRet.UnitOfMeasure.GetValue();
                                        }
                                        //Get value of UPC
                                        if (VoucherItemRet.UPC != null)
                                        {
                                                string UPC5013 = (string)VoucherItemRet.UPC.GetValue();
                                        }
                                }
                        }
                        if (VoucherRet.DataExtRetList != null)
                        {
                                for (int i5014 = 0; i5014 < VoucherRet.DataExtRetList.Count; i5014++)
                                {
                                        IDataExtRet DataExtRet = VoucherRet.DataExtRetList.GetAt(i5014);
                                        //Get value of OwnerID
                                        string OwnerID5015 = (string)DataExtRet.OwnerID.GetValue();
                                        //Get value of DataExtName
                                        string DataExtName5016 = (string)DataExtRet.DataExtName.GetValue();
                                        //Get value of DataExtType
                                        ENDataExtType DataExtType5017 = (ENDataExtType)DataExtRet.DataExtType.GetValue();
                                        //Get value of DataExtValue
                                        string DataExtValue5018 = (string)DataExtRet.DataExtValue.GetValue();
                                }
                        }
                }




        }
}