Index: branches/5.0.x/units/orders/orders_event_handler.php =================================================================== diff -u -r13199 -r13269 --- branches/5.0.x/units/orders/orders_event_handler.php (.../orders_event_handler.php) (revision 13199) +++ branches/5.0.x/units/orders/orders_event_handler.php (.../orders_event_handler.php) (revision 13269) @@ -1,6 +1,6 @@ Application->RecallVar('UserGroups')); $default_group = $this->Application->ConfigValue('User_LoggedInGroup'); if (!in_array($default_group, $user_groups)){ - $user_groups[]=$default_group; + $user_groups[] = $default_group; } - $fields['PaymentType']['options_sql'] .= ' AND '; - $fields['PaymentType']['options_sql'] .= ' (PortalGroups LIKE "%%,'.implode(',%%" OR PortalGroups LIKE "%%,', $user_groups).',%%")'; - + $fields['PaymentType']['options_sql'] = str_replace( + 'ORDER BY ', + 'AND (PortalGroups LIKE "%%,'.implode(',%%" OR PortalGroups LIKE "%%,', $user_groups).',%%") ORDER BY ', + $fields['PaymentType']['options_sql'] + ); } $this->Application->setUnitOption($event->Prefix, 'Fields', $fields);