summaryrefslogtreecommitdiff
path: root/FS/FS/cust_bill.pm
diff options
context:
space:
mode:
Diffstat (limited to 'FS/FS/cust_bill.pm')
-rw-r--r--FS/FS/cust_bill.pm9
1 files changed, 6 insertions, 3 deletions
diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm
index 8c1f75c..600b0db 100644
--- a/FS/FS/cust_bill.pm
+++ b/FS/FS/cust_bill.pm
@@ -1112,9 +1112,8 @@ sub queueable_email {
my $self = qsearchs('cust_bill', { 'invnum' => $opt{invnum} } )
or die "invalid invoice number: " . $opt{invnum};
- if ( $opt{mode} ) {
- $self->set('mode', $opt{mode});
- }
+ $self->set('mode', $opt{mode})
+ if $opt{mode};
my %args = map {$_ => $opt{$_}}
grep { $opt{$_} }
@@ -1255,6 +1254,10 @@ sub batch_invoice {
batchnum => $bill_batch->batchnum,
invnum => $self->invnum,
});
+ if ( $self->mode ) {
+ $opt->{mode} ||= $self->mode;
+ $opt->{mode} = $opt->{mode}->modenum if ref $opt->{mode};
+ }
return $cust_bill_batch->insert($opt);
}