Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edit Tax sourcing #258

Merged
merged 3 commits into from
Jun 10, 2020
Merged

Conversation

derBretti
Copy link

@derBretti derBretti commented Apr 28, 2020

Resolves #257 , #259
Impact: minor
Type: feature

Issue

  1. Tax sourcing was not editable.
  2. Addresses were not matched after editing region or postal code in custom tax rate.

Solution

  1. Add field to editor and column to table.
  2. Replace emtpy strings with null in postal code and region when creating or updating a custom tax rate.

Breaking changes

none

Testing

  1. Go to settings/tax-settings
  2. Note additional sourcing column
  3. Add or edit a custom tax rate, set value for region and postal code
  4. Note dropdown for sourcing field
  5. Edit a custom tax rate, remove values for region and postal code
  6. Note that the edited tax rate is applied when only the country matches

Sven Bretschneider added 2 commits April 28, 2020 16:39
Signed-off-by: Sven Bretschneider <[email protected]>
@aldeed
Copy link
Contributor

aldeed commented May 5, 2020

Might also fix reactioncommerce/reaction#6231

@loan-laux
Copy link
Contributor

Just noticed this PR. I've actually just submitted api-plugin-taxes-flat-rate#3 to fix this issue. It also fixes reaction#6231.

I think @derBretti's solution of sending null values instead of empty strings right from reaction-admin is cleaner. My solution was to default to null in case an empty string was received, but sending the right value from the beginning is a lot better.

@aldeed let me know if you want me to remove this server-side value check, since @derBretti's changes will be sufficient.

However, PR alone won't fix reaction#6231, since the $or selector in the MongoDB query for the Taxes collection needed to be updated to allow for country: null too.

@loan-laux
Copy link
Contributor

@willopez While you're at it, it would be great if you could also review and merge this one that's been sitting here for a while.

@willopez willopez self-requested a review June 10, 2020 18:45
Copy link
Member

@willopez willopez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks @derBretti!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tax sourcing missing
4 participants