X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fcust_bill_pkg.pm;h=178042666e03f3de95f5b1d1f0a2a010d2e5547a;hp=a5c4410084a176f9cb94e21d521ae9fbbe6e5e62;hb=c0c5709fb022b83a482d0b35f7094505766d5868;hpb=817c1ce0e1cbcfd1f684222c66f46dd13b2d6dd7 diff --git a/FS/FS/cust_bill_pkg.pm b/FS/FS/cust_bill_pkg.pm index a5c441008..178042666 100644 --- a/FS/FS/cust_bill_pkg.pm +++ b/FS/FS/cust_bill_pkg.pm @@ -834,6 +834,8 @@ sub _item_discount { description => $self->mt('Discount'), amount => 0, ext_description => \@ext, + pkgpart => $self->pkgpart, + feepart => $self->feepart, # maybe should show quantity/unit discount? }; foreach my $pkg_discount (@pkg_discounts) { @@ -1122,7 +1124,10 @@ sub tax_locationnum { if ( $self->pkgnum ) { # normal sales return $self->cust_pkg->tax_locationnum; } elsif ( $self->feepart ) { # fees - return $self->cust_bill->cust_main->ship_locationnum; + my $custnum = $self->fee_origin->custnum; + if ( $custnum ) { + return FS::cust_main->by_key($custnum)->ship_locationnum; + } } else { # taxes return ''; } @@ -1133,7 +1138,10 @@ sub tax_location { if ( $self->pkgnum ) { # normal sales return $self->cust_pkg->tax_location; } elsif ( $self->feepart ) { # fees - return $self->cust_bill->cust_main->ship_location; + my $custnum = $self->fee_origin->custnum; + if ( $custnum ) { + return FS::cust_main->by_key($custnum)->ship_location; + } } else { # taxes return; }