X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fcust_bill.pm;h=79dbbba67995a05f87e289931864b9a3956735a5;hp=6803a21401f3b140bd97a11f457ebeee4a5df3e9;hb=e71dd08fc2e0aa3ee8cdbeb4e1f39f04898f773b;hpb=9ee7f636a8d23de9634561c9a6aae1e79453b2e5 diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm index 6803a2140..79dbbba67 100644 --- a/FS/FS/cust_bill.pm +++ b/FS/FS/cust_bill.pm @@ -229,7 +229,7 @@ sub void { unless (ref($reason) || !$reason) { $reason = FS::reason->new_or_existing( 'class' => 'I', - 'type' => 'Void invoice', + 'type' => 'Invoice void', 'reason' => $reason ); } @@ -1115,9 +1115,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{$_} } @@ -1258,6 +1257,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); }