[freeside-commits] freeside/FS/FS tax_rate_location.pm, 1.3, 1.3.6.1

Ivan,,, ivan at wavetail.420.am
Fri Apr 15 15:36:27 PDT 2011


Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv16746

Modified Files:
      Tag: FREESIDE_2_1_BRANCH
	tax_rate_location.pm 
Log Message:
adding FS::tax_rate_location->location_sql on 2.1

Index: tax_rate_location.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/tax_rate_location.pm,v
retrieving revision 1.3
retrieving revision 1.3.6.1
diff -u -w -d -r1.3 -r1.3.6.1
--- tax_rate_location.pm	13 Jul 2009 16:02:32 -0000	1.3
+++ tax_rate_location.pm	15 Apr 2011 22:36:25 -0000	1.3.6.1
@@ -151,6 +151,37 @@
 
 =back
 
+=head1 CLASS METHODS
+
+=item location_sql KEY => VALUE, ...
+
+Returns an SQL fragment identifying matching tax_rate_location /
+cust_bill_pkg_tax_rate_location records.
+
+Parameters are county, state, city and locationtaxid
+
+=cut
+
+sub location_sql {
+  my($class, %param) = @_;
+
+  my %pn = (
+   'city'          => 'tax_rate_location.city',
+   'county'        => 'tax_rate_location.county',
+   'state'         => 'tax_rate_location.state',
+   'locationtaxid' => 'cust_bill_pkg_tax_rate_location.locationtaxid',
+  );
+
+  my %ph = map { $pn{$_} => dbh->quote($param{$_}) } keys %pn;
+
+  join( ' AND ',
+    map { "( $_ = $ph{$_} OR $ph{$_} = '' AND $_ IS NULL)" } keys %ph
+  );
+
+}
+
+=back
+
 =head1 SUBROUTINES
 
 =over 4



More information about the freeside-commits mailing list