default to a session cookie instead of setting an explicit timeout, weird timezone...
[freeside.git] / FS / FS / cust_bill_pkg_tax_rate_location.pm
index 39b2bb9..7ae5250 100644 (file)
@@ -1,13 +1,12 @@
 package FS::cust_bill_pkg_tax_rate_location;
+use base qw( FS::Record );
 
 use strict;
-use base qw( FS::Record );
 use FS::Record qw( qsearch qsearchs );
-use FS::cust_bill_pkg;
 use FS::cust_pkg;
-use FS::tax_rate_location;
 use FS::cust_bill_pay_pkg;
 use FS::cust_credit_bill_pkg;
+use FS::tax_rate;
 
 =head1 NAME
 
@@ -128,24 +127,21 @@ sub check {
 
 Returns the associated cust_bill_pkg object
 
-=cut
-
-sub cust_bill_pkg {
-  my $self = shift;
-  qsearchs( 'cust_bill_pkg', { 'billpkgnum' => $self->billpkgnum }  );
-}
-
 =item tax_rate_location
 
 Returns the associated tax_rate_location object
 
+=item taxname
+
+Returns the tax name (the itemdesc).
+
 =cut
 
-sub tax_rate_location {
+sub taxname {
   my $self = shift;
-  qsearchs( 'tax_rate_location',
-            { 'taxratelocationnum' => $self->taxratelocationnum }
-  );
+  my $tax_rate = FS::tax_rate->by_key($self->taxnum)
+    or return '';
+  $tax_rate->taxname;
 }
 
 =item desc