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 git.freeside.biz:/home/git/freeside
[freeside.git]
/
httemplate
/
edit
/
cust_refund.cgi
diff --git
a/httemplate/edit/cust_refund.cgi
b/httemplate/edit/cust_refund.cgi
index
94c0993
..
bfcbfe7
100755
(executable)
--- a/
httemplate/edit/cust_refund.cgi
+++ b/
httemplate/edit/cust_refund.cgi
@@
-41,14
+41,14
@@
</TR>
<TR>
</TR>
<TR>
- <TD ALIGN="right">Date</TD><TD BGCOLOR="#ffffff"><% time2str(
"%D",
$cust_pay->_date) %></TD>
+ <TD ALIGN="right">Date</TD><TD BGCOLOR="#ffffff"><% time2str(
$date_format,
$cust_pay->_date) %></TD>
</TR>
<TR>
<TD ALIGN="right">Method</TD><TD BGCOLOR="#ffffff"><% $payby %> # <% $paymask %></TD>
</TR>
</TR>
<TR>
<TD ALIGN="right">Method</TD><TD BGCOLOR="#ffffff"><% $payby %> # <% $paymask %></TD>
</TR>
-% unless ( $paydate ) { # possibly other reasons: i.e. card has since expired
+% unless ( $paydate
|| $cust_pay->payby ne 'CARD'
) { # possibly other reasons: i.e. card has since expired
<TR>
<TD ALIGN="right">Expiration</TD><TD BGCOLOR="#ffffff">
<% include( '/elements/select-month_year.html',
<TR>
<TD ALIGN="right">Expiration</TD><TD BGCOLOR="#ffffff">
<% include( '/elements/select-month_year.html',
@@
-59,33
+59,29
@@
</TD>
</TR>
% }
</TD>
</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 );
-%
-
-
+% if ( $cust_pay->processor ) {
<TR>
<TR>
- <TD ALIGN="right">Processor</TD><TD BGCOLOR="#ffffff"><% $processor %></TD>
+ <TD ALIGN="right">Processor</TD>
+ <TD BGCOLOR="#ffffff"><% $cust_pay->processor %></TD>
</TR>
</TR>
-% if ( length($auth) ) {
+% if ( length($
cust_pay->
auth) ) {
<TR>
<TR>
- <TD ALIGN="right">Authorization</TD><TD BGCOLOR="#ffffff"><% $auth %></TD>
+ <TD ALIGN="right">Authorization</TD>
+ <TD BGCOLOR="#ffffff"><% $cust_pay->auth %></TD>
</TR>
% }
</TR>
% }
-% if ( length($order_number) ) {
+% if ( length($
cust_pay->
order_number) ) {
<TR>
<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>
% }
</TR>
% }
-% }
+% }
# if ($cust_pay->processor)
</TABLE>
</TABLE>
-% }
+% }
#if $cust_pay
<BR>Refund
<BR>Refund
@@
-93,12
+89,12
@@
<TR>
<TD ALIGN="right">Date</TD>
<TR>
<TD ALIGN="right">Date</TD>
- <TD BGCOLOR="#ffffff"><% time2str(
"%D",
$_date) %></TD>
+ <TD BGCOLOR="#ffffff"><% time2str(
$date_format,
$_date) %></TD>
</TR>
<TR>
<TD ALIGN="right">Amount</TD>
</TR>
<TR>
<TD ALIGN="right">Amount</TD>
- <TD BGCOLOR="#ffffff">$<INPUT TYPE="text" NAME="refund" VALUE="<% $refund %>" SIZE=8 MAXLENGTH=
8
> by <B><% FS::payby->payname($payby) %></B></TD>
+ <TD BGCOLOR="#ffffff">$<INPUT TYPE="text" NAME="refund" VALUE="<% $refund %>" SIZE=8 MAXLENGTH=
9
> by <B><% FS::payby->payname($payby) %></B></TD>
</TR>
% if ( $payby eq 'BILL' ) {
</TR>
% if ( $payby eq 'BILL' ) {
@@
-110,14
+106,17
@@
<INPUT TYPE="hidden" NAME="payinfo" VALUE="">
% }
<INPUT TYPE="hidden" NAME="payinfo" VALUE="">
% }
- <TR>
- <TD ALIGN="right">Reason</TD>
- <TD BGCOLOR="#ffffff"><INPUT TYPE="text" NAME="reason" VALUE="<% $reason %>"></TD>
- </TR>
+<& /elements/tr-select-reason.html,
+ 'field' => 'reasonnum',
+ 'reason_class' => 'F',
+ 'control_button' => "confirm_refund_button",
+ 'cgi' => $cgi,
+&>
+
</TABLE>
<BR>
</TABLE>
<BR>
-<INPUT TYPE="submit"
NAME="submit" VALUE="Post refund"
>
+<INPUT TYPE="submit"
ID="confirm_refund_button" VALUE="<% mt('Post refund') |h %>" DISABLED
>
</FORM>
</FORM>
@@
-130,10
+129,9
@@
<%init>
<%init>
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Refund payment');
-
my $conf = new FS::Conf;
my $conf = new FS::Conf;
+my $date_format = $conf->config('date_format') || '%m/%d/%Y';
+
my $custnum = $cgi->param('custnum');
my $refund = $cgi->param('refund');
my $payby = $cgi->param('payby');
my $custnum = $cgi->param('custnum');
my $refund = $cgi->param('refund');
my $payby = $cgi->param('payby');
@@
-141,6
+139,9
@@
my $payinfo = $cgi->param('payinfo');
my $reason = $cgi->param('reason');
my $link = $cgi->param('popup') ? 'popup' : '';
my $reason = $cgi->param('reason');
my $link = $cgi->param('popup') ? 'popup' : '';
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->refund_access_right($payby);
+
my( $paynum, $cust_pay ) = ( '', '' );
if ( $cgi->param('paynum') =~ /^(\d+)$/ ) {
$paynum = $1;
my( $paynum, $cust_pay ) = ( '', '' );
if ( $cgi->param('paynum') =~ /^(\d+)$/ ) {
$paynum = $1;