diff options
author | ivan <ivan> | 2010-05-13 03:06:42 +0000 |
---|---|---|
committer | ivan <ivan> | 2010-05-13 03:06:42 +0000 |
commit | f1f24b84af7ef1c5f6c8da040133059fbfe7a9e0 (patch) | |
tree | af4931be8cd3d0bc303b5d157d56e5a84eb8b705 /httemplate/search/cust_bill_pkg.cgi | |
parent | 4446e946fe5b71a7278b4fa96e312f939b7bc9cb (diff) |
add "Owed" and "Payment date" columns to unearned revenue detail, RT#7776
Diffstat (limited to 'httemplate/search/cust_bill_pkg.cgi')
-rw-r--r-- | httemplate/search/cust_bill_pkg.cgi | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/httemplate/search/cust_bill_pkg.cgi b/httemplate/search/cust_bill_pkg.cgi index f6ba8acf3..77901de87 100644 --- a/httemplate/search/cust_bill_pkg.cgi +++ b/httemplate/search/cust_bill_pkg.cgi @@ -10,8 +10,8 @@ #'#', 'Description', ( $unearned - ? 'Unearned' - : 'Setup charge' + ? ( 'Unearned', 'Owed', 'Payment date' ) + : ( 'Setup charge' ) ), ( $use_usage eq 'usage' ? 'Usage charge' @@ -49,6 +49,10 @@ 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' ) { @@ -74,6 +78,7 @@ #'', '', '', + ( $unearned ? ( '', '' ) : () ), '', ( $unearned ? ( '', '' ) : () ), $ilink, @@ -83,7 +88,9 @@ ), ], #'align' => 'rlrrrc'.FS::UI::Web::cust_aligns(), - 'align' => 'lrr'. + 'align' => 'lr'. + ( $unearned ? 'rc' : '' ). + 'r'. ( $unearned ? 'cc' : '' ). 'rc'. FS::UI::Web::cust_aligns(), @@ -91,6 +98,7 @@ #'', '', '', + ( $unearned ? ( '', '' ) : () ), '', ( $unearned ? ( '', '' ) : () ), '', @@ -101,6 +109,7 @@ #'', '', '', + ( $unearned ? ( '', '' ) : () ), '', ( $unearned ? ( '', '' ) : () ), '', @@ -570,4 +579,17 @@ my $clink = [ "${p}view/cust_main.cgi?", 'custnum' ]; 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> |