Skip to content

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

Closed
@fooman

Description

@fooman

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions