From: Ivan Kohler Date: Wed, 11 Sep 2013 04:25:15 +0000 (-0700) Subject: fix order package UI layout when there aren't any sales people for an agent, RT#24955 X-Git-Url: http://git.freeside.biz/gitweb/?a=commitdiff_plain;h=a3371bd505dfc1b7791cfe681aa33afb1f77e063;p=freeside.git fix order package UI layout when there aren't any sales people for an agent, RT#24955 --- 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') ) {