[freeside-commits] freeside/FS/FS Conf.pm, 1.180.2.33, 1.180.2.34 cust_pkg.pm, 1.73.2.21, 1.73.2.22

Ivan,,, ivan at wavetail.420.am
Fri Sep 12 00:58:39 PDT 2008


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

Modified Files:
      Tag: FREESIDE_1_7_BRANCH
	Conf.pm cust_pkg.pm 
Log Message:
make the max # of indivudal services printed on invoices configurable.  RT#3904

Index: Conf.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Conf.pm,v
retrieving revision 1.180.2.33
retrieving revision 1.180.2.34
diff -u -d -r1.180.2.33 -r1.180.2.34
--- Conf.pm	12 Sep 2008 02:02:05 -0000	1.180.2.33
+++ Conf.pm	12 Sep 2008 07:58:34 -0000	1.180.2.34
@@ -2380,6 +2380,13 @@
     'type'        => 'text',
   },
 
+  {
+    'key'         => 'cust_bill-max_same_services',
+    'section'     => 'billing',
+    'description' => 'Maximum number of the same service to list individually on invoices before condensing to a single line listing the number of services.  Defaults to 5.',
+    'type'        => 'text',
+  },
+
 );
 
 1;

Index: cust_pkg.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_pkg.pm,v
retrieving revision 1.73.2.21
retrieving revision 1.73.2.22
diff -u -d -r1.73.2.21 -r1.73.2.22
--- cust_pkg.pm	8 Sep 2008 02:45:03 -0000	1.73.2.21
+++ cust_pkg.pm	12 Sep 2008 07:58:35 -0000	1.73.2.22
@@ -1361,15 +1361,19 @@
 
 =item h_labels_short END_TIMESTAMP [ START_TIMESTAMP ]
 
-Like h_labels, except returns a simple flat list, and shortens long 
-(currently >5) lists of identical services to one line that lists the service
-label and the number of individual services rather than individual items.
+Like h_labels, except returns a simple flat list, and shortens long
+(currently >5 or the cust_bill-max_same_services configuration value) lists of
+identical services to one line that lists the service label and the number of
+individual services rather than individual items.
 
 =cut
 
 sub h_labels_short {
   my $self = shift;
 
+  my $conf = new FS::Conf;
+  my $max_same_services = $conf->config('cust_bill-max_same_services') || 5;
+
   my %labels;
   #tie %labels, 'Tie::IxHash';
   push @{ $labels{$_->[0]} }, $_->[1]
@@ -1378,7 +1382,7 @@
   foreach my $label ( keys %labels ) {
     my @values = @{ $labels{$label} };
     my $num = scalar(@values);
-    if ( $num > 5 ) {
+    if ( $num > $max_same_services ) {
       push @labels, "$label ($num)";
     } else {
       push @labels, map { "$label: $_" } @values;



More information about the freeside-commits mailing list