X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_bill.pm;h=79dbbba67995a05f87e289931864b9a3956735a5;hb=09af85fc0e7a48392c930c9672a99448cf9630d4;hp=138d0fab8fd1673b40e3468588ae2c042c6888bc;hpb=5da68ff1a7c638e30cbafbc9b0749f1e82b333df;p=freeside.git diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm index 138d0fab8..79dbbba67 100644 --- a/FS/FS/cust_bill.pm +++ b/FS/FS/cust_bill.pm @@ -228,8 +228,8 @@ sub void { unless (ref($reason) || !$reason) { $reason = FS::reason->new_or_existing( - 'class' => 'X', - 'type' => 'Void invoice', + 'class' => 'I', + '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); }