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

[Admin] Adding tax rate feature #4624

Merged
merged 5 commits into from
Mar 29, 2016

Conversation

lchrusciel
Copy link
Member

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
Copy link
Contributor

Choose a reason for hiding this comment

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

It -> it

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
Copy link
Contributor

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 🎉

@lchrusciel lchrusciel force-pushed the tax-rate-features branch 2 times, most recently from ba8b89b to 0148fa7 Compare March 25, 2016 10:50
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
Copy link
Contributor

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.?

Copy link
Member Author

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

@lchrusciel lchrusciel force-pushed the tax-rate-features branch 2 times, most recently from 1b173c9 to cda0c4c Compare March 25, 2016 10:54
I want to add a new tax rate to the registry

Background:
Given there is "EU" zone containing all members of European Union
Copy link
Contributor

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 :)

Copy link
Member Author

Choose a reason for hiding this comment

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

👍 Applied (edited)

Copy link
Member

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

@pamil
Copy link
Contributor

pamil commented Mar 25, 2016

Looks good! 👍

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
Copy link
Member

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

@pjedrzejewski pjedrzejewski added the Admin AdminBundle related issues and PRs. label Mar 25, 2016
@lchrusciel lchrusciel force-pushed the tax-rate-features branch 8 times, most recently from cfba78c to 60af81a Compare March 25, 2016 14:26
{
$taxRate = $this->taxRateRepository->findOneBy(['name' => $taxRateName]);
if (null === $taxRate) {
throw new \InvalidArgumentException(sprintf('Tax category with name "%s" does not exist', $taxRateName));
Copy link
Member

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
Copy link
Member

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.

@lchrusciel lchrusciel force-pushed the tax-rate-features branch 3 times, most recently from 315ff32 to 694f094 Compare March 29, 2016 08:04
*/
public function iShouldBeNotifiedAboutSuccessfulEdition()
{
$this->updatePage->isCodeDisabled();
Copy link
Member Author

Choose a reason for hiding this comment

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

Redundant

@@ -0,0 +1,16 @@
sylius_admin_tax_category:
Copy link
Member Author

Choose a reason for hiding this comment

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

sylius_admin_tax_rate

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
Copy link
Contributor

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?

@michalmarcinkowski
Copy link
Contributor

Nice work! 👍

@michalmarcinkowski michalmarcinkowski merged commit 07344da into Sylius:master Mar 29, 2016
@lchrusciel lchrusciel deleted the tax-rate-features branch March 29, 2016 12:16
@@ -0,0 +1,58 @@
@managing_tax_rates
Feature: Editing tax rate
In order to change tax classification of my products
Copy link
Member

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

Copy link
Contributor

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Admin AdminBundle related issues and PRs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants