[freeside-commits] freeside/FS/FS Conf.pm, 1.419, 1.420 cust_bill.pm, 1.303, 1.304

Ivan,,, ivan at wavetail.420.am
Tue Jan 18 00:42:18 PST 2011


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

Modified Files:
	Conf.pm cust_bill.pm 
Log Message:
date_format_long for showing "1 Feb 2011" instead of "Feb 1st, 2011", RT#11176

Index: Conf.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Conf.pm,v
retrieving revision 1.419
retrieving revision 1.420
diff -u -w -d -r1.419 -r1.420
--- Conf.pm	18 Jan 2011 03:32:42 -0000	1.419
+++ Conf.pm	18 Jan 2011 08:42:15 -0000	1.420
@@ -796,6 +796,17 @@
   },
 
   {
+    'key'         => 'date_format_long',
+    'section'     => 'UI',
+    'description' => 'Verbose format for displaying dates',
+    'type'        => 'select',
+    'select_hash' => [
+                       '%b %o, %Y' => 'Mon DDth, YYYY',
+                       '%e %b %Y'  => 'DD Mon YYYY',
+                     ],
+  },
+
+  {
     'key'         => 'deletecustomers',
     'section'     => 'UI',
     'description' => 'Enable customer deletions.  Be very careful!  Deleting a customer will remove all traces that the customer ever existed!  It should probably only be used when auditing a legacy database.  Normally, you cancel all of a customers\' packages if they cancel service.',
@@ -3361,6 +3372,7 @@
     'type'        => 'select',
     'select_hash' => [
                        ''      => 'Numeric only',
+                       '\d{7}' => 'Numeric only, exactly 7 digits',
                        'ww?d+' => 'Numeric with one or two letter prefix',
                      ],
   },

Index: cust_bill.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_bill.pm,v
retrieving revision 1.303
retrieving revision 1.304
diff -u -w -d -r1.303 -r1.304
--- cust_bill.pm	13 Jan 2011 16:35:14 -0000	1.303
+++ cust_bill.pm	18 Jan 2011 08:42:15 -0000	1.304
@@ -1,7 +1,8 @@
 package FS::cust_bill;
 
 use strict;
-use vars qw( @ISA $DEBUG $me $conf $money_char $date_format $rdate_format );
+use vars qw( @ISA $DEBUG $me $conf
+             $money_char $date_format $rdate_format $date_format_long );
 use vars qw( $invoice_lines @buf ); #yuck
 use Fcntl qw(:flock); #for spool_csv
 use List::Util qw(min max);
@@ -46,8 +47,9 @@
 FS::UID->install_callback( sub { 
   $conf = new FS::Conf;
   $money_char   = $conf->config('money_char')  || '$';  
-  $date_format  = $conf->config('date_format') || '%x';  
-  $rdate_format = $conf->config('date_format') || '%m/%d/%Y';  
+  $date_format      = $conf->config('date_format')      || '%x'; #/YY
+  $rdate_format     = $conf->config('date_format')      || '%m/%d/%Y';  #/YYYY
+  $date_format_long = $conf->config('date_format_long') || '%b %o, %Y';
 } );
 
 =head1 NAME
@@ -2298,10 +2300,12 @@
   my $escape_function_nonbsp = ($format eq 'html')
                                  ? \&_html_escape : $escape_function;
 
-  my %date_formats = ( 'latex'    => '%b %o, %Y',
-                       'html'     => '%b %o, %Y',
+  my %date_formats = ( 'latex'    => $date_format_long,
+                       'html'     => $date_format_long,
                        'template' => '%s',
                      );
+  $date_formats{'html'} =~ s/ / /g;
+
   my $date_format = $date_formats{$format};
 
   my %embolden_functions = ( 'latex'    => sub { return '\textbf{'. shift(). '}'
@@ -2378,7 +2382,7 @@
     #invoice info
     'invnum'          => $self->invnum,
     'date'            => time2str($date_format, $self->_date),
-    'today'           => time2str('%b %o, %Y', $today),
+    'today'           => time2str($date_format_long, $today),
     'terms'           => $self->terms,
     'template'        => $template, #params{'template'},
     'notice_name'     => ($params{'notice_name'} || 'Invoice'),#escape_function?
@@ -3092,7 +3096,6 @@
 
   my ($file, $lfile) = $self->print_latex(@_);
   my $ps = generate_ps($file);
-  unlink($file.'.tex');
   unlink($lfile);
 
   $ps;
@@ -3121,7 +3124,6 @@
 
   my ($file, $lfile) = $self->print_latex(@_);
   my $pdf = generate_pdf($file);
-  unlink($file.'.tex');
   unlink($lfile);
 
   $pdf;



More information about the freeside-commits mailing list