TaxRecordMod

Used to create and modify tax rates for the specified (and existing) tax code and tax category. A tax record is mainly an SDK concept/device rather than one you see in the UI. A tax record contains all the tax rate data for a specific tax category/tax code pair, and can contain a maximum of three tax rates per tax code. You can query for all of the tax records in the company using the Company query; however, no filters are provided, and the tax records have no name or list IDs.


Request

Response

XMLOPS

VB.NET

C#

Tag Type Max length Implementation Required

ITaxRecordMod

Used to create and modify tax rates for the specified (and existing) tax code and tax category. A tax record is mainly an SDK concept/device rather than one you see in the UI. A tax record contains all the tax rate data for a specific tax category/tax code pair, and can contain a maximum of three tax rates per tax code. You can query for all of the tax records in the company using the Company query; however, no filters are provided, and the tax records have no name or list IDs.
    2.0  

TaxRecord

A tax record is mainly an SDK concept/device rather than one you see in the UI. A tax record contains all the tax rate data for a specific tax category/tax code pair, and can contain a maximum of three tax rates per tax code. You can query for all of the tax records in the company using the Company query; however, no filters are provided, and the tax records have no name or list IDs.
ITaxRecord     Y

TaxCategoryListID

The ListID of the tax category. This is always the same value as the tax category element. The list ID tag element, although redundant, helps to identify the use of this in object references.
IQBIDType   2.0 Y

TaxCategory

In the QBPOS UI, you specify sales tax behavior by creating sales tax locations and tax codes. (What the QBPOS UI calls a “tax location” is what the SDK calls a “tax category”.) The tax code and its name is shared between all tax categories (locations): that is, all tax categories will have the same set of tax codes. However, the actual tax rate(s) that are used in a given tax code can vary from one tax category to the next. The tax code rates that are actually applied at transaction time are those that are in the tax category that is currently specified as the default tax category (location) in sales tax preferences. You create and modify tax categories and tax codes using the TaxCategoryAdd/Mod and TaxCodeAdd/Mod requests respectively. You assign tax code rates to a tax code within a tax category using the TaxRecordMod request. You query for the tax preference information (tax rate information for each tax code under each tax category) using the CompanyQuery. However, currently the default tax category (location) can be specified only within the QBPOS UI. When you create or modify an inventory item in QBPOS, you apply a tax code to it, but not a tax category. At sales transaction time, the actual sales tax is calculated for each item, based on the tax code assigned to that item and the tax code rate(s) for that tax code under the tax category currently specified as the default tax category (location).
IQBStringType 20 chars    

POSTaxCodeListID

The list ID of the tax code. This is always the same as the tax code itself. It has its own element tag only to identify it as an object reference.
IQBIDType   2.0 Y

POSTaxCode

The tax code. This is the three-character maximum code, which is different from the (usually) longer tax code name that is displayed in the UI to provide a better “hint” for the user.
IQBStringType 3 chars    

TaxPercent

The tax rate for this tax, expressed as a percentage, eg, a value of 20.1 means the tax rate is 20.1%. If you are specifying a single tax rate, and thus are not using the TaxRate aggregate in the TaxRecordMod, you use the TaxPercent element that is at the first level in the Tax Record. If instead you are using the TaxPercent within the TaxRate aggregate (that is, you are specifying a multi-rate tax or a price-dependant single-rate tax), only the TaxPercent element within the Tax Rate(s) will be applied at transaction time.
IQBPercentType      

TaxRateList

When you construct a tax record mod request using qbposFC, and you use the TaxRate aggregate, you must append a TaxRate object to the TaxRateList object before proceeding to set the properties in that TaxRate.
ITaxRateList   2.0  

(List of ITaxRate Objects)

       

TaxPercent

The tax rate for this tax, expressed as a percentage, eg, a value of 20.1 means the tax rate is 20.1%. If you are specifying a single tax rate, and thus are not using the TaxRate aggregate in the TaxRecordMod, you use the TaxPercent element that is at the first level in the Tax Record. If instead you are using the TaxPercent within the TaxRate aggregate (that is, you are specifying a multi-rate tax or a price-dependant single-rate tax), only the TaxPercent element within the Tax Rate(s) will be applied at transaction time.
IQBPercentType      

