diff options
author | Mark Wells <mark@freeside.biz> | 2013-01-02 19:01:16 -0800 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2013-01-02 19:01:16 -0800 |
commit | e5d6af11f52aabe8c9e6e12ce43c3401ccf025a8 (patch) | |
tree | e67a2737e58566ad7d4e4b759b3bf4a542dae25d /httemplate | |
parent | c7286ce9036d71665c2bfed9de93f87309b72d35 (diff) |
move credit card transaction results out of paybatch and into real fields, #18548
Diffstat (limited to 'httemplate')
-rwxr-xr-x | httemplate/edit/cust_refund.cgi | 20 | ||||
-rwxr-xr-x | httemplate/edit/process/cust_pay.cgi | 2 | ||||
-rwxr-xr-x | httemplate/search/elements/cust_pay_or_refund.html | 10 | ||||
-rw-r--r-- | httemplate/search/elements/report_cust_pay_or_refund.html | 43 | ||||
-rw-r--r-- | httemplate/view/cust_pay.html | 4 | ||||
-rw-r--r-- | httemplate/view/cust_refund.html | 4 |
6 files changed, 58 insertions, 25 deletions
diff --git a/httemplate/edit/cust_refund.cgi b/httemplate/edit/cust_refund.cgi index 1ef69fdae..656d5ebb5 100755 --- a/httemplate/edit/cust_refund.cgi +++ b/httemplate/edit/cust_refund.cgi @@ -60,29 +60,25 @@ </TR> % } -% -% #false laziness w/FS/FS/cust_main::realtime_refund_bop -% if ( $cust_pay->paybatch =~ /^(\w+):(\w+)(:(\w+))?$/ ) { -% my ( $processor, $auth, $order_number ) = ( $1, $2, $4 ); -% - - <TR> - <TD ALIGN="right">Processor</TD><TD BGCOLOR="#ffffff"><% $processor %></TD> + <TD ALIGN="right">Processor</TD> + <TD BGCOLOR="#ffffff"><% $cust_pay->processor %></TD> </TR> % if ( length($auth) ) { <TR> - <TD ALIGN="right">Authorization</TD><TD BGCOLOR="#ffffff"><% $auth %></TD> + <TD ALIGN="right">Authorization</TD> + <TD BGCOLOR="#ffffff"><% $cust_pay->auth %></TD> </TR> % } -% if ( length($order_number) ) { +% if ( length($cust_pay->order_number) ) { <TR> - <TD ALIGN="right">Order number</TD><TD BGCOLOR="#ffffff"><% $order_number %></TD> + <TD ALIGN="right">Order number</TD> + <TD BGCOLOR="#ffffff"><% $cust_pay->order_number %></TD> </TR> % } -% } +% } #if $cust_pay </TABLE> % } diff --git a/httemplate/edit/process/cust_pay.cgi b/httemplate/edit/process/cust_pay.cgi index ce0ec3212..a002fa181 100755 --- a/httemplate/edit/process/cust_pay.cgi +++ b/httemplate/edit/process/cust_pay.cgi @@ -57,6 +57,8 @@ my $new = new FS::cust_pay ( { bank depositor account teller ) #} fields('cust_pay') + # gatewaynum, processor, auth, order_number + # are for realtime payments only, and can't be entered manually } ); my @rights = ('Post payment'); diff --git a/httemplate/search/elements/cust_pay_or_refund.html b/httemplate/search/elements/cust_pay_or_refund.html index b0524913a..eeef0c0e1 100755 --- a/httemplate/search/elements/cust_pay_or_refund.html +++ b/httemplate/search/elements/cust_pay_or_refund.html @@ -330,6 +330,16 @@ if ( $cgi->param('magic') ) { push @search, "$table.payinfo = '$1'"; } + if ( $cgi->param('ccpay') =~ /^([\w-:]+)$/ ) { + # I think that's all the characters we need to allow. + # To avoid confusion, this parameter searches both auth and order_number. + push @search, "($table.auth LIKE '$1%') OR ($table.order_number LIKE '$1%')"; + push @fields, 'auth', 'order_number'; + push @header, 'Auth #', 'Transaction #'; + $align .= 'rr'; + + } + if ( $cgi->param('usernum') =~ /^(\d+)$/ ) { push @search, "$table.usernum = $1"; } diff --git a/httemplate/search/elements/report_cust_pay_or_refund.html b/httemplate/search/elements/report_cust_pay_or_refund.html index a2b90b47d..7a1216bb6 100644 --- a/httemplate/search/elements/report_cust_pay_or_refund.html +++ b/httemplate/search/elements/report_cust_pay_or_refund.html @@ -50,23 +50,48 @@ Examples: <SCRIPT TYPE="text/javascript"> function payby_changed(what) { - if ( what.options[what.selectedIndex].value == 'BILL' ) { - document.getElementById('checkno_caption').style.color = '#000000'; - what.form.payinfo.disabled = false; - what.form.payinfo.style.backgroundColor = '#ffffff'; + if ( what.value == 'BILL' ) { + show('payinfo'); + hide('ccpay'); + } else if ( what.value.match(/^CARD/) ) { + hide('payinfo'); + show('ccpay'); } else { - document.getElementById('checkno_caption').style.color = '#bbbbbb'; - what.form.payinfo.disabled = true; - what.form.payinfo.style.backgroundColor = '#dddddd'; + hide('payinfo'); + hide('ccpay'); } } + function show(what) { + document.getElementById(what+'_caption').style.color = '#000000'; + document.getElementById(what).disabled = false; + document.getElementById(what).style.backgroundColor = '#ffffff'; + } + + function hide(what) { + document.getElementById(what+'_caption').style.color = '#bbbbbb'; + document.getElementById(what).disabled = true; + document.getElementById(what).style.backgroundColor = '#dddddd'; + } + + + </SCRIPT> <TR> - <TD ALIGN="right"><FONT ID="checkno_caption" COLOR="#bbbbbb"><% mt('Check #:') |h %> </FONT></TD> + <TD ALIGN="right"><FONT ID="payinfo_caption" COLOR="#bbbbbb"><% mt('Check #:') |h %> </FONT></TD> + <TD> + <INPUT TYPE="text" ID="payinfo" NAME="payinfo" DISABLED STYLE="background-color: #dddddd"> + </TD> + </TR> + <TR> + <TD ALIGN="right"> + <FONT ID="ccpay_caption" COLOR="#bbbbbb"> + <% mt('Transaction #') |h %> + </FONT> + </TD> <TD> - <INPUT TYPE="text" NAME="payinfo" DISABLED STYLE="background-color: #dddddd"> + <INPUT TYPE="text" ID="ccpay" NAME="ccpay" DISABLED STYLE="background-color: #dddddd"> </TD> </TR> diff --git a/httemplate/view/cust_pay.html b/httemplate/view/cust_pay.html index f9c8bc19c..76a24884a 100644 --- a/httemplate/view/cust_pay.html +++ b/httemplate/view/cust_pay.html @@ -77,7 +77,7 @@ <TD BGCOLOR="#FFFFFF"><B><% $cust_pay->payby_name %> #<% $cust_pay->paymask %></B></TD> </TR> -% if ( $cust_pay->payby =~ /^(CARD|CHEK|LECB)$/ && $cust_pay->paybatch ) { +% if ( $cust_pay->payby =~ /^(CARD|CHEK|LECB)$/ && $cust_pay->processor ) { <TR> <TD ALIGN="right"><% mt('Processor') |h %></TD> @@ -86,7 +86,7 @@ <TR> <TD ALIGN="right"><% mt('Authorization #') |h %></TD> - <TD BGCOLOR="#FFFFFF"><B><% $cust_pay->authorization %></B></TD> + <TD BGCOLOR="#FFFFFF"><B><% $cust_pay->auth %></B></TD> </TR> % if ( $cust_pay->order_number ) { diff --git a/httemplate/view/cust_refund.html b/httemplate/view/cust_refund.html index 996b4c05a..319761506 100644 --- a/httemplate/view/cust_refund.html +++ b/httemplate/view/cust_refund.html @@ -62,7 +62,7 @@ <TD BGCOLOR="#FFFFFF"><B><% $cust_refund->payby_name %><% $cust_refund->paymask ? ' #'.$cust_refund->paymask : '' %></B></TD> </TR> -% if ( $cust_refund->payby =~ /^(CARD|CHEK|LECB)$/ && $cust_refund->paybatch ) { +% if ( $cust_refund->payby =~ /^(CARD|CHEK|LECB)$/ && $cust_refund->processor ) { <TR> <TD ALIGN="right"><% mt('Processor') |h %></TD> @@ -71,7 +71,7 @@ <TR> <TD ALIGN="right"><% mt('Authorization #') |h %></TD> - <TD BGCOLOR="#FFFFFF"><B><% $cust_refund->authorization %></B></TD> + <TD BGCOLOR="#FFFFFF"><B><% $cust_refund->auth %></B></TD> </TR> % if ( $cust_refund->order_number ) { |