#'#',
'Description',
( $unearned
- ? 'Unearned'
- : 'Setup charge'
+ ? ( 'Unearned', 'Owed', 'Payment date' )
+ : ( 'Setup charge' )
),
( $use_usage eq 'usage'
? 'Usage charge'
sprintf($money_char.'%.2f', $cust_bill_pkg->setup );
}
},
+ ( $unearned
+ ? ( $owed_sub, $payment_date_sub, )
+ : ()
+ ),
sub { my $row = shift;
my $value = 0;
if ( $use_usage eq 'recurring' ) {
#'',
'',
'',
+ ( $unearned ? ( '', '' ) : () ),
'',
( $unearned ? ( '', '' ) : () ),
$ilink,
),
],
#'align' => 'rlrrrc'.FS::UI::Web::cust_aligns(),
- 'align' => 'lrr'.
+ 'align' => 'lr'.
+ ( $unearned ? 'rc' : '' ).
+ 'r'.
( $unearned ? 'cc' : '' ).
'rc'.
FS::UI::Web::cust_aligns(),
#'',
'',
'',
+ ( $unearned ? ( '', '' ) : () ),
'',
( $unearned ? ( '', '' ) : () ),
'',
#'',
'',
'',
+ ( $unearned ? ( '', '' ) : () ),
'',
( $unearned ? ( '', '' ) : () ),
'',
push @where, "_date >= $beginning",
"_date <= $ending";
-push @where , " payby != 'COMP' "
- unless $cgi->param('include_comp_cust');
-
if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) {
push @where, "cust_main.agentnum = $1";
}
my $conf = new FS::Conf;
my $money_char = $conf->config('money_char') || '$';
+my $owed_sub = sub {
+ $money_char. shift->owed_recur; #_recur :/
+};
+
+my $payment_date_sub = sub {
+ #my $cust_bill_pkg = shift;
+ my @cust_pay = sort { $a->_date <=> $b->_date }
+ map $_->cust_bill_pay->cust_pay,
+ shift->cust_bill_pay_pkg('recur') #recur :/
+ or return '';
+ time2str('%b %d %Y', $cust_pay[-1]->_date );
+};
+
</%init>