[freeside-commits] branch FREESIDE_2_3_BRANCH updated. cf8051f1b06d78a1267c468ce067b03f25575162

Ivan ivan at 420.am
Thu May 31 01:24:57 PDT 2012


The branch, FREESIDE_2_3_BRANCH has been updated
       via  cf8051f1b06d78a1267c468ce067b03f25575162 (commit)
      from  dcaa62482395cc9d67e03994fff8e68fb471f812 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit cf8051f1b06d78a1267c468ce067b03f25575162
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Thu May 31 01:24:57 2012 -0700

    fix tax report under MySQL, RT#17856

diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm
index 39a4d5c..d16881a 100644
--- a/FS/FS/cust_pkg.pm
+++ b/FS/FS/cust_pkg.pm
@@ -10,7 +10,7 @@ use List::Util qw(max);
 use Tie::IxHash;
 use Time::Local qw( timelocal timelocal_nocheck );
 use MIME::Entity;
-use FS::UID qw( getotaker dbh );
+use FS::UID qw( getotaker dbh driver_name );
 use FS::Misc qw( send_email );
 use FS::Record qw( qsearch qsearchs fields );
 use FS::CurrentUser;
@@ -2000,7 +2000,7 @@ sub cust_svc {
   }
   if ( $opt{'svcdb'} ) {
     $search{addl_from} = ' LEFT JOIN part_svc USING ( svcpart ) ';
-    $search{hashref}->{svcdb} = $opt{'svcdb'};
+    $search{extra_sql} = ' AND svcdb = '. dbh->quote( $opt{'svcdb'} );
   }
 
   cluck "cust_pkg->cust_svc called" if $DEBUG > 2;
@@ -3619,10 +3619,12 @@ sub _location_sql_where {
   my $or_empty_county   = " OR ( ? = '' AND $table.${prefix}county   IS NULL )";
   my $or_empty_state    = " OR ( ? = '' AND $table.${prefix}state    IS NULL )";
 
+  my $text = (driver_name =~ /^mysql/i) ? 'char' : 'text';
+
 #        ( $table.${prefix}city    = ? $or_empty_city   $ornull )
   "
-        ( $table.district = ? OR ? = '' OR CAST(? AS text) IS NULL )
-    AND ( $table.${prefix}city     = ? OR ? = '' OR CAST(? AS text) IS NULL )
+        ( $table.district = ? OR ? = '' OR CAST(? AS $text) IS NULL )
+    AND ( $table.${prefix}city     = ? OR ? = '' OR CAST(? AS $text) IS NULL )
     AND ( $table.${prefix}county   = ? $or_empty_county $ornull )
     AND ( $table.${prefix}state    = ? $or_empty_state  $ornull )
     AND   $table.${prefix}country  = ?

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/cust_pkg.pm |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)




More information about the freeside-commits mailing list