From: levinse Date: Thu, 7 Jul 2011 17:00:56 +0000 (+0000) Subject: add a per-package disable_line_item_date_ranges option, RT13200 X-Git-Tag: freeside_2_3_0~37 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=3f8dd846e92d44fc461d91d5fd5e012a770370d1 add a per-package disable_line_item_date_ranges option, RT13200 --- diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm index 15543a9ea..082c92d03 100644 --- a/FS/FS/cust_bill.pm +++ b/FS/FS/cust_bill.pm @@ -4679,7 +4679,8 @@ sub _items_cust_bill_pkg { $description .= " (" . time2str($date_format, $cust_bill_pkg->sdate). " - ". time2str($date_format, $cust_bill_pkg->edate). ")" - unless $conf->exists('disable_line_item_date_ranges'); + unless $conf->exists('disable_line_item_date_ranges') + || $cust_pkg->part_pkg->option('disable_line_item_date_ranges',1); my @d = (); diff --git a/httemplate/edit/part_pkg.cgi b/httemplate/edit/part_pkg.cgi index 271fe0915..d36fac660 100755 --- a/httemplate/edit/part_pkg.cgi +++ b/httemplate/edit/part_pkg.cgi @@ -38,6 +38,7 @@ 'taxproduct_select'=> 'Tax products', 'plan' => 'Price plan', 'disabled' => 'Disable new orders', + 'disable_line_item_date_ranges' => 'Disable line item date ranges', 'setup_cost' => 'Setup cost', 'recur_cost' => 'Recur cost', 'pay_weight' => 'Payment weight', @@ -88,6 +89,7 @@ : () ), {field=>'disabled', type=>$disabled_type, value=>'Y'}, + {field=>'disable_line_item_date_ranges', type=>$disabled_type, value=>'Y'}, { type => 'tablebreak-tr-title', value => 'Pricing', #better name? @@ -369,9 +371,8 @@ my $error_callback = sub { } @options; - #$cgi->param($_, $options{$_}) foreach (qw( setup_fee recur_fee )); $object->set($_ => scalar($cgi->param($_)) ) - foreach (qw( setup_fee recur_fee )); + foreach (qw( setup_fee recur_fee disable_line_item_date_ranges )); $pkgpart = $object->pkgpart; @@ -384,7 +385,7 @@ my $new_object_callback = sub { my $part_pkg = FS::part_pkg->new( $hashref ); $part_pkg->set($_ => '0') - foreach (qw( setup_fee recur_fee )); + foreach (qw( setup_fee recur_fee disable_line_item_date_ranges )); $part_pkg; @@ -422,7 +423,7 @@ my $edit_callback = sub { %options = $object->options; $object->set($_ => $object->option($_)) - foreach (qw( setup_fee recur_fee )); + foreach (qw( setup_fee recur_fee disable_line_item_date_ranges )); $pkgpart = $object->pkgpart; @@ -468,7 +469,7 @@ my $clone_callback = sub { %options = $object->options; $object->set($_ => $options{$_}) - foreach (qw( setup_fee recur_fee )); + foreach (qw( setup_fee recur_fee disable_line_item_date_ranges )); $recur_disabled = $object->freq ? 0 : 1; }; diff --git a/httemplate/edit/process/part_pkg.cgi b/httemplate/edit/process/part_pkg.cgi index 27f07e617..c388676df 100755 --- a/httemplate/edit/process/part_pkg.cgi +++ b/httemplate/edit/process/part_pkg.cgi @@ -109,7 +109,7 @@ my $args_callback = sub { } $options{$_} = scalar( $cgi->param($_) ) - for (qw( setup_fee recur_fee )); + for (qw( setup_fee recur_fee disable_line_item_date_ranges )); push @args, 'options' => \%options;