diff options
author | jeff <jeff> | 2007-01-08 17:36:53 +0000 |
---|---|---|
committer | jeff <jeff> | 2007-01-08 17:36:53 +0000 |
commit | b89c7f126690704c8d1558dba06d5fabd7470528 (patch) | |
tree | 7a1ce8e2d5675952f4a06472897cab9d19e01037 /httemplate | |
parent | 704992901b980cd3d41568d7fec0842b2a64bdf7 (diff) |
refund deletion
Diffstat (limited to 'httemplate')
-rwxr-xr-x | httemplate/misc/delete-cust_refund.cgi | 17 | ||||
-rw-r--r-- | httemplate/view/cust_main/payment_history.html | 16 |
2 files changed, 32 insertions, 1 deletions
diff --git a/httemplate/misc/delete-cust_refund.cgi b/httemplate/misc/delete-cust_refund.cgi new file mode 100755 index 000000000..3e44560d0 --- /dev/null +++ b/httemplate/misc/delete-cust_refund.cgi @@ -0,0 +1,17 @@ +% +% +%#untaint refundnum +%my($query) = $cgi->keywords; +%$query =~ /^(\d+)$/ || die "Illegal refundnum"; +%my $refundnum = $1; +% +%my $cust_refund = qsearchs('cust_refund',{'refundnum'=>$refundnum}); +%my $custnum = $cust_refund->custnum; +% +%my $error = $cust_refund->delete; +%eidiot($error) if $error; +% +%print $cgi->redirect($p. "view/cust_main.cgi?". $custnum); +% +% + diff --git a/httemplate/view/cust_main/payment_history.html b/httemplate/view/cust_main/payment_history.html index a23ca9ac7..43c55e8c9 100644 --- a/httemplate/view/cust_main/payment_history.html +++ b/httemplate/view/cust_main/payment_history.html @@ -372,9 +372,23 @@ % $payby =~ s/^CHEK$/Electronic check /; % $payby =~ s/^(CARD|COMP)$/$1 /; % +% my $delete = ''; +% if ( $cust_refund->closed !~ /^Y/i +% && $conf->exists('deleterefunds') +% && $curuser->access_right('Delete refund') +% ) +% { +% $delete = qq! (<A HREF="javascript:areyousure('!. +% qq!${p}misc/delete-cust_refund.cgi?!. $cust_refund->refundnum. +% qq!', 'Are you sure you want to delete this refund?')"!. +% qq! TITLE="Delete this refund from the database completely - not recommended"!. +% qq!>delete</A>)!; +% } +% % push @history, { % 'date' => $cust_refund->_date, -% 'desc' => "Refund ($payby$payinfo) by ". $cust_refund->otaker, +% 'desc' => "Refund ($payby$payinfo) by ". $cust_refund->otaker. "<BR>". +% $delete, % 'refund' => $cust_refund->refund, % }; % |