TaxRateName

You should assign a tax rate name to each tax rate as this will help identify tax rates when you query for tax records using CompanyQuery.
IQBStringType 31 chars    

TaxAgency

The name of the tax authority to which the tax is to be paid.
IQBStringType      

TaxLowRange

The dollar amount at which the tax rate starts being applied.
IQBAmountType      

TaxHighRange

The dollar amount at which the tax rate stops being applied. By setting the TaxLowRange but leaving the TaxHighRange unset, you can specify that the tax rate starts at the TaxLowRange amount and continues to be taxed from that amount onward.
IQBAmountType      

IsTaxAppliedOnlyWithinRange

Specify the value True to apply the tax rate to the amount specified by TaxLowRange and TaxHighRange, and False if the tax is to be applied outside that amount range.
IQBBoolType      

QBTaxGroup

The QuickBooks tax group or tax item to which this QBPOS tax record is mapped. This field is available only if the QBPOS company is configured to be used with QuickBooks.
IQBStringType      

QBTaxGroup

The QuickBooks tax group or tax item to which this QBPOS tax record is mapped. This field is available only if the QBPOS company is configured to be used with QuickBooks.
IQBStringType      

QBTaxCode

The QuickBooks tax code to which this QBPOS tax code is mapped. This field is available only if the QBPOS company is configured to be used with QuickBooks.
IQBStringType      
Tag Type Max length Implementation Required

IResponse

Used to create and modify tax rates for the specified (and existing) tax code and tax category. A tax record is mainly an SDK concept/device rather than one you see in the UI. A tax record contains all the tax rate data for a specific tax category/tax code pair, and can contain a maximum of three tax rates per tax code. You can query for all of the tax records in the company using the Company query; however, no filters are provided, and the tax records have no name or list IDs.
    2.0  

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

ITaxRecordRet      

TaxRecord

A tax record is mainly an SDK concept/device rather than one you see in the UI. A tax record contains all the tax rate data for a specific tax category/tax code pair, and can contain a maximum of three tax rates per tax code. You can query for all of the tax records in the company using the Company query; however, no filters are provided, and the tax records have no name or list IDs.
ITaxRecord     Y

TaxCategoryListID

The ListID of the tax category. This is always the same value as the tax category element. The list ID tag element, although redundant, helps to identify the use of this in object references.
IQBIDType   2.0 Y

TaxCategory

In the QBPOS UI, you specify sales tax behavior by creating sales tax locations and tax codes. (What the QBPOS UI calls a “tax location” is what the SDK calls a “tax category”.) The tax code and its name is shared between all tax categories (locations): that is, all tax categories will have the same set of tax codes. However, the actual tax rate(s) that are used in a given tax code can vary from one tax category to the next. The tax code rates that are actually applied at transaction time are those that are in the tax category that is currently specified as the default tax category (location) in sales tax preferences. You create and modify tax categories and tax codes using the TaxCategoryAdd/Mod and TaxCodeAdd/Mod requests respectively. You assign tax code rates to a tax code within a tax category using the TaxRecordMod request. You query for the tax preference information (tax rate information for each tax code under each tax category) using the CompanyQuery. However, currently the default tax category (location) can be specified only within the QBPOS UI. When you create or modify an inventory item in QBPOS, you apply a tax code to it, but not a tax category. At sales transaction time, the actual sales tax is calculated for each item, based on the tax code assigned to that item and the tax code rate(s) for that tax code under the tax category currently specified as the default tax category (location).
IQBStringType 20 chars    

POSTaxCodeListID

The list ID of the tax code. This is always the same as the tax code itself. It has its own element tag only to identify it as an object reference.
IQBIDType   2.0 Y

POSTaxCode

The tax code. This is the three-character maximum code, which is different from the (usually) longer tax code name that is displayed in the UI to provide a better “hint” for the user.
IQBStringType 3 chars    

TaxPercent

The tax rate for this tax, expressed as a percentage, eg, a value of 20.1 means the tax rate is 20.1%. If you are specifying a single tax rate, and thus are not using the TaxRate aggregate in the TaxRecordMod, you use the TaxPercent element that is at the first level in the Tax Record. If instead you are using the TaxPercent within the TaxRate aggregate (that is, you are specifying a multi-rate tax or a price-dependant single-rate tax), only the TaxPercent element within the Tax Rate(s) will be applied at transaction time.
IQBPercentType      

TaxRateList

When you construct a tax record mod request using qbposFC, and you use the TaxRate aggregate, you must append a TaxRate object to the TaxRateList object before proceeding to set the properties in that TaxRate.
ITaxRateList   2.0  

(List of ITaxRate Objects)

       

TaxPercent

The tax rate for this tax, expressed as a percentage, eg, a value of 20.1 means the tax rate is 20.1%. If you are specifying a single tax rate, and thus are not using the TaxRate aggregate in the TaxRecordMod, you use the TaxPercent element that is at the first level in the Tax Record. If instead you are using the TaxPercent within the TaxRate aggregate (that is, you are specifying a multi-rate tax or a price-dependant single-rate tax), only the TaxPercent element within the Tax Rate(s) will be applied at transaction time.
IQBPercentType      

TaxRateName

You should assign a tax rate name to each tax rate as this will help identify tax rates when you query for tax records using CompanyQuery.
IQBStringType 31 chars    

TaxAgency

The name of the tax authority to which the tax is to be paid.
IQBStringType      

TaxLowRange

The dollar amount at which the tax rate starts being applied.
IQBAmountType      

TaxHighRange

The dollar amount at which the tax rate stops being applied. By setting the TaxLowRange but leaving the TaxHighRange unset, you can specify that the tax rate starts at the TaxLowRange amount and continues to be taxed from that amount onward.
IQBAmountType      

IsTaxAppliedOnlyWithinRange

Specify the value True to apply the tax rate to the amount specified by TaxLowRange and TaxHighRange, and False if the tax is to be applied outside that amount range.
IQBBoolType      

QBTaxGroup

The QuickBooks tax group or tax item to which this QBPOS tax record is mapped. This field is available only if the QBPOS company is configured to be used with QuickBooks.
IQBStringType      

QBTaxGroup

The QuickBooks tax group or tax item to which this QBPOS tax record is mapped. This field is available only if the QBPOS company is configured to be used with QuickBooks.
IQBStringType      

QBTaxCode

The QuickBooks tax code to which this QBPOS tax code is mapped. This field is available only if the QBPOS company is configured to be used with QuickBooks.
IQBStringType      

 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
