Skip to content

Commit 066dfea

Browse files
committed
Merge remote-tracking branch 'af/MC-13860' into MC-13852
2 parents f15d049 + 61c6de5 commit 066dfea

File tree

8 files changed

+12
-75
lines changed

8 files changed

+12
-75
lines changed

app/code/Magento/ProductAlert/Model/Email.php

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
*
4040
* @api
4141
* @since 100.0.2
42+
* @method int getStoreId()
43+
* @method $this setStoreId()
4244
*/
4345
class Email extends AbstractModel
4446
{
@@ -136,11 +138,6 @@ class Email extends AbstractModel
136138
*/
137139
protected $_customerHelper;
138140

139-
/**
140-
* @var int
141-
*/
142-
private $storeId = null;
143-
144141
/**
145142
* @param Context $context
146143
* @param Registry $registry
@@ -215,18 +212,6 @@ public function setWebsite(\Magento\Store\Model\Website $website)
215212
return $this;
216213
}
217214

218-
/**
219-
* Set store id from product alert.
220-
*
221-
* @param int $storeId
222-
* @return $this
223-
*/
224-
public function setStoreId(int $storeId)
225-
{
226-
$this->storeId = $storeId;
227-
return $this;
228-
}
229-
230215
/**
231216
* Set website id
232217
*
@@ -357,7 +342,7 @@ public function send()
357342
return false;
358343
}
359344

360-
$storeId = $this->storeId ?: (int) $this->_customer->getStoreId();
345+
$storeId = $this->getStoreId() ?: (int) $this->_customer->getStoreId();
361346
$store = $this->getStore($storeId);
362347

363348
$this->_appEmulation->startEnvironmentEmulation($storeId);

app/code/Magento/Sales/Block/Order/Item/Renderer/DefaultRenderer.php

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -270,23 +270,6 @@ public function getTotalAmount($item)
270270
return $totalAmount;
271271
}
272272

273-
/**
274-
* Return the base total amount minus discount.
275-
*
276-
* @param OrderItem|InvoiceItem|CreditmemoItem $item
277-
* @return mixed
278-
*/
279-
public function getBaseTotalAmount($item)
280-
{
281-
$baseTotalAmount = $item->getBaseRowTotal()
282-
+ $item->getBaseTaxAmount()
283-
+ $item->getBaseDiscountTaxCompensationAmount()
284-
+ $item->getBaseWeeeTaxAppliedAmount()
285-
- $item->getBaseDiscountAmount();
286-
287-
return $baseTotalAmount;
288-
}
289-
290273
/**
291274
* Return HTML for item total after discount
292275
*

app/code/Magento/Sales/Model/Order.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ private function canCreditmemoForZeroTotalRefunded($totalRefunded)
696696
* @param float $totalRefunded
697697
* @return bool
698698
*/
699-
public function canCreditmemoForZeroTotal($totalRefunded)
699+
private function canCreditmemoForZeroTotal($totalRefunded)
700700
{
701701
$totalPaid = $this->getTotalPaid();
702702
//check if total paid is less than grandtotal

app/code/Magento/Sales/Model/Order/Creditmemo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ public function isValidGrandTotal()
650650
*
651651
* @return bool
652652
*/
653-
public function isAllowZeroGrandTotal()
653+
private function isAllowZeroGrandTotal()
654654
{
655655
$isAllowed = $this->scopeConfig->getValue(
656656
'sales/zerograndtotal_creditmemo/allow_zero_grandtotal',

app/code/Magento/Sales/Model/Order/Webapi/ChangeOutputArray.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,11 @@ public function execute(
5252
$result[OrderItemInterface::ROW_TOTAL] = $this->priceRenderer->getTotalAmount($dataObject);
5353
$result[OrderItemInterface::BASE_ROW_TOTAL] = $this->priceRenderer->getBaseTotalAmount($dataObject);
5454
$result[OrderItemInterface::ROW_TOTAL_INCL_TAX] = $this->defaultRenderer->getTotalAmount($dataObject);
55-
$result[OrderItemInterface::BASE_ROW_TOTAL_INCL_TAX] = $this->defaultRenderer->getBaseTotalAmount($dataObject);
55+
$result[OrderItemInterface::BASE_ROW_TOTAL_INCL_TAX] = $dataObject->getBaseRowTotal()
56+
+ $dataObject->getBaseTaxAmount()
57+
+ $dataObject->getBaseDiscountTaxCompensationAmount()
58+
+ $dataObject->getBaseWeeeTaxAppliedAmount()
59+
- $dataObject->getBaseDiscountAmount();
5660

5761
return $result;
5862
}

app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/SaveTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,9 @@ public function testSaveActionWithNegativeCreditmemo()
203203

204204
$creditmemoMock = $this->createPartialMock(
205205
\Magento\Sales\Model\Order\Creditmemo::class,
206-
['load', 'getGrandTotal', 'isAllowZeroGrandTotal', '__wakeup']
206+
['load', 'isValidGrandTotal', '__wakeup']
207207
);
208-
$creditmemoMock->expects($this->once())->method('getGrandTotal')->will($this->returnValue('0'));
209-
$creditmemoMock->expects($this->once())->method('isAllowZeroGrandTotal')->will($this->returnValue(false));
208+
$creditmemoMock->expects($this->once())->method('isValidGrandTotal')->will($this->returnValue(false));
210209
$this->memoLoaderMock->expects(
211210
$this->once()
212211
)->method(

app/code/Magento/Sales/Test/Unit/Model/Order/CreditmemoTest.php

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -117,27 +117,9 @@ public function testIsValidGrandTotalGrandTotalEmpty()
117117
public function testIsValidGrandTotalGrandTotal()
118118
{
119119
$this->creditmemo->setGrandTotal(0);
120-
$this->creditmemo->isAllowZeroGrandTotal(true);
121120
$this->assertFalse($this->creditmemo->isValidGrandTotal());
122121
}
123122

124-
/**
125-
* Test for isAllowZeroGrandTotal method.
126-
*
127-
* @return void
128-
*/
129-
public function testIsAllowZeroGrandTotal()
130-
{
131-
$isAllowed = 0;
132-
$this->scopeConfigMock->expects($this->once())
133-
->method('getValue')
134-
->with(
135-
'sales/zerograndtotal_creditmemo/allow_zero_grandtotal',
136-
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
137-
)->willReturn($isAllowed);
138-
$this->assertEquals($isAllowed, $this->creditmemo->isAllowZeroGrandTotal());
139-
}
140-
141123
public function testIsValidGrandTotal()
142124
{
143125
$this->creditmemo->setGrandTotal(1);

app/code/Magento/Sales/Test/Unit/Model/OrderTest.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -428,22 +428,6 @@ public function testCanCreditMemo()
428428
$this->assertTrue($this->order->canCreditmemo());
429429
}
430430

431-
/**
432-
* Test canCreditMemo method when grand total and paid total are zero.
433-
*
434-
* @return void
435-
*/
436-
public function testCanCreditMemoForZeroTotal()
437-
{
438-
$grandTotal = 0;
439-
$totalPaid = 0;
440-
$totalRefunded = 0;
441-
$this->prepareOrderItem();
442-
$this->order->setGrandTotal($grandTotal);
443-
$this->order->setTotalPaid($totalPaid);
444-
$this->assertFalse($this->order->canCreditmemoForZeroTotal($totalRefunded));
445-
}
446-
447431
public function testCanNotCreditMemoWithTotalNull()
448432
{
449433
$totalPaid = 0;

0 commit comments

Comments
 (0)