summaryrefslogtreecommitdiff
path: root/httemplate/edit/process
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2013-08-18 19:58:17 -0700
committerIvan Kohler <ivan@freeside.biz>2013-08-18 19:58:17 -0700
commit6891db8c9287fa670e5f6961c8ad3f2e3097fc3c (patch)
tree01dea3792e8afde6bc09f4a51ab6c6af44d36a2c /httemplate/edit/process
parent48c5c17b6ca02cd04f1dd5deb530738f2409c585 (diff)
continue sales person work: customer and package selection, commissions, reporting. RT#23402
Diffstat (limited to 'httemplate/edit/process')
-rw-r--r--httemplate/edit/process/cust_pkg_salesnum.html33
1 files changed, 33 insertions, 0 deletions
diff --git a/httemplate/edit/process/cust_pkg_salesnum.html b/httemplate/edit/process/cust_pkg_salesnum.html
new file mode 100644
index 000000000..aab37416a
--- /dev/null
+++ b/httemplate/edit/process/cust_pkg_salesnum.html
@@ -0,0 +1,33 @@
+% if ($error) {
+% $cgi->param('error', $error);
+% $cgi->redirect(popurl(3). 'edit/cust_pkg_salesnum.html?'. $cgi->query_string );
+% } else {
+
+ <& /elements/header-popup.html, "Sales Person 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('salesnum') =~ /^(\d*)$/;
+my $salesnum = $1;
+my $error = $cust_pkg->set_salesnum($1);
+
+</%init>