service dates on invoices optional (#1658)
[freeside.git] / FS / FS / cust_bill.pm
index 3af0c54..b44dde6 100644 (file)
@@ -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),