[freeside-commits] freeside/httemplate/edit cust_pkg_discount.html, NONE, 1.1
Ivan,,,
ivan at wavetail.420.am
Sat Jan 30 15:00:27 PST 2010
Update of /home/cvs/cvsroot/freeside/httemplate/edit
In directory wavetail.420.am:/tmp/cvs-serv11953/httemplate/edit
Added Files:
cust_pkg_discount.html
Log Message:
discounts, RT#6679
--- NEW FILE: cust_pkg_discount.html ---
<% include('/elements/header-popup.html', "Discount Package") %>
<SCRIPT TYPE="text/javascript">
function enable_discount_pkg () {
if ( document.DiscountPkgForm.discountnum.selectedIndex > 0 ) {
document.DiscountPkgForm.submit.disabled = false;
} else {
document.DiscountPkgForm.submit.disabled = true;
}
}
</SCRIPT>
<% include('/elements/error.html') %>
<FORM NAME="DiscountPkgForm" ACTION="<% $p %>edit/process/cust_pkg_discount.html" METHOD=POST>
<INPUT TYPE="hidden" NAME="pkgnum" VALUE="<% $pkgnum %>">
<% ntable('#cccccc') %>
<TR>
<TH ALIGN="right">Current package </TH>
<TD COLSPAN=7>
<% $curuser->option('show_pkgnum') ? $cust_pkg->pkgnum.': ' : '' %><B><% $part_pkg->pkg |h %></B> - <% $part_pkg->comment |h %>
</TD>
</TR>
<% include('/elements/tr-select-discount.html',
'empty_label' => ( $pkgdiscountnum ? '' : 'Select discount' ),
'onchange' => 'enable_discount_pkg',
)
%>
</TABLE>
<BR>
<INPUT NAME="submit" TYPE="submit" VALUE="Discount package" <% $pkgdiscountnum ? '' : 'DISABLED' %>>
</FORM>
</BODY>
</HTML>
<%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;
</%init>
More information about the freeside-commits
mailing list