diff options
author | Mark Wells <mark@freeside.biz> | 2013-09-27 17:19:36 -0700 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2013-09-27 17:19:36 -0700 |
commit | eb3bd392a89b8b666dc512951e78913c05b98810 (patch) | |
tree | 22670bdf99b0a473abb708f6f5c55cbfa2f0c249 /httemplate/misc/delete-invoice_conf.html | |
parent | e3012c0751dad6710ea35b6d074b551bffdad09b (diff) |
invoice configurations, #24723
Diffstat (limited to 'httemplate/misc/delete-invoice_conf.html')
-rw-r--r-- | httemplate/misc/delete-invoice_conf.html | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/httemplate/misc/delete-invoice_conf.html b/httemplate/misc/delete-invoice_conf.html new file mode 100644 index 000000000..6cc6ddc95 --- /dev/null +++ b/httemplate/misc/delete-invoice_conf.html @@ -0,0 +1,19 @@ +<%init> +my $curuser = $FS::CurrentUser::CurrentUser; +die "access denied" + unless $curuser->access_right(['Edit templates', 'Edit global templates']); + +my ($query) = $cgi->keywords; +$query =~ /^(\d+)$/ or die "bad confnum"; +my $invoice_conf = FS::invoice_conf->by_key($1) + or die "couldn't find invoice_conf #$1"; +if ( !$curuser->access_right('Edit global templates') ) { + my $agentnum = FS::invoice_mode->by_key($invoice_conf->modenum)->agentnum; + die "access denied" + unless $curuser->agentnums_href->{$agentnum}; +} + +my $error = $invoice_conf->delete; # may also delete the invoice_mode +my $url = $p.'browse/invoice_conf.html'; +</%init> +<% $cgi->redirect($url) %> |