From b799e8a48e0ea4e192d51fc445c3bee14c55e687 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Sun, 25 Aug 2013 16:23:24 -0700 Subject: continue sales person work: customer and package selection, commissions, reporting. RT#23402 --- httemplate/elements/tr-select-sales.html | 89 ++++++++++++++++++++++++++++++-- httemplate/elements/xmlhttp.html | 12 +++-- 2 files changed, 92 insertions(+), 9 deletions(-) (limited to 'httemplate/elements') diff --git a/httemplate/elements/tr-select-sales.html b/httemplate/elements/tr-select-sales.html index 2a2edf03c..b69b3d8b6 100644 --- a/httemplate/elements/tr-select-sales.html +++ b/httemplate/elements/tr-select-sales.html @@ -13,7 +13,8 @@ Example: 'label' => 'Sales Person', 'empty_label' => 'Select sales person', #override default - #on already# 'disable_empty' => 1, + 'disable_empty' => 0, #on byd efault, pass 0 to disable + 'field' => 'salesnum', #HTML element name and ID &> @@ -21,8 +22,8 @@ Example: % if ( scalar(@sales) == 0 || $opt{'fixed'} ) { @@ -63,19 +64,99 @@ Example: % } +<& /elements/xmlhttp.html, + 'url' => $p.'misc/sales.cgi', + 'subs' => [ 'get_sales' ], +&> + + <%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 &>