From 32c73194ceb8bacbaffea7a5bd802c293bb979a0 Mon Sep 17 00:00:00 2001 From: jeff Date: Wed, 6 Jun 2007 22:34:19 +0000 Subject: [PATCH] service dates on invoices optional (#1658) --- FS/FS/Conf.pm | 8 +++++++- FS/FS/cust_bill.pm | 26 +++++++++++++++++++++----- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index bcfa5f6bb..394ffeb02 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -1804,7 +1804,13 @@ httemplate/docs/config.html 'type' => 'text', }, + { + 'key' => 'disable_line_item_date_ranges', + 'section' => 'billing', + 'description' => 'Prevent freeside from automatically generating date ranges on invoice line items.', + 'type' => 'checkbox', + }, + ); 1; - diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm index 3af0c54a8..b44dde63f 100644 --- a/FS/FS/cust_bill.pm +++ b/FS/FS/cust_bill.pm @@ -1548,8 +1548,12 @@ sub print_text { if ( $cust_bill_pkg->recur != 0 ) { push @buf, [ - "$desc (" . time2str("%x", $cust_bill_pkg->sdate) . " - " . - time2str("%x", $cust_bill_pkg->edate) . ")", + $desc . + ( $conf->exists('disable_line_item_date_ranges') + ? '' + : " (" . time2str("%x", $cust_bill_pkg->sdate) . " - " . + time2str("%x", $cust_bill_pkg->edate) . ")" + ), $money_char. sprintf("%10.2f", $cust_bill_pkg->recur) ]; push @buf, @@ -2530,10 +2534,22 @@ sub _items_cust_bill_pkg { } if ( $cust_bill_pkg->recur != 0 ) { + push @buf, [ + $desc . + ( $conf->exists('disable_line_item_date_ranges') + ? '' + : " (" . time2str("%x", $cust_bill_pkg->sdate) . " - " . + time2str("%x", $cust_bill_pkg->edate) . ")" + ), + $money_char. sprintf("%10.2f", $cust_bill_pkg->recur) + ]; push @b, { - description => "$desc (" . - time2str('%x', $cust_bill_pkg->sdate). ' - '. - time2str('%x', $cust_bill_pkg->edate). ')', + description => $desc . + ( $conf->exists('disable_line_item_date_ranges') + ? '' + : " (" .time2str("%x", $cust_bill_pkg->sdate). + " - ".time2str("%x", $cust_bill_pkg->edate).")" + ), #pkgpart => $part_pkg->pkgpart, pkgnum => $cust_bill_pkg->pkgnum, amount => sprintf("%.2f", $cust_bill_pkg->recur), -- 2.11.0