- $tax_total += $taxitem->setup;
- foreach my $link ( @{ $taxitem->get($link_table) } ) {
- $link->set('tax_cust_bill_pkg', $tax_cust_bill_pkg);
-
- # if the link represents tax on tax, also fix its taxable pointer
- # to point to the "final" taxline
- my $taxable_cust_bill_pkg = $link->get('taxable_cust_bill_pkg');
- if (my $other_taxname = $taxable_cust_bill_pkg->itemdesc) {
- $link->set('taxable_cust_bill_pkg',
- $real_taxline_named{$other_taxname}
- );
- }
-
- push @tax_links, $link;
+ $tax_total += $link->amount;
+ $link->set('tax_cust_bill_pkg', $tax_cust_bill_pkg);
+
+ # if the link represents tax on tax, also fix its taxable pointer
+ # to point to the "final" taxline
+ my $taxable_cust_bill_pkg = $link->get('taxable_cust_bill_pkg');
+ if ( $taxable_cust_bill_pkg and
+ my $other_taxname = $taxable_cust_bill_pkg->itemdesc) {
+ $link->set('taxable_cust_bill_pkg',
+ $real_taxline_named{$other_taxname}
+ );