projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of https://github.com/jgoodman/Freeside
[freeside.git]
/
httemplate
/
search
/
elements
/
cust_pay_or_refund.html
diff --git
a/httemplate/search/elements/cust_pay_or_refund.html
b/httemplate/search/elements/cust_pay_or_refund.html
index
7b2a170
..
7afab4e
100755
(executable)
--- a/
httemplate/search/elements/cust_pay_or_refund.html
+++ b/
httemplate/search/elements/cust_pay_or_refund.html
@@
-167,7
+167,7
@@
push @links, '', '';
push @fields, 'payby_payinfo_pretty',
sub { sprintf('$%.2f', shift->$amount_field() ) },
;
push @fields, 'payby_payinfo_pretty',
sub { sprintf('$%.2f', shift->$amount_field() ) },
;
-push @link_onclicks, $sub_receipt, ''
,
+push @link_onclicks, $sub_receipt, ''
;
push @sort_fields, '', $amount_field;
if ( $unapplied ) {
push @sort_fields, '', $amount_field;
if ( $unapplied ) {
@@
-271,7
+271,7
@@
if ( $cgi->param('magic') ) {
foreach my $payby ( $cgi->param('payby') ) {
$payby =~
foreach my $payby ( $cgi->param('payby') ) {
$payby =~
- /^(CARD|CHEK|BILL|
PREP|CASH|WEST|MCRD)(-(VisaMC|Amex|Discover|Maestro
))?$/
+ /^(CARD|CHEK|BILL|
CASH|PPAL|APPL|ANRD|PREP|WIRE|WEST|EDI|MCRD)(-(VisaMC|Amex|Discover|Maestro|Tokenized
))?$/
or die "illegal payby $payby";
my $payby_search = "$table.payby = '$1'";
or die "illegal payby $payby";
my $payby_search = "$table.payby = '$1'";
@@
-282,6
+282,7
@@
if ( $cgi->param('magic') ) {
my $search;
if ( $cardtype eq 'VisaMC' ) {
my $search;
if ( $cardtype eq 'VisaMC' ) {
+
#avoid posix regexes for portability
$search =
" ( ( substring($table.payinfo from 1 for 1) = '4' ".
#avoid posix regexes for portability
$search =
" ( ( substring($table.payinfo from 1 for 1) = '4' ".
@@
-305,11
+306,14
@@
if ( $cgi->param('magic') ) {
" OR substring($table.payinfo from 1 for 2) = '55' ".
# " OR substring($table.payinfo from 1 for 2) = '36' ". #Diner's int'l was processed as Visa/MC inside US, now Discover
" ) ";
" OR substring($table.payinfo from 1 for 2) = '55' ".
# " OR substring($table.payinfo from 1 for 2) = '36' ". #Diner's int'l was processed as Visa/MC inside US, now Discover
" ) ";
+
} elsif ( $cardtype eq 'Amex' ) {
} elsif ( $cardtype eq 'Amex' ) {
+
$search =
" ( substring($table.payinfo from 1 for 2 ) = '34' ".
" OR substring($table.payinfo from 1 for 2 ) = '37' ".
" ) ";
$search =
" ( substring($table.payinfo from 1 for 2 ) = '34' ".
" OR substring($table.payinfo from 1 for 2 ) = '37' ".
" ) ";
+
} elsif ( $cardtype eq 'Discover' ) {
my $conf = new FS::Conf;
} elsif ( $cardtype eq 'Discover' ) {
my $conf = new FS::Conf;
@@
-347,7
+351,9
@@
if ( $cgi->param('magic') ) {
).
" OR substring($table.payinfo from 1 for 3 ) = '622' ". #China Union Pay processed as Discover outside CN
" ) ";
).
" OR substring($table.payinfo from 1 for 3 ) = '622' ". #China Union Pay processed as Discover outside CN
" ) ";
- } elsif ( $cardtype eq 'Maestro' ) {
+
+ } elsif ( $cardtype eq 'Maestro' ) {
+
$search =
" ( substring($table.payinfo from 1 for 2 ) = '63' ".
" OR substring($table.payinfo from 1 for 2 ) = '67' ".
$search =
" ( substring($table.payinfo from 1 for 2 ) = '63' ".
" OR substring($table.payinfo from 1 for 2 ) = '67' ".
@@
-364,6
+370,11
@@
if ( $cgi->param('magic') ) {
" OR substring($table.payinfo from 1 for 6 ) ".
" SIMILAR TO '49118[1-2]' ".
" ) ";
" OR substring($table.payinfo from 1 for 6 ) ".
" SIMILAR TO '49118[1-2]' ".
" ) ";
+
+ } elsif ( $cardtype eq 'Tokenized' ) {
+
+ $search = " substring($table.payinfo from 1 for 2 ) = '99' ";
+
} else {
die "unknown card type $cardtype";
}
} else {
die "unknown card type $cardtype";
}
@@
-429,8
+440,6
@@
if ( $cgi->param('magic') ) {
$cgi->param('paybatch') =~ /^([\w\/\:\-\.]+)$/
or die "illegal paybatch: ". $cgi->param('paybatch');
$cgi->param('paybatch') =~ /^([\w\/\:\-\.]+)$/
or die "illegal paybatch: ". $cgi->param('paybatch');
- push @search, "paybatch = '$1'";
-
$orderby = "LOWER(company || ' ' || last || ' ' || first )";
} elsif ( $cgi->param('magic') eq 'batchnum' ) {
$orderby = "LOWER(company || ' ' || last || ' ' || first )";
} elsif ( $cgi->param('magic') eq 'batchnum' ) {
@@
-446,6
+455,10
@@
if ( $cgi->param('magic') ) {
die "unknown search magic: ". $cgi->param('magic');
}
die "unknown search magic: ". $cgi->param('magic');
}
+ if ( $cgi->param('paybatch') =~ /^([\w\/\:\-\.]+)$/ ) {
+ push @search, "paybatch = '$1'";
+ }
+
#unapplied payment/refund
if ( $unapplied ) {
push @select, '(' . "FS::$table"->unapplied_sql . ') AS unapplied_amount';
#unapplied payment/refund
if ( $unapplied ) {
push @select, '(' . "FS::$table"->unapplied_sql . ') AS unapplied_amount';