Fixed: Apply refund rule according to configured cancellation rule
This commit is contained in:
@@ -176,6 +176,11 @@ class HotelOrderRefundRules extends ObjectModel
|
||||
|
||||
$daysBeforeCancel = (int) $daysDifference->format('%a');
|
||||
$ruleApplied = false;
|
||||
// check the rule with the highest days first, so the closest matching rule is applied
|
||||
usort($refundRules, function ($ruleA, $ruleB) {
|
||||
return $ruleB['days'] - $ruleA['days'];
|
||||
});
|
||||
|
||||
foreach ($refundRules as $refRule) {
|
||||
if ($daysBeforeCancel >= $refRule['days']) {
|
||||
if ($objOrder->is_advance_payment) {
|
||||
|
||||
Reference in New Issue
Block a user