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

Tax categories scenarios + tax included in price #405

Merged
merged 3 commits into from
Oct 14, 2013

Conversation

pjedrzejewski
Copy link
Member

  • Add scenarios checking if correct tax rates are applied for different items. For example, clothing can be taxes X% and food Y% or whatever...
  • Fix the taxes calculation when tax is included in the price of the product. BAM.

Fixes #278.

@@ -129,18 +129,20 @@ public function applyTaxes(OrderInterface $order)
$description = sprintf('%s (%d%%)', $rateName, $taxAmount);

if (!array_key_exists($description, $taxes)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not simply:

$taxes[$description] = array(
    'amount'   => (isset($taxes[$description]['amount']) ? $taxes[$description]['amount'] : 0) + $amount,
    'included' => $rate->isIncludedInPrice()
);

@stloyd
Copy link
Contributor

stloyd commented Oct 14, 2013

@pjedrzejewski In overall 👍

pjedrzejewski pushed a commit that referenced this pull request Oct 14, 2013
Tax categories scenarios + tax included in price
@pjedrzejewski pjedrzejewski merged commit 1688a40 into master Oct 14, 2013
@pjedrzejewski pjedrzejewski deleted the tax-categories-features branch October 14, 2013 22:53
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.

[OrderProcessing] Make tax included in price really included in it
2 participants