diff options
author | Nick Logan <nick@freeside.biz> | 2017-11-03 17:46:29 +0000 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2018-09-13 13:10:53 -0700 |
commit | cced221275ae4924d3eb6e56f5746adebdc3fe61 (patch) | |
tree | 3dad67094a53c317788f8dbeef7995afda5aca71 | |
parent | e57a68b492b2f3f78969333d7b3a8af9fa9b1b12 (diff) |
RT# 74452 - address code format change request
- Wrap at col 80 for new code
- Use the more familiar destructive search-and-replace instead of
the non-destructive inline search and replace (s///r) from 5.14.
- Explicitly return.
-rw-r--r-- | FS/FS/part_event/Condition/has_referral_custnum.pm | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/FS/FS/part_event/Condition/has_referral_custnum.pm b/FS/FS/part_event/Condition/has_referral_custnum.pm index 564c6524b..007ce4548 100644 --- a/FS/FS/part_event/Condition/has_referral_custnum.pm +++ b/FS/FS/part_event/Condition/has_referral_custnum.pm @@ -1,6 +1,5 @@ package FS::part_event::Condition::has_referral_custnum; -use v5.14; use strict; use FS::cust_main; @@ -61,14 +60,19 @@ sub condition { sub condition_sql { my( $class, $table, %opt ) = @_; - my $age = $class->condition_sql_option_age_from('age', $opt{'time'}); - my $balance_sql = FS::cust_main->balance_sql( $age ) =~ s/cust_main.custnum/cust_main.referral_custnum/r; - my $balance_date_sql = FS::cust_main->balance_date_sql =~ s/cust_main.custnum/cust_main.referral_custnum/r; - my $active_sql = FS::cust_main->active_sql =~ s/cust_main.custnum/cust_main.referral_custnum/r; + my $age = $class->condition_sql_option_age_from('age', $opt{'time'}); + my $balance_sql = FS::cust_main->balance_sql( $age ); + my $balance_date_sql = FS::cust_main->balance_date_sql; + my $active_sql = FS::cust_main->active_sql; + $balance_sql =~ s/cust_main.custnum/cust_main.referral_custnum/; + $balance_date_sql =~ s/cust_main.custnum/cust_main.referral_custnum/; + $active_sql =~ s/cust_main.custnum/cust_main.referral_custnum/; my $sql = "cust_main.referral_custnum IS NOT NULL". - " AND ( ". $class->condition_sql_option('active') . " IS NULL OR $active_sql )". - " AND ( $balance_date_sql <= $balance_sql )"; + " AND (".$class->condition_sql_option('active')." IS NULL OR $active_sql)". + " AND ($balance_date_sql <= $balance_sql)"; + + return $sql; } 1; |