[freeside-commits] freeside/FS/FS Conf.pm, 1.397.2.57, 1.397.2.58 cust_bill.pm, 1.299.2.42, 1.299.2.43

Ivan,,, ivan at wavetail.420.am
Thu Jul 14 15:22:10 PDT 2011


Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv1045/FS/FS

Modified Files:
      Tag: FREESIDE_2_1_BRANCH
	Conf.pm cust_bill.pm 
Log Message:
add cust_bill-latex_lineitem_maxlength conf, RT#13634

Index: Conf.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Conf.pm,v
retrieving revision 1.397.2.57
retrieving revision 1.397.2.58
diff -u -w -d -r1.397.2.57 -r1.397.2.58
--- Conf.pm	23 Jun 2011 04:08:50 -0000	1.397.2.57
+++ Conf.pm	14 Jul 2011 22:22:07 -0000	1.397.2.58
@@ -4340,6 +4340,13 @@
   },
 
   {
+    'key'         => 'cust_bill-latex_lineitem_maxlength',
+    'section'     => 'invoicing',
+    'description' => 'Truncate long line items to this number of characters on typeset invoices, to avoid losing things off the right margin.  Defaults to 50.  ',
+    'type'        => 'text',
+  },
+
+  {
     'key'         => 'cust_main-status_module',
     'section'     => 'UI',
     'description' => 'Which module to use for customer status display.  The "Classic" module (the default) considers accounts with cancelled recurring packages but un-cancelled one-time charges Inactive.  The "Recurring" module considers those customers Cancelled.  Similarly for customers with suspended recurring packages but one-time charges.', #other differences?

Index: cust_bill.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_bill.pm,v
retrieving revision 1.299.2.42
retrieving revision 1.299.2.43
diff -u -w -d -r1.299.2.42 -r1.299.2.43
--- cust_bill.pm	14 Jul 2011 17:31:50 -0000	1.299.2.42
+++ cust_bill.pm	14 Jul 2011 22:22:08 -0000	1.299.2.43
@@ -3951,6 +3951,8 @@
   my %classnums = ();
   my %lines = ();
 
+  my $maxlength = $conf->config('cust_bill-latex_lineitem_maxlength') || 50;
+
   my %usage_class =  map { $_->classnum => $_ } qsearch( 'usage_class', {} );
   foreach my $cust_bill_pkg ( $self->cust_bill_pkg ) {
     next unless $cust_bill_pkg->pkgnum > 0;
@@ -3970,8 +3972,8 @@
 
         my $desc = $detail->regionname; 
         my $description = $desc;
-        $description = substr($desc, 0, 50). '...'
-          if $format eq 'latex' && length($desc) > 50;
+        $description = substr($desc, 0, $maxlength). '...'
+          if $format eq 'latex' && length($desc) > $maxlength;
 
         $lines{$section}{$desc} ||= {
           description     => &{$escape}($description),
@@ -4115,6 +4117,8 @@
   my %classnums = ();
   my %lines = ();
 
+  my $maxlength = $conf->config('cust_bill-latex_lineitem_maxlength') || 50;
+
   my %usage_class =  map { $_->classnum => $_ } qsearch( 'usage_class', {} );
   $usage_class{''} ||= new FS::usage_class { 'classname' => '', 'weight' => 0 };
 
@@ -4144,8 +4148,8 @@
 
       my $desc = $detail->regionname; 
       my $description = $desc;
-      $description = substr($desc, 0, 50). '...'
-        if $format eq 'latex' && length($desc) > 50;
+      $description = substr($desc, 0, $maxlength). '...'
+        if $format eq 'latex' && length($desc) > $maxlength;
 
       $lines{$phonenum}{$desc} ||= {
         description     => &{$escape}($description),
@@ -4457,6 +4461,8 @@
   my $multisection = $opt{multisection} || '';
   my $discount_show_always = 0;
 
+  my $maxlength = $conf->config('cust_bill-latex_lineitem_maxlength') || 50;
+
   my @b = ();
   my ($s, $r, $u) = ( undef, undef, undef );
   foreach my $cust_bill_pkg ( @$cust_bill_pkgs )
@@ -4482,8 +4488,8 @@
       my $type = $display->type;
 
       my $desc = $cust_bill_pkg->desc;
-      $desc = substr($desc, 0, 50). '...'
-        if $format eq 'latex' && length($desc) > 50;
+      $desc = substr($desc, 0, $maxlength). '...'
+        if $format eq 'latex' && length($desc) > $maxlength;
 
       my %details_opt = ( 'format'          => $format,
                           'escape_function' => $escape_function,
@@ -4524,8 +4530,8 @@
 
             if ( $multilocation ) {
               my $loc = $cust_pkg->location_label;
-              $loc = substr($loc, 0, 50). '...'
-                if $format eq 'latex' && length($loc) > 50;
+              $loc = substr($loc, 0, $maxlength). '...'
+                if $format eq 'latex' && length($loc) > $maxlength;
               push @d, &{$escape_function}($loc);
             }
 
@@ -4605,8 +4611,8 @@
 
             if ( $multilocation ) {
               my $loc = $cust_pkg->location_label;
-              $loc = substr($loc, 0, 50). '...'
-                if $format eq 'latex' && length($loc) > 50;
+              $loc = substr($loc, 0, $maxlength). '...'
+                if $format eq 'latex' && length($loc) > $maxlength;
               push @d, &{$escape_function}($loc);
             }
 



More information about the freeside-commits mailing list