X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fcust_main.pm;h=f102d97eea2cb459448b8b76c17b09c27698a148;hp=74433d772b4197be109003ca90c5b2d99b9e6f26;hb=ad3bcb39580173f0ac1b6357cb49515d48af7ddf;hpb=7e02bdd1d34068129b9f63970f59e9f6562a105a 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