1- This is how tax created:-
val taxRate = TaxRate() taxRate.isDefault = false taxRate.name = ml + "ml" taxRate.rate = 0 taxRate.taxAmount = taxAmount val isCreated = inventoryConnector().createTaxRate2(taxRate) taxId = isCreated.id
2- This is how tax applying.
val listTaxRates = ArrayList<String>() inventoryConnector().taxRates.forEach { i -> if (taxId == i.id) { listTaxRates.add(i.id) return@forEach } } inventoryConnector().assignTaxRatesToItem( itemId, listTaxRates )
:- So I want to add tax to the specific inventory item, Suppose we have 5 inventory items so I want to add custom tax(What tax we want to add) to specific inventory item.
:-So at this time tax is created but not applied to the item.