Google Geocode Returns Wring Address - geocode

I am using the Google geocode API and the results I receive are almost always accurate, except when they are not. For exampe, the URL: https://maps.google.com/maps/api/geocode/xml?sensor=false&key=mykey&address=107%20Vandiver%20Rd%20Lot#13,Allenhurst,GA,31301 returns a completely different area of the country (listed below). The same address returns: 107 Vandiver Rd #13
Allenhurst, GA 31301 on Google Maps. Any idea as to what I a doing wrong?
Returns:
<GeocodeResponse>
<status>OK</status>
<result>
<type>premise</type>
<formatted_address>107 Vandiver Dr, Madison, TN 37115, USA</formatted_address>
<address_component>
<long_name>107</long_name>
<short_name>107</short_name>
<type>street_number</type>
</address_component>
<address_component>
<long_name>Vandiver Drive</long_name>
<short_name>Vandiver Dr</short_name>
<type>route</type>
</address_component>
<address_component>
<long_name>Madison</long_name>
<short_name>Madison</short_name>
<type>neighborhood</type>
<type>political</type>
</address_component>
<address_component>
<long_name>Nashville</long_name>
<short_name>Nashville</short_name>
<type>locality</type>
<type>political</type>
</address_component>
<address_component>
<long_name>Davidson County</long_name>
<short_name>Davidson County</short_name>
<type>administrative_area_level_2</type>
<type>political</type>
</address_component>
<address_component>
<long_name>Tennessee</long_name>
<short_name>TN</short_name>
<type>administrative_area_level_1</type>
<type>political</type>
</address_component>
<address_component>
<long_name>United States</long_name>
<short_name>US</short_name>
<type>country</type>
<type>political</type>
</address_component>
<address_component>
<long_name>37115</long_name>
<short_name>37115</short_name>
<type>postal_code</type>
</address_component>
<address_component>
<long_name>4242</long_name>
<short_name>4242</short_name>
<type>postal_code_suffix</type>
</address_component>
<geometry>
<location>
<lat>36.2632706</lat>
<lng>-86.6781400</lng>
</location>
<location_type>ROOFTOP</location_type>
<viewport>
<southwest>
<lat>36.2619304</lat>
<lng>-86.6795023</lng>
</southwest>
<northeast>
<lat>36.2646284</lat>
<lng>-86.6768044</lng>
</northeast>
</viewport>
<bounds>
<southwest>
<lat>36.2632156</lat>
<lng>-86.6782322</lng>
</southwest>
<northeast>
<lat>36.2633432</lat>
<lng>-86.6780745</lng>
</northeast>
</bounds>
</geometry>
<place_id>ChIJ_XkNqMtDZIgRQYGJVL6WQro</place_id>
</result>
</GeocodeResponse>

You are not url encoding the '#' in 'Lot#13'
https://maps.google.com/maps/api/geocode/xml?sensor=false&key=mykey&address=107%20Vandiver%20Rd%20Lot%2313,Allenhurst,GA,31301 will work fine.

Related

Kie Workbench Execute Rules

