From c14b35ce12141287e201bba8489b202a1b34b38f Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Sun, 25 Aug 2013 16:23:17 -0700 Subject: [PATCH] continue sales person work: customer and package selection, commissions, reporting. RT#23402 --- httemplate/edit/cust_main/top_misc.html | 12 +++++ httemplate/elements/tr-select-sales.html | 89 ++++++++++++++++++++++++++++++-- httemplate/elements/xmlhttp.html | 12 +++-- httemplate/misc/sales.cgi | 27 ++++++++++ httemplate/search/report_cust_pkg.html | 15 ++++++ 5 files changed, 146 insertions(+), 9 deletions(-) create mode 100644 httemplate/misc/sales.cgi diff --git a/httemplate/edit/cust_main/top_misc.html b/httemplate/edit/cust_main/top_misc.html index d8141b5a7..ebd9b927c 100644 --- a/httemplate/edit/cust_main/top_misc.html +++ b/httemplate/edit/cust_main/top_misc.html @@ -20,7 +20,9 @@ <% $cust_main->residential_commercial eq 'Commercial' ? 'CHECKED' : '' %> > + + <%init> my $curuser = $FS::CurrentUser::CurrentUser; my %opt = @_; my $salesnum = $opt{'curr_value'} || $opt{'value'}; +my $field = $opt{'element_name'} || $opt{'field'} || 'salesnum'; +my $id = $opt{'id'} || $opt{'field'} || 'salesnum'; my @sales = qsearch({ 'table' => 'sales', 'hashref' => { 'disabled' => '' }, 'extra_sql' => ' AND '. $curuser->agentnums_sql, + 'order_by' => 'ORDER BY salesperson', }); my $colspan = $opt{'colspan'} ? 'COLSPAN="'.$opt{'colspan'}.'"' : ''; - diff --git a/httemplate/elements/xmlhttp.html b/httemplate/elements/xmlhttp.html index a9e65c790..2f4f0d555 100644 --- a/httemplate/elements/xmlhttp.html +++ b/httemplate/elements/xmlhttp.html @@ -14,17 +14,19 @@ Example: ); +<%shared> +my %initialized = ();#won't work if component is "preloaded"... so don't do that + <& /elements/rs_init_object.html &> <& /elements/init_overlib.html &> + <& /elements/tr-select-sales.html, 'label' => 'Customer sales person', 'element_name' => 'cust_main_salesnum', -- 2.11.0