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

Magento\Sales\Model\Order::getFullTaxInfo() incorrectly combines percentages #602

Closed
fooman opened this issue Jul 2, 2014 · 3 comments
Closed
Assignees

Comments

@fooman
Copy link
Contributor

fooman commented Jul 2, 2014

For an order which has 6% tax rate applied to one item and 21% tax rate applied to shipping - like in the below screenshot
order_ 100000001-_2014-07-02_13 11 21

The method Magento\Sales\Model\Order::getFullTaxInfo() will produce:

array(2) {
  [0] =>
  array(7) {
    'hidden' =>
    string(1) "0"
    'amount' =>
    string(7) "42.4500"
    'base_amount' =>
    string(7) "42.4500"
    'base_real_amount' =>
    string(7) "42.4500"
    'rates' =>
    array(1) {
      [0] =>
      array(5) {
        'code' =>
        string(16) "NL - reduced VAT"
        'title' =>
        string(11) "reduced VAT"
        'percent' =>
        double(6)
        'position' =>
        string(1) "0"
        'priority' =>
        string(1) "2"
      }
    }
    'percent' =>
    double(6)
    'id' =>
    string(16) "NL - reduced VAT"
  }
  [1] =>
  array(7) {
    'hidden' =>
    string(1) "0"
    'amount' =>
    string(6) "0.8700"
    'base_amount' =>
    string(6) "0.8700"
    'base_real_amount' =>
    string(6) "0.8700"
    'rates' =>
    array(1) {
      [0] =>
      array(5) {
        'code' =>
        string(8) "NL - VAT"
        'title' =>
        string(3) "VAT"
        'percent' =>
        double(21)
        'position' =>
        string(1) "0"
        'priority' =>
        string(1) "1"
      }
    }
    'percent' =>
    double(22.26)
    'id' =>
    string(8) "NL - VAT"
  }
}

The percent in the second tax rate 22.26 is incorrect - it somehow combines with the first one (21 * 1.06 = 22.26) even though they are independent. While I couldn't see anywhere that this is displayed immediately it indicates to me that there is something not working correctly in the tax calculation process.

@ilol
Copy link

ilol commented Jul 2, 2014

@fooman, thank you for bringing this up! We created a ticket in the backlog and will get back to you once the team processes your pull request

@choukalos
Copy link

@fooman, thanks for bringing this up. Given the dates I think this must have been when the teams were porting over the tax engine from 1x. We shouldn't have this issue at this point in the latest mainline in addition we should have an automated test to cover this scenario. I updated the ticket in our backlog to that effect. When the team validates & ensures we have a covering automated test they'll close out this issue.

