diff options
author | Ivan Kohler <ivan@freeside.biz> | 2013-03-26 19:00:33 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2013-03-26 19:00:33 -0700 |
commit | d06f67ed49d71e8d2c957d877fe738a8cac0cfe2 (patch) | |
tree | 304285d7a9c54175d6662a6af9411108aba8e097 /httemplate/edit/process | |
parent | 8a6bdb6425eac988c19822f301a5849468f85f2e (diff) | |
parent | 6a42226f7f1779974316111cb178a3c6a6d74931 (diff) |
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Diffstat (limited to 'httemplate/edit/process')
-rw-r--r-- | httemplate/edit/process/cust_pkg_quantity.html | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/httemplate/edit/process/cust_pkg_quantity.html b/httemplate/edit/process/cust_pkg_quantity.html new file mode 100644 index 000000000..fb2657252 --- /dev/null +++ b/httemplate/edit/process/cust_pkg_quantity.html @@ -0,0 +1,33 @@ +% if ($error) { +% $cgi->param('error', $error); +% $cgi->redirect(popurl(3). 'edit/cust_pkg_quantity.html?'. $cgi->query_string ); +% } else { + + <& /elements/header-popup.html, "Quantity changed" &> + <SCRIPT TYPE="text/javascript"> + window.top.location.reload(); + </SCRIPT> + </BODY> + </HTML> + +% } +<%init> + +my $curuser = $FS::CurrentUser::CurrentUser; + +die "access denied" + unless $curuser->access_right('Change customer package'); + +my $cust_pkg = qsearchs({ + 'table' => 'cust_pkg', + 'addl_from' => 'LEFT JOIN cust_main USING ( custnum )', + 'hashref' => { 'pkgnum' => scalar($cgi->param('pkgnum')), }, + 'extra_sql' => ' AND '. $curuser->agentnums_sql, +}); +die 'unknown pkgnum' unless $cust_pkg; + +$cgi->param('quantity') =~ /^(\d+)$/; +my $quantity = $1; +my $error = $cust_pkg->set_quantity($1); + +</%init> |