Ok, I see the issue here. When filtering out rules to run, it uses the start/expiration date to make sure it is still a valid rule, which is the first part. When testing orders on that rule, it uses the start/expiration on the order creation date. Ok, I think the solution here would be to still run order rules that have expired, up to 30 days after expiration. This should cover orders that are late changing. Here is what you can try:
in the file www/administrator/components/com_aworewards/aworewards/library/class-aworewards-library-reward.php, around line 1670 is this:
<?php
$current_date = AR()->helper->get_date( null, 'Y-m-d H:i:s', 'utc2utc' );
$rules = AR()->db->get_objectlist( '
SELECT r.*
FROM #__aworewards_rule r
WHERE r.estore="' . $this->estore . '"
AND r.state="published"
AND r.rule_type="' . AR()->db->escape( $rule_type ) . '"
AND ( (r.startdate IS NULL AND r.expiration IS NULL) OR
(r.expiration IS NULL AND r.startdate<="' . $current_date . '") OR
(r.startdate IS NULL AND r.expiration>="' . $current_date . '") OR
(r.startdate<="' . $current_date . '" AND r.expiration>="' . $current_date . '")
)
AND r.customer_type="'. AR()->db->escape( $customer_type ) . '"
GROUP BY r.id
ORDER BY r.ordering,r.id
', 'id' );
?>
Please change it to this
<?php
$current_date = AR()->helper->get_date( null, 'Y-m-d H:i:s', 'utc2utc' );
$current_date_exp = $current_date;
if ( $rule_type == 'order' ) {
$gmdate = new DateTime( 'now', new DateTimeZone( 'UTC' ) );
$gmdate->modify( '-30 days' );
$current_date_exp = $gmdate->format( 'Y-m-d H:i:s' );
}
$rules = AR()->db->get_objectlist( '
SELECT r.*
FROM #__aworewards_rule r
WHERE r.estore="' . $this->estore . '"
AND r.state="published"
AND r.rule_type="' . AR()->db->escape( $rule_type ) . '"
AND ( (r.startdate IS NULL AND r.expiration IS NULL) OR
(r.expiration IS NULL AND r.startdate<="' . $current_date . '") OR
(r.startdate IS NULL AND r.expiration>="' . $current_date_exp . '") OR
(r.startdate<="' . $current_date . '" AND r.expiration>="' . $current_date_exp . '")
)
AND r.customer_type="'. AR()->db->escape( $customer_type ) . '"
GROUP BY r.id
ORDER BY r.ordering,r.id
', 'id' );
?>
That should still process order rules 30 days after expiration.