X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fcust_pkg_discount.html;fp=httemplate%2Fedit%2Fcust_pkg_discount.html;h=22d8c632fed45ba24598c35c642b0ae9fb21bf43;hb=481011e14852aa62181bed0c7ae34b1e37ebff18;hp=0000000000000000000000000000000000000000;hpb=d6be23266fb627a4e7831055bf55ae675dbad4e9;p=freeside.git diff --git a/httemplate/edit/cust_pkg_discount.html b/httemplate/edit/cust_pkg_discount.html new file mode 100755 index 000000000..22d8c632f --- /dev/null +++ b/httemplate/edit/cust_pkg_discount.html @@ -0,0 +1,75 @@ +<% include('/elements/header-popup.html', "Discount Package") %> + + + +<% include('/elements/error.html') %> + +
+ + +<% ntable('#cccccc') %> + + + Current package  + + <% $curuser->option('show_pkgnum') ? $cust_pkg->pkgnum.': ' : '' %><% $part_pkg->pkg |h %> - <% $part_pkg->comment |h %> + + + +<% include('/elements/tr-select-discount.html', + 'empty_label' => ( $pkgdiscountnum ? '' : 'Select discount' ), + 'onchange' => 'enable_discount_pkg', + ) +%> + + + +
+> + +
+ + + +<%init> + +#some false laziness w/misc/change_pkg.cgi + +my $conf = new FS::Conf; + +my $curuser = $FS::CurrentUser::CurrentUser; + +die "access denied" + unless $curuser->access_right('Discount customer package'); + +my $pkgnum = scalar($cgi->param('pkgnum')); +$pkgnum =~ /^(\d+)$/ or die "illegal pkgnum $pkgnum"; +$pkgnum = $1; + +my $pkgdiscountnum = ''; + +my $cust_pkg = + qsearchs({ + 'table' => 'cust_pkg', + 'addl_from' => 'LEFT JOIN cust_main USING ( custnum )', + 'hashref' => { 'pkgnum' => $pkgnum }, + 'extra_sql' => ' AND '. $curuser->agentnums_sql, + }) or die "unknown pkgnum $pkgnum"; + +#my $cust_main = $cust_pkg->cust_main +# or die "can't get cust_main record for custnum ". $cust_pkg->custnum. +# " ( pkgnum ". cust_pkg->pkgnum. ")"; + +my $part_pkg = $cust_pkg->part_pkg; + +