Skip to content

Commit d3248d0

Browse files
🔃 [EngCom] Public Pull Requests - 2.3-develop
Accepted Public Pull Requests: - #14812: [Forwardport] Fixed setting of triggerRecollection flag (by @ihor-sviziev) - #14805: Fix for issue 911 found on MSI project - Cannot read property source_� (by @phoenix128) - #14775: MSI-920: Fixed incorrect test (during order cancellation) (by @seruymt) - #14846: Updated readme.md file 2.3-develop (by @sidolov) - #14834: Remove unused namespace from Ui Export model (by @williankeller) - #14842: For MSI-377: fix test fixture and mark return processor as @api (by @seruymt) - #14806: FIX for MSI issue #74 on qty increment (by @phoenix128) Fixed GitHub Issues: - #9580: Quote Attribute trigger_recollect causes a timeout (reported by @bh-ref) has been fixed in #14812 by @ihor-sviziev in 2.3-develop branch Related commits: 1. d0ceba3
2 parents fb7c593 + d624371 commit d3248d0

File tree

15 files changed

+86
-45
lines changed

15 files changed

+86
-45
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ The members of this team have been recognized for their outstanding commitment t
3535
</a>
3636

3737
<h3>Top Contributors</h3>
38-
Magento team thanks for any contribution that can improve our code base, documentation or increase test coverage. We always recognize our most active members, your contributions are the foundation of the Magento open source platform.
38+
Magento is thankful for any contribution that can improve our code base, documentation or increase test coverage. We always recognize our most active members, as their contributions are the foundation of the Magento Open Source platform.
3939
<a href="https://magento.com/magento-contributors">
4040
<img src="https://raw.githubusercontent.com/wiki/magento/magento2/images/contributors.png"/>
4141
</a>

app/code/Magento/CatalogInventory/Api/StockConfigurationInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function getEnableQtyIncrements($storeId = null);
7777

7878
/**
7979
* @param int $storeId
80-
* @return int
80+
* @return float
8181
*/
8282
public function getQtyIncrements($store = null);
8383

app/code/Magento/CatalogInventory/Model/Configuration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ public function getEnableQtyIncrements($store = null)
273273

