X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fpart_pkg%2Fflat.pm;h=97d4363da910c5b16bf81943db2946ea98c166c9;hp=04d761b16ca5b348bc6c08610da64e7cd6276778;hb=44dcd4a1ff335a85a6babf0e007be57e6ec4f525;hpb=156e74067cc8723e187dfd9c5aa7ff956306fe01 diff --git a/FS/FS/part_pkg/flat.pm b/FS/FS/part_pkg/flat.pm index 04d761b16..97d4363da 100644 --- a/FS/FS/part_pkg/flat.pm +++ b/FS/FS/part_pkg/flat.pm @@ -58,8 +58,9 @@ tie my %contract_years, 'Tie::IxHash', ( }, 'prorate_round_day' => { 'name' => 'When synchronizing, round the prorated '. - 'period to the nearest full day', - 'type' => 'checkbox', + 'period', + 'type' => 'select', + 'select_options' => \%FS::part_pkg::prorate_Mixin::prorate_round_day_opts, }, 'add_full_period' => { 'disabled' => 1 }, # doesn't make sense with sync? @@ -136,11 +137,7 @@ sub calc_setup { sub base_setup { my($self, $cust_pkg, $sdate, $details ) = @_; - ( exists( $self->{'Hash'}{'_opt_setup_fee'} ) - ? $self->{'Hash'}{'_opt_setup_fee'} - : $self->option('setup_fee', 1) - ) - || 0; + $self->option('setup_fee', 1) || 0; } sub calc_recur { @@ -178,7 +175,7 @@ sub cutoff_day { my $cust_pkg = shift; if ( $self->option('sync_bill_date',1) ) { my $next_bill = $cust_pkg->cust_main->next_bill_date; - if ( defined($next_bill) ) { + if ( $next_bill ) { # careful here. if the prorate calculation is going to round to # the nearest day, this needs to always return the same result if ( $self->option('prorate_round_day', 1) ) { @@ -193,11 +190,7 @@ sub cutoff_day { sub base_recur { my($self, $cust_pkg, $sdate) = @_; - ( exists( $self->{'Hash'}{'_opt_recur_fee'} ) - ? $self->{'Hash'}{'_opt_recur_fee'} - : $self->option('recur_fee', 1) - ) - || 0; + $self->option('recur_fee', 1) || 0; } sub base_recur_permonth { @@ -232,6 +225,8 @@ sub calc_cancel { } } +# no longer used; see credit_remaining in FS::cust_pkg + sub calc_remain { my ($self, $cust_pkg, %options) = @_;