From: ivan Date: Mon, 5 Feb 2007 23:48:30 +0000 (+0000) Subject: fix payment/credit line-item application erroring out on tax applications X-Git-Tag: TRIXBOX_2_6~669 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=3005e5fc92dce4d680f2cd9895db683336cf7c4f fix payment/credit line-item application erroring out on tax applications --- diff --git a/FS/FS/cust_bill_ApplicationCommon.pm b/FS/FS/cust_bill_ApplicationCommon.pm index 467b581ab..9f61f5be5 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 = ();