VoucherAdd

There are two types of voucher in QBPOS. A receiving voucher is a QuickBooks POS history document that provides a permanent record of merchandise received into inventory. When a shipment arrives from a vendor, you create a receiving voucher to update inventory. A return voucher, on the other hand, records merchandise returned to the vendor and removed from inventory. Use a return voucher if you need to send back items that have already been received into inventory. If you refuse delivery before creating a receiving voucher, such as for merchandise that arrives damaged, no return voucher should be made. When receiving merchandise ordered on a purchase order (PO), you can bring any or all of the ordered items to the voucher by “referencing” the PO on the voucher.


Request

Response

XMLOPS

VB.NET

C#

Tag Type Max length Implementation Required

IVoucherAdd

There are two types of voucher in QBPOS. A receiving voucher is a QuickBooks POS history document that provides a permanent record of merchandise received into inventory. When a shipment arrives from a vendor, you create a receiving voucher to update inventory. A return voucher, on the other hand, records merchandise returned to the vendor and removed from inventory. Use a return voucher if you need to send back items that have already been received into inventory. If you refuse delivery before creating a receiving voucher, such as for merchandise that arrives damaged, no return voucher should be made. When receiving merchandise ordered on a purchase order (PO), you can bring any or all of the ordered items to the voucher by “referencing” the PO on the voucher.
       

defMacro

You use a macro in a request message set if you need to create some object in one request, then refer to it in a subsequent request within that same message set. For example, you could create an inventory item and then include that item as a line item in a sales order all in one request message set, rather than create the item, query for it, then include it in a separate SalesOrderAdd request. In this latter case, you are accessing QBPOS three times, versus only once, using macros. The item to be referenced is specified via the defmacro. The actual reference to that item in the succeeding request is done via the use macro, as follows: ItemInventoryAdd defMacro=”ListID:Inv1” In the above line, you simply replace Inv1 with the name you want to give the macro. When you reference this macro in another request (one that requires that object’s listID) in the same message set, you use this syntax: ListID useMacro=”ListID:Inv1” This is covered in more detail in the Programming Guide.
IQBStringType   2.0  

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    

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      

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    

PayeeListID

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

useMacro

You use a macro in a request message set if you need to create some object in one request, then refer to it in a subsequent request within that same message set. For example, you could create an inventory item and then include that item as a line item in a sales order all in one request message set, rather than create the item, query for it, then include it in a separate SalesOrderAdd request. In this latter case, you are accessing QBPOS three times, versus only once, using macros. The item to be referenced is specified via the defmacro. The actual reference to that item in the succeeding request is done via the use macro, as follows: ItemInventoryAdd defMacro=”ListID:Inv1” In the above line, you simply replace Inv1 with the name you want to give the macro. When you reference this macro in another request (one that requires that object’s listID) in the same message set, you use this syntax: ListID useMacro=”ListID:Inv1” This is covered in more detail in the Programming Guide.
IQBStringType   2.0  

PurchaseOrderTxnID

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

useMacro

You use a macro in a request message set if you need to create some object in one request, then refer to it in a subsequent request within that same message set. For example, you could create an inventory item and then include that item as a line item in a sales order all in one request message set, rather than create the item, query for it, then include it in a separate SalesOrderAdd request. In this latter case, you are accessing QBPOS three times, versus only once, using macros. The item to be referenced is specified via the defmacro. The actual reference to that item in the succeeding request is done via the use macro, as follows: ItemInventoryAdd defMacro=”ListID:Inv1” In the above line, you simply replace Inv1 with the name you want to give the macro. When you reference this macro in another request (one that requires that object’s listID) in the same message set, you use this syntax: ListID useMacro=”ListID:Inv1” This is covered in more detail in the Programming Guide.
IQBStringType   2.0  

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      

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      

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  

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  

VendorListID

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

useMacro

You use a macro in a request message set if you need to create some object in one request, then refer to it in a subsequent request within that same message set. For example, you could create an inventory item and then include that item as a line item in a sales order all in one request message set, rather than create the item, query for it, then include it in a separate SalesOrderAdd request. In this latter case, you are accessing QBPOS three times, versus only once, using macros. The item to be referenced is specified via the defmacro. The actual reference to that item in the succeeding request is done via the use macro, as follows: ItemInventoryAdd defMacro=”ListID:Inv1” In the above line, you simply replace Inv1 with the name you want to give the macro. When you reference this macro in another request (one that requires that object’s listID) in the same message set, you use this syntax: ListID useMacro=”ListID:Inv1” This is covered in more detail in the Programming Guide.
IQBStringType   2.0  

VoucherType

Specify the type of voucher you are creating.
IQBENVoucherTypeType      

Workstation

Workstation from which the transaction was made.
IQBIntType      

VoucherItemAddList

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

