2 my $curuser = $FS::CurrentUser::CurrentUser;
4 unless $curuser->access_right(['Edit templates', 'Edit global templates']);
6 my ($query) = $cgi->keywords;
7 $query =~ /^(\d+)$/ or die "bad confnum";
8 my $invoice_conf = FS::invoice_conf->by_key($1)
9 or die "couldn't find invoice_conf #$1";
10 if ( !$curuser->access_right('Edit global templates') ) {
11 my $agentnum = FS::invoice_mode->by_key($invoice_conf->modenum)->agentnum;
13 unless $curuser->agentnums_href->{$agentnum};
16 my $error = $invoice_conf->delete; # may also delete the invoice_mode
17 my $url = $p.'browse/invoice_conf.html';
19 <% $cgi->redirect($url) %>