invoice_sections_with_taxes per-agent, RT#79636
[freeside.git] / httemplate / elements / tr-select-cdrbatch.html
1 % if ( ! $show ) {
2
3   <INPUT TYPE="hidden" NAME="<% $opt{'element_name'} || $opt{'field'} || 'cdrbatchnum' %>" VALUE="__ALL__">
4
5 % } else { 
6
7   <TR>
8     <TD ALIGN="right"><% $opt{'cdrbatch'} || 'CDR Batch: ' %></TD>
9     <TD>
10       <% include( '/elements/select-cdrbatch.html', 'curr_value' => $selected_cdrbatch, %opt ) %>
11     </TD>
12   </TR>
13
14 % } 
15 <%init>
16
17 my( %opt ) = @_;
18 my $conf = new FS::Conf;
19 my $selected_cdrbatch = $opt{'curr_value'}; # || $opt{'value'} necessary?
20
21 $opt{'records'} = delete $opt{'cdr_batch'}
22   if $opt{'cdr_batch'};
23
24 my $sth = dbh->prepare('SELECT COUNT(*) FROM cdr_batch LIMIT 1')
25   or die dbh->errstr;
26 $sth->execute or die $sth->errstr;
27 my $show = $sth->fetchrow_arrayref->[0];
28
29 </%init>
30