From 26e91d6afcd21b7113cdc6aebb37ad5acd3d5de8 Mon Sep 17 00:00:00 2001 From: levinse Date: Thu, 7 Jul 2011 17:00:58 +0000 Subject: [PATCH] add a per-package disable_line_item_date_ranges option, RT13200 --- FS/FS/cust_bill.pm | 3 ++- httemplate/edit/part_pkg.cgi | 11 ++++++----- httemplate/edit/process/part_pkg.cgi | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm index 37baadd93..2d7341efd 100644 --- a/FS/FS/cust_bill.pm +++ b/FS/FS/cust_bill.pm @@ -4564,7 +4564,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 724880190..b4d2eb99d 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; -- 2.11.0