274274
/**
275275
* @param null|string|bool|int|\Magento\Store\Model\Store $store
276-
* @return int
276+
* @return float
277277
*/
278278
public function getQtyIncrements($store = null)
279279
{

app/code/Magento/CatalogInventory/Model/Stock/Item.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ public function getUseConfigQtyIncrements()
392392
/**
393393
* Retrieve Quantity Increments
394394
*
395-
* @return int|false
395+
* @return int|float|false
396396
*/
397397
public function getQtyIncrements()
398398
{
@@ -401,7 +401,13 @@ public function getQtyIncrements()
401401
if ($this->getUseConfigQtyIncrements()) {
402402
$this->qtyIncrements = $this->stockConfiguration->getQtyIncrements($this->getStoreId());
403403
} else {
404-
$this->qtyIncrements = (int) $this->getData(static::QTY_INCREMENTS);
404+
$this->qtyIncrements = $this->getData(static::QTY_INCREMENTS);
405+
}
406+
407+
if ($this->getIsQtyDecimal()) { // Cast accordingly to decimal qty usage
408+
$this->qtyIncrements = (float) $this->qtyIncrements;
409+
} else {
410+
$this->qtyIncrements = (int) $this->qtyIncrements;
405411
}
406412
}
407413
if ($this->qtyIncrements <= 0) {

app/code/Magento/CatalogInventory/Test/Unit/Model/Stock/ItemTest.php

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,7 @@ public function testGetQtyIncrements($config, $expected)
394394
$this->setDataArrayValue('qty_increments', $config['qty_increments']);
395395
$this->setDataArrayValue('enable_qty_increments', $config['enable_qty_increments']);
396396
$this->setDataArrayValue('use_config_qty_increments', $config['use_config_qty_increments']);
397+
$this->setDataArrayValue('is_qty_decimal', $config['is_qty_decimal']);
397398
if ($config['use_config_qty_increments']) {
398399
$this->stockConfiguration->expects($this->once())
399400
->method('getQtyIncrements')
@@ -415,23 +416,44 @@ public function getQtyIncrementsDataProvider()
415416
[
416417
'qty_increments' => 1,
417418
'enable_qty_increments' => true,
418-
'use_config_qty_increments' => true
419+
'use_config_qty_increments' => true,
420+
'is_qty_decimal' => false,
421+
],
422+
1
423+
],
424+
[
425+
[
426+
'qty_increments' => 1.5,
427+
'enable_qty_increments' => true,
428+
'use_config_qty_increments' => true,
429+
'is_qty_decimal' => true,
430+
],
431+
1.5
432+
],
433+
[
434+
[
435+
'qty_increments' => 1.5,
436+
'enable_qty_increments' => true,
437+
'use_config_qty_increments' => true,
438+
'is_qty_decimal' => false,
419439
],
420440
1
421441
],
422442
[
423443
[
424444
'qty_increments' => -2,
425445
'enable_qty_increments' => true,
426-
'use_config_qty_increments' => true
446+
'use_config_qty_increments' => true,
447+
'is_qty_decimal' => false,
427448
],
428449
false
429450
],
430451
[
431452
[
432453
'qty_increments' => 3,
433454
'enable_qty_increments' => true,
434-
'use_config_qty_increments' => false
455+
'use_config_qty_increments' => false,
456+
'is_qty_decimal' => false,
435457
],
436458
3
437459
],

app/code/Magento/CatalogInventory/view/adminhtml/ui_component/product_form.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,6 @@
571571
<settings>
572572
<scopeLabel>[GLOBAL]</scopeLabel>
573573
<validation>
574-
<rule name="validate-digits" xsi:type="boolean">true</rule>
575574
<rule name="validate-number" xsi:type="boolean">true</rule>
576575
</validation>
577576
<label translate="true">Qty Increments</label>

app/code/Magento/Quote/Model/Quote.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2378,8 +2378,9 @@ protected function _afterLoad()
23782378
{
23792379
// collect totals and save me, if required
23802380
if (1 == $this->getTriggerRecollect()) {
2381-
$this->collectTotals()->save();
2382-
$this->setTriggerRecollect(0);
2381+
$this->collectTotals()
2382+
->setTriggerRecollect(0)
2383+
->save();
23832384
}
23842385
return parent::_afterLoad();
23852386
}

app/code/Magento/SalesInventory/Model/Order/ReturnProcessor.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
/**
1212
* Class ReturnProcessor
13+
*
14+
* @api
1315
*/
1416
class ReturnProcessor
1517
{

app/code/Magento/Ui/Model/Export/ConvertToCsv.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
use Magento\Framework\App\Filesystem\DirectoryList;
99
use Magento\Framework\Exception\LocalizedException;
1010
use Magento\Framework\Filesystem;
11-
use Magento\Framework\Filesystem\Directory\WriteInterface;
1211
use Magento\Ui\Component\MassAction\Filter;
1312

1413
/**
@@ -17,7 +16,7 @@
1716
class ConvertToCsv
1817
{
1918
/**
20-
* @var WriteInterface
19+
* @var DirectoryList
2120
*/
2221
protected $directory;
2322

app/code/Magento/Ui/Model/Export/ConvertToXml.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
use Magento\Framework\Convert\ExcelFactory;
1313
use Magento\Framework\Exception\LocalizedException;
1414
use Magento\Framework\Filesystem;
15-
use Magento\Framework\Filesystem\Directory\WriteInterface;
1615
use Magento\Ui\Component\MassAction\Filter;
1716

1817
/**
@@ -21,7 +20,7 @@
2120
class ConvertToXml
2221
{
2322
/**
24-
* @var WriteInterface
23+
* @var DirectoryList
2524
*/
2625
protected $directory;
2726

0 commit comments

Comments
 (0)