X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Felements%2Ftr-select-sales.html;h=956a9d1590bebefb0d5169c3f85ab0316c034021;hp=c29e0d70cf3813576b47875144cf843838f3f299;hb=7b0bbc4117a7959b9f7b7b2cf999b8188ba34160;hpb=9327f3d24c49da3200413966d153e8415c26e744 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', });