70923b633946aebb587e39abe54c177747e7d2d0
[freeside.git] / httemplate / elements / tr-select-invoice.html
1
2   <TR ID="invoice_row" STYLE="display:none;">
3     <TH ALIGN="right"><% mt('Open invoices') |h %></TH>
4     <TD COLSPAN=7>
5      <SELECT
6           ID       = "<% $opt{prefix} %>invoice"
7           NAME     = "<% $opt{prefix} %>invoice"
8           onChange = "<% $opt{prefix} %>invoice_select_changed(this)"
9           <% $opt{disabled} %>
10         >
11                 <OPTION VALUE="select">Select an invoice to pay</OPTION>
12 %         foreach my $record (@records) {
13 %            my $read_date = time2str("%b %o, %Y", $record->_date);
14             <OPTION VALUE="<% $record->charged %>"><% $record->invnum %> (<% $read_date %>) - <% $record->charged %></OPTION>   
15 %         }
16
17         </SELECT>       
18     </TD>
19   </TR>
20
21 <%init>
22
23 my %opt = @_;
24
25 my @records = qsearch( {
26     'select'    => '*',
27     'table'     => 'cust_bill',
28     'hashref'   => { 'custnum' => $opt{custnum} },
29     'order_by'  => 'ORDER BY _date',
30 });
31
32 </%init>