X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fpart_pkg%2Fflat.pm;h=762ecebc08be28c73f0f01c1b7faf11149f89aa5;hp=6fd9c7d0857eb7c428b4a18f5638fcd587bb3f69;hb=07ed221540128b8c75f4cb5a2af1e01b25fa8e18;hpb=f81c236b2f3b5fe8777b04ee78b793b301eef9fd diff --git a/FS/FS/part_pkg/flat.pm b/FS/FS/part_pkg/flat.pm index 6fd9c7d08..762ecebc0 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 @@ -114,9 +121,9 @@ sub price_info { } sub calc_setup { - my($self, $cust_pkg, $sdate, $details, $param ) = @_; + my($self, $cust_pkg, $time, $details, $param ) = @_; - return 0 if $self->prorate_setup($cust_pkg, $sdate); + return 0 if $self->prorate_setup($cust_pkg, $time); my $i = 0; my $count = $self->option( 'additional_count', 'quiet' ) || 0; @@ -124,12 +131,12 @@ sub calc_setup { push @$details, $self->option( 'additional_info' . $i++ ); } - my $charge = $self->base_setup($cust_pkg, $sdate, $details); + my $charge = $self->base_setup($cust_pkg, $time, $details); my $discount = 0; if ( $charge > 0 ) { $param->{'setup_charge'} = $charge; - $discount = $self->calc_discount($cust_pkg, $sdate, $details, $param); + $discount = $self->calc_discount($cust_pkg, \$time, $details, $param); delete $param->{'setup_charge'}; } @@ -137,7 +144,7 @@ sub calc_setup { } sub base_setup { - my($self, $cust_pkg, $sdate, $details ) = @_; + my($self, $cust_pkg, $time, $details ) = @_; $self->option('setup_fee', 1) || 0; }