- my $mnow = $$sdate;
-
- # if this is the first bill but the bill date has been set
- # (by prorate_defer_bill), calculate from the setup date,
- # and append the setup fee to @$details.
- if ( $self->option('prorate_defer_bill',1)
- and ! $cust_pkg->getfield('last_bill')
- and $cust_pkg->setup ) {
- #warn "[calc_prorate] #".$cust_pkg->pkgnum.": running deferred setup\n";
- $param->{'setup_fee'} = $self->calc_setup($cust_pkg, $$sdate, $details);
- $mnow = $cust_pkg->setup;
- }
+ my $add_period = $self->option('add_full_period',1);
+
+ my $mnow = $$sdate;
+
+ # if this is the first bill but the bill date has been set
+ # (by prorate_defer_bill), calculate from the setup date,
+ # append the setup fee to @$details, and make sure to bill for
+ # a full period after the bill date.
+ if ( $self->option('prorate_defer_bill',1)
+ && ! $cust_pkg->getfield('last_bill')
+ && $cust_pkg->setup
+ )
+ {
+ #warn "[calc_prorate] #".$cust_pkg->pkgnum.": running deferred setup\n";
+ $param->{'setup_fee'} = $self->calc_setup($cust_pkg, $$sdate, $details);
+ $mnow = $cust_pkg->setup;
+ $add_period = 1;
+ }