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 1616
1717class CanRefund implements ValidatorInterface
1818{
19- use \Magento \Sales \Model \Order \Validation \CanRefundTrait;
20-
2119 /**
2220 * @var OrderPaymentRepositoryInterface
2321 */
@@ -91,8 +89,13 @@ private function isPaymentAllowRefund(InvoiceInterface $invoice)
9189 */
9290 private function isGrandTotalEnoughToRefund (InvoiceInterface $ entity )
9391 {
92+ $ isAllowedZeroGrandTotal = $ this ->objectManager ->get (ScopeConfigInterface::class)->getValue (
93+ 'sales/zerograndtotal_creditmemo/allow_zero_grandtotal ' ,
94+ \Magento \Store \Model \ScopeInterface::SCOPE_STORE
95+ );
96+
9497 return abs ($ entity ->getBaseGrandTotal () - $ entity ->getBaseTotalRefunded ()) >= .0001 ||
95- $ this -> isAllowZeroGrandTotal () ;
98+ $ isAllowedZeroGrandTotal ;
9699 }
97100
98101 /**
Original file line number Diff line number Diff line change 1313
1414class CanRefund implements ValidatorInterface
1515{
16- use \Magento \Sales \Model \Order \Validation \CanRefundTrait;
17-
1816 /**
1917 * @var PriceCurrencyInterface
2018 */
@@ -69,8 +67,13 @@ public function validate($entity)
6967 */
7068 private function isTotalPaidEnoughForRefund (OrderInterface $ order )
7169 {
70+ $ isAllowedZeroGrandTotal = $ this ->objectManager ->get (ScopeConfigInterface::class)->getValue (
71+ 'sales/zerograndtotal_creditmemo/allow_zero_grandtotal ' ,
72+ \Magento \Store \Model \ScopeInterface::SCOPE_STORE
73+ );
74+
7275 return !abs ($ this ->priceCurrency ->round ($ order ->getTotalPaid ()) - $ order ->getTotalRefunded ()) < .0001 ||
7376 $ order ->getTotalPaid () == 0 &&
74- $ this -> isAllowZeroGrandTotal () ;
77+ $ isAllowedZeroGrandTotal ;
7578 }
7679}
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments