[freeside-commits] freeside/FS/FS Conf.pm, 1.236, 1.237 Schema.pm, 1.94, 1.95 cust_bill.pm, 1.219, 1.220 cust_bill_pkg.pm, 1.19, 1.20 cust_main.pm, 1.354, 1.355

Jeff Finucane,420,, jeff at wavetail.420.am
Fri Aug 1 21:20:19 PDT 2008


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

Modified Files:
	Conf.pm Schema.pm cust_bill.pm cust_bill_pkg.pm cust_main.pm 
Log Message:
bundled package presentation improvements

Index: Schema.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Schema.pm,v
retrieving revision 1.94
retrieving revision 1.95
diff -u -d -r1.94 -r1.95
--- Schema.pm	2 Aug 2008 04:09:59 -0000	1.94
+++ Schema.pm	2 Aug 2008 04:20:15 -0000	1.95
@@ -621,6 +621,7 @@
         'referral_custnum', 'int',  'NULL', '', '', '', 
         'comments', 'text', 'NULL', '', '', '', 
         'spool_cdr','char', 'NULL', 1, '', '', 
+        'squelch_cdr','char', 'NULL', 1, '', '', 
         'invoice_terms', 'varchar', 'NULL', $char_d, '', '',
       ],
       'primary_key' => 'custnum',

Index: Conf.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Conf.pm,v
retrieving revision 1.236
retrieving revision 1.237
diff -u -d -r1.236 -r1.237
--- Conf.pm	21 Jul 2008 19:09:33 -0000	1.236
+++ Conf.pm	2 Aug 2008 04:20:15 -0000	1.237
@@ -1893,6 +1893,13 @@
   },
 
   {
+    'key'         => 'voip-cust_cdr_squelch',
+    'section'     => '',
+    'description' => 'Enable the per-customer option for not printing CDR on invoices.',
+    'type'        => 'checkbox',
+  },
+
+  {
     'key'         => 'svc_forward-arbitrary_dst',
     'section'     => '',
     'description' => "Allow forwards to point to arbitrary strings that don't necessarily look like email addresses.  Only used when using forwards for weird, non-email things.",

Index: cust_bill_pkg.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_bill_pkg.pm,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- cust_bill_pkg.pm	2 Aug 2008 04:10:01 -0000	1.19
+++ cust_bill_pkg.pm	2 Aug 2008 04:20:16 -0000	1.20
@@ -285,6 +285,8 @@
                     }
     if $format eq 'latex';
 
+  $format_sub = $opt{format_function} if $opt{format_function};
+
   map { ( $_->format eq 'C'
           ? &{$format_sub}( $_->detail )
           : &{$escape_function}( $_->detail )

Index: cust_bill.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_bill.pm,v
retrieving revision 1.219
retrieving revision 1.220
diff -u -d -r1.219 -r1.220
--- cust_bill.pm	2 Aug 2008 04:10:00 -0000	1.219
+++ cust_bill.pm	2 Aug 2008 04:20:16 -0000	1.220
@@ -1631,6 +1631,8 @@
 
 cid - 
 
+unsquelch_cdr - overrides any per customer cdr squelching when true
+
 =cut
 
 sub print_generic {
@@ -2054,6 +2056,8 @@
     $options{'section'} = $section if $multisection;
     $options{'format'} = $format;
     $options{'escape_function'} = $escape_function;
+    $options{'format_function'} = sub { () }
+      unless $params{unsquelch_cdr} || $cust_main->squelch_cdr ne 'Y';
 
     foreach my $line_item ( $self->_items_pkg(%options) ) {
       my $detail = {
@@ -2638,6 +2642,7 @@
 
   my $format = $opt{format} || '';
   my $escape_function = $opt{escape_function} || sub { shift };
+  my $format_function = $opt{format_function} || '';
 
   my @b = ();
   foreach my $cust_bill_pkg ( @$cust_bill_pkg ) {
@@ -2648,6 +2653,7 @@
 
     my %details_opt = ( 'format'          => $format,
                         'escape_function' => $escape_function,
+                        'format_function' => $format_function,
                       );
 
     if ( $cust_bill_pkg->pkgnum > 0 ) {

Index: cust_main.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_main.pm,v
retrieving revision 1.354
retrieving revision 1.355
diff -u -d -r1.354 -r1.355
--- cust_main.pm	2 Aug 2008 04:10:01 -0000	1.354
+++ cust_main.pm	2 Aug 2008 04:20:16 -0000	1.355
@@ -223,6 +223,8 @@
 
 =item spool_cdr - Enable individual CDR spooling, empty or `Y'
 
+=item squelch_cdr - Discourage individual CDR printing, empty or `Y'
+
 =back
 
 =head1 METHODS
@@ -1530,7 +1532,7 @@
     $self->payname($1);
   }
 
-  foreach my $flag (qw( tax spool_cdr )) {
+  foreach my $flag (qw( tax spool_cdr squelch_cdr )) {
     $self->$flag() =~ /^(Y?)$/ or return "Illegal $flag: ". $self->$flag();
     $self->$flag($1);
   }



More information about the freeside-commits mailing list