X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_main.pm;h=f102d97eea2cb459448b8b76c17b09c27698a148;hb=a4bdb7786f9ef6ef318ca6ce465e33a39d2d4653;hp=74433d772b4197be109003ca90c5b2d99b9e6f26;hpb=cd7cfb165d6d843671ec11022f38ecd484812f9f;p=freeside.git diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index 74433d772..f102d97ee 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -1856,7 +1856,7 @@ sub check { return "You are not permitted to create complimentary accounts." if ! $self->custnum && $self->complimentary eq 'Y' - && ! $FS::CurrentUser->CurrentUser->access_right('Complimentary customer'); + && ! $FS::CurrentUser::CurrentUser->access_right('Complimentary customer'); if ( $self->paydate eq '' || $self->paydate eq '-' ) { return "Expiration date required" @@ -2015,6 +2015,17 @@ sub cust_payby { }); } +sub has_cust_payby_auto { + my $self = shift; + scalar( qsearch({ + 'table' => 'cust_payby', + 'hashref' => { 'custnum' => $self->custnum, }, + 'extra_sql' => " AND payby IN ( 'CARD', 'CHEK' ) ", + 'order_by' => 'LIMIT 1', + }) ); + +} + =item unsuspend Unsuspends all unflagged suspended packages (see L