diff options
author | ivan <ivan> | 2008-09-03 01:46:43 +0000 |
---|---|---|
committer | ivan <ivan> | 2008-09-03 01:46:43 +0000 |
commit | 46a7257273fdae101658c8a1ee74f654ca0876b5 (patch) | |
tree | 16e5d2021a2cbc0d0fa2988bd767890013eed41e /httemplate/edit/process/cust_refund.cgi | |
parent | 2e3742946113c9a4e52a4741c020ff5b129050e8 (diff) |
add back ability to post a check/cash refund. be more explicit about it instead of just being a checkbox when posting a credit. RT#3812
Diffstat (limited to 'httemplate/edit/process/cust_refund.cgi')
-rwxr-xr-x | httemplate/edit/process/cust_refund.cgi | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/httemplate/edit/process/cust_refund.cgi b/httemplate/edit/process/cust_refund.cgi index 1a7a394b3..5749e5346 100755 --- a/httemplate/edit/process/cust_refund.cgi +++ b/httemplate/edit/process/cust_refund.cgi @@ -2,18 +2,32 @@ % $cgi->param('error', $error); <% $cgi->redirect(popurl(2). "cust_refund.cgi?". $cgi->query_string ) %> %} else { +% +% if ( $link eq 'popup' ) { +% +<% header('Refund entered') %> + <SCRIPT TYPE="text/javascript"> + window.top.location.reload(); + </SCRIPT> + + </BODY></HTML> +% } else { <% $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum") %> +% } %} <%init> die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Refund payment'); + unless $FS::CurrentUser::CurrentUser->access_right('Refund payment') + || $FS::CurrentUser::CurrentUser->access_right('Post refund'); $cgi->param('custnum') =~ /^(\d*)$/ or die "Illegal custnum!"; my $custnum = $1; my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } ) or die "unknown custnum $custnum"; +my $link = $cgi->param('popup') ? 'popup' : ''; + my $error = ''; if ( $cgi->param('payby') =~ /^(CARD|CHEK)$/ ) { my %options = (); @@ -31,13 +45,12 @@ if ( $cgi->param('payby') =~ /^(CARD|CHEK)$/ ) { 'reason' => $reason, %options ); } else { - die 'unimplemented'; - #my $new = new FS::cust_refund ( { - # map { - # $_, scalar($cgi->param($_)); - # } ( fields('cust_refund'), 'paynum' ) - #} ); - #$error = $new->insert; + my $new = new FS::cust_refund ( { + map { + $_, scalar($cgi->param($_)); + } fields('cust_refund') #huh? , 'paynum' ) + } ); + $error = $new->insert; } </%init> |