summaryrefslogtreecommitdiff
path: root/FS/FS/cust_bill.pm
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2016-04-02 16:24:55 -0700
committerIvan Kohler <ivan@freeside.biz>2016-04-02 16:24:55 -0700
commit290e2cc9d7c0963352f8f0d30df372b12096acdf (patch)
tree4dd9cd441bed916edc59d2260d6b60ba4494ce5a /FS/FS/cust_bill.pm
parentdedee00def0505cefca5689cccdd30fa2a9aaac3 (diff)
invoice mode in PDF spools, RT#39587
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);
}