+sub base_recur {
+ my $self = shift;
+ $self->option('recur_fee', 1) || 0;
+}
+
+sub calc_setup {
+ # moved from all descendant packages which just had $self->option('setup_fee')
+ my($self, $cust_pkg, $sdate, $details, $param) = @_;
+
+ return 0 if $self->prorate_setup($cust_pkg, $sdate);
+
+ my $charge = $self->option('setup_fee');
+
+ my $discount = 0;
+ if ( $charge > 0 ) {
+ $param->{'setup_charge'} = $charge;
+ $discount = $self->calc_discount($cust_pkg, $sdate, $details, $param);
+ delete $param->{'setup_charge'};
+ }
+
+ sprintf('%.2f', ($cust_pkg->quantity || 1) * ($charge - $discount) );
+}
+
+sub cutoff_day {
+ # prorate/subscription only; we don't support sync_bill_date here
+ my( $self, $cust_pkg ) = @_;
+ my $recur_method = $self->option('recur_method',1) || 'anniversary';
+ my $cust_main = $cust_pkg->cust_main;
+
+ if ( $cust_main->force_prorate_day and $cust_main->prorate_day ) {
+ return ( $cust_main->prorate_day );
+ } elsif ($recur_method eq 'prorate' || $recur_method eq 'subscription') {
+
+ return split(/\s*,\s*/, $self->option('cutoff_day', 1) || '1');
+ }
+}
+