[freeside-commits] freeside/FS/FS/part_pkg flat.pm, 1.53.2.2, 1.53.2.3 prorate_Mixin.pm, 1.5.2.2, 1.5.2.3 subscription.pm, 1.18.2.1, 1.18.2.2

Mark Wells mark at wavetail.420.am
Fri Jan 7 17:40:34 PST 2011


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

Modified Files:
      Tag: FREESIDE_2_1_BRANCH
	flat.pm prorate_Mixin.pm subscription.pm 
Log Message:
fix introrate/prorate interaction, RT#11018

Index: prorate_Mixin.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg/prorate_Mixin.pm,v
retrieving revision 1.5.2.2
retrieving revision 1.5.2.3
diff -u -w -d -r1.5.2.2 -r1.5.2.3
--- prorate_Mixin.pm	8 Dec 2010 00:03:13 -0000	1.5.2.2
+++ prorate_Mixin.pm	8 Jan 2011 01:40:32 -0000	1.5.2.3
@@ -49,7 +49,7 @@
   my $self  = shift;
   my ($cust_pkg, $sdate, $details, $param, $cutoff_day) = @_;
  
-  my $charge = $self->option('recur_fee',1) || 0;
+  my $charge = $self->base_recur($cust_pkg, $sdate) || 0;
   if($cutoff_day) {
     # only works for freq >= 1 month; probably can't be fixed
     my $mnow = $$sdate;

Index: flat.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg/flat.pm,v
retrieving revision 1.53.2.2
retrieving revision 1.53.2.3
diff -u -w -d -r1.53.2.2 -r1.53.2.3
--- flat.pm	24 Dec 2010 09:49:49 -0000	1.53.2.2
+++ flat.pm	8 Jan 2011 01:40:32 -0000	1.53.2.3
@@ -107,7 +107,7 @@
   return 0
     if $self->option('recur_temporality', 1) eq 'preceding' && $last_bill == 0;
 
-  my $charge = $self->base_recur($cust_pkg);
+  my $charge = $self->base_recur($cust_pkg, $sdate);
   if ( $self->option('sync_bill_date',1) ) {
     my $next_bill = $cust_pkg->cust_main->next_bill_date;
     if ( defined($next_bill) ) {
@@ -127,7 +127,7 @@
 }
 
 sub base_recur {
-  my($self, $cust_pkg) = @_;
+  my($self, $cust_pkg, $sdate) = @_;
   $self->option('recur_fee', 1) || 0;
 }
 
@@ -151,7 +151,7 @@
 
   my $next_bill = $cust_pkg->getfield('bill') || 0;
 
-  return 0 if    ! $self->base_recur($cust_pkg)
+  return 0 if    ! $self->base_recur($cust_pkg, \$time)
               || ! $next_bill
               || $next_bill < $time;
 

Index: subscription.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg/subscription.pm,v
retrieving revision 1.18.2.1
retrieving revision 1.18.2.2
diff -u -w -d -r1.18.2.1 -r1.18.2.2
--- subscription.pm	24 Dec 2010 09:49:49 -0000	1.18.2.1
+++ subscription.pm	8 Jan 2011 01:40:32 -0000	1.18.2.2
@@ -98,7 +98,7 @@
 
   $$sdate = timelocal(0,0,0,$cutoff_day,$mon,$year);
 
-  my $br = $self->base_recur($cust_pkg);
+  my $br = $self->base_recur($cust_pkg, $sdate);
 
   my $discount = $self->calc_discount($cust_pkg, $sdate, $details, $param);
 



More information about the freeside-commits mailing list