magento-team added a commit that referenced this issue Oct 13, 2014
* Released Performance Toolkit
 * GitHub requests:
   * [#665](#665) -- Main menu event in wrong area
   * [#666](#666) -- Update di.xml
   * [#602](#602) -- Magento\Sales\Model\Order::getFullTaxInfo() incorrectly combines percentages
   * [#673](#673) -- Fixed fatal error during installation
 * Functional tests:
   * Updated API-functional test for Customer and Address metadata service
   * Add cross sell
   * Add a product to wishlist
   * Add up sell
   * Checkout with gift messages
   * Create an order from a customer
   * Create a shipment for offline payment methods
   * Delete a product from mini shopping cart
   * Reorder
   * Sales order report
   * Updating URL rewrites from a category page
 * Layout updates:
   * Moved layout files to the page_layout directory
   * Moved layout validation files to framework
 * Theme updates:
   * Blank Theme layouts & templates were unified
 * Search Library:
   * Added ability to aggregate queries for MySQL adapter
   * Implemented automatic range aggregation for MySQL adapter
 * Search module:
   * Introduced the Search module
   * Moved autocomplete to the Search module
   * Added base UI to the Search module
 * Documentation:
   * Added basic description of modules in the README.md files
 * Modularity:
   * Created API and script to get module and dependency information
 * Framework Improvements:
   * Decomposed heavy objects basing on profiling results
   * Refactored the getCustomAttributesCodes method in ProductService
   * Refactored Customer Model to use Group Model instead of Group Service
   * Updated Travis configuration to run "composer install"
 * Performance improvements:
   * Removed unnecessary "save order" call during order submission step
 * Fixed missing installation features of the new setup:
   * Added missing installation parameters: admin_no_form_key, order_increment_prefix, cleanup_database
   * Fixed the link to the license agreement in web installer
   * Fixed the web installation wizard which was stuck at 96%
 * Fixed bugs:
   * Fixed an issue where newly created attribute was always added to the Product Details tab
   * Fixed an issue where it was impossible to change the Stock Availability status of a product from the Advanced Inventory tab
   * Fixed an issue where the Stock Status value changed from In Stock to Out of Stock if quantity was not specified
   * Fixed an issue where performance toolkit failed in case of unknown argument
   * Fixed an issue where 404 error page was displayed instead of the URL Rewrite Information page
   * Fixed an issue where the Click for price link was not working if a product name contained quote mark
   * Fixed an issue where the Compare products link disappeared after switching to other page
   * Fixed an issue where the custom logo was not displayed on the category page
   * Fixed an XSS vulnerability in category name
   * Fixed an issue where a success save message was not displayed after saving a Search term
   * Fixed an issue with Google Analytics where it was impossible to add the code to the pages
   * Fixed an issue where import custom options grid was not displayed on the product creation page
   * Fixed an issue where it was impossible to retrieve a product collection from category in the "adminhtml" area
   * Fixed an issue where product attributes were absent on product creation form after switching to another product template
   * Fixed an issue where the 'URL key for specified store already exists.' error message was displayed when saving a configurable product with variations which have the same name
   * Fixed an issue where search in the Search Terms Report grid did not work
   * Fixed an issue where the unnecessary tab "General" was displayed on the Category page in the Admin panel
   * Fixed an issue where the Stock Status value changed from In Stock to Out of Stock if quantity was not specified for a configurable product when saving to a new template
   * Fixed an issue where product Stock Status was always set to 'In Stock' if product quantity was specified
   * Fixed an IE specific issue where for bundle products the Manage Stock option was reset to Yes
   * Fixed an issue where backorder messages were not displayed
   * Fixed an issue where the Price field was always required during Bundle product update using ProductService
   * Fixed an issue where product name was missing in the error message
   * Fixed an issue where configurable product did not contain a message to select options while adding product from wishlist to shopping cart
   * Fixed an issue where the Validate VAT Number button did not work during order creation in the Admin panel
   * Fixed an issue where Item qty in Wishlist got reset after update without changes
   * Fixed an issue where invoice amount was incorrect when items with discount were partially invoiced
   * Fixed product thumbnails alignment in the storefront
   * Fixed an issue where inactive Categories were not greyed out in the tree in the Admin panel
   * Fixed an issue where it was impossible to disable debug mode
   * Fixed the code sample in the index.php file
   * Removed language selector in the setup UI
   * Fixed an issue where setup was broken if db_prefix was used
   * Implemented usage of Symfony's PHPExecutableFinder for executing CLI tools
   * Fixed an issue with the Import/Export functionality
   * Fixed an issue with catalog product/category and category/product indexers invalidation after import
   * Fixed an issue with entering invalid date in the Product Views Report
   * Fixed an issue where it was impossible to view orders for customers from a deleted customer group
   * Fixed an issue where a duplicate customer record was created after adding an order from the Admin panel
   * Fixed an issue where it was impossible to log in to the Admin panel from the first attempt
@verklov
Copy link
Contributor

verklov commented Oct 14, 2014

@fooman, the team fixed this issue. We have deployed the fix in code update 0.1.0-alpha99. Thanks again for reporting this issue to us. Please continue helping us make Magento product better!

@verklov verklov closed this as completed Oct 14, 2014
magento-team pushed a commit that referenced this issue Sep 16, 2015
okorshenko pushed a commit that referenced this issue May 17, 2016
okorshenko pushed a commit that referenced this issue Dec 14, 2016
…lication

MAGETWO-60066: Magento 2.0.11 Publication
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

No branches or pull requests

4 participants