Skip to content

Commit 226a5d8

Browse files
🔃 [EngCom] Public Pull Requests - 2.2-develop
Accepted Public Pull Requests: - #13185: Fix negative basket total due to shipping tax residue (by @torreytsui) - #12324: Simplified \Magento\Framework\Reflection\TypeProcessor (by @joni-jones)
2 parents b1bfccb + 02220a5 commit 226a5d8

File tree

4 files changed

+214
-105
lines changed

4 files changed

+214
-105
lines changed

app/code/Magento/Tax/Model/Sales/Total/Quote/Tax.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,23 @@ protected function clearValues(Address\Total $total)
152152
$total->setBaseTotalAmount('subtotal', 0);
153153
$total->setTotalAmount('tax', 0);
154154
$total->setBaseTotalAmount('tax', 0);
155+
$total->setTotalAmount('shipping', 0);
156+
$total->setBaseTotalAmount('shipping', 0);
155157
$total->setTotalAmount('discount_tax_compensation', 0);
156158
$total->setBaseTotalAmount('discount_tax_compensation', 0);
157159
$total->setTotalAmount('shipping_discount_tax_compensation', 0);
158160
$total->setBaseTotalAmount('shipping_discount_tax_compensation', 0);
159161
$total->setSubtotalInclTax(0);
160162
$total->setBaseSubtotalInclTax(0);
163+
$total->setShippingInclTax(0);
164+
$total->setBaseShippingInclTax(0);
165+
$total->setShippingTaxAmount(0);
166+
$total->setBaseShippingTaxAmount(0);
167+
$total->setShippingAmountForDiscount(0);
168+
$total->setBaseShippingAmountForDiscount(0);
169+
$total->setBaseShippingAmountForDiscount(0);
170+
$total->setTotalAmount('extra_tax', 0);
171+
$total->setBaseTotalAmount('extra_tax', 0);
161172
}
162173

163174
/**

lib/internal/Magento/Framework/Reflection/Test/Unit/DataObject.php

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
*/
66
namespace Magento\Framework\Reflection\Test\Unit;
77

8+
use Magento\Framework\Reflection\Test\Unit\Fixture\TSampleInterface;
9+
810
/**
911
* Dummy data object to be used by TypeProcessorTest
1012
*/
@@ -13,18 +15,23 @@ class DataObject
1315
/**
1416
* @var string
1517
*/
16-
protected $attrName;
18+
private $attrName;
1719

1820
/**
1921
* @var bool
2022
*/
21-
protected $isActive;
23+
private $isActive;
2224

2325
/**
2426
* @var string
2527
*/
2628
private $name;
2729

30+
/**
31+
* @var array
32+
*/
33+
private $data = [];
34+
2835
/**
2936
* @return string
3037
*/
@@ -70,4 +77,32 @@ public function setName($name = null)
7077
$this->name = $name;
7178
return $this;
7279
}
80+
81+
/**
82+
* @param string $key Key is used as index
83+
* @param string $value
84+
* @return void
85+
*/
86+
public function setData(string $key, string $value)
87+
{
88+
$this->data[$key] = $value;
89+
}
90+
91+
/**
92+
* @param array $data
93+
* @return void
94+
*/
95+
public function addData(array $data)
96+
{
97+
$this->data = $data;
98+
}
99+
100+
/**
101+
* @param TSampleInterface[] $list
102+
* @return void
103+
*/
104+
public function addObjectList(array $list)
105+
{
106+
$this->data['objects'] = $list;
107+
}
73108
}

0 commit comments

Comments
 (0)