<?xml version="1.0" encoding="utf-8"?>
<?qbposxml version="4.0"?>
<QBPOSXML>
        <QBPOSXMLMsgsRq onError="stopOnError">
                <TaxRecordModRq>
                        <TaxRecordMod> <!-- required -->
                                <TaxRecord> <!-- required -->
                                        <TaxCategoryListID >IDTYPE</TaxCategoryListID> <!-- required -->
                                        <TaxCategory >STRTYPE</TaxCategory> <!-- optional -->
                                        <POSTaxCodeListID >IDTYPE</POSTaxCodeListID> <!-- required -->
                                        <POSTaxCode >STRTYPE</POSTaxCode> <!-- optional -->
                                        <TaxPercent >PERCENTTYPE</TaxPercent> <!-- optional -->
                                        <TaxRate> <!-- must occur 0 - 3 times -->
                                                <TaxPercent >PERCENTTYPE</TaxPercent> <!-- optional -->
                                                <TaxRateName >STRTYPE</TaxRateName> <!-- optional -->
                                                <TaxAgency >STRTYPE</TaxAgency> <!-- optional -->
                                                <TaxLowRange >AMTTYPE</TaxLowRange> <!-- optional -->
                                                <TaxHighRange >AMTTYPE</TaxHighRange> <!-- optional -->
                                                <IsTaxAppliedOnlyWithinRange >BOOLTYPE</IsTaxAppliedOnlyWithinRange> <!-- optional -->
                                                <QBTaxGroup >STRTYPE</QBTaxGroup> <!-- optional -->
                                        </TaxRate>
                                        <QBTaxGroup >STRTYPE</QBTaxGroup> <!-- optional -->
                                        <QBTaxCode >STRTYPE</QBTaxCode> <!-- optional -->
                                </TaxRecord>
                        </TaxRecordMod>
                </TaxRecordModRq>

                <TaxRecordModRs statusCode="INTTYPE" statusSeverity="STRTYPE" statusMessage="STRTYPE">
                        <TaxRecordRet> <!-- optional -->
                                <TaxRecord> <!-- required -->
                                        <TaxCategoryListID >IDTYPE</TaxCategoryListID> <!-- required -->
                                        <TaxCategory >STRTYPE</TaxCategory> <!-- optional -->
                                        <POSTaxCodeListID >IDTYPE</POSTaxCodeListID> <!-- required -->
                                        <POSTaxCode >STRTYPE</POSTaxCode> <!-- optional -->
                                        <TaxPercent >PERCENTTYPE</TaxPercent> <!-- optional -->
                                        <TaxRate> <!-- must occur 0 - 3 times -->
                                                <TaxPercent >PERCENTTYPE</TaxPercent> <!-- optional -->
                                                <TaxRateName >STRTYPE</TaxRateName> <!-- optional -->
                                                <TaxAgency >STRTYPE</TaxAgency> <!-- optional -->
                                                <TaxLowRange >AMTTYPE</TaxLowRange> <!-- optional -->
                                                <TaxHighRange >AMTTYPE</TaxHighRange> <!-- optional -->
                                                <IsTaxAppliedOnlyWithinRange >BOOLTYPE</IsTaxAppliedOnlyWithinRange> <!-- optional -->
                                                <QBTaxGroup >STRTYPE</QBTaxGroup> <!-- optional -->
                                        </TaxRate>
                                        <QBTaxGroup >STRTYPE</QBTaxGroup> <!-- optional -->
                                        <QBTaxCode >STRTYPE</QBTaxCode> <!-- optional -->
                                </TaxRecord>
                        </TaxRecordRet>
                </TaxRecordModRs>
        </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
