diff options
author | ivan <ivan> | 2012-01-03 05:10:25 +0000 |
---|---|---|
committer | ivan <ivan> | 2012-01-03 05:10:25 +0000 |
commit | df41e077b4bf3d63604b7de171fbe53c04db1ea3 (patch) | |
tree | e064e52e32f8f77908f38e72c4bad35aaba4a9e5 /FS | |
parent | 79ae09bffa5efc73ee1195ea06f8c14d399cef36 (diff) |
add option for "Month of MMM" line item date style, RT#15858
Diffstat (limited to 'FS')
-rw-r--r-- | FS/FS/Conf.pm | 10 | ||||
-rw-r--r-- | FS/FS/cust_bill.pm | 19 |
2 files changed, 24 insertions, 5 deletions
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index db4a40c..6a0b2e9 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -3532,6 +3532,16 @@ and customer address. Include units.', }, { + 'key' => 'cust_bill-line_item-date_style', + 'section' => 'billing', + 'description' => 'Display format for line item date ranges on invoice line items.', + 'type' => 'select', + 'select_hash' => [ '' => 'STARTDATE-ENDDATE', + 'month_of' => 'Month of MONTHNAME', + ], + }, + + { 'key' => 'support_packages', 'section' => '', 'description' => 'A list of packages eligible for RT ticket time transfer, one pkgpart per line.', #this should really be a select multiple, or specified in the packages themselves... diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm index 41ff6aa..7f6b3b9 100644 --- a/FS/FS/cust_bill.pm +++ b/FS/FS/cust_bill.pm @@ -4986,11 +4986,20 @@ sub _items_cust_bill_pkg { my $description = ($is_summary && $type && $type eq 'U') ? "Usage charges" : $desc; - $description .= " (" . time2str($date_format, $cust_bill_pkg->sdate). - " - ". time2str($date_format, $cust_bill_pkg->edate). - ")" - unless $conf->exists('disable_line_item_date_ranges') - || $cust_pkg->part_pkg->option('disable_line_item_date_ranges',1); + unless ( + $conf->exists('disable_line_item_date_ranges') + || $cust_pkg->part_pkg->option('disable_line_item_date_ranges',1) + ) { + my $time_period; + my $date_style = $conf->config('cust_bill-line_item-date_style'); + if ( $date_style eq 'month_of' ) { + $time_period = time2str('The month of %B', $cust_bill_pkg->sdate); + } else { + $time_period = time2str($date_format, $cust_bill_pkg->sdate). + " - ". time2str($date_format, $cust_bill_pkg->edate); + } + $description .= " ($time_period)"; + } my @d = (); my @seconds = (); # for display of usage info |