projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
more datavolume format
[freeside.git]
/
FS
/
FS
/
cust_bill_ApplicationCommon.pm
diff --git
a/FS/FS/cust_bill_ApplicationCommon.pm
b/FS/FS/cust_bill_ApplicationCommon.pm
index
195fa8d
..
24274e7
100644
(file)
--- a/
FS/FS/cust_bill_ApplicationCommon.pm
+++ b/
FS/FS/cust_bill_ApplicationCommon.pm
@@
-126,7
+126,7
@@
sub apply_to_lineitems {
my @open = $self->cust_bill->open_cust_bill_pkg; #FOR UPDATE...?
warn "$me ". scalar(@open). " open line items for invoice ".
my @open = $self->cust_bill->open_cust_bill_pkg; #FOR UPDATE...?
warn "$me ". scalar(@open). " open line items for invoice ".
- $self->cust_bill->invnum. "\n"
+ $self->cust_bill->invnum. "
: ". join(', ', @open). "
\n"
if $DEBUG;
my $total = 0;
$total += $_->setup + $_->recur foreach @open;
if $DEBUG;
my $total = 0;
$total += $_->setup + $_->recur foreach @open;
@@
-178,7
+178,15
@@
sub apply_to_lineitems {
# - apply based on weights...
my $weight_col = $self->_app_part_pkg_weight_column;
# - 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 = ();
@open;
my %saw = ();