[freeside-commits] branch FREESIDE_2_3_BRANCH updated. e61c3867a93add32ffb00c88ad84da77473de37c

Ivan ivan at 420.am
Thu Apr 12 20:16:39 PDT 2012


The branch, FREESIDE_2_3_BRANCH has been updated
       via  e61c3867a93add32ffb00c88ad84da77473de37c (commit)
      from  afaf9a63ac0e47bfc2d46be745ea84af9a7ca681 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit e61c3867a93add32ffb00c88ad84da77473de37c
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Thu Apr 12 20:16:39 2012 -0700

    add cust_bill-line_item-date_description, RT#15858

diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index a048a18..109e561 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -3580,9 +3580,19 @@ and customer address. Include units.',
     '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',
+    'select_hash' => [ ''           => 'STARTDATE-ENDDATE',
+                       'month_of'   => 'Month of MONTHNAME',
+                       'X_month'    => 'DATE_DESC MONTHNAME',
                      ],
+    'per_agent'   => 1,
+  },
+
+  {
+    'key'         => 'cust_bill-line_item-date_description',
+    'section'     => 'billing',
+    'description' => 'Text to display for "DATE_DESC" when using cust_bill-line_item-date_style DATE_DESC MONTHNAME.',
+    'type'        => 'text',
+    'per_agent'   => 1,
   },
 
   {
diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm
index 255ce60..a76170a 100644
--- a/FS/FS/cust_bill.pm
+++ b/FS/FS/cust_bill.pm
@@ -4887,6 +4887,8 @@ sub _items_cust_bill_pkg {
 
   my $maxlength = $conf->config('cust_bill-latex_lineitem_maxlength') || 50;
 
+  my $cust_main = $self->cust_main;#for per-agent cust_bill-line_item-ate_style
+
   my @b = ();
   my ($s, $r, $u) = ( undef, undef, undef );
   foreach my $cust_bill_pkg ( @$cust_bill_pkgs )
@@ -5022,14 +5024,24 @@ sub _items_cust_bill_pkg {
           my $description = ($is_summary && $type && $type eq 'U')
                             ? "Usage charges" : $desc;
 
+          #pry be a bit more efficient to look some of this conf stuff up
+          # outside the loop
           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');
+            my $date_style = $conf->config( 'cust_bill-line_item-date_style',
+                                            $cust_main->agentnum
+                                          );
             if ( defined($date_style) && $date_style eq 'month_of' ) {
               $time_period = time2str('The month of %B', $cust_bill_pkg->sdate);
+            } elsif ( defined($date_style) && $date_style eq 'X_month' ) {
+              my $desc = $conf->config( 'cust_bill-line_item-date_description',
+                                         $cust_main->agentnum
+                                      );
+              $desc .= ' ' unless $desc =~ /\s$/;
+              $time_period = $desc. time2str('%B', $cust_bill_pkg->sdate);
             } else {
               $time_period =      time2str($date_format, $cust_bill_pkg->sdate).
                            " - ". time2str($date_format, $cust_bill_pkg->edate);

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/Conf.pm      |   14 ++++++++++++--
 FS/FS/cust_bill.pm |   14 +++++++++++++-
 2 files changed, 25 insertions(+), 3 deletions(-)




More information about the freeside-commits mailing list