summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2007-03-01 17:24:49 +0000
committerivan <ivan>2007-03-01 17:24:49 +0000
commit50ddccbfd874565763e3c511273399c860432b0a (patch)
treeb767ac9d860ae3f7bb3db4314dec48efa0a41e5a
parentbe5335c0e8ea90a202a4d7c9cdc43ef1597fca43 (diff)
backport fix for "Can't call method "part_pkg" on an undefined value at .../cust_bill.pm line 434" to 1.7
-rw-r--r--FS/FS/cust_bill.pm12
1 files changed, 8 insertions, 4 deletions
diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm
index 2c0b35388..844d1b867 100644
--- a/FS/FS/cust_bill.pm
+++ b/FS/FS/cust_bill.pm
@@ -432,12 +432,16 @@ sub apply_payments_and_credits {
my @open_lineitems = $self->open_cust_bill_pkg;
my $max_pay_weight =
- max( map { $_->cust_pkg->part_pkg->pay_weight || 0 }
- @open_lineitems
+ max( map { $_->part_pkg->pay_weight || 0 }
+ grep { $_ }
+ map { $_->cust_pkg }
+ @open_lineitems
);
my $max_credit_weight =
- max( map { $_->cust_pkg->part_pkg->credit_weight || 0 }
- @open_lineitems
+ max( map { $_->part_pkg->credit_weight || 0 }
+ grep { $_ }
+ map { $_->cust_pkg }
+ @open_lineitems
);
#if both are the same... payments first? it has to be something