[freeside-commits] branch master updated. e43f8075d053e3f1d969d8f762ab510a2de126de

Mark Wells mark at 420.am
Tue Jan 27 23:30:05 PST 2015


The branch, master has been updated
       via  e43f8075d053e3f1d969d8f762ab510a2de126de (commit)
       via  71f6489e0b4cdd286668b79c8a397876df20840c (commit)
       via  fa298c55a9e276ef714f1e6dbf11ae3931ad8684 (commit)
      from  167c155032545af623972ffb449455810d0a2b78 (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 e43f8075d053e3f1d969d8f762ab510a2de126de
Author: Mark Wells <mark at freeside.biz>
Date:   Tue Jan 27 23:29:57 2015 -0800

    fix sprintf error, mostly #31273

diff --git a/FS/FS/Template_Mixin.pm b/FS/FS/Template_Mixin.pm
index 00cea1a..9669ac2 100644
--- a/FS/FS/Template_Mixin.pm
+++ b/FS/FS/Template_Mixin.pm
@@ -1172,6 +1172,12 @@ sub print_generic {
            join(', ', map "$_=>".$line_item->{$_}, keys %$line_item). "\n"
         if $DEBUG > 1;
 
+      push @buf, ( [ $line_item->{'description'},
+                     $money_char. sprintf("%10.2f", $line_item->{'amount'}),
+                   ],
+                   map { [ " ". $_, '' ] } @{$line_item->{'ext_description'}},
+                 );
+
       $line_item->{'ref'} = $line_item->{'pkgnum'};
       $line_item->{'product_code'} = $line_item->{'pkgpart'} || 'N/A'; # mt()?
       $line_item->{'section'} = $section;
@@ -1184,11 +1190,6 @@ sub print_generic {
       $line_item->{'ext_description'} ||= [];
  
       push @detail_items, $line_item;
-      push @buf, ( [ $line_item->{'description'},
-                     $money_char. sprintf("%10.2f", $line_item->{'amount'}),
-                   ],
-                   map { [ " ". $_, '' ] } @{$line_item->{'ext_description'}},
-                 );
     }
 
     if ( $section->{'description'} ) {


commit 71f6489e0b4cdd286668b79c8a397876df20840c
Author: Mark Wells <mark at freeside.biz>
Date:   Tue Jan 27 23:27:54 2015 -0800

    give discounts a default name, #31273

diff --git a/FS/FS/discount.pm b/FS/FS/discount.pm
index 0561f9c..361e0b4 100644
--- a/FS/FS/discount.pm
+++ b/FS/FS/discount.pm
@@ -173,7 +173,12 @@ sub description_short {
   my $conf = new FS::Conf;
   my $money_char = $conf->config('money_char') || '$';  
 
-  my $desc = $self->name ? $self->name.': ' : '';
+  my $desc;
+  if ( $self->name ) {
+    $desc = $self->name . ': ';
+  } else {
+    $desc = 'Discount of ';
+  }
   $desc .= $money_char. sprintf('%.2f/month', $self->amount)
     if $self->amount > 0;
 


commit fa298c55a9e276ef714f1e6dbf11ae3931ad8684
Author: Mark Wells <mark at freeside.biz>
Date:   Tue Jan 27 22:56:04 2015 -0800

    reject "old-style" latex templates

diff --git a/FS/FS/Template_Mixin.pm b/FS/FS/Template_Mixin.pm
index 996cb55..00cea1a 100644
--- a/FS/FS/Template_Mixin.pm
+++ b/FS/FS/Template_Mixin.pm
@@ -347,8 +347,8 @@ sub print_generic {
 
   if ( $format eq 'latex' && grep { /^%%Detail/ } @invoice_template ) {
     #change this to a die when the old code is removed
-    # it's been almost ten years, changing it to a die on the next release.
-    warn "old-style invoice template $templatefile; ".
+    # it's been almost ten years, changing it to a die
+    die "old-style invoice template $templatefile; ".
          "patch with conf/invoice_latex.diff or use new conf/invoice_latex*\n";
          #$old_latex = 'true';
          #@invoice_template = _translate_old_latex_format(@invoice_template);


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

Summary of changes:
 FS/FS/Template_Mixin.pm |   15 ++++++++-------
 FS/FS/discount.pm       |    7 ++++++-
 2 files changed, 14 insertions(+), 8 deletions(-)




More information about the freeside-commits mailing list