May be this question has been asked number of times but I could not figure out the actual solution by going through them. I have a decision table in KIEWorkbench which takes the input from one fact and sets it into another fact. I am trying to call the rules by invoking the endpoint: http://localhost:8085/kie-server-6.4.0.Final-ee7/services/rest/server/containers/instances/pocResult
In the header, I have set the Content-Type as application/xml.
<batch-execution lookup="ksession">
<insert out-identifier="Subject">
<demo.pocFindResult.Subject>
<bCode> ABC</bCode>
<bGCode>XY</bGCode>
<pCode>L0001</pcode>
<subjectType>CA</subjectType>
</demo.pocFindResult.Subject>
</insert>
<fire-all-rules />
<get-objects out-identifier="Result">
<demo.pocFindResult.result/>
</get-objects>
My Decision table is as below:
package demo.pocFindResult;
//from row number: 1
rule "Row 1 findrules"
ruleflow-group "fire-rules"
dialect "java"
lock-on-active true
no-loop true
when
sub : Subject( bCode == "ABC" , bGCode == "XY" , subjectType == "CA" , pCode == "L0001" )
then
Result rs = new Result();
rs.setResultStartDate( "*TODAY" );
rs.setResultEndDate( "*YEAREND" );
rs.setResultContentStartDate( "*TODAY" );
rs.setResultContentEndDate( "*YEAREND" );
insert( rs );
end
How can I get the Result object as the response? Here is my response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<response type="SUCCESS" msg="Container pocResult successfully called.">
<execution-results>
<results>
<item key="Subject">
<value xsi:type="jaxbListWrapper" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<type>LIST</type>
</value>
</item>
</results>
<facts>
<item key="Subject"/>
</facts>
</execution-results>
</response>
I want the result object with the dates set.
What is the response you get?
I would firstly try to place fire-all-rules tag after your return object. Otherwise, I would try:
<batch-execution lookup="ksession">
<insert out-identifier="Subject">
<demo.pocFindResult.Subject>
<bCode> ABC</bCode>
<bGCode>XY</bGCode>
<pCode>L0001</pcode>
<subjectType>CA</subjectType>
</demo.pocFindResult.Subject>
</insert>
<insert out-identifier="Result" return-object="true" entry-point="DEFAULT">
<demo.pocFindResult.result/>
</insert>
<fire-all-rules/>
</batch-execution>
I am using JBPM 7.0.0-SNAPSHOT and got the same result as yours. When I used the same rules in 6.2.0.Final, I had result back.
EDIT:
The key problem is the header:
Authorization:Basic YWRtaW46YWRtaW4=
Content-Type:application/xml ,
Then I added another header:
"X-KIE-ContentType : XSTREAM"
<batch-execution lookup="defaultKieSession">
<insert return-object="true">
<com.bp.PageContext>
<ID>AID</ID>
</com.bp.PageContext>
</insert>
<insert out-identifier="Group" return-object="true">
<com.bp.GroupData>
</com.bp.GroupData>
</insert>
<insert out-identifier="ERR" return-object="true">
<com.bp.ErrorMessage/>
</insert>
<fire-all-rules/>
<get-objects/>
</batch-execution>
I've got the result back:
<org.kie.server.api.model.ServiceResponse>
<type>SUCCESS</type>
<msg>Container bpcontainr successfully called.</msg>
<result class="execution-results">
<result identifier="Group">
<com.bp,GroupData>
<Code>TEST,QA</Code>
</com.bp.GroupData>
</result>
<result identifier="ERR">
<com.bp.ErrorMessage/>
</result>
<fact-handle identifier="Group" external-form="0:8:567620710:567620710:8:DEFAULT:NON_TRAIT:com.bp.GroupData"/>
<fact-handle identifier="ERR" external-form="0:9:1581854082:1581854082:9:DEFAULT:NON_TRAIT:com.bp.ErrorMessage"/>
</result>
</org.kie.server.api.model.ServiceResponse>

SSO:How to get array of groups in redmine ominiauth SAML plugin from the SAML respone?

Implementing SSO for redmine: Idp- OpenAM, SP-redmine (Ominiauth SAML plugin)
I want to get list of groups which are assigned to user in redmine_ominiauth_saml plugin but I can get just single group which is first on SAML response in groups assertion.
So is there any different configuration for array attribute:
Mapping of attributes for SP on OpenAM:
groups=isMemberOf
last_name=sn
username=mail
first_name=givenName
email=mail
Mapping of attributes on Redmine:
"/opt/redmine/config/initializers/saml_3.0.rb"
:attribute_mapping => {
# How will we map attributes from SSO to redmine attribute
:login => 'extra.raw_info.username',
:firstname => 'extra.raw_info.first_name',
:lastname => 'extra.raw_info.last_name',
:mail => 'extra.raw_info.email',
:isMemberOf => 'extra.raw_info.groups'
}
SAML response contains attribute groups in array like this:
<saml:AttributeStatement>
<saml:Attribute Name="first_name">
<saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="xs:string"
>umesh</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute Name="username">
<saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="xs:string"
>ubr#abc.com</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute Name="email">
<saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="xs:string"
>ubr#abc.com</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute Name="last_name">
<saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="xs:string"
>rajani</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute Name="groups">
<saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="xs:string"
>cn=ABC,ou=groups,dc=abc,dc=opendj,dc=com</saml:AttributeValue>
<saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="xs:string"
>cn=XYZ,ou=groups,dc=abc,dc=opendj,dc=com</saml:AttributeValue>
<saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="xs:string"
>cn=YZQ,ou=groups,dc=abc,dc=opendj,dc=com</saml:AttributeValue>
</saml:Attribute>
</saml:AttributeStatement>
I knew this code in SAML plugin gives me single group (code in ruby):
/opt/redmine/plugins/redmine_omniauth_saml/lib/redmine_omniauth_saml.rb
def user_attributes_from_saml(omniauth)
HashWithIndifferentAccess.new.tap do |h|
required_attribute_mapping.each do |symbol|
key = configured_saml[:attribute_mapping][symbol]
h[symbol] = key.split('.') # Get an array with nested keys: name.first will return [name, first]
.map {|x| [:[], x]} # Create pair elements being :[] symbol and the key
.inject(omniauth) do |hash, params| # For each key, apply method :[] with key as parameter
hash.send(*params)
end
**print "key:value "+key+":" +h[symbol]** # gives key value pair, first_name, group 'ABC' only leaves other group
end
end
end
Actually ruby-saml plugin is default retrun as attributes as single value.
We need to set as for multi value in ruby-saml plugin.
ruby-saml plugin have attributes.rb file.
Update the value of ##single_value_compatibility and set as "false"
Now you are getting full array of value.
Hope you issue will resolved.

