diff options
Diffstat (limited to 'httemplate')
-rwxr-xr-x | httemplate/edit/cust_refund.cgi | 13 | ||||
-rwxr-xr-x | httemplate/edit/process/cust_refund.cgi | 9 | ||||
-rw-r--r-- | httemplate/elements/menu.html | 4 | ||||
-rwxr-xr-x | httemplate/elements/tr-select-reason.html | 6 | ||||
-rw-r--r-- | httemplate/view/cust_main/payment_history.html | 2 |
5 files changed, 24 insertions, 10 deletions
diff --git a/httemplate/edit/cust_refund.cgi b/httemplate/edit/cust_refund.cgi index 3c189afe6..bfcbfe725 100755 --- a/httemplate/edit/cust_refund.cgi +++ b/httemplate/edit/cust_refund.cgi @@ -106,14 +106,17 @@ <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> -<INPUT TYPE="submit" NAME="submit" VALUE="Post refund"> +<INPUT TYPE="submit" ID="confirm_refund_button" VALUE="<% mt('Post refund') |h %>" DISABLED> </FORM> diff --git a/httemplate/edit/process/cust_refund.cgi b/httemplate/edit/process/cust_refund.cgi index 0fee6ed30..6ad468b6c 100755 --- a/httemplate/edit/process/cust_refund.cgi +++ b/httemplate/edit/process/cust_refund.cgi @@ -33,8 +33,13 @@ my $payby = $cgi->param('payby'); die "access denied" unless $FS::CurrentUser::CurrentUser->refund_access_right($payby); -my $error = ''; -if ( $payby =~ /^(CARD|CHEK)$/ ) { +$cgi->param('reasonnum') =~ /^(-?\d+)$/ or die "Illegal reasonnum"; +my ($reasonnum, $error) = $m->comp('/misc/process/elements/reason'); +$cgi->param('reasonnum', $reasonnum) unless $error; + +if ( $error ) { + # do nothing +} elsif ( $payby =~ /^(CARD|CHEK)$/ ) { my %options = (); my $bop = $FS::payby::payby2bop{$1}; $cgi->param('refund') =~ /^(\d*)(\.\d{2})?$/ diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html index dfd0eaba7..0988b98db 100644 --- a/httemplate/elements/menu.html +++ b/httemplate/elements/menu.html @@ -688,6 +688,10 @@ if ( $curuser->access_right('Configuration') ) { $config_billing{'Credit reason types'} = [ $fsurl.'browse/reason_type.html?class=R', 'Credit reason types define groups of reasons.' ]; $config_billing{'Credit void reasons'} = [ $fsurl.'browse/reason.html?class=X', 'Credit void reasons explain why a credit was voided.' ]; $config_billing{'Credit void reason types'} = [ $fsurl.'browse/reason_type.html?class=X', 'Credit void reason types define groups of reasons.' ]; + + $config_billing{'separator5'} = ''; #its a separator! + $config_billing{'Refund reasons'} = [ $fsurl.'browse/reason.html?class=F', 'Refund reasons explain why a refund was issued.' ]; + $config_billing{'Refund reason types'} = [ $fsurl.'browse/reason_type.html?class=F', 'Refund reason types define groups of reasons.' ]; } #XXX also to be unified diff --git a/httemplate/elements/tr-select-reason.html b/httemplate/elements/tr-select-reason.html index 836dd9bcd..47acd854b 100755 --- a/httemplate/elements/tr-select-reason.html +++ b/httemplate/elements/tr-select-reason.html @@ -6,8 +6,8 @@ Example: #required 'field' => 'reasonnum', - 'reason_class' => 'C', # currently 'C', 'R', 'S' or 'X' - # for cancel, credit, suspend or void credit + 'reason_class' => 'C', # currently 'C', 'R', 'F', 'S' or 'X' + # for cancel, credit, refund, suspend or void credit #recommended 'cgi' => $cgi, #easiest way for things to be properly "sticky" on errors @@ -197,6 +197,8 @@ if ($class eq 'C') { $add_access_right = 'Add on-the-fly credit reason'; } elsif ($class eq 'X') { $add_access_right = 'Add on-the-fly void credit reason'; +} elsif ($class eq 'F') { + $add_access_right = 'Add on-the-fly refund reason'; } else { die "illegal class: $class"; } diff --git a/httemplate/view/cust_main/payment_history.html b/httemplate/view/cust_main/payment_history.html index 5418fb8e5..737b0e251 100644 --- a/httemplate/view/cust_main/payment_history.html +++ b/httemplate/view/cust_main/payment_history.html @@ -102,7 +102,7 @@ 'action' => "${p}edit/cust_refund.cgi?popup=1;payby=BILL", 'cust_main' => $cust_main, 'actionlabel' => emt('Enter check refund'), - 'width' => 392, + 'width' => 440, &> % } |