projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6e004ea
)
mysql compat fix, try again, #28895
author
Mark Wells
<mark@freeside.biz>
Thu, 17 Jul 2014 19:40:17 +0000
(12:40 -0700)
committer
Mark Wells
<mark@freeside.biz>
Thu, 17 Jul 2014 19:50:16 +0000
(12:50 -0700)
FS/FS/cust_pay.pm
patch
|
blob
|
history
diff --git
a/FS/FS/cust_pay.pm
b/FS/FS/cust_pay.pm
index
aa5655d
..
139837c
100644
(file)
--- a/
FS/FS/cust_pay.pm
+++ b/
FS/FS/cust_pay.pm
@@
-9,7
+9,7
@@
use vars qw( $DEBUG $me $conf @encrypted_fields
use Date::Format;
use Business::CreditCard;
use Text::Template;
use Date::Format;
use Business::CreditCard;
use Text::Template;
-use FS::UID qw( getotaker );
+use FS::UID qw( getotaker
driver_name
);
use FS::Misc qw( send_email );
use FS::Misc::DateTime qw( parse_datetime ); #for batch_import
use FS::Record qw( dbh qsearch qsearchs );
use FS::Misc qw( send_email );
use FS::Misc::DateTime qw( parse_datetime ); #for batch_import
use FS::Record qw( dbh qsearch qsearchs );
@@
-1077,9
+1077,10
@@
sub process_upgrade_paybatch {
###
# migrate batchnums from the misused 'paybatch' field to 'batchnum'
###
###
# migrate batchnums from the misused 'paybatch' field to 'batchnum'
###
+ my $text = (driver_name =~ /^mysql/i) ? 'char' : 'text';
my $search = FS::Cursor->new( {
'table' => 'cust_pay',
my $search = FS::Cursor->new( {
'table' => 'cust_pay',
- 'addl_from' =>
' JOIN pay_batch ON cust_pay.paybatch = CONCAT(pay_batch.batchnum) '
,
+ 'addl_from' =>
" JOIN pay_batch ON cust_pay.paybatch = CAST(pay_batch.batchnum AS $text) "
,
} );
while (my $cust_pay = $search->fetch) {
$cust_pay->set('batchnum' => $cust_pay->paybatch);
} );
while (my $cust_pay = $search->fetch) {
$cust_pay->set('batchnum' => $cust_pay->paybatch);