Get Contacts folder items using ews in office 365

I'm using the following SOAP request to retrieve the items in contacts folder in office 365 mail addin
'<?xml version="1.0" encoding="UTF-8"?>'+
' <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"' +
' xmlns:xsd="http://www.w3.org/2001/XMLSchema"' +
' xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"'+
' xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages">'+
' <soap:Header>'+
' <t:RequestServerVersion Version="Exchange2013" />' +
' </soap:Header>'+
' <soap:Body >'+
' <m:FindPeople>'+
' <m:IndexedPageItemView BasePoint="Beginning" MaxEntriesReturned="100" Offset="0"/>'+
' <m:ParentFolderId>'+
' <t:DistinguishedFolderId Id="contacts"/>'+
' </m:ParentFolderId>'+
' </m:FindPeople>'+
' </soap:Body>'+
' </soap:Envelope>';
But the following error shows up.
I have used FindItem , GetFolder methods for calendar folder and those are working.
Is there anyway to look for people email address by using the name as search value.
the makeEwsRequestAsync in Mail Apps only supports a subset of EWS operations which FindPeople is not one of. You can see a full list of supported operations on https://msdn.microsoft.com/en-us/library/office/fp160952.aspx .
Is there anyway to look for people email address by using the name as search value.
Sure just use a FindItem with a restriction on the DisplayName eg
<?xml version="1.0" encoding="utf-8" ?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="
http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://sc
hemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xml
soap.org/soap/envelope/">
<soap:Header>
<t:RequestServerVersion Version="Exchange2013_SP1" />
</soap:Header>
<soap:Body>
<m:FindItem Traversal="Shallow">
<m:ItemShape>
<t:BaseShape>AllProperties</t:BaseShape>
</m:ItemShape>
<m:IndexedPageItemView MaxEntriesReturned="1000" Offset="0" BasePoint="Beginning" />
<m:Restriction>
<t:Contains ContainmentMode="Substring" ContainmentComparison="IgnoreCase">
<t:FieldURI FieldURI="contacts:DisplayName" />
<t:Constant Value="Blah blah" />
</t:Contains>
</m:Restriction>
<m:ParentFolderIds>
<t:DistinguishedFolderId Id="contacts" />
</m:ParentFolderIds>
</m:FindItem>
</soap:Body>
</soap:Envelope>
Cheers
Glen

GE Orion Context Broker: when we make an update of the entity, does not allow us to update the attribute of type "coords"

