[freeside-commits] freeside/FS/FS cust_bill.pm, 1.244, 1.245 cust_bill_pkg.pm, 1.33, 1.34

Ivan,,, ivan at wavetail.420.am
Wed Jun 10 14:58:32 PDT 2009


Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv11452

Modified Files:
	cust_bill.pm cust_bill_pkg.pm 
Log Message:
should hopefully fix old services showing up on invoices, RT#5451/RT#5514/RT#5564/RT#3032

Index: cust_bill_pkg.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_bill_pkg.pm,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- cust_bill_pkg.pm	13 May 2009 22:27:41 -0000	1.33
+++ cust_bill_pkg.pm	10 Jun 2009 21:58:30 -0000	1.34
@@ -276,6 +276,23 @@
   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.

Index: cust_bill.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_bill.pm,v
retrieving revision 1.244
retrieving revision 1.245
diff -u -d -r1.244 -r1.245
--- cust_bill.pm	31 May 2009 09:57:46 -0000	1.244
+++ cust_bill.pm	10 Jun 2009 21:58:30 -0000	1.245
@@ -2861,8 +2861,12 @@
 
           #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



More information about the freeside-commits mailing list