(List of IVoucherItemAdd 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     Y

useMacro

You use a macro in a request message set if you need to create some object in one request, then refer to it in a subsequent request within that same message set. For example, you could create an inventory item and then include that item as a line item in a sales order all in one request message set, rather than create the item, query for it, then include it in a separate SalesOrderAdd request. In this latter case, you are accessing QBPOS three times, versus only once, using macros. The item to be referenced is specified via the defmacro. The actual reference to that item in the succeeding request is done via the use macro, as follows: ItemInventoryAdd defMacro=”ListID:Inv1” In the above line, you simply replace Inv1 with the name you want to give the macro. When you reference this macro in another request (one that requires that object’s listID) in the same message set, you use this syntax: ListID useMacro=”ListID:Inv1” This is covered in more detail in the Programming Guide.
IQBStringType   2.0  

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      

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    

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

There are two types of voucher in QBPOS. A receiving voucher is a QuickBooks POS history document that provides a permanent record of merchandise received into inventory. When a shipment arrives from a vendor, you create a receiving voucher to update inventory. A return voucher, on the other hand, records merchandise returned to the vendor and removed from inventory. Use a return voucher if you need to send back items that have already been received into inventory. If you refuse delivery before creating a receiving voucher, such as for merchandise that arrives damaged, no return voucher should be made. When receiving merchandise ordered on a purchase order (PO), you can bring any or all of the ordered items to the voucher by “referencing” the PO on the voucher.
       

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

Detail

IVoucherRet      

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
<?xml version="1.0" encoding="utf-8"?>
<?qbposxml version="4.0"?>
<QBPOSXML>
        <QBPOSXMLMsgsRq onError="stopOnError">
                <VoucherAddRq>
                        <VoucherAdd defMacro="MACROTYPE"> <!-- required -->
                                <Associate >STRTYPE</Associate> <!-- optional -->
                                <Comments >STRTYPE</Comments> <!-- optional -->
                                <Discount >AMTTYPE</Discount> <!-- optional -->
                                <DiscountPercent >FLOATTYPE</DiscountPercent> <!-- optional -->
                                <Fee >AMTTYPE</Fee> <!-- optional -->
                                <Freight >AMTTYPE</Freight> <!-- optional -->
                                <InvoiceDate >DATETYPE</InvoiceDate> <!-- optional -->
                                <InvoiceDueDate >DATETYPE</InvoiceDueDate> <!-- optional -->
                                <InvoiceNumber >STRTYPE</InvoiceNumber> <!-- optional -->
                                <PayeeListID  useMacro="MACROTYPE">IDTYPE</PayeeListID> <!-- optional -->
                                <PurchaseOrderTxnID  useMacro="MACROTYPE">IDTYPE</PurchaseOrderTxnID> <!-- optional -->
                                <!-- QuickBooksFlag may have one of the following values: NotPosted, Completed, Error, UnbilledPurchases -->
                                <QuickBooksFlag >ENUMTYPE</QuickBooksFlag> <!-- optional -->
                                <StoreNumber >INTTYPE</StoreNumber> <!-- optional -->
                                <TermsDiscount >FLOATTYPE</TermsDiscount> <!-- optional -->
                                <TermsDiscountDays >INTTYPE</TermsDiscountDays> <!-- optional -->
                                <TermsNetDays >INTTYPE</TermsNetDays> <!-- optional -->
                                <TxnDate >DATETYPE</TxnDate> <!-- optional -->
                                <!-- TxnState may have one of the following values: Normal, Held -->
                                <TxnState >ENUMTYPE</TxnState> <!-- optional -->
                                <VendorListID  useMacro="MACROTYPE">IDTYPE</VendorListID> <!-- required -->
                                <!-- VoucherType may have one of the following values: Receiving, Return -->
                                <VoucherType >ENUMTYPE</VoucherType> <!-- optional -->
                                <Workstation >INTTYPE</Workstation> <!-- optional -->
                                <VoucherItemAdd> <!-- optional, may repeat -->
                                        <ListID  useMacro="MACROTYPE">IDTYPE</ListID> <!-- required -->
                                        <ALU >STRTYPE</ALU> <!-- optional -->
                                        <Attribute >STRTYPE</Attribute> <!-- optional -->
                                        <Cost >AMTTYPE</Cost> <!-- optional -->
                                        <Desc1 >STRTYPE</Desc1> <!-- optional -->
                                        <Desc2 >STRTYPE</Desc2> <!-- optional -->
                                        <ExtendedCost >AMTTYPE</ExtendedCost> <!-- optional -->
                                        <QtyReceived >QUANTYPE</QtyReceived> <!-- optional -->
                                        <SerialNumber >STRTYPE</SerialNumber> <!-- optional -->
                                        <Size >STRTYPE</Size> <!-- optional -->
                                        <UnitOfMeasure >STRTYPE</UnitOfMeasure> <!-- optional -->
                                        <UPC >STRTYPE</UPC> <!-- optional -->
                                </VoucherItemAdd>
                        </VoucherAdd>
                        <IncludeRetElement >STRTYPE</IncludeRetElement> <!-- optional, may repeat -->
                </VoucherAddRq>

                <VoucherAddRs statusCode="INTTYPE" statusSeverity="STRTYPE" statusMessage="STRTYPE">
                        <VoucherRet> <!-- optional -->
                                <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>
                </VoucherAddRs>
        </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
'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 SampleVoucherAdd
                Public Sub  DoVoucherAdd()
                        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

                                BuildVoucherAddRq(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

                                WalkVoucherAddRs(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 BuildVoucherAddRq(requestMsgSet as IMsgSetRequest)
                        Dim VoucherAddRq as IVoucherAdd
                        VoucherAddRq= requestMsgSet.AppendVoucherAddRq()
                        'Set field value for Associate
                        VoucherAddRq.Associate.SetValue("ab")
                        'Set field value for Comments
                        VoucherAddRq.Comments.SetValue("ab")
                        'Set field value for Discount
                        VoucherAddRq.Discount.SetValue(10.01)
                        'Set field value for DiscountPercent
                        VoucherAddRq.DiscountPercent.SetValue(12.34)
                        'Set field value for Fee
                        VoucherAddRq.Fee.SetValue(10.01)
                        'Set field value for Freight
                        VoucherAddRq.Freight.SetValue(10.01)
                        'Set field value for InvoiceDate
                        VoucherAddRq.InvoiceDate.SetValue(DateTime.Parse("12/15/2007"))
                        'Set field value for InvoiceDueDate
                        VoucherAddRq.InvoiceDueDate.SetValue(DateTime.Parse("12/15/2007"))
                        'Set field value for InvoiceNumber
                        VoucherAddRq.InvoiceNumber.SetValue("ab")
                        'Set field value for PayeeListID
                        VoucherAddRq.PayeeListID.SetValue("200000-1011023419")
                        'Set attributes
                        'Set field value for PayeeListID to use Macro
                        VoucherAddRq.PayeeListID.SetValueUseMacro("200000-1011023419")
                        'Set field value for PurchaseOrderTxnID
                        VoucherAddRq.PurchaseOrderTxnID.SetValue("200000-1011023419")
                        'Set attributes
                        'Set field value for PurchaseOrderTxnID to use Macro
                        VoucherAddRq.PurchaseOrderTxnID.SetValueUseMacro("200000-1011023419")
                        'Set field value for QuickBooksFlag
                        VoucherAddRq.QuickBooksFlag.SetValue(ENQuickBooksFlag.qbfNotPosted)
                        'Set field value for StoreNumber
                        VoucherAddRq.StoreNumber.SetValue(6)
                        'Set field value for TermsDiscount
                        VoucherAddRq.TermsDiscount.SetValue(12.34)
                        'Set field value for TermsDiscountDays
                        VoucherAddRq.TermsDiscountDays.SetValue(6)
                        'Set field value for TermsNetDays
                        VoucherAddRq.TermsNetDays.SetValue(6)
                        'Set field value for TxnDate
                        VoucherAddRq.TxnDate.SetValue(DateTime.Parse("12/15/2007"))
                        'Set field value for TxnState
                        VoucherAddRq.TxnState.SetValue(ENTxnState.tsNormal)
                        'Set field value for VendorListID
                        VoucherAddRq.VendorListID.SetValue("200000-1011023419")
                        'Set attributes
                        'Set field value for VendorListID to use Macro
                        VoucherAddRq.VendorListID.SetValueUseMacro("200000-1011023419")
                        'Set field value for VoucherType
                        VoucherAddRq.VoucherType.SetValue(ENVoucherType.vtReceiving)
                        'Set field value for Workstation
                        VoucherAddRq.Workstation.SetValue(6)
                        Dim VoucherItemAdd4735 as IVoucherItemAdd
                        VoucherItemAdd4735=VoucherAddRq.VoucherItemAddList.Append()
                        'Set field value for ListID
                        VoucherItemAdd4735.ListID.SetValue("200000-1011023419")
                        'Set attributes
                        'Set field value for ListID to use Macro
                        VoucherItemAdd4735.ListID.SetValueUseMacro("200000-1011023419")
                        'Set field value for ALU
                        VoucherItemAdd4735.ALU.SetValue("ab")
                        'Set field value for Attribute
                        VoucherItemAdd4735.Attribute.SetValue("ab")
                        'Set field value for Cost
                        VoucherItemAdd4735.Cost.SetValue(10.01)
                        'Set field value for Desc1
                        VoucherItemAdd4735.Desc1.SetValue("ab")
                        'Set field value for Desc2
                        VoucherItemAdd4735.Desc2.SetValue("ab")
                        'Set field value for ExtendedCost
                        VoucherItemAdd4735.ExtendedCost.SetValue(10.01)
                        'Set field value for QtyReceived
                        VoucherItemAdd4735.QtyReceived.SetValue(2)
                        'Set field value for SerialNumber
                        VoucherItemAdd4735.SerialNumber.SetValue("ab")
                        'Set field value for Size
                        VoucherItemAdd4735.Size.SetValue("ab")
                        'Set field value for UnitOfMeasure
                        VoucherItemAdd4735.UnitOfMeasure.SetValue("ab")
                        'Set field value for UPC
                        VoucherItemAdd4735.UPC.SetValue("ab")
                        'Set field value for IncludeRetElementList
                        'May create more than one of these if needed
                        VoucherAddRq.IncludeRetElementList.Add("ab")
                End Sub




                Public Sub WalkVoucherAddRs( 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.rtVoucherAddRs) then
                                                        'upcast to more specific type here, this is safe because we checked with response.Type check above
                                                        Dim VoucherRet as IVoucherRet
                                                        VoucherRet = CType(response.Detail,IVoucherRet)
                                                                WalkVoucherRet(VoucherRet)
                                                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 IVoucherRet
                        'Get value of TxnID
                        if ( not VoucherRet.TxnID is nothing) then
                                Dim TxnID4736 as String
                                TxnID4736 = VoucherRet.TxnID.GetValue()
                        End If
                        'Get value of TimeCreated
                        if ( not VoucherRet.TimeCreated is nothing) then
                                Dim TimeCreated4737 as DateTime
                                TimeCreated4737 = VoucherRet.TimeCreated.GetValue()
                        End If
                        'Get value of TimeModified
                        if ( not VoucherRet.TimeModified is nothing) then
                                Dim TimeModified4738 as DateTime
                                TimeModified4738 = VoucherRet.TimeModified.GetValue()
                        End If
                        'Get value of Associate
                        if ( not VoucherRet.Associate is nothing) then
                                Dim Associate4739 as String
                                Associate4739 = VoucherRet.Associate.GetValue()
                        End If
                        'Get value of Comments
                        if ( not VoucherRet.Comments is nothing) then
                                Dim Comments4740 as String
                                Comments4740 = VoucherRet.Comments.GetValue()
                        End If
                        'Get value of CompanyName
                        if ( not VoucherRet.CompanyName is nothing) then
                                Dim CompanyName4741 as String
                                CompanyName4741 = VoucherRet.CompanyName.GetValue()
                        End If
                        'Get value of Discount
                        if ( not VoucherRet.Discount is nothing) then
                                Dim Discount4742 as Double
                                Discount4742 = VoucherRet.Discount.GetValue()
                        End If
                        'Get value of DiscountPercent
                        if ( not VoucherRet.DiscountPercent is nothing) then
                                Dim DiscountPercent4743 as Single
                                DiscountPercent4743 = VoucherRet.DiscountPercent.GetValue()
                        End If
                        'Get value of Fee
                        if ( not VoucherRet.Fee is nothing) then
                                Dim Fee4744 as Double
                                Fee4744 = VoucherRet.Fee.GetValue()
                        End If
                        'Get value of Freight
                        if ( not VoucherRet.Freight is nothing) then
                                Dim Freight4745 as Double
                                Freight4745 = VoucherRet.Freight.GetValue()
                        End If
                        'Get value of HistoryDocStatus
                        if ( not VoucherRet.HistoryDocStatus is nothing) then
                                Dim HistoryDocStatus4746 as ENHistoryDocStatus
                                HistoryDocStatus4746 = VoucherRet.HistoryDocStatus.GetValue()
                        End If
                        'Get value of InvoiceDate
                        if ( not VoucherRet.InvoiceDate is nothing) then
                                Dim InvoiceDate4747 as DateTime
                                InvoiceDate4747 = VoucherRet.InvoiceDate.GetValue()
                        End If
                        'Get value of InvoiceDueDate
                        if ( not VoucherRet.InvoiceDueDate is nothing) then
                                Dim InvoiceDueDate4748 as DateTime
                                InvoiceDueDate4748 = VoucherRet.InvoiceDueDate.GetValue()
                        End If
                        'Get value of InvoiceNumber
                        if ( not VoucherRet.InvoiceNumber is nothing) then
                                Dim InvoiceNumber4749 as String
                                InvoiceNumber4749 = VoucherRet.InvoiceNumber.GetValue()
                        End If
                        'Get value of ItemsCount
                        if ( not VoucherRet.ItemsCount is nothing) then
                                Dim ItemsCount4750 as Integer
                                ItemsCount4750 = VoucherRet.ItemsCount.GetValue()
                        End If
                        'Get value of PayeeCode
                        if ( not VoucherRet.PayeeCode is nothing) then
                                Dim PayeeCode4751 as String
                                PayeeCode4751 = VoucherRet.PayeeCode.GetValue()
                        End If
                        'Get value of PayeeListID
                        if ( not VoucherRet.PayeeListID is nothing) then
                                Dim PayeeListID4752 as String
                                PayeeListID4752 = VoucherRet.PayeeListID.GetValue()
                        End If
                        'Get value of PayeeName
                        if ( not VoucherRet.PayeeName is nothing) then
                                Dim PayeeName4753 as String
                                PayeeName4753 = VoucherRet.PayeeName.GetValue()
                        End If
                        'Get value of PurchaseOrderNumber
                        if ( not VoucherRet.PurchaseOrderNumber is nothing) then
                                Dim PurchaseOrderNumber4754 as String
                                PurchaseOrderNumber4754 = VoucherRet.PurchaseOrderNumber.GetValue()
                        End If
                        'Get value of PurchaseOrderTxnID
                        if ( not VoucherRet.PurchaseOrderTxnID is nothing) then
                                Dim PurchaseOrderTxnID4755 as String
                                PurchaseOrderTxnID4755 = VoucherRet.PurchaseOrderTxnID.GetValue()
                        End If
                        'Get value of QuickBooksFlag
                        if ( not VoucherRet.QuickBooksFlag is nothing) then
                                Dim QuickBooksFlag4756 as ENQuickBooksFlag
                                QuickBooksFlag4756 = VoucherRet.QuickBooksFlag.GetValue()
                        End If
                        'Get value of StoreExchangeStatus
                        if ( not VoucherRet.StoreExchangeStatus is nothing) then
                                Dim StoreExchangeStatus4757 as ENStoreExchangeStatus
                                StoreExchangeStatus4757 = VoucherRet.StoreExchangeStatus.GetValue()
                        End If
                        'Get value of StoreNumber
                        if ( not VoucherRet.StoreNumber is nothing) then
                                Dim StoreNumber4758 as Integer
                                StoreNumber4758 = VoucherRet.StoreNumber.GetValue()
                        End If
                        'Get value of Subtotal
                        if ( not VoucherRet.Subtotal is nothing) then
                                Dim Subtotal4759 as Double
                                Subtotal4759 = VoucherRet.Subtotal.GetValue()
                        End If
                        'Get value of TermsDiscount
                        if ( not VoucherRet.TermsDiscount is nothing) then
                                Dim TermsDiscount4760 as Single
                                TermsDiscount4760 = VoucherRet.TermsDiscount.GetValue()
                        End If
                        'Get value of TermsDiscountDays
                        if ( not VoucherRet.TermsDiscountDays is nothing) then
                                Dim TermsDiscountDays4761 as Integer
                                TermsDiscountDays4761 = VoucherRet.TermsDiscountDays.GetValue()
                        End If
                        'Get value of TermsNetDays
                        if ( not VoucherRet.TermsNetDays is nothing) then
                                Dim TermsNetDays4762 as Integer
                                TermsNetDays4762 = VoucherRet.TermsNetDays.GetValue()
                        End If
                        'Get value of Total
                        if ( not VoucherRet.Total is nothing) then
                                Dim Total4763 as Double
                                Total4763 = VoucherRet.Total.GetValue()
                        End If
                        'Get value of TotalQty
                        if ( not VoucherRet.TotalQty is nothing) then
                                Dim TotalQty4764 as Double
                                TotalQty4764 = VoucherRet.TotalQty.GetValue()
                        End If
                        'Get value of TxnDate
                        if ( not VoucherRet.TxnDate is nothing) then
                                Dim TxnDate4765 as DateTime
                                TxnDate4765 = VoucherRet.TxnDate.GetValue()
                        End If
                        'Get value of TxnState
                        if ( not VoucherRet.TxnState is nothing) then
                                Dim TxnState4766 as ENTxnState
                                TxnState4766 = VoucherRet.TxnState.GetValue()
                        End If
                        'Get value of VendorCode
                        if ( not VoucherRet.VendorCode is nothing) then
                                Dim VendorCode4767 as String
                                VendorCode4767 = VoucherRet.VendorCode.GetValue()
                        End If
                        'Get value of VendorListID
                        if ( not VoucherRet.VendorListID is nothing) then
                                Dim VendorListID4768 as String
                                VendorListID4768 = VoucherRet.VendorListID.GetValue()
                        End If
                        'Get value of VoucherNumber
                        if ( not VoucherRet.VoucherNumber is nothing) then
                                Dim VoucherNumber4769 as Integer
                                VoucherNumber4769 = VoucherRet.VoucherNumber.GetValue()
                        End If
                        'Get value of VoucherType
                        if ( not VoucherRet.VoucherType is nothing) then
                                Dim VoucherType4770 as ENVoucherType
                                VoucherType4770 = VoucherRet.VoucherType.GetValue()
                        End If
                        'Get value of Workstation
                        if ( not VoucherRet.Workstation is nothing) then
                                Dim Workstation4771 as Integer
                                Workstation4771 = VoucherRet.Workstation.GetValue()
                        End If
                        if (not VoucherRet.VoucherItemRetList is nothing)
                                Dim i4772 as Integer
                                for i4772 = 0  to VoucherRet.VoucherItemRetList.Count - 1
                                        Dim VoucherItemRet as IVoucherItemRet
                                        VoucherItemRet = VoucherRet.VoucherItemRetList.GetAt(i4772)
                                        'Get value of ListID
                                        if ( not VoucherItemRet.ListID is nothing) then
                                                Dim ListID4773 as String
                                                ListID4773 = VoucherItemRet.ListID.GetValue()
                                        End If
                                        'Get value of ALU
                                        if ( not VoucherItemRet.ALU is nothing) then
                                                Dim ALU4774 as String
                                                ALU4774 = VoucherItemRet.ALU.GetValue()
                                        End If
                                        'Get value of Attribute
                                        if ( not VoucherItemRet.Attribute is nothing) then
                                                Dim Attribute4775 as String
                                                Attribute4775 = VoucherItemRet.Attribute.GetValue()
                                        End If
                                        'Get value of Cost
                                        if ( not VoucherItemRet.Cost is nothing) then
                                                Dim Cost4776 as Double
                                                Cost4776 = VoucherItemRet.Cost.GetValue()
                                        End If
                                        'Get value of Desc1
                                        if ( not VoucherItemRet.Desc1 is nothing) then
                                                Dim Desc14777 as String
                                                Desc14777 = VoucherItemRet.Desc1.GetValue()
                                        End If
                                        'Get value of Desc2
                                        if ( not VoucherItemRet.Desc2 is nothing) then
                                                Dim Desc24778 as String
                                                Desc24778 = VoucherItemRet.Desc2.GetValue()
                                        End If
                                        'Get value of ExtendedCost
                                        if ( not VoucherItemRet.ExtendedCost is nothing) then
                                                Dim ExtendedCost4779 as Double
                                                ExtendedCost4779 = VoucherItemRet.ExtendedCost.GetValue()
                                        End If
                                        'Get value of ItemNumber
                                        if ( not VoucherItemRet.ItemNumber is nothing) then
                                                Dim ItemNumber4780 as Integer
                                                ItemNumber4780 = VoucherItemRet.ItemNumber.GetValue()
                                        End If
                                        'Get value of NumberOfBaseUnits
                                        if ( not VoucherItemRet.NumberOfBaseUnits is nothing) then
                                                Dim NumberOfBaseUnits4781 as Double
                                                NumberOfBaseUnits4781 = VoucherItemRet.NumberOfBaseUnits.GetValue()
                                        End If
                                        'Get value of OriginalOrderQty
                                        if ( not VoucherItemRet.OriginalOrderQty is nothing) then
                                                Dim OriginalOrderQty4782 as Double
                                                OriginalOrderQty4782 = VoucherItemRet.OriginalOrderQty.GetValue()
                                        End If
                                        'Get value of QtyReceived
                                        if ( not VoucherItemRet.QtyReceived is nothing) then
                                                Dim QtyReceived4783 as Double
                                                QtyReceived4783 = VoucherItemRet.QtyReceived.GetValue()
                                        End If
                                        'Get value of SerialNumber
                                        if ( not VoucherItemRet.SerialNumber is nothing) then
                                                Dim SerialNumber4784 as String
                                                SerialNumber4784 = VoucherItemRet.SerialNumber.GetValue()
                                        End If
                                        'Get value of Size
                                        if ( not VoucherItemRet.Size is nothing) then
                                                Dim Size4785 as String
                                                Size4785 = VoucherItemRet.Size.GetValue()
                                        End If
                                        'Get value of UnitOfMeasure
                                        if ( not VoucherItemRet.UnitOfMeasure is nothing) then
                                                Dim UnitOfMeasure4786 as String
                                                UnitOfMeasure4786 = VoucherItemRet.UnitOfMeasure.GetValue()
                                        End If
                                        'Get value of UPC
                                        if ( not VoucherItemRet.UPC is nothing) then
                                                Dim UPC4787 as String
                                                UPC4787 = VoucherItemRet.UPC.GetValue()
                                        End If
                                Next i4772
                        End If
                        if (not VoucherRet.DataExtRetList is nothing)
                                Dim i4788 as Integer
                                for i4788 = 0  to VoucherRet.DataExtRetList.Count - 1
                                        Dim DataExtRet as IDataExtRet
                                        DataExtRet = VoucherRet.DataExtRetList.GetAt(i4788)
                                        'Get value of OwnerID
                                        Dim OwnerID4789 as String
                                        OwnerID4789 = DataExtRet.OwnerID.GetValue()
                                        'Get value of DataExtName
                                        Dim DataExtName4790 as String
                                        DataExtName4790 = DataExtRet.DataExtName.GetValue()
                                        'Get value of DataExtType
                                        Dim DataExtType4791 as ENDataExtType
                                        DataExtType4791 = DataExtRet.DataExtType.GetValue()
                                        'Get value of DataExtValue
                                        Dim DataExtValue4792 as String
                                        DataExtValue4792 = DataExtRet.DataExtValue.GetValue()
                                Next i4788
                        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
//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 SampleVoucherAdd
        {
                public void  DoVoucherAdd()
                {
                        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;

                                BuildVoucherAddRq(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;

                                WalkVoucherAddRs(responseMsgSet);
                        }
                        catch (Exception e)
                        {
                                MessageBox.Show(e.Message, "Error");
                                if (sessionBegun)
                                {
                                        sessionManager.EndSession();
                                }
                                if (connectionOpen)
                                {
                                        sessionManager.CloseConnection();
                                }
                        }
                }
                void BuildVoucherAddRq(IMsgSetRequest requestMsgSet)
                {
                        IVoucherAdd VoucherAddRq= requestMsgSet.AppendVoucherAddRq();
                        //Set attributes
                        //Set field value for defMacro
                        VoucherAddRq.defMacro.SetValue("IQBStringType");
                        //Set field value for Associate
                        VoucherAddRq.Associate.SetValue("ab");
                        //Set field value for Comments
                        VoucherAddRq.Comments.SetValue("ab");
                        //Set field value for Discount
                        VoucherAddRq.Discount.SetValue(10.01);
                        //Set field value for DiscountPercent
                        VoucherAddRq.DiscountPercent.SetValue(12.34F);
                        //Set field value for Fee
                        VoucherAddRq.Fee.SetValue(10.01);
                        //Set field value for Freight
                        VoucherAddRq.Freight.SetValue(10.01);
                        //Set field value for InvoiceDate
                        VoucherAddRq.InvoiceDate.SetValue(DateTime.Parse("12/15/2007"));
                        //Set field value for InvoiceDueDate
                        VoucherAddRq.InvoiceDueDate.SetValue(DateTime.Parse("12/15/2007"));
                        //Set field value for InvoiceNumber
                        VoucherAddRq.InvoiceNumber.SetValue("ab");
                        //Set field value for PayeeListID
                        VoucherAddRq.PayeeListID.SetValue("200000-1011023419");
                        //Set attributes
                        //Set field value for PayeeListID to use Macro
                        VoucherAddRq.PayeeListID.SetValueUseMacro("200000-1011023419");
                        //Set field value for PurchaseOrderTxnID
                        VoucherAddRq.PurchaseOrderTxnID.SetValue("200000-1011023419");
                        //Set attributes
                        //Set field value for PurchaseOrderTxnID to use Macro
                        VoucherAddRq.PurchaseOrderTxnID.SetValueUseMacro("200000-1011023419");
                        //Set field value for QuickBooksFlag
                        VoucherAddRq.QuickBooksFlag.SetValue(ENQuickBooksFlag.qbfNotPosted);
                        //Set field value for StoreNumber
                        VoucherAddRq.StoreNumber.SetValue(6);
                        //Set field value for TermsDiscount
                        VoucherAddRq.TermsDiscount.SetValue(12.34F);
                        //Set field value for TermsDiscountDays
                        VoucherAddRq.TermsDiscountDays.SetValue(6);
                        //Set field value for TermsNetDays
                        VoucherAddRq.TermsNetDays.SetValue(6);
                        //Set field value for TxnDate
                        VoucherAddRq.TxnDate.SetValue(DateTime.Parse("12/15/2007"));
                        //Set field value for TxnState
                        VoucherAddRq.TxnState.SetValue(ENTxnState.tsNormal);
                        //Set field value for VendorListID
                        VoucherAddRq.VendorListID.SetValue("200000-1011023419");
                        //Set attributes
                        //Set field value for VendorListID to use Macro
                        VoucherAddRq.VendorListID.SetValueUseMacro("200000-1011023419");
                        //Set field value for VoucherType
                        VoucherAddRq.VoucherType.SetValue(ENVoucherType.vtReceiving);
                        //Set field value for Workstation
                        VoucherAddRq.Workstation.SetValue(6);
                        IVoucherItemAdd VoucherItemAdd4793=VoucherAddRq.VoucherItemAddList.Append();
                        //Set field value for ListID
                        VoucherItemAdd4793.ListID.SetValue("200000-1011023419");
                        //Set attributes
                        //Set field value for ListID to use Macro
                        VoucherItemAdd4793.ListID.SetValueUseMacro("200000-1011023419");
                        //Set field value for ALU
                        VoucherItemAdd4793.ALU.SetValue("ab");
                        //Set field value for Attribute
                        VoucherItemAdd4793.Attribute.SetValue("ab");
                        //Set field value for Cost
                        VoucherItemAdd4793.Cost.SetValue(10.01);
                        //Set field value for Desc1
                        VoucherItemAdd4793.Desc1.SetValue("ab");
                        //Set field value for Desc2
                        VoucherItemAdd4793.Desc2.SetValue("ab");
                        //Set field value for ExtendedCost
                        VoucherItemAdd4793.ExtendedCost.SetValue(10.01);
                        //Set field value for QtyReceived
                        VoucherItemAdd4793.QtyReceived.SetValue(2);
                        //Set field value for SerialNumber
                        VoucherItemAdd4793.SerialNumber.SetValue("ab");
                        //Set field value for Size
                        VoucherItemAdd4793.Size.SetValue("ab");
                        //Set field value for UnitOfMeasure
                        VoucherItemAdd4793.UnitOfMeasure.SetValue("ab");
                        //Set field value for UPC
                        VoucherItemAdd4793.UPC.SetValue("ab");
                        //Set field value for IncludeRetElementList
                        //May create more than one of these if needed
                        VoucherAddRq.IncludeRetElementList.Add("ab");
                }




                void WalkVoucherAddRs(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.rtVoucherAddRs)
                                                {
                                                        //upcast to more specific type here, this is safe because we checked with response.Type check above
                                                        IVoucherRet VoucherRet = (IVoucherRet)response.Detail;
                                                                WalkVoucherRet(VoucherRet);
                                                }
                                        }
                                }
                        }
                }




                void WalkVoucherRet(IVoucherRet VoucherRet)
                {
                        if (VoucherRet == null) return;
                        //Go through all the elements of IVoucherRet
                        //Get value of TxnID
                        if (VoucherRet.TxnID != null)
                        {
                                string TxnID4794 = (string)VoucherRet.TxnID.GetValue();
                        }
                        //Get value of TimeCreated
                        if (VoucherRet.TimeCreated != null)
                        {
                                DateTime TimeCreated4795 = (DateTime)VoucherRet.TimeCreated.GetValue();
                        }
                        //Get value of TimeModified
                        if (VoucherRet.TimeModified != null)
                        {
                                DateTime TimeModified4796 = (DateTime)VoucherRet.TimeModified.GetValue();
                        }
                        //Get value of Associate
                        if (VoucherRet.Associate != null)
                        {
                                string Associate4797 = (string)VoucherRet.Associate.GetValue();
                        }
                        //Get value of Comments
                        if (VoucherRet.Comments != null)
                        {
                                string Comments4798 = (string)VoucherRet.Comments.GetValue();
                        }
                        //Get value of CompanyName
                        if (VoucherRet.CompanyName != null)
                        {
                                string CompanyName4799 = (string)VoucherRet.CompanyName.GetValue();
                        }
                        //Get value of Discount
                        if (VoucherRet.Discount != null)
                        {
                                double Discount4800 = (double)VoucherRet.Discount.GetValue();
                        }
                        //Get value of DiscountPercent
                        if (VoucherRet.DiscountPercent != null)
                        {
                                float DiscountPercent4801 = (float)VoucherRet.DiscountPercent.GetValue();
                        }
                        //Get value of Fee
                        if (VoucherRet.Fee != null)
                        {
                                double Fee4802 = (double)VoucherRet.Fee.GetValue();
                        }
                        //Get value of Freight
                        if (VoucherRet.Freight != null)
                        {
                                double Freight4803 = (double)VoucherRet.Freight.GetValue();
                        }
                        //Get value of HistoryDocStatus
                        if (VoucherRet.HistoryDocStatus != null)
                        {
                                ENHistoryDocStatus HistoryDocStatus4804 = (ENHistoryDocStatus)VoucherRet.HistoryDocStatus.GetValue();
                        }
                        //Get value of InvoiceDate
                        if (VoucherRet.InvoiceDate != null)
                        {
                                DateTime InvoiceDate4805 = (DateTime)VoucherRet.InvoiceDate.GetValue();
                        }
                        //Get value of InvoiceDueDate
                        if (VoucherRet.InvoiceDueDate != null)
                        {
                                DateTime InvoiceDueDate4806 = (DateTime)VoucherRet.InvoiceDueDate.GetValue();
                        }
                        //Get value of InvoiceNumber
                        if (VoucherRet.InvoiceNumber != null)
                        {
                                string InvoiceNumber4807 = (string)VoucherRet.InvoiceNumber.GetValue();
                        }
                        //Get value of ItemsCount
                        if (VoucherRet.ItemsCount != null)
                        {
                                int ItemsCount4808 = (int)VoucherRet.ItemsCount.GetValue();
                        }
                        //Get value of PayeeCode
                        if (VoucherRet.PayeeCode != null)
                        {
                                string PayeeCode4809 = (string)VoucherRet.PayeeCode.GetValue();
                        }
                        //Get value of PayeeListID
                        if (VoucherRet.PayeeListID != null)
                        {
                                string PayeeListID4810 = (string)VoucherRet.PayeeListID.GetValue();
                        }
                        //Get value of PayeeName
                        if (VoucherRet.PayeeName != null)
                        {
                                string PayeeName4811 = (string)VoucherRet.PayeeName.GetValue();
                        }
                        //Get value of PurchaseOrderNumber
                        if (VoucherRet.PurchaseOrderNumber != null)
                        {
                                string PurchaseOrderNumber4812 = (string)VoucherRet.PurchaseOrderNumber.GetValue();
                        }
                        //Get value of PurchaseOrderTxnID
                        if (VoucherRet.PurchaseOrderTxnID != null)
                        {
                                string PurchaseOrderTxnID4813 = (string)VoucherRet.PurchaseOrderTxnID.GetValue();
                        }
                        //Get value of QuickBooksFlag
                        if (VoucherRet.QuickBooksFlag != null)
                        {
                                ENQuickBooksFlag QuickBooksFlag4814 = (ENQuickBooksFlag)VoucherRet.QuickBooksFlag.GetValue();
                        }
                        //Get value of StoreExchangeStatus
                        if (VoucherRet.StoreExchangeStatus != null)
                        {
                                ENStoreExchangeStatus StoreExchangeStatus4815 = (ENStoreExchangeStatus)VoucherRet.StoreExchangeStatus.GetValue();
                        }
                        //Get value of StoreNumber
                        if (VoucherRet.StoreNumber != null)
                        {
                                int StoreNumber4816 = (int)VoucherRet.StoreNumber.GetValue();
                        }
                        //Get value of Subtotal
                        if (VoucherRet.Subtotal != null)
                        {
                                double Subtotal4817 = (double)VoucherRet.Subtotal.GetValue();
                        }
                        //Get value of TermsDiscount
                        if (VoucherRet.TermsDiscount != null)
                        {
                                float TermsDiscount4818 = (float)VoucherRet.TermsDiscount.GetValue();
                        }
                        //Get value of TermsDiscountDays
                        if (VoucherRet.TermsDiscountDays != null)
                        {
                                int TermsDiscountDays4819 = (int)VoucherRet.TermsDiscountDays.GetValue();
                        }
                        //Get value of TermsNetDays
                        if (VoucherRet.TermsNetDays != null)
                        {
                                int TermsNetDays4820 = (int)VoucherRet.TermsNetDays.GetValue();
                        }
                        //Get value of Total
                        if (VoucherRet.Total != null)
                        {
                                double Total4821 = (double)VoucherRet.Total.GetValue();
                        }
                        //Get value of TotalQty
                        if (VoucherRet.TotalQty != null)
                        {
                                int TotalQty4822 = (int)VoucherRet.TotalQty.GetValue();
                        }
                        //Get value of TxnDate
                        if (VoucherRet.TxnDate != null)
                        {
                                DateTime TxnDate4823 = (DateTime)VoucherRet.TxnDate.GetValue();
                        }
                        //Get value of TxnState
                        if (VoucherRet.TxnState != null)
                        {
                                ENTxnState TxnState4824 = (ENTxnState)VoucherRet.TxnState.GetValue();
                        }
                        //Get value of VendorCode
                        if (VoucherRet.VendorCode != null)
                        {
                                string VendorCode4825 = (string)VoucherRet.VendorCode.GetValue();
                        }
                        //Get value of VendorListID
                        if (VoucherRet.VendorListID != null)
                        {
                                string VendorListID4826 = (string)VoucherRet.VendorListID.GetValue();
                        }
                        //Get value of VoucherNumber
                        if (VoucherRet.VoucherNumber != null)
                        {
                                int VoucherNumber4827 = (int)VoucherRet.VoucherNumber.GetValue();
                        }
                        //Get value of VoucherType
                        if (VoucherRet.VoucherType != null)
                        {
                                ENVoucherType VoucherType4828 = (ENVoucherType)VoucherRet.VoucherType.GetValue();
                        }
                        //Get value of Workstation
                        if (VoucherRet.Workstation != null)
                        {
                                int Workstation4829 = (int)VoucherRet.Workstation.GetValue();
                        }
                        if (VoucherRet.VoucherItemRetList != null)
                        {
                                for (int i4830 = 0; i4830 < VoucherRet.VoucherItemRetList.Count; i4830++)
                                {
                                        IVoucherItemRet VoucherItemRet = VoucherRet.VoucherItemRetList.GetAt(i4830);
                                        //Get value of ListID
                                        if (VoucherItemRet.ListID != null)
                                        {
                                                string ListID4831 = (string)VoucherItemRet.ListID.GetValue();
                                        }
                                        //Get value of ALU
                                        if (VoucherItemRet.ALU != null)
                                        {
                                                string ALU4832 = (string)VoucherItemRet.ALU.GetValue();
                                        }
                                        //Get value of Attribute
                                        if (VoucherItemRet.Attribute != null)
                                        {
                                                string Attribute4833 = (string)VoucherItemRet.Attribute.GetValue();
                                        }
                                        //Get value of Cost
                                        if (VoucherItemRet.Cost != null)
                                        {
                                                double Cost4834 = (double)VoucherItemRet.Cost.GetValue();
                                        }
                                        //Get value of Desc1
                                        if (VoucherItemRet.Desc1 != null)
                                        {
                                                string Desc14835 = (string)VoucherItemRet.Desc1.GetValue();
                                        }
                                        //Get value of Desc2
                                        if (VoucherItemRet.Desc2 != null)
                                        {
                                                string Desc24836 = (string)VoucherItemRet.Desc2.GetValue();
                                        }
                                        //Get value of ExtendedCost
                                        if (VoucherItemRet.ExtendedCost != null)
                                        {
                                                double ExtendedCost4837 = (double)VoucherItemRet.ExtendedCost.GetValue();
                                        }
                                        //Get value of ItemNumber
                                        if (VoucherItemRet.ItemNumber != null)
                                        {
                                                int ItemNumber4838 = (int)VoucherItemRet.ItemNumber.GetValue();
                                        }
                                        //Get value of NumberOfBaseUnits
                                        if (VoucherItemRet.NumberOfBaseUnits != null)
                                        {
                                                int NumberOfBaseUnits4839 = (int)VoucherItemRet.NumberOfBaseUnits.GetValue();
                                        }
                                        //Get value of OriginalOrderQty
                                        if (VoucherItemRet.OriginalOrderQty != null)
                                        {
                                                int OriginalOrderQty4840 = (int)VoucherItemRet.OriginalOrderQty.GetValue();
                                        }
                                        //Get value of QtyReceived
                                        if (VoucherItemRet.QtyReceived != null)
                                        {
                                                int QtyReceived4841 = (int)VoucherItemRet.QtyReceived.GetValue();
                                        }
                                        //Get value of SerialNumber
                                        if (VoucherItemRet.SerialNumber != null)
                                        {
                                                string SerialNumber4842 = (string)VoucherItemRet.SerialNumber.GetValue();
                                        }
                                        //Get value of Size
                                        if (VoucherItemRet.Size != null)
                                        {
                                                string Size4843 = (string)VoucherItemRet.Size.GetValue();
                                        }
                                        //Get value of UnitOfMeasure
                                        if (VoucherItemRet.UnitOfMeasure != null)
                                        {
                                                string UnitOfMeasure4844 = (string)VoucherItemRet.UnitOfMeasure.GetValue();
                                        }
                                        //Get value of UPC
                                        if (VoucherItemRet.UPC != null)
                                        {
                                                string UPC4845 = (string)VoucherItemRet.UPC.GetValue();
                                        }
                                }
                        }
                        if (VoucherRet.DataExtRetList != null)
                        {
                                for (int i4846 = 0; i4846 < VoucherRet.DataExtRetList.Count; i4846++)
                                {
                                        IDataExtRet DataExtRet = VoucherRet.DataExtRetList.GetAt(i4846);
                                        //Get value of OwnerID
                                        string OwnerID4847 = (string)DataExtRet.OwnerID.GetValue();
                                        //Get value of DataExtName
                                        string DataExtName4848 = (string)DataExtRet.DataExtName.GetValue();
                                        //Get value of DataExtType
                                        ENDataExtType DataExtType4849 = (ENDataExtType)DataExtRet.DataExtType.GetValue();
                                        //Get value of DataExtValue
                                        string DataExtValue4850 = (string)DataExtRet.DataExtValue.GetValue();
                                }
                        }
                }




        }
}