summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--FS/FS/cust_main.pm11
-rwxr-xr-xhttemplate/view/cust_main/packages/section.html2
-rw-r--r--httemplate/view/cust_main/packages/status.html11
3 files changed, 16 insertions, 8 deletions
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm
index a9d7ac7bd..f102d97ee 100644
--- a/FS/FS/cust_main.pm
+++ b/FS/FS/cust_main.pm
@@ -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</unflagged_suspended_pkgs>
diff --git a/httemplate/view/cust_main/packages/section.html b/httemplate/view/cust_main/packages/section.html
index e888c94ac..e38c34fe8 100755
--- a/httemplate/view/cust_main/packages/section.html
+++ b/httemplate/view/cust_main/packages/section.html
@@ -20,6 +20,8 @@
cust_pkg-group_by_location
no_services
)),
+ #for status.html
+ 'has_cust_payby_auto' => $cust_main->has_cust_payby_auto,
&>
% }
% } else { # there are no packages
diff --git a/httemplate/view/cust_main/packages/status.html b/httemplate/view/cust_main/packages/status.html
index 2bb4befb8..3515b38e1 100644
--- a/httemplate/view/cust_main/packages/status.html
+++ b/httemplate/view/cust_main/packages/status.html
@@ -494,16 +494,11 @@ sub pkg_status_row_detached {
sub pkg_status_row_noauto {
my( $cust_pkg, %opt ) = @_;
- my $part_pkg = $opt{'part_pkg'};
- return '' unless $cust_pkg->no_auto || $part_pkg->no_auto;
- #inefficient, should be passed in
- my $cust_main = $cust_pkg->cust_main;
+ return '' unless ( $cust_pkg->no_auto || $opt{'part_pkg'}->no_auto );
+ && $opt{'has_cust_payby_auto'};
- return '' unless $cust_main->payby =~ /^(CARD|CHEK)$/;
- my $what = lc(FS::payby->shortname($cust_main->payby));
-
- pkg_status_row_colspan( $cust_pkg, emt("No automatic $what charge"), '');
+ pkg_status_row_colspan( $cust_pkg, emt("No automatic charge"), '');
}
sub pkg_status_row_separate_bill {