fix regression caused by RT10481 in sql_external, RT11536
[freeside.git] / FS / FS / part_pkg / recur_Common.pm
index 7614d7a..05e1efb 100644 (file)
@@ -32,10 +32,12 @@ sub calc_recur_Common {
     my $recur_method = $self->option('recur_method', 1) || 'anniversary';
     
     $charges = $self->base_recur;
+    $charges += $param->{'override_charges'} if $param->{'override_charges'};
 
     if ( $recur_method eq 'prorate' ) {
       my $cutoff_day = $self->option('cutoff_day') || 1;
       $charges = $self->calc_prorate(@_, $cutoff_day);
+      $charges += $param->{'override_charges'} if $param->{'override_charges'};
     }
     elsif ( $recur_method eq 'anniversary' and 
             $self->option('sync_bill_date',1) ) {
@@ -43,6 +45,7 @@ sub calc_recur_Common {
       if ( defined($next_bill) ) {
         my $cutoff_day = (localtime($next_bill))[3];
         $charges = $self->calc_prorate(@_, $cutoff_day);
+        $charges += $param->{'override_charges'} if $param->{'override_charges'};
       }
     } 
     elsif ( $recur_method eq 'subscription' ) {