diff options
-rw-r--r-- | FS/FS/part_export/sqlradius.pm | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/FS/FS/part_export/sqlradius.pm b/FS/FS/part_export/sqlradius.pm index db66c39c0..833dd9a1d 100644 --- a/FS/FS/part_export/sqlradius.pm +++ b/FS/FS/part_export/sqlradius.pm @@ -741,8 +741,11 @@ sub usage_sessions { } } if ( $opt->{session_status} ne 'closed' ) { - $acctstoptime = "( $acctstoptime ) OR " if $acctstoptime; - $acctstoptime .= 'AcctStopTime IS NULL'; + if ( $acctstoptime ) { + $acctstoptime = "( ( $acctstoptime ) OR AcctStopTime IS NULL )"; + } else { + $acctstoptime = 'AcctStopTime IS NULL'; + } } push @where, $acctstoptime; |