RT#37125: Include discounts in report: customer accounting summary
[freeside.git] / httemplate / misc / delete-cust_pkg_discount.html
1 % if ( $error ) {
2 %   errorpage($error);
3 % } else {
4 %   my $frag = "cust_pkg". $cust_pkg->pkgnum;
5 %   my $show = $curuser->default_customer_view =~ /^(jumbo|packages)$/
6 %                ? ''
7 %                : ';show=packages';
8 <% $cgi->redirect($p. "view/cust_main.cgi?custnum=$custnum$show;fragment=$frag#$frag" ) %>
9 % }
10 <%init>
11
12 my $curuser = $FS::CurrentUser::CurrentUser;
13
14 #XXX ACL to remove discounts
15 #die "access denied"
16 #  unless $curuser->access_right('Delete invoices');
17
18 #untaint pkgdiscountnum
19 my($query) = $cgi->keywords;
20 $query =~ /^(\d+)$/ || die "Illegal crednum";
21 my $pkgdiscountnum = $1;
22
23 my $cust_pkg_discount =
24   qsearchs('cust_pkg_discount', {'pkgdiscountnum'=>$pkgdiscountnum});
25 my $cust_pkg = $cust_pkg_discount->cust_pkg;
26 my $custnum = $cust_pkg->custnum;
27
28 $cust_pkg_discount->disabled('Y');
29
30 my $error = $cust_pkg_discount->replace;
31
32 </%init>