question

subodhrai avatar image
subodhrai asked subodhrai commented

How to set default tax rate false for Inventory item from our custom app?

1- I want to set default tax rate false from our app. As below code mentioned which I have implemented to achieve this.

val item = Item()
    item.id = inventoryItem.id
    item.defaultTaxRates=false
}
inventoryConnector().updateItem(item)
InventoryTaxes
4 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

David Marginian avatar image David Marginian ♦♦ commented ·

You are setting defaultTaxRates to false on item but updating item2 maybe that is the problem? If not, then please try to do a bit of investigation on your end. If you retrieve the item is defaultTaxRates set properly? Etc.

0 Likes 0 ·
subodhrai avatar image subodhrai David Marginian ♦♦ commented ·

Thanks for your reply,

I have updated please re-check.

0 Likes 0 ·
David Marginian avatar image David Marginian ♦♦ subodhrai commented ·

Thanks for updating your code. You don't have a valid Item there, which I am guessing is the issue. Why don't you retrieve the item, and then update it? This may not be the best example but take a look at - https://github.com/clover/clover-android-sdk/blob/master/clover-android-sdk-examples/src/main/java/com/clover/android/sdk/examples/InventoryTestActivity.java. Note how the Item() calls are wrapped in a try/catch and I am guessing you will see that you are getting an exception. You may also want to consider using the version of the updateItem call that takes a callback.

0 Likes 0 ·
Show more comments

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community