• Welcome to KonaKart Community Forum. Please login or sign up.
 

Webservice, TaxRates

Started by eriksen, August 02, 2008, 11:54:35 pm

Previous topic - Next topic

eriksen

I'm having a problem retrieving Tax rates from Konakart.
(The insert works fine)

This is my Code ( service = KKWSAdminIf ):

AdminTaxRateSearch ss = new AdminTaxRateSearch();
ss.setId(-1);
AdminTaxRateSearchResult rr = service.getTaxRates(ss, -1, 0);
System.err.println("result: " + rr.getTaxRates().length +  " : " + rr.getTotalSetSize());

The console:
> result: 0 : 10

There is 10 rates, but I can't get them, the AdminTaxRateSearchResult is empty.
I have tried service.getAllTaxRates() with the same result.

Is this a bug, or do I do somethig very wrong here?







pete

Hi,

Try setting:

ss.setId(-1);
ss.setTaxClassId(0);
ss.setGeoZoneId(0);

to tell it to fetch all tax classes and zones.

ming

Hi,

It's not sending any results back because you've set a limit of 0:  (3rd parameter)

service.getTaxRates(ss, -1, 0);

change the last parameter to either -1 or a chosen limit (of, say 100)

Ming

eriksen

Thanks for the response!

Ming: I have tried this before, and gave it another trie now. Same result. I hva been playing around with the parameters , but allways the same result. Fks AdminTaxRateSearchResult rr = service.getTaxRates(ss, 2, 2) should give me 2 objects , but the same: 0 in result array, and 10 in getTotalSetSize.

Pete: I tried out your solution with the same negative result. I don't think changing this parameters will solve the problem anyway bacause the AdminTaxRateSearchResult says it got 10 in the result.

Is there any source code for AdminTaxRateSearch around? Its frustrating not beeng able to debug this.


Eriksen

ming

QuoteMing: I have tried this before, and gave it another trie now. Same result. I hva been playing around with the parameters , but allways the same result. Fks AdminTaxRateSearchResult rr = service.getTaxRates(ss, 2, 2) should give me 2 objects , but the same: 0 in result array, and 10 in getTotalSetSize.


Well, it works for me with a default installation.

You could enable the database logging to see what query is actually being run and figure it out from there.

The query should be:

SELECT tax_rates.tax_rates_id, tax_rates.tax_zone_id, tax_rates.tax_class_id, tax_rates.tax_priority,
tax_rates.tax_rate, tax_rates.tax_description, tax_class.tax_class_title, geo_zones.geo_zone_name
FROM tax_rates, tax_class, geo_zones WHERE tax_rates.tax_class_id=tax_class.tax_class_id
AND tax_rates.tax_zone_id=geo_zones.geo_zone_id
ORDER BY tax_class.tax_class_title ASC LIMIT 100

pete

Are the tax rates visible through the Admin App ? Remember that the Admin App uses the same API.