Regards,
Our problem is ‘a priori’ related to the GE implementation Orion Context Broker. Our version Orion Context Broker: 0.14.0.
We have a Web Service which we have implemented, sending data collected by a number of dispositives, to a machine that we have deployed in our account Fi-ware Platform. The problem that has been presented to us is that one of the attributes we are setting is a type attribute “coords” and when we are trying to make an update of the entity, does not allow us to update that attribute, and gives the following error (see below, a part of the response). We also want to update this field.
</contextAttribute>
<contextAttribute>
<name>android_version</name>
<type />
<contextValue />
</contextAttribute>
<contextAttribute>
<name>date</name>
<type />
<contextValue />
</contextAttribute>
<contextAttribute>
<name>position</name>
<type>coords</type>
<contextValue />
<metada>
<contextMetadata>
<name>location</name>
<type>string</type>
<value>WSG84</value>
</contextMetadata>
</metada>
</contextAttribute>
</contextAttributeList>
</contextElement>
<statusCode>
<code>472</code>
<reasonPhrase>request parameter is invalid/not allowed</reasonPhrase>
<details>action:UPDATE - entity: (300000000000008, dispositivo) - offending attribute: position - location attribute has to be defined at creation time, with APPEND</details>
</statusCode>
</contextElementResponse>
The REST request that we are setting to the ContextBroker and which is giving us problems is:
public static String payloadUpdateTemplate =
#"<updateContextRequest>
<contextElementList>
<contextElement>
<entityId type='dispositivo' isPattern='false'>
<id>{0}</id>
</entityId>
<contextAttributeList>
<contextAttribute>
<name>temperature</name>
<type>Cº</type>
<contextValue>{1}</contextValue>
</contextAttribute>
<contextAttribute>
<name>latitude</name>
<type>φ</type>
<contextValue>{2}</contextValue>
</contextAttribute>
<contextAttribute>
<name>longitude</name>
<type>λ</type>
<contextValue>{3}</contextValue>
</contextAttribute>
<contextAttribute>
<name>altitude</name>
<type>m</type>
<contextValue>{4}</contextValue>
</contextAttribute>
<contextAttribute>
<name>acceleration</name>
<type>m/s²</type>
<contextValue>{5}</contextValue>
</contextAttribute>
<contextAttribute>
<name>android_version</name>
<type></type>
<contextValue>{6}</contextValue>
</contextAttribute>
<contextAttribute>
<name>date</name>
<type></type>
<contextValue>{7}</contextValue>
</contextAttribute>
<contextAttribute>
<name>position</name>
<type>coords</type>
<contextValue>{2}, {3}</contextValue>
<metadata>
<contextMetadata>
<name>location</name>
<type>string</type>
<value>WSG84</value>
</contextMetadata>
</metadata>
</contextAttribute>
</contextAttributeList>
</contextElement>
</contextElementList>
<updateAction>UPDATE</updateAction>
</updateContextRequest>";
Yes, we have previously created the entity that we are trying to update, using updateContext operation with APPEND action type. The payload that we are using to do entity creation is:
public static String payloadInsertTemplate =
#"<updateContextRequest>
<contextElementList>
<contextElement>
<entityId type='dispositivo' isPattern='false'>
<id>{0}</id>
</entityId>
<contextAttributeList>
<contextAttribute>
<name>temperature</name>
<type>Cº</type>
<contextValue>{1}</contextValue>
</contextAttribute>
<contextAttribute>
<name>latitude</name>
<type>φ</type>
<contextValue>{2}</contextValue>
</contextAttribute>
<contextAttribute>
<name>longitude</name>
<type>λ</type>
<contextValue>{3}</contextValue>
</contextAttribute>
<contextAttribute>
<name>altitude</name>
<type>m</type>
<contextValue>{4}</contextValue>
</contextAttribute>
<contextAttribute>
<name>acceleration</name>
<type>m/s²</type>
<contextValue>{5}</contextValue>
</contextAttribute>
<contextAttribute>
<name>android_version</name>
<type></type>
<contextValue>{6}</contextValue>
</contextAttribute>
<contextAttribute>
<name>date</name>
<type></type>
<contextValue>{7}</contextValue>
</contextAttribute>
<contextAttribute>
<name>position</name>
<type>coords</type>
<contextValue>{2}, {3}</contextValue>
<metadata>
<contextMetadata>
<name>location</name>
<type>string</type>
<value>WSG84</value>
</contextMetadata>
</metadata>
</contextAttribute>
</contextAttributeList>
</contextElement>
</contextElementList>
<updateAction>APPEND</updateAction>
</updateContextRequest>";
We are using a REST Web Service. The literal {0} in the payload identifies each entity of the context. For example, if the ID of a dispositivo is 1111, the literal {0} will be 1111. In the other side, if the code of a sensor is 2222, the literal {0} will be 2222. The literal {0} is an identification key (unique and not null).
More information,
1) First of all, we insert a new entity with the following payload. The literal {0} is the ID of the entity, for example, id(entity) = 30000000000002. The literal {1} is the current value of the temperature of the entity Id, for example, temperature(entity) = 30,0.
public static String payloadInsertTemplate =
#"<updateContextRequest>
<contextElementList>
<contextElement>
<entityId type='dispositivo' isPattern='false'>
<id>{0}</id>
</entityId>
<contextAttributeList>
<contextAttribute>
<name>temperature</name>
<type>Cº</type>
<contextValue>{1}</contextValue>
</contextAttribute>
.
.
.
.
<contextAttribute>
<name>position</name>
<type>coords</type>
<contextValue>{2}, {3}</contextValue>
<metadata>
<contextMetadata>
<name>location</name>
<type>string</type>
<value>WSG84</value>
</contextMetadata>
</metadata>
</contextAttribute>
</contextAttributeList>
</contextElement>
</contextElementList>
<updateAction>APPEND</updateAction>
</updateContextRequest>";
2) The result of the insertion operation is as follows.
<updateContextResponse>
<contextResponseList>
<contextElementResponse>
<contextElement>
<entityId type="dispositivo" isPattern="false">
<id>30000000000002</id>
</entityId>
<contextAttributeList>
<contextAttribute>
<name>temperature</name>
<type>Cº</type>
<contextValue />
</contextAttribute>
.
.
.
.
<contextAttribute>
<name>position</name>
<type>coords</type>
<contextValue />
<metadata>
<contextMetadata>
<name>location</name>
<type>string</type>
<value>WSG84</value>
</contextMetadata>
</metadata>
</contextAttribute>
</contexAttributeList>
</contextElement>
<statusCode>
<code>200</code>
<reasonPhrase>OK</reasonPhrase>
</statusCode>
</contextElementResponse>
</contextResponseList>
</updateContextResponse>
3) We make the query and we can check the new values created with the payload.
<queryContextRequest>
<entityIdList>
<entityId type='dispositivo' isPattern='false'>
<id>{0}</id>
</entityId>
</entityIdList>
<attributeList/>
</queryContextRequest>
4) Then we are getting the value that we have introduced.
<queryContextResponse>
<contextResponseList>
<contextElementResponse>
<contextElement>
<entityId type="dispositivo" isPattern="false">
<id>30000000000002</id>
</entityId>
<contextAttributeList>
<contextAttribute>
<name>temperature</name>
<type>Cº</type>
<contextValue>30,0</contextValue>
</contextAttribute>
.
.
.
.
<contextAttribute>
<name>position</name>
<type>coords</type>
<contextValue>36.723804, -4.417518</contextValue>
<metadata>
<contextMetadata>
<name>location</name>
<type>string</type>
<value>WSG84</value>
</contextMetadata>
</metadata>
</contextAttribute>
</contextAttributeList>
</contextElement>
<statusCode>
<code>200</code>
<reasonPhrase>OK</reasonPhrase>
</statusCode>
</contextElementResponse>
</contextResponseList>
5) Now we try to do the update of this data which we have introduced correctly (how you can check) and it gives the error.
This block means that you can't update a value of an attribute that not defined at creation time.
action:UPDATE - entity: (300000000000008, dispositivo) -
offending attribute: position - location attribute has to be defined
at creation time, with APPEND
If the location attribute was not defined at creation time you should use APPEND action to create that new attribute in your entity, also if this entity already created before.
Using APPEND instead of UPDATE you will be able to append new attributes to a previously created Entity.
After that be sure that you're replacing all curly braces to properly values.
This seems to be an issue in 0.14.0 (and before). Fortunatelly, there are two easy workarounds to this problem:
Use APPEND instead of UPDATE (note that APPEND on existing context elements has the same semantic than UPDATE).
Remove the <metadata>...</metadata> for location given that once you have defined an attribute as location it is stored as such and you don't need to "repeat" the metadata in further updateCoxtext requests (you can check that with queryContext).
We will implement a fix in the next release (0.14.1). Thanks for the feedback!

