'count_query' => $count_sql,
'header' => [
FS::UI::Web::cust_header(),
- #'Status', # (me)',
- #'Status', # (cust_main)',
'0-30',
'30-60',
'60-90',
scalar(FS::UI::Web::cust_header()-1)
)
),
- #'',
- #'',
sprintf( $money_char.'%.2f',
$row->{'owed_0_30'} ),
sprintf( $money_char.'%.2f',
],
'fields' => [
\&FS::UI::Web::cust_fields,
- #sub { ( &{$status_statuscol}(shift) )[0] },
- #sub { ucfirst(shift->status) },
sub { sprintf( $money_char.'%.2f',
shift->get('owed_0_30') ) },
sub { sprintf( $money_char.'%.2f',
( map { $_ ne 'Cust. Status' ? $clink : '' }
FS::UI::Web::cust_header()
),
- #'',
- #'',
'',
'',
'',
'',
],
#'align' => 'rlccrrrrr',
- 'align' => $align,
+ 'align' => FS::UI::Web::cust_aligns(). 'rrrrr',
#'size' => [ '', '', '-1', '-1', '', '', '', '', '', ],
#'style' => [ '', '', 'b', 'b', '', '', '', '', 'b', ],
'size' => [ ( map '', FS::UI::Web::cust_header() ),
'', '', '', '', 'b', ],
'color' => [
FS::UI::Web::cust_colors(),
- #sub { ( &{$status_statuscol}(shift) )[1] },
- #sub { shift->statuscolor; },
'',
'',
'',
my $conf = new FS::Conf;
my $money_char = $conf->config('money_char') || '$';
-#my $align = join('', map { /#/ ? 'r' : 'l' } FS::UI::Web::cust_header() ).
-# 'crrrrr';
-my $align = FS::UI::Web::cust_aligns().
- 'rrrrr';
-
my $clink = [ "${p}view/cust_main.cgi?", 'custnum' ];
-my $status_statuscol = sub {
- #conceptual false laziness with cust_main::status...
- my $row = shift;
-
- my $status = 'unknown';
- if ( $row->num_pkgs_sql == 0 ) {
- $status = 'prospect';
- } elsif ( $row->active_pkgs > 0 ) {
- $status = 'active';
- } elsif ( $row->inactive_pkgs > 0 ) {
- $status = 'inactive';
- } elsif ( $row->suspended_pkgs > 0 ) {
- $status = 'suspended';
- } elsif ( $row->cancelled_pkgs > 0 ) {
- $status = 'cancelled'
- }
-
- ( ucfirst($status), $FS::cust_main::statuscolor{$status} );
-};
-
</%init>