-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[Admin] Adding tax rate feature #4624
[Admin] Adding tax rate feature #4624
Conversation
lchrusciel
commented
Mar 25, 2016
Q | A |
---|---|
Bug fix? | no |
New feature? | no |
BC breaks? | no |
Deprecations? | no |
Related tickets | |
License | MIT |
Given I want to create a new tax rate | ||
When I specify its code as "EUROPEAN_UNION_SALES_TAX" | ||
And I name it "European Union Sales Tax" | ||
And It is defined for EU zone |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It -> it
1701cdc
to
4a82c04
Compare
And It is defined for EU zone | ||
And It defines tax rates for "Food and Beverage" tax category | ||
And I its amount is "20%" | ||
And I choose default calculator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possibly the default calculator? /cc @TheMadeleine the articles master 🎉
ba8b89b
to
0148fa7
Compare
Given I want to create a new tax rate | ||
When I specify its code as "EUROPEAN_UNION_SALES_TAX" | ||
And I name it "European Union Sales Tax" | ||
And it is defined for a EU zone |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anyway, we use "I specify its code", "I name it" but the "it is defined", "it defines", looks inconsistent.
Shouldn't it be "I define it for the EU zone", "I make it applicable for "Food and Beverage" tax category", etc.?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thats was what I needed
1b173c9
to
cda0c4c
Compare
I want to add a new tax rate to the registry | ||
|
||
Background: | ||
Given there is "EU" zone containing all members of European Union |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is "EU" zone
it is defined for a EU zone
Let's either use the quotation marks or not :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Applied (edited)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given there is a zone "EU" containing all members of the European Union
cda0c4c
to
f100cc8
Compare
Looks good! 👍 |
f100cc8
to
92c3969
Compare
Given I want to create a new tax rate | ||
When I specify its code as "EUROPEAN_UNION_SALES_TAX" | ||
And I name it "European Union Sales Tax" | ||
And I define it for a "EU" zone |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for the "EU" zone
Cause it is already defined in the system and we know which one it is. :D
cfba78c
to
60af81a
Compare
{ | ||
$taxRate = $this->taxRateRepository->findOneBy(['name' => $taxRateName]); | ||
if (null === $taxRate) { | ||
throw new \InvalidArgumentException(sprintf('Tax category with name "%s" does not exist', $taxRateName)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing dot at the end of exception message.
/** | ||
* @author Łukasz Chruściel <lukasz.chrusciel@lakion.com> | ||
*/ | ||
trait ChoosesCalculator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do not have many other calculators, I think in this case trait is an overkill.
315ff32
to
694f094
Compare
*/ | ||
public function iShouldBeNotifiedAboutSuccessfulEdition() | ||
{ | ||
$this->updatePage->isCodeDisabled(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant
4fcbd22
to
260a650
Compare
@@ -0,0 +1,16 @@ | |||
sylius_admin_tax_category: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sylius_admin_tax_rate
260a650
to
17a5a60
Compare
And I define it for the "European Union" zone | ||
And I make it applicable for the "Food and Beverage" tax category | ||
And I specify its amount as 20% | ||
And I want to use the default tax calculator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And I want to use choose?
Nice work! 👍 |
17a5a60
to
107f940
Compare
107f940
to
1d34671
Compare
@@ -0,0 +1,58 @@ | |||
@managing_tax_rates | |||
Feature: Editing tax rate | |||
In order to change tax classification of my products |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order to change taxes applied to orders
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"taxes applied to products" will be more appropriate for me :)