[freeside-commits] branch master updated. 77783e2521b98f0ca76ebe953873fbdc7cc51e98

Mark Wells mark at 420.am
Tue Jan 7 11:50:05 PST 2014


The branch, master has been updated
       via  77783e2521b98f0ca76ebe953873fbdc7cc51e98 (commit)
      from  e08dc441d98b98643d5108ce8c189fcf12693e0c (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 77783e2521b98f0ca76ebe953873fbdc7cc51e98
Author: Mark Wells <mark at freeside.biz>
Date:   Tue Jan 7 11:48:58 2014 -0800

    correctly pass arguments when manually re-emailing/printing invoices, #26076

diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm
index cdce7be..1569ef4 100644
--- a/FS/FS/cust_bill.pm
+++ b/FS/FS/cust_bill.pm
@@ -1396,7 +1396,7 @@ sub email {
   my $self = shift;
   return if $self->hide;
   my $conf = $self->conf;
-  my $opt = shift;
+  my $opt = shift || {};
   if ($opt and !ref($opt)) {
     die "FS::cust_bill::email called with positional parameters";
   }
@@ -1471,7 +1471,7 @@ I<notice_name>, if specified, overrides "Invoice" as the name of the sent docume
 sub lpr_data {
   my $self = shift;
   my $conf = $self->conf;
-  my $opt = shift;
+  my $opt = shift || {};
   if ($opt and !ref($opt)) {
     # nobody does this anyway
     die "FS::cust_bill::lpr_data called with positional parameters";
@@ -1497,7 +1497,7 @@ sub print {
   my $self = shift;
   return if $self->hide;
   my $conf = $self->conf;
-  my $opt = shift;
+  my $opt = shift || {};
   if ($opt and !ref($opt)) {
     die "FS::cust_bill::print called with positional parameters";
   }
@@ -1532,7 +1532,7 @@ sub fax_invoice {
   my $self = shift;
   return if $self->hide;
   my $conf = $self->conf;
-  my $opt = shift;
+  my $opt = shift || {};
   if ($opt and !ref($opt)) {
     die "FS::cust_bill::fax_invoice called with positional parameters";
   }
diff --git a/FS/FS/cust_event.pm b/FS/FS/cust_event.pm
index 6a67c08..78d4217 100644
--- a/FS/FS/cust_event.pm
+++ b/FS/FS/cust_event.pm
@@ -479,9 +479,15 @@ sub re_X {
     my $cust_X = $cust_event->cust_X; # cust_bill
     next unless $cust_X->can($method);
 
-    $cust_X->$method( $cust_event->part_event->templatename
-                      || $cust_X->agent_template
-                    );
+    my $part_event = $cust_event->part_event;
+    my $template = $part_event->templatename
+                   || $cust_X->agent_template;
+    my $modenum = $part_event->option('modenum') || '';
+    my $invoice_from = $part_event->option('agent_invoice_from') || '';
+    $cust_X->set('mode' => $modenum);
+    $cust_X->$method( { template      => $template,
+                        modenum       => $modenum,
+                        invoice_from  => $invoice_from } );
 
     if ( $job ) { #progressbar foo
       $num++;

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

Summary of changes:
 FS/FS/cust_bill.pm  |    8 ++++----
 FS/FS/cust_event.pm |   12 +++++++++---
 2 files changed, 13 insertions(+), 7 deletions(-)




More information about the freeside-commits mailing list