summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--FS/FS/cust_bill.pm8
-rw-r--r--FS/FS/cust_event.pm12
2 files changed, 13 insertions, 7 deletions
diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm
index d0e7048b7..a14e69b6f 100644
--- a/FS/FS/cust_bill.pm
+++ b/FS/FS/cust_bill.pm
@@ -1414,7 +1414,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";
}
@@ -1489,7 +1489,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";
@@ -1515,7 +1515,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";
}
@@ -1550,7 +1550,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 30dea6e28..9c41d3c14 100644
--- a/FS/FS/cust_event.pm
+++ b/FS/FS/cust_event.pm
@@ -487,9 +487,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++;