File tree Expand file tree Collapse file tree 3 files changed +12
-33
lines changed
app/code/Magento/Sales/Model/Order Expand file tree Collapse file tree 3 files changed +12
-33
lines changed Original file line number Diff line number Diff line change 16
16
17
17
class CanRefund implements ValidatorInterface
18
18
{
19
- use \Magento \Sales \Model \Order \Validation \CanRefundTrait;
20
-
21
19
/**
22
20
* @var OrderPaymentRepositoryInterface
23
21
*/
@@ -91,8 +89,13 @@ private function isPaymentAllowRefund(InvoiceInterface $invoice)
91
89
*/
92
90
private function isGrandTotalEnoughToRefund (InvoiceInterface $ entity )
93
91
{
92
+ $ isAllowedZeroGrandTotal = $ this ->objectManager ->get (ScopeConfigInterface::class)->getValue (
93
+ 'sales/zerograndtotal_creditmemo/allow_zero_grandtotal ' ,
94
+ \Magento \Store \Model \ScopeInterface::SCOPE_STORE
95
+ );
96
+
94
97
return abs ($ entity ->getBaseGrandTotal () - $ entity ->getBaseTotalRefunded ()) >= .0001 ||
95
- $ this -> isAllowZeroGrandTotal () ;
98
+ $ isAllowedZeroGrandTotal ;
96
99
}
97
100
98
101
/**
Original file line number Diff line number Diff line change 13
13
14
14
class CanRefund implements ValidatorInterface
15
15
{
16
- use \Magento \Sales \Model \Order \Validation \CanRefundTrait;
17
-
18
16
/**
19
17
* @var PriceCurrencyInterface
20
18
*/
@@ -69,8 +67,13 @@ public function validate($entity)
69
67
*/
70
68
private function isTotalPaidEnoughForRefund (OrderInterface $ order )
71
69
{
70
+ $ isAllowedZeroGrandTotal = $ this ->objectManager ->get (ScopeConfigInterface::class)->getValue (
71
+ 'sales/zerograndtotal_creditmemo/allow_zero_grandtotal ' ,
72
+ \Magento \Store \Model \ScopeInterface::SCOPE_STORE
73
+ );
74
+
72
75
return !abs ($ this ->priceCurrency ->round ($ order ->getTotalPaid ()) - $ order ->getTotalRefunded ()) < .0001 ||
73
76
$ order ->getTotalPaid () == 0 &&
74
- $ this -> isAllowZeroGrandTotal () ;
77
+ $ isAllowedZeroGrandTotal ;
75
78
}
76
79
}
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments