summaryrefslogtreecommitdiff
path: root/httemplate/misc
diff options
context:
space:
mode:
authorChristopher Burger <burgerc@freeside.biz>2018-06-12 09:51:58 -0400
committerChristopher Burger <burgerc@freeside.biz>2018-06-12 11:08:59 -0400
commit42b35cdaeb0643630eda0513556a8e668fbcb8e2 (patch)
treeb7be235db2198c56ec2bb8bd535ea25ddebf96d5 /httemplate/misc
parent8196faffdbc0abc43ce346119a76430c8a242b56 (diff)
RT# 74435 - fixed errors in posting a echeck refund when no account is listed.
Conflicts: httemplate/misc/payment.cgi
Diffstat (limited to 'httemplate/misc')
-rw-r--r--httemplate/misc/payment.cgi183
-rw-r--r--httemplate/misc/process/payment.cgi7
2 files changed, 10 insertions, 180 deletions
diff --git a/httemplate/misc/payment.cgi b/httemplate/misc/payment.cgi
index a6c6bac..b170da2 100644
--- a/httemplate/misc/payment.cgi
+++ b/httemplate/misc/payment.cgi
@@ -134,178 +134,10 @@ function change_batch_checkbox () {
>
<TABLE class="fsinnerbox">
-% my $auto = 0;
-% if ( $payby eq 'CARD' ) {
-%
-% my( $payinfo, $paycvv, $month, $year ) = ( '', '', '', '' );
-% my $payname = $cust_main->first. ' '. $cust_main->getfield('last');
-% my $location = $cust_main->bill_location;
-
- <TR>
- <TH ALIGN="right"><% mt('Card number') |h %></TH>
- <TD COLSPAN=7>
- <TABLE>
- <TR>
- <TD>
- <INPUT TYPE="text" NAME="payinfo" SIZE=20 MAXLENGTH=19 VALUE="<%$payinfo%>"> </TD>
- <TH><% mt('Exp.') |h %></TH>
- <TD>
- <SELECT NAME="month">
-% for ( ( map "0$_", 1 .. 9 ), 10 .. 12 ) {
-
- <OPTION<% $_ == $month ? ' SELECTED' : '' %>><% $_ %>
-% }
-
- </SELECT>
- </TD>
- <TD> / </TD>
- <TD>
- <SELECT NAME="year">
-% my @a = localtime; for ( $a[5]+1900 .. $a[5]+1915 ) {
-
- <OPTION<% $_ == $year ? ' SELECTED' : '' %>><% $_ %>
-% }
-
- </SELECT>
- </TD>
- </TR>
- </TABLE>
- </TD>
- </TR>
- <TR>
- <TH ALIGN="right"><% mt('CVV2') |h %></TH>
- <TD><INPUT TYPE="text" NAME="paycvv" VALUE="<% $paycvv %>" SIZE=4 MAXLENGTH=4>
- (<A HREF="javascript:void(0);" onClick="overlib( OLiframeContent('../docs/cvv2.html', 480, 352, 'cvv2_popup' ), CAPTION, 'CVV2 Help', STICKY, AUTOSTATUSCAP, CLOSECLICK, DRAGGABLE ); return false;"><% mt('help') |h %></A>)
- </TD>
- </TR>
- <TR>
- <TH ALIGN="right"><% mt('Exact name on card') |h %></TH>
- <TD><INPUT TYPE="text" SIZE=32 MAXLENGTH=80 NAME="payname" VALUE="<%$payname%>"></TD>
- </TR>
-
- <& /elements/location.html,
- 'object' => $location,
- 'no_asterisks' => 1,
- 'address1_label' => emt('Card billing address'),
- &>
-
-% } elsif ( $payby eq 'CHEK' ) {
-%
-% my( $account, $aba, $branch, $payname, $ss, $paytype, $paystate,
-% $stateid, $stateid_state )
-% = ( '', '', '', '', '', '', '', '', '' );
-%
-% #false laziness w/{edit,view}/cust_main/billing.html
-% my $routing_label = $conf->config('echeck-country') eq 'US'
-% ? 'ABA/Routing number'
-% : 'Routing number';
-% my $routing_size = $conf->config('echeck-country') eq 'CA' ? 4 : 10;
-% my $routing_maxlength = $conf->config('echeck-country') eq 'CA' ? 3 : 9;
-
- <INPUT TYPE="hidden" NAME="month" VALUE="12">
- <INPUT TYPE="hidden" NAME="year" VALUE="2037">
- <TR>
- <TD ALIGN="right"><% mt('Account number') |h %></TD>
- <TD><INPUT TYPE="text" SIZE=10 NAME="payinfo1" VALUE="<%$account%>"></TD>
- <TD ALIGN="right"><% mt('Type') |h %></TD>
- <TD><SELECT NAME="paytype"><% join('', map { qq!<OPTION VALUE="$_" !.($paytype eq $_ ? 'SELECTED' : '').">$_</OPTION>" } FS::cust_payby->paytypes) %></SELECT></TD>
- </TR>
- <TR>
- <TD ALIGN="right"><% mt($routing_label) |h %></TD>
- <TD>
- <INPUT TYPE="text" SIZE="<% $routing_size %>" MAXLENGTH="<% $routing_maxlength %>" NAME="payinfo2" VALUE="<%$aba%>">
- (<A HREF="javascript:void(0);" onClick="overlib( OLiframeContent('../docs/ach.html', 380, 240, 'ach_popup' ), CAPTION, 'ACH Help', STICKY, AUTOSTATUSCAP, CLOSECLICK, DRAGGABLE ); return false;"><% mt('help') |h %></A>)
- </TD>
- </TR>
-% if ( $conf->config('echeck-country') eq 'CA' ) {
- <TR>
- <TD ALIGN="right"><% mt('Branch number') |h %></TD>
- <TD>
- <INPUT TYPE="text" NAME="payinfo3" VALUE="<%$branch%>" SIZE=6 MAXLENGTH=5>
- </TD>
- </TR>
-% }
- <TR>
- <TD ALIGN="right"><% mt('Bank name') |h %></TD>
- <TD><INPUT TYPE="text" NAME="payname" VALUE="<%$payname%>"></TD>
- </TR>
-
-% if ( $conf->exists('show_bankstate') ) {
- <TR>
- <TD ALIGN="right"><% mt('Bank state') |h %></TD>
- <TD><& /elements/select-state.html,
- 'disable_empty' => 0,
- 'empty_label' => emt('(choose)'),
- 'state' => $paystate,
- 'country' => $cust_main->country,
- 'prefix' => 'pay',
- &>
- </TD>
- </TR>
-% } else {
- <INPUT TYPE="hidden" NAME="paystate" VALUE="<% $paystate %>">
-% }
-
-% if ( $conf->exists('show_ss') ) {
- <TR>
- <TD ALIGN="right">
- <% mt('Account holder') |h %><BR>
- <% mt('Social security or tax ID #') |h %>
- </TD>
- <TD><INPUT TYPE="text" NAME="ss" VALUE="<% $ss %>"></TD>
- </TR>
-% } else {
- <INPUT TYPE="hidden" NAME="ss" VALUE="<% $ss %>"></TD>
-% }
-
-% if ( $conf->exists('show_stateid') ) {
- <TR>
- <TD ALIGN="right">
- <% mt('Account holder') |h %><BR>
- <% mt("Driver's license or state ID #") |h %>
- </TD>
- <TD><INPUT TYPE="text" NAME="stateid" VALUE="<% $stateid %>"></TD>
- <TD ALIGN="right"><% mt('State') |h %></TD>
- <TD><& /elements/select-state.html,
- 'disable_empty' => 0,
- 'empty_label' => emt('(choose)'),
- 'state' => $stateid_state,
- 'country' => $cust_main->country,
- 'prefix' => 'stateid_',
- &>
- </TD>
- </TR>
-% } else {
- <INPUT TYPE="hidden" NAME="stateid" VALUE="<% $stateid %>">
- <INPUT TYPE="hidden" NAME="stateid_state" VALUE="<% $stateid_state %>">
-% }
-
-% } #end CARD/CHEK-specific section
-
-
-<TR>
- <TD COLSPAN=8>
- <INPUT TYPE="checkbox" CHECKED NAME="save" VALUE="1">
- <% mt('Remember this information') |h %>
- </TD>
-</TR>
-
-<TR>
- <TD COLSPAN=8>
- <INPUT TYPE="checkbox"<% $auto ? ' CHECKED' : '' %> NAME="auto" VALUE="1" onClick="if (this.checked) { document.OneTrueForm.save.checked=true; }">
- <% mt("Charge future payments to this [_1] automatically",$type{$payby}) |h %>
-% if ( @cust_payby ) {
- <% mt('as') |h %>
- <SELECT NAME="weight">
-% for ( 1 .. 1+scalar(grep { $_->payby =~ /^(CARD|CHEK)$/ } @cust_payby) ) {
- <OPTION VALUE="<%$_%>"><% mt( $weight{$_} ) |h %>
-% }
- </SELECT>
-% } else {
- <INPUT TYPE="hidden" NAME="weight" VALUE="1">
-% }
- </TD>
-</TR>
+<& /elements/cust_payby_new.html,
+ 'cust_payby' => \@cust_payby,
+ 'curr_value' => $custpaybynum,
+&>
</TABLE>
</DIV>
@@ -354,13 +186,6 @@ my $payinfo = '';
my $conf = new FS::Conf;
-#false laziness w/selfservice make_payment.html shortcut for one-country
-my %states = map { $_->state => 1 }
- qsearch('cust_main_county', {
- 'country' => $conf->config('countrydefault') || 'US'
- } );
-my @states = sort { $a cmp $b } keys %states;
-
my $amount = '';
if ( $balance > 0 ) {
# when configured to do so, amount will only auto-fill with balance
diff --git a/httemplate/misc/process/payment.cgi b/httemplate/misc/process/payment.cgi
index 717d57c..5620b5b 100644
--- a/httemplate/misc/process/payment.cgi
+++ b/httemplate/misc/process/payment.cgi
@@ -90,6 +90,7 @@ if ( (my $custpaybynum = scalar($cgi->param('custpaybynum'))) > 0 ) {
$paycvv = $cust_payby->paycvv; # pass it if we got it, running a transaction will clear it
( $month, $year ) = $cust_payby->paydate_mon_year;
$payname = $cust_payby->payname;
+ $cgi->param(-name=>"paytype", -value=>$cust_payby->paytype) unless $cgi->param("paytype");
} else {
@@ -208,6 +209,10 @@ if ( (my $custpaybynum = scalar($cgi->param('custpaybynum'))) > 0 ) {
my $error = '';
my $paynum = '';
+my $paydate;
+if ($cust_payby->paydate) { $paydate = "$year-$month-01"; }
+else { $paydate = "2037-12-01"; }
+
if ( $cgi->param('batch') ) {
$error = 'Prepayment discounts not supported with batched payments'
@@ -217,7 +222,7 @@ if ( $cgi->param('batch') ) {
'payby' => $payby,
'amount' => $amount,
'payinfo' => $payinfo,
- 'paydate' => "$year-$month-01",
+ 'paydate' => $paydate,
'payname' => $payname,
map { $_ => scalar($cgi->param($_)) }
@{$payby2fields{$payby}}