summaryrefslogtreecommitdiff
path: root/httemplate/view
diff options
context:
space:
mode:
authorivan <ivan>2004-01-09 22:11:54 +0000
committerivan <ivan>2004-01-09 22:11:54 +0000
commitf3212b82d6d54500bbe31c02c8ffa456f018a067 (patch)
tree71af32913a105b30f105a0eeb2bab4caa668ff38 /httemplate/view
parente68e85f88922d6678a9c6fc1a7624065e38b7361 (diff)
add deletecredits config value to enable deletion of credits
Diffstat (limited to 'httemplate/view')
-rwxr-xr-xhttemplate/view/cust_main.cgi11
1 files changed, 10 insertions, 1 deletions
diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi
index fb015671f..8123b2f82 100755
--- a/httemplate/view/cust_main.cgi
+++ b/httemplate/view/cust_main.cgi
@@ -554,6 +554,11 @@ function cust_pay_unapply_areyousure(href) {
== true)
window.location.href = href;
}
+function cust_credit_areyousure(href) {
+ if (confirm("Are you sure you want to delete this credit?")
+ == true)
+ window.location.href = href;
+}
</SCRIPT>
END
@@ -628,9 +633,13 @@ if ( $conf->config('payby-default') ne 'HIDE' ) {
$cust_credit->reason,
time2str("%D", $cust_credit_bill->_date),
);
+ my $delete =
+ $cust_credit->closed !~ /^Y/i && $conf->exists('deletecredits')
+ ? qq! (<A HREF="javascript:cust_credit_areyousure('${p}misc/delete-cust_credit.cgi?!. $cust_credit->crednum. qq!')">delete</A>)!
+ : '';
push @history,
"$date\tCredit #$crednum: $reason<BR>".
- "(applied to invoice #$invnum on $app_date)\t\t\t$amount\t";
+ "(applied to invoice #$invnum on $app_date)$delete\t\t\t$amount\t";
}
}