From f417eee294482e6a7bc4ad60c916b84ffd662112 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Tue, 10 Sep 2013 21:25:12 -0700 Subject: [PATCH] fix order package UI layout when there aren't any sales people for an agent, RT#24955 --- httemplate/elements/tr-select-sales.html | 7 +++++-- httemplate/misc/order_pkg.html | 3 ++- 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') ) { -- 2.11.0