[freeside-commits] branch FREESIDE_4_BRANCH updated. 95ba23d356d292d30023f94d4bc2eb8712f148cc

Ivan ivan at 420.am
Fri Apr 21 13:06:53 PDT 2017


The branch, FREESIDE_4_BRANCH has been updated
       via  95ba23d356d292d30023f94d4bc2eb8712f148cc (commit)
      from  ff47ea64ff72717fa76b8cbb1d2d136910a5e6f1 (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 95ba23d356d292d30023f94d4bc2eb8712f148cc
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Fri Apr 21 13:06:52 2017 -0700

    expose invoice_lines() to invoice_html template for legacy mailbug use, RT#71087

diff --git a/FS/FS/Template_Mixin.pm b/FS/FS/Template_Mixin.pm
index 7596c80..e465155 100644
--- a/FS/FS/Template_Mixin.pm
+++ b/FS/FS/Template_Mixin.pm
@@ -1643,24 +1643,24 @@ sub print_generic {
   die "no invoice_lines() functions in template?"
     if ( $format eq 'template' && !$wasfunc );
 
-  if ($format eq 'template') {
-
-    if ( $invoice_lines ) {
-      $invoice_data{'total_pages'} = int( scalar(@buf) / $invoice_lines );
-      $invoice_data{'total_pages'}++
-        if scalar(@buf) % $invoice_lines;
+  if ( $invoice_lines ) {
+    $invoice_data{'total_pages'} = int( scalar(@buf) / $invoice_lines );
+    $invoice_data{'total_pages'}++
+      if scalar(@buf) % $invoice_lines;
+  }
+
+  #setup subroutine for the template
+  $invoice_data{invoice_lines} = sub {
+    my $lines = shift || scalar(@buf);
+    map { 
+      scalar(@buf)
+        ? shift @buf
+        : [ '', '' ];
     }
+    ( 1 .. $lines );
+  };
 
-    #setup subroutine for the template
-    $invoice_data{invoice_lines} = sub {
-      my $lines = shift || scalar(@buf);
-      map { 
-        scalar(@buf)
-          ? shift @buf
-          : [ '', '' ];
-      }
-      ( 1 .. $lines );
-    };
+  if ($format eq 'template') {
 
     my $lines;
     my @collect;

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

Summary of changes:
 FS/FS/Template_Mixin.pm |   32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)




More information about the freeside-commits mailing list