From: Ivan Kohler Date: Sun, 25 Aug 2013 23:23:17 +0000 (-0700) Subject: continue sales person work: customer and package selection, commissions, reporting... X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=c14b35ce12141287e201bba8489b202a1b34b38f continue sales person work: customer and package selection, commissions, reporting. RT#23402 --- 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',