- }
-
-# unless ( $self->tax =~ /Y/i
-# || $self->payby eq 'COMP'
-# || $taxable_charged == 0 ) {
-# my $cust_main_county = qsearchs('cust_main_county',{
-# 'state' => $self->state,
-# 'county' => $self->county,
-# 'country' => $self->country,
-# } ) or die "fatal: can't find tax rate for state/county/country ".
-# $self->state. "/". $self->county. "/". $self->country. "\n";
-# my $tax = sprintf( "%.2f",
-# $taxable_charged * ( $cust_main_county->getfield('tax') / 100 )
-# );
-
- if ( dbdef->table('cust_bill_pkg')->column('itemdesc') ) { #1.5 schema
-
- foreach my $taxname ( grep { $tax{$_} > 0 } keys %tax ) {
- my $tax = sprintf("%.2f", $tax{$taxname} );
- $charged = sprintf( "%.2f", $charged+$tax );
-
- my $cust_bill_pkg = new FS::cust_bill_pkg ({
- 'pkgnum' => 0,
- 'setup' => $tax,
- 'recur' => 0,
- 'sdate' => '',
- 'edate' => '',
- 'itemdesc' => $taxname,
- });
- push @cust_bill_pkg, $cust_bill_pkg;
- }
-
- } else { #1.4 schema
-
- my $tax = 0;
- foreach ( values %tax ) { $tax += $_ };
- $tax = sprintf("%.2f", $tax);
- if ( $tax > 0 ) {
- $charged = sprintf( "%.2f", $charged+$tax );
-
- my $cust_bill_pkg = new FS::cust_bill_pkg ({
- 'pkgnum' => 0,
- 'setup' => $tax,
- 'recur' => 0,
- 'sdate' => '',
- 'edate' => '',
- });
- push @cust_bill_pkg, $cust_bill_pkg;
- }
-