'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 SampleTaxRecordMod
                Public Sub  DoTaxRecordMod()
                        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

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

                                WalkTaxRecordModRs(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 BuildTaxRecordModRq(requestMsgSet as IMsgSetRequest)
                        Dim TaxRecordModRq as ITaxRecordMod
                        TaxRecordModRq= requestMsgSet.AppendTaxRecordModRq()
                        'Set field value for TaxCategoryListID
                        TaxRecordModRq.TaxRecord.TaxCategoryListID.SetValue("200000-1011023419")
                        'Set field value for TaxCategory
                        TaxRecordModRq.TaxRecord.TaxCategory.SetValue("ab")
                        'Set field value for POSTaxCodeListID
                        TaxRecordModRq.TaxRecord.POSTaxCodeListID.SetValue("200000-1011023419")
                        'Set field value for POSTaxCode
                        TaxRecordModRq.TaxRecord.POSTaxCode.SetValue("ab")
                        'Set field value for TaxPercent
                        TaxRecordModRq.TaxRecord.TaxPercent.SetValue(20.00)
                        Dim TaxRate4205 as ITaxRate
                        TaxRate4205=TaxRecordModRq.TaxRecord.TaxRateList.Append()
                        'Set field value for TaxPercent
                        TaxRate4205.TaxPercent.SetValue(20.00)
                        'Set field value for TaxRateName
                        TaxRate4205.TaxRateName.SetValue("ab")
                        'Set field value for TaxAgency
                        TaxRate4205.TaxAgency.SetValue("ab")
                        'Set field value for TaxLowRange
                        TaxRate4205.TaxLowRange.SetValue(10.01)
                        'Set field value for TaxHighRange
                        TaxRate4205.TaxHighRange.SetValue(10.01)
                        'Set field value for IsTaxAppliedOnlyWithinRange
                        TaxRate4205.IsTaxAppliedOnlyWithinRange.SetValue(True)
                        'Set field value for QBTaxGroup
                        TaxRate4205.QBTaxGroup.SetValue("ab")
                        'Set field value for QBTaxGroup
                        TaxRecordModRq.TaxRecord.QBTaxGroup.SetValue("ab")
                        'Set field value for QBTaxCode
                        TaxRecordModRq.TaxRecord.QBTaxCode.SetValue("ab")
                End Sub




                Public Sub WalkTaxRecordModRs( 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.rtTaxRecordModRs) then
                                                        'upcast to more specific type here, this is safe because we checked with response.Type check above
                                                        Dim TaxRecordRet as ITaxRecordRet
                                                        TaxRecordRet = CType(response.Detail,ITaxRecordRet)
                                                                WalkTaxRecordRet(TaxRecordRet)
                                                End If
                                        End If
                                End If
                        Next j
                End Sub




                Public Sub WalkTaxRecordRet(TaxRecordRet as ITaxRecordRet)
                        if (TaxRecordRet is nothing) then
                                Exit Sub
                        End If

                        'Go through all the elements of ITaxRecordRet
                        'Get value of TaxCategoryListID
                        Dim TaxCategoryListID4206 as String
                        TaxCategoryListID4206 = TaxRecordRet.TaxRecord.TaxCategoryListID.GetValue()
                        'Get value of TaxCategory
                        if ( not TaxRecordRet.TaxRecord.TaxCategory is nothing) then
                                Dim TaxCategory4207 as String
                                TaxCategory4207 = TaxRecordRet.TaxRecord.TaxCategory.GetValue()
                        End If
                        'Get value of POSTaxCodeListID
                        Dim POSTaxCodeListID4208 as String
                        POSTaxCodeListID4208 = TaxRecordRet.TaxRecord.POSTaxCodeListID.GetValue()
                        'Get value of POSTaxCode
                        if ( not TaxRecordRet.TaxRecord.POSTaxCode is nothing) then
                                Dim POSTaxCode4209 as String
                                POSTaxCode4209 = TaxRecordRet.TaxRecord.POSTaxCode.GetValue()
                        End If
                        'Get value of TaxPercent
                        if ( not TaxRecordRet.TaxRecord.TaxPercent is nothing) then
                                Dim TaxPercent4210 as Double
                                TaxPercent4210 = TaxRecordRet.TaxRecord.TaxPercent.GetValue()
                        End If
                        if (not TaxRecordRet.TaxRecord.TaxRateList is nothing)
                                Dim i4211 as Integer
                                for i4211 = 0  to TaxRecordRet.TaxRecord.TaxRateList.Count - 1
                                        Dim TaxRate as ITaxRate
                                        TaxRate = TaxRecordRet.TaxRecord.TaxRateList.GetAt(i4211)
                                        'Get value of TaxPercent
                                        if ( not TaxRate.TaxPercent is nothing) then
                                                Dim TaxPercent4212 as Double
                                                TaxPercent4212 = TaxRate.TaxPercent.GetValue()
                                        End If
                                        'Get value of TaxRateName
                                        if ( not TaxRate.TaxRateName is nothing) then
                                                Dim TaxRateName4213 as String
                                                TaxRateName4213 = TaxRate.TaxRateName.GetValue()
                                        End If
                                        'Get value of TaxAgency
                                        if ( not TaxRate.TaxAgency is nothing) then
                                                Dim TaxAgency4214 as String
                                                TaxAgency4214 = TaxRate.TaxAgency.GetValue()
                                        End If
                                        'Get value of TaxLowRange
                                        if ( not TaxRate.TaxLowRange is nothing) then
                                                Dim TaxLowRange4215 as Double
                                                TaxLowRange4215 = TaxRate.TaxLowRange.GetValue()
                                        End If
                                        'Get value of TaxHighRange
                                        if ( not TaxRate.TaxHighRange is nothing) then
                                                Dim TaxHighRange4216 as Double
                                                TaxHighRange4216 = TaxRate.TaxHighRange.GetValue()
                                        End If
                                        'Get value of IsTaxAppliedOnlyWithinRange
                                        if ( not TaxRate.IsTaxAppliedOnlyWithinRange is nothing) then
                                                Dim IsTaxAppliedOnlyWithinRange4217 as Boolean
                                                IsTaxAppliedOnlyWithinRange4217 = TaxRate.IsTaxAppliedOnlyWithinRange.GetValue()
                                        End If
                                        'Get value of QBTaxGroup
                                        if ( not TaxRate.QBTaxGroup is nothing) then
                                                Dim QBTaxGroup4218 as String
                                                QBTaxGroup4218 = TaxRate.QBTaxGroup.GetValue()
                                        End If
                                Next i4211
                        End If
                        'Get value of QBTaxGroup
                        if ( not TaxRecordRet.TaxRecord.QBTaxGroup is nothing) then
                                Dim QBTaxGroup4219 as String
                                QBTaxGroup4219 = TaxRecordRet.TaxRecord.QBTaxGroup.GetValue()
                        End If
                        'Get value of QBTaxCode
                        if ( not TaxRecordRet.TaxRecord.QBTaxCode is nothing) then
                                Dim QBTaxCode4220 as String
                                QBTaxCode4220 = TaxRecordRet.TaxRecord.QBTaxCode.GetValue()
                        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
//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 SampleTaxRecordMod
        {
                public void  DoTaxRecordMod()
                {
                        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;

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

                                WalkTaxRecordModRs(responseMsgSet);
                        }
                        catch (Exception e)
                        {
                                MessageBox.Show(e.Message, "Error");
                                if (sessionBegun)
                                {
                                        sessionManager.EndSession();
                                }
                                if (connectionOpen)
                                {
                                        sessionManager.CloseConnection();
                                }
                        }
                }
                void BuildTaxRecordModRq(IMsgSetRequest requestMsgSet)
                {
                        ITaxRecordMod TaxRecordModRq= requestMsgSet.AppendTaxRecordModRq();
                        //Set field value for TaxCategoryListID
                        TaxRecordModRq.TaxRecord.TaxCategoryListID.SetValue("200000-1011023419");
                        //Set field value for TaxCategory
                        TaxRecordModRq.TaxRecord.TaxCategory.SetValue("ab");
                        //Set field value for POSTaxCodeListID
                        TaxRecordModRq.TaxRecord.POSTaxCodeListID.SetValue("200000-1011023419");
                        //Set field value for POSTaxCode
                        TaxRecordModRq.TaxRecord.POSTaxCode.SetValue("ab");
                        //Set field value for TaxPercent
                        TaxRecordModRq.TaxRecord.TaxPercent.SetValue(20.00);
                        ITaxRate TaxRate4221=TaxRecordModRq.TaxRecord.TaxRateList.Append();
                        //Set field value for TaxPercent
                        TaxRate4221.TaxPercent.SetValue(20.00);
                        //Set field value for TaxRateName
                        TaxRate4221.TaxRateName.SetValue("ab");
                        //Set field value for TaxAgency
                        TaxRate4221.TaxAgency.SetValue("ab");
                        //Set field value for TaxLowRange
                        TaxRate4221.TaxLowRange.SetValue(10.01);
                        //Set field value for TaxHighRange
                        TaxRate4221.TaxHighRange.SetValue(10.01);
                        //Set field value for IsTaxAppliedOnlyWithinRange
                        TaxRate4221.IsTaxAppliedOnlyWithinRange.SetValue(true);
                        //Set field value for QBTaxGroup
                        TaxRate4221.QBTaxGroup.SetValue("ab");
                        //Set field value for QBTaxGroup
                        TaxRecordModRq.TaxRecord.QBTaxGroup.SetValue("ab");
                        //Set field value for QBTaxCode
                        TaxRecordModRq.TaxRecord.QBTaxCode.SetValue("ab");
                }




                void WalkTaxRecordModRs(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.rtTaxRecordModRs)
                                                {
                                                        //upcast to more specific type here, this is safe because we checked with response.Type check above
                                                        ITaxRecordRet TaxRecordRet = (ITaxRecordRet)response.Detail;
                                                                WalkTaxRecordRet(TaxRecordRet);
                                                }
                                        }
                                }
                        }
                }




                void WalkTaxRecordRet(ITaxRecordRet TaxRecordRet)
                {
                        if (TaxRecordRet == null) return;
                        //Go through all the elements of ITaxRecordRet
                        //Get value of TaxCategoryListID
                        string TaxCategoryListID4222 = (string)TaxRecordRet.TaxRecord.TaxCategoryListID.GetValue();
                        //Get value of TaxCategory
                        if (TaxRecordRet.TaxRecord.TaxCategory != null)
                        {
                                string TaxCategory4223 = (string)TaxRecordRet.TaxRecord.TaxCategory.GetValue();
                        }
                        //Get value of POSTaxCodeListID
                        string POSTaxCodeListID4224 = (string)TaxRecordRet.TaxRecord.POSTaxCodeListID.GetValue();
                        //Get value of POSTaxCode
                        if (TaxRecordRet.TaxRecord.POSTaxCode != null)
                        {
                                string POSTaxCode4225 = (string)TaxRecordRet.TaxRecord.POSTaxCode.GetValue();
                        }
                        //Get value of TaxPercent
                        if (TaxRecordRet.TaxRecord.TaxPercent != null)
                        {
                                double TaxPercent4226 = (double)TaxRecordRet.TaxRecord.TaxPercent.GetValue();
                        }
                        if (TaxRecordRet.TaxRecord.TaxRateList != null)
                        {
                                for (int i4227 = 0; i4227 < TaxRecordRet.TaxRecord.TaxRateList.Count; i4227++)
                                {
                                        ITaxRate TaxRate = TaxRecordRet.TaxRecord.TaxRateList.GetAt(i4227);
                                        //Get value of TaxPercent
                                        if (TaxRate.TaxPercent != null)
                                        {
                                                double TaxPercent4228 = (double)TaxRate.TaxPercent.GetValue();
                                        }
                                        //Get value of TaxRateName
                                        if (TaxRate.TaxRateName != null)
                                        {
                                                string TaxRateName4229 = (string)TaxRate.TaxRateName.GetValue();
                                        }
                                        //Get value of TaxAgency
                                        if (TaxRate.TaxAgency != null)
                                        {
                                                string TaxAgency4230 = (string)TaxRate.TaxAgency.GetValue();
                                        }
                                        //Get value of TaxLowRange
                                        if (TaxRate.TaxLowRange != null)
                                        {
                                                double TaxLowRange4231 = (double)TaxRate.TaxLowRange.GetValue();
                                        }
                                        //Get value of TaxHighRange
                                        if (TaxRate.TaxHighRange != null)
                                        {
                                                double TaxHighRange4232 = (double)TaxRate.TaxHighRange.GetValue();
                                        }
                                        //Get value of IsTaxAppliedOnlyWithinRange
                                        if (TaxRate.IsTaxAppliedOnlyWithinRange != null)
                                        {
                                                bool IsTaxAppliedOnlyWithinRange4233 = (bool)TaxRate.IsTaxAppliedOnlyWithinRange.GetValue();
                                        }
                                        //Get value of QBTaxGroup
                                        if (TaxRate.QBTaxGroup != null)
                                        {
                                                string QBTaxGroup4234 = (string)TaxRate.QBTaxGroup.GetValue();
                                        }
                                }
                        }
                        //Get value of QBTaxGroup
                        if (TaxRecordRet.TaxRecord.QBTaxGroup != null)
                        {
                                string QBTaxGroup4235 = (string)TaxRecordRet.TaxRecord.QBTaxGroup.GetValue();
                        }
                        //Get value of QBTaxCode
                        if (TaxRecordRet.TaxRecord.QBTaxCode != null)
                        {
                                string QBTaxCode4236 = (string)TaxRecordRet.TaxRecord.QBTaxCode.GetValue();
                        }
                }




        }
}