+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';
+ return () unless $recur_method eq 'prorate'
+ || $recur_method eq 'subscription';
+
+ #false laziness w/prorate.pm::cutoff_day
+ my $prorate_day = $cust_pkg->cust_main->prorate_day;
+ $prorate_day ? ( $prorate_day )
+ : split(/\s*,\s*/, $self->option('cutoff_day', 1) || '1');
+}
+