[freeside-commits] freeside/FS/FS/part_pkg flat.pm, 1.55, 1.56 prorate_Mixin.pm, 1.7, 1.8 subscription.pm, 1.19, 1.20

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


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

Modified Files:
	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.7
retrieving revision 1.8
diff -u -w -d -r1.7 -r1.8
--- prorate_Mixin.pm	8 Dec 2010 00:02:43 -0000	1.7
+++ prorate_Mixin.pm	8 Jan 2011 01:40:20 -0000	1.8
@@ -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.55
retrieving revision 1.56
diff -u -w -d -r1.55 -r1.56
--- flat.pm	24 Dec 2010 09:49:32 -0000	1.55
+++ flat.pm	8 Jan 2011 01:40:20 -0000	1.56
@@ -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.19
retrieving revision 1.20
diff -u -w -d -r1.19 -r1.20
--- subscription.pm	24 Dec 2010 09:49:32 -0000	1.19
+++ subscription.pm	8 Jan 2011 01:40:20 -0000	1.20
@@ -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