tax report update, link to new line item report, per-agent tax reporting
[freeside.git] / httemplate / elements / tr-select-agent.html
diff --git a/httemplate/elements/tr-select-agent.html b/httemplate/elements/tr-select-agent.html
new file mode 100644 (file)
index 0000000..2227262
--- /dev/null
@@ -0,0 +1,29 @@
+<%
+  my( $agentnum, %opt ) = @_;
+
+  my @agents;
+  if ( $opt{'agents'} ) {
+    @agents = @{ $opt{'agents'} };
+  } else {
+    @agents = qsearch( 'agent', { disabled=>'' } );
+  }
+
+%>
+
+<% if ( scalar(@agents) == 1 ) { %>
+
+  <INPUT TYPE="hidden" NAME="agentnum" VALUE="<%= $agents[0]->agentnum %>">
+
+<% } else { %>
+
+  <TR>
+    <TD ALIGN="right"><%= $opt{'label'} || 'Agent: ' %></TD>
+    <TD>
+      <%= include( '/elements/select-agent.html', $agentnum,
+                     'agents' => \@agents,
+                 )
+      %>
+    </TD>
+  </TR>
+
+<% } %>