fix prorates & recurring fees with recur_Common-using packages, RT#11993
[freeside.git] / FS / FS / part_pkg / prorate_Mixin.pm
index 1aa2f2c..7bdb666 100644 (file)
@@ -50,7 +50,7 @@ day arrives.
 sub calc_prorate {
   my $self  = shift;
   my ($cust_pkg, $sdate, $details, $param) = @_;
-  my $cutoff_day = $self->cutoff_day($cust_pkg) or return; #die?
+  my $cutoff_day = $self->cutoff_day or die "no cutoff_day"; #($cust_pkg)
 
   my $charge = $self->base_recur($cust_pkg, $sdate) || 0;
   if ( $cutoff_day ) {
@@ -90,6 +90,17 @@ sub calc_prorate {
   return $charge;
 }
 
+=item cutoff_day
+
+Returns the value of the "cutoff_day" option, or 1.
+
+=cut
+
+sub cutoff_day {
+  my $self = shift;
+  $self->option('cutoff_day', 1) || 1;
+}
+
 =item prorate_setup CUST_PKG SDATE
 
 Set up the package.  This only has an effect if prorate_defer_bill is