service dates on invoices optional (#1658)
authorjeff <jeff>
Wed, 6 Jun 2007 22:34:19 +0000 (22:34 +0000)
committerjeff <jeff>
Wed, 6 Jun 2007 22:34:19 +0000 (22:34 +0000)
FS/FS/Conf.pm
FS/FS/cust_bill.pm

index bcfa5f6..394ffeb 100644 (file)
@@ -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;
-
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),