summaryrefslogtreecommitdiff
path: root/FS/FS/cust_bill_ApplicationCommon.pm
diff options
context:
space:
mode:
authorivan <ivan>2007-02-05 23:48:30 +0000
committerivan <ivan>2007-02-05 23:48:30 +0000
commit3005e5fc92dce4d680f2cd9895db683336cf7c4f (patch)
treeaf242c23f1fd99733c91cd73974f3c6534b782d9 /FS/FS/cust_bill_ApplicationCommon.pm
parent553bae9c8217daa25c83681ba633e9c112e3d9b1 (diff)
fix payment/credit line-item application erroring out on tax applications
Diffstat (limited to 'FS/FS/cust_bill_ApplicationCommon.pm')
-rw-r--r--FS/FS/cust_bill_ApplicationCommon.pm10
1 files changed, 9 insertions, 1 deletions
diff --git a/FS/FS/cust_bill_ApplicationCommon.pm b/FS/FS/cust_bill_ApplicationCommon.pm
index 467b581..9f61f5b 100644
--- a/FS/FS/cust_bill_ApplicationCommon.pm
+++ b/FS/FS/cust_bill_ApplicationCommon.pm
@@ -178,7 +178,15 @@ sub apply_to_lineitems {
# - apply based on weights...
my $weight_col = $self->_app_part_pkg_weight_column;
- my @openweight = map { [ $_, ($_->cust_pkg->part_pkg->$weight_col()||0) ] }
+ my @openweight = map {
+ my $open = $_;
+ my $cust_pkg = $open->cust_pkg;
+ my $weight =
+ $cust_pkg
+ ? ( $cust_pkg->part_pkg->$weight_col() || 0 )
+ : 0; #default or per-tax weight?
+ [ $open, $weight ]
+ }
@open;
my %saw = ();