summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2013-09-10 21:25:12 -0700
committerIvan Kohler <ivan@freeside.biz>2013-09-10 21:25:12 -0700
commitf417eee294482e6a7bc4ad60c916b84ffd662112 (patch)
tree3d5b7bee0f1063c754c361e91f4dc1d791cc1645
parent42cb05f8b363d8f56ff620256adcaf1a4f15046f (diff)
fix order package UI layout when there aren't any sales people for an agent, RT#24955
-rw-r--r--httemplate/elements/tr-select-sales.html7
-rw-r--r--httemplate/misc/order_pkg.html3
2 files changed, 7 insertions, 3 deletions
diff --git a/httemplate/elements/tr-select-sales.html b/httemplate/elements/tr-select-sales.html
index c29e0d70c..956a9d159 100644
--- a/httemplate/elements/tr-select-sales.html
+++ b/httemplate/elements/tr-select-sales.html
@@ -155,8 +155,11 @@ 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' => '' },
+my $hashref = { disabled => '' };
+$hashref->{agentnum} = $opt{agentnum} if $opt{agentnum};
+
+my @sales = qsearch({ 'table' => 'sales',
+ 'hashref' => $hashref,
'extra_sql' => ' AND '. $curuser->agentnums_sql,
'order_by' => 'ORDER BY salesperson',
});
diff --git a/httemplate/misc/order_pkg.html b/httemplate/misc/order_pkg.html
index febe427f9..03531bf4d 100644
--- a/httemplate/misc/order_pkg.html
+++ b/httemplate/misc/order_pkg.html
@@ -38,7 +38,8 @@
<& /elements/tr-select-sales.html,
'curr_value' => scalar($cgi->param('salesnum')),
- 'th' => 1,
+ 'agentnum' => $agent->agentnum,
+ 'th' => 1,
&>
% if ( $conf->exists('pkg_referral') ) {