Quickbooks IPP v3 sales tax issue

We are building an application using IPP v3 that will sync invoices from our SaaS app to QBOE (and hopefully QBD). The problem are are encountering is with replicating the sales on our invoices with the invoices created in quickbooks.
Specifically, our invoices can have line items which are not taxable (each state is different in terms of which items are taxed and at what rate). Also there are many times both state, city and county taxes, some of which apply to some line items and not to others.
It appears for the IPP v3 US version, taxes must be global to the invoice?
I think that all of this could be solved if we could just override the total tax amount for the invoice. Documentations seems to indicate that API supports that. However, all my attempts were ignored. It's either no Tax or default tax rate (in percentage). That means that we can't override totals or enter fixed taxes.
Another option would be to add an extra line to the invoice named "Tax Name" and the value. The invoice total would be correct but Tax Reports on quickbooks wouldn't?
I would really like a straight answer like "tax amount cannot be overridden through the API" just to be sure.
I would also like to know if Intuit plans to support that feature in a near future?
There are fields in the API like "PercentBased" (which can be set to true or false) that seem to indicate that fixed amounts can be set. But these fields are completely ignored when I try to use them.
Any help or future guidance on this would be greatly appreciate as it pertains to IPP v3 for QBOE / QBD.
Here's our XML request
<?xml version='1.0' encoding='utf-8'?>
<IntuitBatchRequest xmlns:ns2="http://www.intuit.com/sb/cdm/qbo"
xmlns="http://schema.intuit.com/finance/v3">
<BatchItemRequest bId="bid1" operation="create">
<Invoice>
<DocNumber>2459999</DocNumber>
<TxnDate>2012-12-10</TxnDate>
<GlobalTaxCalculation>TaxIncluded</GlobalTaxCalculation>
<Line>
<DetailType>SalesItemLineDetail</DetailType>
<Amount>200</Amount>
<SalesItemLineDetail>
<TaxCodeRef>TAX</TaxCodeRef>
<ServiceDate>2012-12-10</ServiceDate>
</SalesItemLineDetail>
<Description>Test</Description>
<ItemRef>1</ItemRef>
</Line>
<CustomerRef>66</CustomerRef>
<TxnTaxDetail>
<TaxLine>
<DetailType>TaxLineDetail</DetailType>
<Amount>13.00</Amount>
<TaxLineDetail>
<NetAmountTaxable>200.00</NetAmountTaxable>
<TaxPercent>6.50</TaxPercent>
<TaxRateRef>1</TaxRateRef>
<PercentBased>true</PercentBased>
</TaxLineDetail>
</TaxLine>
</TxnTaxDetail>
</Invoice>
</BatchItemRequest>
</IntuitBatchRequest>
You can override the tax amount in the Taxline in TxnTaxDetail-
Eg:
Includes tax # 20% on 16.67 = 3.33. we would expect the request to include following tax details
"TxnTaxDetail": {
"TotalTax":3.33,
"TaxLine":[
{
"Amount":3.33,
"DetailType": "TaxLineDetail",
"TaxLineDetail": {
"TaxRateRef": {
"value":"4"
},
"PercentBased":true,
"TaxPercent": 20,
"NetAmountTaxable": 16.67
"GlobalTaxCalculation": "TaxIncludes",...
Please refer-
https://developer.intuit.com/docs/0025_quickbooksapi/0050_data_services/v3/020_key_concepts/0700_other_topics#TxnTaxDetail
EDIT:
Adding the sample request and response xml. Just set the following tags.
<TxnTaxDetail>
<TxnTaxCodeRef>
<TotalTax>
</TxnTaxDetail>
Do not set the Taxline as QBO recalculates the tax based on the details sent in the request. So in response you’ll get the recalculated amount based in the TaxPercent specified.
Request sample-
<?xml version="1.0"?>
<Invoice xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schema.intuit.com/finance/v3">
<TxnDate>2013-10-11+05:30</TxnDate>
<PrivateNote>This is a private note</PrivateNote>
<Line>
<Description>Invoice line description.</Description>
<Amount>900</Amount>
<DetailType>SalesItemLineDetail</DetailType>
<SalesItemLineDetail>
<ItemRef name="Bat">2</ItemRef>
<UnitPrice>90</UnitPrice>
<Qty>10</Qty>
<TaxCodeRef>TAX</TaxCodeRef>
<ServiceDate>2013-10-11+05:30</ServiceDate>
</SalesItemLineDetail>
</Line>
<TxnTaxDetail>
<TxnTaxCodeRef name="StateSalesTax">8</TxnTaxCodeRef>
<TotalTax>450</TotalTax>
</TxnTaxDetail>
<AutoDocNumber>true</AutoDocNumber>
<CustomerRef name="5748584cc7d64bb18a0e">23</CustomerRef>
<BillAddr>
<Line1>123 Main St.</Line1>
<Line2>Unit 506</Line2>
<City>Brockton</City>
<Country>United States</Country>
<CountrySubDivisionCode>MA</CountrySubDivisionCode>
<PostalCode>02301</PostalCode>
<Note>Billing Address Note</Note>
</BillAddr>
<ShipAddr>
<Line1>100 Fifth Ave.</Line1>
<City>Waltham</City>
<Country>United States</Country>
<CountrySubDivisionCode>MA</CountrySubDivisionCode>
<PostalCode>02452</PostalCode>
<Note>Shipping Address Note</Note>
</ShipAddr>
<SalesTermRef name="Due on receipt">1</SalesTermRef>
<DueDate>2013-11-10+05:30</DueDate>
<GlobalTaxCalculation>TaxInclusive</GlobalTaxCalculation>
<ARAccountRef name="Accounts Receivable (A/R)">32</ARAccountRef>
</Invoice>
Response sample-
<IntuitResponse xmlns="http://schema.intuit.com/finance/v3" time="2013-10-18T01:50:19.576-07:00">
<Invoice domain="QBO" sparse="false">
<Id>50</Id>
<SyncToken>0</SyncToken>
<MetaData>
<CreateTime>2013-10-18T01:50:20-07:00</CreateTime>
<LastUpdatedTime>2013-10-18T01:50:20-07:00</LastUpdatedTime>
</MetaData>
<DocNumber>1037</DocNumber>
<TxnDate>2013-10-11</TxnDate>
<PrivateNote>This is a private note</PrivateNote>
<Line>
<Id>1</Id>
<LineNum>1</LineNum>
<Description>Invoice line test</Description>
<Amount>900.00</Amount>
<DetailType>SalesItemLineDetail</DetailType>
<SalesItemLineDetail>
<ItemRef name="Bat">2</ItemRef>
<UnitPrice>90</UnitPrice>
<Qty>10</Qty>
<TaxCodeRef>TAX</TaxCodeRef>
<ServiceDate>2013-10-11</ServiceDate>
</SalesItemLineDetail>
</Line>
<Line>
<Amount>900.00</Amount>
<DetailType>SubTotalLineDetail</DetailType>
<SubTotalLineDetail />
</Line>
<TxnTaxDetail>
<TxnTaxCodeRef>8</TxnTaxCodeRef>
<TotalTax>450.00</TotalTax>
<TaxLine>
<Amount>450.00</Amount>
<DetailType>TaxLineDetail</DetailType>
<TaxLineDetail>
<TaxRateRef>18</TaxRateRef>
<PercentBased>true</PercentBased>
<TaxPercent>2.5</TaxPercent>
<NetAmountTaxable>900.00</NetAmountTaxable>
</TaxLineDetail>
</TaxLine>
</TxnTaxDetail>
<CustomerRef name="5748584cc7d64bb18a0e">23</CustomerRef>
<BillAddr>
<Id>78</Id>
<Line1>123 Main St.</Line1>
<Line2>Unit 506</Line2>
<City>Brockton</City>
<Country>United States</Country>
<CountrySubDivisionCode>MA</CountrySubDivisionCode>
<PostalCode>02301</PostalCode>
<Lat>42.0829092</Lat>
<Long>-71.01995200000002</Long>
</BillAddr>
<ShipAddr>
<Id>79</Id>
<Line1>100 Fifth Ave.</Line1>
<City>Waltham</City>
<Country>United States</Country>
<CountrySubDivisionCode>MA</CountrySubDivisionCode>
<PostalCode>02452</PostalCode>
<Lat>42.3933303</Lat>
<Long>-71.256777</Long>
</ShipAddr>
<SalesTermRef>1</SalesTermRef>
<DueDate>2013-11-10</DueDate>
<TotalAmt>1350.00</TotalAmt>
<ApplyTaxAfterDiscount>false</ApplyTaxAfterDiscount>
<PrintStatus>NeedToPrint</PrintStatus>
<EmailStatus>NotSet</EmailStatus>
<Balance>1350.00</Balance>
<Deposit>0</Deposit>
<AllowIPNPayment>false</AllowIPNPayment>
<AllowOnlinePayment>false</AllowOnlinePayment>
</Invoice>
</IntuitResponse>
EDIT for Global-
Ok, I retested this fr Global.
I can override amounts for individual taxlines and then final taxamount-
here is an invoice update request -
I changed the following tags-
<TxnTaxDetail>
<TotalTax>2.90</TotalTax>
and then in one of the taxlines
<TaxLine>
<Amount>0.70</Amount>
and then in the final invoice amounts
<TotalAmt>79.90</TotalAmt>
<Balance>79.90</Balance>
<Invoice xmlns="http://schema.intuit.com/finance/v3" domain="QBO" sparse="false">
<Id>1</Id>
<SyncToken>0</SyncToken>
<MetaData>
<CreateTime>2015-01-30T09:32:06-08:00</CreateTime>
<LastUpdatedTime>2015-01-30T09:32:06-08:00</LastUpdatedTime>
</MetaData>
<DocNumber>1001</DocNumber>
<TxnDate>2015-01-30</TxnDate>
<CurrencyRef name="Canadian Dollar">CAD</CurrencyRef>
<Line>
<Id>1</Id>
<LineNum>1</LineNum>
<Amount>33.00</Amount>
<DetailType>SalesItemLineDetail</DetailType>
<SalesItemLineDetail>
<ItemRef name="Hours">2</ItemRef>
<UnitPrice>33</UnitPrice>
<Qty>1</Qty>
<TaxCodeRef>7</TaxCodeRef>
</SalesItemLineDetail>
</Line>
<Line>
<Id>2</Id>
<LineNum>2</LineNum>
<Amount>44.00</Amount>
<DetailType>SalesItemLineDetail</DetailType>
<SalesItemLineDetail>
<ItemRef name="Sales">1</ItemRef>
<UnitPrice>44</UnitPrice>
<Qty>1</Qty>
<TaxCodeRef>5</TaxCodeRef>
</SalesItemLineDetail>
</Line>
<Line>
<Amount>77.00</Amount>
<DetailType>SubTotalLineDetail</DetailType>
<SubTotalLineDetail />
</Line>
<TxnTaxDetail>
<TotalTax>2.90</TotalTax>
<TaxLine>
<Amount>2.20</Amount>
<DetailType>TaxLineDetail</DetailType>
<TaxLineDetail>
<TaxRateRef>6</TaxRateRef>
<PercentBased>true</PercentBased>
<TaxPercent>5</TaxPercent>
<NetAmountTaxable>44.00</NetAmountTaxable>
</TaxLineDetail>
</TaxLine>
<TaxLine>
<Amount>0.70</Amount>
<DetailType>TaxLineDetail</DetailType>
<TaxLineDetail>
<TaxRateRef>15</TaxRateRef>
<PercentBased>true</PercentBased>
<TaxPercent>2</TaxPercent>
<NetAmountTaxable>33.00</NetAmountTaxable>
</TaxLineDetail>
</TaxLine>
</TxnTaxDetail>
<CustomerRef name="dd">1</CustomerRef>
<SalesTermRef>3</SalesTermRef>
<DueDate>2015-03-01</DueDate>
<GlobalTaxCalculation>TaxExcluded</GlobalTaxCalculation>
<TotalAmt>79.90</TotalAmt>
<PrintStatus>NotSet</PrintStatus>
<EmailStatus>NotSet</EmailStatus>
<Balance>79.90</Balance>
<Deposit>0</Deposit>
<AllowIPNPayment>false</AllowIPNPayment>
<AllowOnlinePayment>false</AllowOnlinePayment>
<AllowOnlineCreditCardPayment>false</AllowOnlineCreditCardPayment>
<AllowOnlineACHPayment>false</AllowOnlineACHPayment>