diff options
author | ivan <ivan> | 2009-06-10 21:58:30 +0000 |
---|---|---|
committer | ivan <ivan> | 2009-06-10 21:58:30 +0000 |
commit | d72073a19a37641e1f8fb888b827be9d7ac74bed (patch) | |
tree | 6e6499f38cb1a55ed8aa0e24c148f052122f8882 /FS | |
parent | 876eb5c57cbd2b6686ad875b84d9400a3418719c (diff) |
should hopefully fix old services showing up on invoices, RT#5451/RT#5514/RT#5564/RT#3032
Diffstat (limited to 'FS')
-rw-r--r-- | FS/FS/cust_bill.pm | 6 | ||||
-rw-r--r-- | FS/FS/cust_bill_pkg.pm | 17 |
2 files changed, 22 insertions, 1 deletions
diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm index 51b97668e..737f68cc1 100644 --- a/FS/FS/cust_bill.pm +++ b/FS/FS/cust_bill.pm @@ -2861,8 +2861,12 @@ sub _items_cust_bill_pkg { #at least until cust_bill_pkg has "past" ranges in addition to #the "future" sdate/edate ones... see #3032 + my @dates = ( $self->_date ); + my $prev = $cust_bill_pkg->previous_cust_bill_pkg; + push @dates, $prev->sdate if $prev; + push @d, map &{$escape_function}($_), - $cust_pkg->h_labels_short($self->_date) + $cust_pkg->h_labels_short(@dates) #$cust_bill_pkg->edate, #$cust_bill_pkg->sdate) unless $cust_pkg->part_pkg->hide_svc_detail diff --git a/FS/FS/cust_bill_pkg.pm b/FS/FS/cust_bill_pkg.pm index 6bd39d4b9..bb071739e 100644 --- a/FS/FS/cust_bill_pkg.pm +++ b/FS/FS/cust_bill_pkg.pm @@ -276,6 +276,23 @@ sub cust_bill { qsearchs( 'cust_bill', { 'invnum' => $self->invnum } ); } +=item previous_cust_bill_pkg + +Returns the previous cust_bill_pkg for this package, if any. + +=cut + +sub previous_cust_bill_pkg { + my $self = shift; + qsearchs({ + 'table' => 'cust_bill_pkg', + 'hashref' => { 'pkgnum' => $self->pkgnum, + 'sdate' => { op=>'<', value=>$self->sdate }, + }, + 'order_by' => 'ORDER BY sdate DESC LIMIT 1', + }); +} + =item details [ OPTION => VALUE ... ] Returns an array of detail information for the invoice line item. |