solidusio / solidus_avatax

Avatax integration with Solidus
BSD 3-Clause "New" or "Revised" License
5 stars 23 forks source link

Errors encountered when using admin trying to delete adjustments. #10

Closed dhonig closed 8 years ago

dhonig commented 9 years ago

So posting here but I am on Spree 2.3.5 of the Bonobos fork with spree_avatax.
I am seeing a problem with the following workflow

  1. Customer service unlocks adjustments to modify an order.
  2. Customer service attempts to delete an adjustment
  3. Since the adjustment is unlocked the Spree::TaxRate#compute_adjustment(item) method is called which then raises an error as defined below def compute_amount(item)

    Avatax tax adjustments should always be in a closed state so Spree should never attempt to call this code

    raise SpreeAvatax::TaxRateInvalidOperation.new("Spree::TaxRate#compute_amount should never be called when Avatax is present") end

For a quick fix, I have changed this to: def compute_amount(item) item.amount end

Which will just return the previously calculated tax, which should be correct.

Just wondering if this case was never considered or encountered as its very possible folks are managing customer service issues/refunds/adjustments in other ways?

dhonig commented 9 years ago

just a foot note that this is most likely a workflow issue. if the adjustments are locked before being saved then there are no issues.

dhonig commented 8 years ago

closing since this is can be avoided if the proper workflow is followed.