[freeside-commits] freeside/FS/FS/part_pkg agent.pm, 1.4, 1.5 base_rate.pm, 1.3, 1.4

Ivan,,, ivan at wavetail.420.am
Wed Aug 5 16:32:36 PDT 2009


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

Modified Files:
	agent.pm base_rate.pm 
Log Message:
fix cancellation errors with updated flat_introrate, RT#5865

Index: agent.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg/agent.pm,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- agent.pm	21 Jun 2009 22:00:06 -0000	1.4
+++ agent.pm	5 Aug 2009 23:32:34 -0000	1.5
@@ -119,7 +119,7 @@
         my $pkg_setup_fee  =
           $part_pkg->setup_cost || $part_pkg->option('setup_fee');
         my $pkg_base_recur =
-          $part_pkg->recur_cost || $part_pkg->base_recur_permonth;
+          $part_pkg->recur_cost || $part_pkg->base_recur_permonth($cust_pkg);
 
         my $pkg_start = $cust_pkg->get('setup');
         if ( $pkg_start < $last_bill ) {

Index: base_rate.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg/base_rate.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- base_rate.pm	13 Apr 2008 07:41:28 -0000	1.3
+++ base_rate.pm	5 Aug 2009 23:32:34 -0000	1.4
@@ -63,7 +63,7 @@
   my $time = time;  #should be able to pass this in for credit calculation
   my $next_bill = $cust_pkg->getfield('bill') || 0;
   my $last_bill = $cust_pkg->last_bill || 0;
-  return 0 if    ! $self->base_recur
+  return 0 if    ! $self->base_recur($cust_pkg)
               || ! $self->option('unused_credit', 1)
               || ! $last_bill
               || ! $next_bill
@@ -81,7 +81,7 @@
   my $freq_sec = $1 * $sec{$2||'m'};
   return 0 unless $freq_sec;
 
-  sprintf("%.2f", $self->base_recur * ( $next_bill - $time ) / $freq_sec );
+  sprintf("%.2f", $self->base_recur($cust_pkg) * ( $next_bill - $time ) / $freq_sec );
 
 }
 



More information about the freeside-commits mailing list