summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorivan <ivan>2009-06-18 10:07:29 +0000
committerivan <ivan>2009-06-18 10:07:29 +0000
commit37c309cc6f31f6038c75641c6c21648a92337eb3 (patch)
treef4bc48b66d9c5ae2bdf7854c7cfbce3cc25410cf /FS
parent53e8e54d52fcc170f4e489b65376a135c421d431 (diff)
uuh, don't bomb out if there *isn't* a postal fee package
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/cust_main.pm37
1 files changed, 21 insertions, 16 deletions
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm
index 1bbf92d17..960c57024 100644
--- a/FS/FS/cust_main.pm
+++ b/FS/FS/cust_main.pm
@@ -2436,28 +2436,33 @@ sub bill {
my $postal_pkg = $self->charge_postal_fee();
if ( $postal_pkg && !ref( $postal_pkg ) ) {
+
$dbh->rollback if $oldAutoCommit;
return "can't charge postal invoice fee for customer ".
$self->custnum. ": $postal_pkg";
- }
- foreach my $part_pkg ( $postal_pkg->part_pkg->self_and_bill_linked ) {
- my $error =
- $self->_make_lines( 'part_pkg' => $part_pkg,
- 'cust_pkg' => $postal_pkg,
- 'precommit_hooks' => \@precommit_hooks,
- 'line_items' => \@cust_bill_pkg,
- 'setup' => \$total_setup,
- 'recur' => \$total_recur,
- 'tax_matrix' => \%taxlisthash,
- 'time' => $time,
- 'options' => \%options,
- );
- if ($error) {
- $dbh->rollback if $oldAutoCommit;
- return $error;
+ } elsif ( $postal_pkg ) {
+
+ foreach my $part_pkg ( $postal_pkg->part_pkg->self_and_bill_linked ) {
+ my $error =
+ $self->_make_lines( 'part_pkg' => $part_pkg,
+ 'cust_pkg' => $postal_pkg,
+ 'precommit_hooks' => \@precommit_hooks,
+ 'line_items' => \@cust_bill_pkg,
+ 'setup' => \$total_setup,
+ 'recur' => \$total_recur,
+ 'tax_matrix' => \%taxlisthash,
+ 'time' => $time,
+ 'options' => \%options,
+ );
+ if ($error) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
}
+
}
+
}
warn "having a look at the taxes we found...\n" if $DEBUG > 2;