X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_pkg%2Fflat.pm;h=c06328b1bbe17dbe42b3e2f8fb31c76290061e10;hb=057fc61586d26199005660b908ece68a7a1da681;hp=0bc3860a322a56028f2eaf453b3975bd2f338327;hpb=9cdd008acdaa19127409188b51e25fe8c8b0b04b;p=freeside.git diff --git a/FS/FS/part_pkg/flat.pm b/FS/FS/part_pkg/flat.pm index 0bc3860a3..c06328b1b 100644 --- a/FS/FS/part_pkg/flat.pm +++ b/FS/FS/part_pkg/flat.pm @@ -57,6 +57,12 @@ tie my %contract_years, 'Tie::IxHash', ( 'the customer\'s next bill date', 'type' => 'checkbox', }, + 'prorate_defer_change_bill' => { + 'name' => 'When synchronizing, defer bill for '. + 'package changes until the customer\'s '. + 'next bill date', + 'type' => 'checkbox', + }, 'prorate_round_day' => { 'name' => 'When synchronizing, round the prorated '. 'period', @@ -87,7 +93,8 @@ tie my %contract_years, 'Tie::IxHash', ( }, 'fieldorder' => [ qw( recur_temporality start_1st - sync_bill_date prorate_defer_bill prorate_round_day + sync_bill_date prorate_defer_bill + prorate_defer_change_bill prorate_round_day suspend_bill unsuspend_adjust_bill bill_recur_on_cancel bill_suspend_as_cancel @@ -118,27 +125,22 @@ sub calc_setup { return 0 if $self->prorate_setup($cust_pkg, $sdate); - if (!$cust_pkg->waive_setup) { - my $i = 0; - my $count = $self->option( 'additional_count', 'quiet' ) || 0; - while ($i < $count) { - push @$details, $self->option( 'additional_info' . $i++ ); - } + my $i = 0; + my $count = $self->option( 'additional_count', 'quiet' ) || 0; + while ($i < $count) { + push @$details, $self->option( 'additional_info' . $i++ ); + } - my $charge = $self->base_setup($cust_pkg, $sdate, $details); + my $charge = $self->base_setup($cust_pkg, $sdate, $details); - my $discount = 0; - if ( $charge > 0 ) { + my $discount = 0; + if ( $charge > 0 ) { $param->{'setup_charge'} = $charge; $discount = $self->calc_discount($cust_pkg, $sdate, $details, $param); delete $param->{'setup_charge'}; - } - - return sprintf( '%.2f', ($cust_pkg->quantity || 1) * ($charge - $discount) ); } - return; - + sprintf( '%.2f', ($cust_pkg->quantity || 1) * ($charge - $discount) ); } sub base_setup {