[freeside-commits] freeside/httemplate/search cust_bill_pkg.cgi, 1.28.2.3, 1.28.2.4
Ivan,,,
ivan at wavetail.420.am
Wed May 12 20:06:44 PDT 2010
Update of /home/cvs/cvsroot/freeside/httemplate/search
In directory wavetail.420.am:/tmp/cvs-serv16249
Modified Files:
Tag: FREESIDE_1_9_BRANCH
cust_bill_pkg.cgi
Log Message:
add "Owed" and "Payment date" columns to unearned revenue detail, RT#7776
Index: cust_bill_pkg.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/cust_bill_pkg.cgi,v
retrieving revision 1.28.2.3
retrieving revision 1.28.2.4
diff -u -w -d -r1.28.2.3 -r1.28.2.4
--- cust_bill_pkg.cgi 13 May 2010 02:33:53 -0000 1.28.2.3
+++ cust_bill_pkg.cgi 13 May 2010 03:06:42 -0000 1.28.2.4
@@ -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 ? ( '', '' ) : () ),
'',
@@ -554,4 +563,17 @@
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>
More information about the freeside-commits
mailing list