Texas tax intergration

Rick Eicher II rick at pbol.net
Thu Mar 7 08:39:02 PST 2002


I am working on intergrating texas taxes for internet access into freeside.

The way texas taxes work for internet access is as follows:

 subtract $25 off the total and tax 80% of what is left

So if the total is less than $25 it is tax free.

I have added a char of lenght 1 to part_pkg & h_part_pkg tables. I added a
check box on the part_pkg.cgi page. Also edited part_pkg.pm and the
part_pkg.cgi in the process dir. That parts working great.

To do this each package a customer will need to have the tax calculated
seperately. This is because some packages may fall under texas tax for
internet access and some might not.

So I am wondering if I should bring the tax calculation up into the for each
statement of cust_main.pm that starts at around line 865.

Here what code I have writen at this time.

###############################################
if ($part_pkg->dbdef_table->column('texastax') && $part_pkg->texastax =~
/^Y$/i){
       if ($taxable_charged > 25){            # make sure there is at least
25 dollars to tax
          $taxable_charged = $taxable_charged - 25;     # take 25 dollars
out of the total
          $taxable_charged = $taxable_charged * .80;    # need to tax 80% of
what is left
          my $tax = sprintf( "%.2f",$taxable_charged * (
$cust_main_county->getfield('tax') / 100 ));
      }else{
          my $tax = sprintf("%.2f",0); # not more than 25 dollars means tax
exempt
      }
    }else{
      my $tax = sprintf( "%.2f",$taxable_charged * (
$cust_main_county->getfield('tax') / 100 ));
    }
####################################################

This is just below the for each statement around line 1012.

I am check for texastax by way of
"$part_pkg->dbdef_table->column('texastax')" which is defined in side the
for each statement. This will need to inside that foreach statement.

Ideas, problems, sugestions?

Thanks,
Rick Eicher II










More information about the freeside-devel mailing list