invoice_sections_with_taxes per-agent, RT#79636
[freeside.git] / httemplate / elements / tr-select-invoice.html
1 <%doc>
2
3 Example:
4
5   include( '/elements/tr-select-invoice.html',
6
7     #opt - most get used in /elements/tr-amount-fee
8     'custnum'              => 4,     # customer number,
9     'prefix'               => 'pre', # prefix to fields and row ID's
10   )
11
12 </%doc>
13
14   <TR ID="invoice_row" STYLE="display:none;">
15     <TH ALIGN="right"><% mt('Open invoices') |h %></TH>
16     <TD COLSPAN=7>
17      <SELECT
18           ID       = "<% $opt{prefix} %>invoice"
19           NAME     = "<% $opt{prefix} %>invoice"
20           onChange = "<% $opt{prefix} %>invoice_select_changed(this)"
21         >
22                 <OPTION VALUE="select">Select an invoice to pay</OPTION>
23 %         foreach my $record (@records) {
24 %            my $read_date = time2str("%b %o, %Y", $record->_date);
25             <OPTION VALUE="<% $record->charged %>"><% $record->invnum %> (<% $read_date %>) - <% $record->charged %></OPTION>   
26 %         }
27
28         </SELECT>       
29     </TD>
30   </TR>
31
32 <%init>
33
34 my %opt = @_;
35
36 my @records = qsearch( {
37     'select'    => '*',
38     'table'     => 'cust_bill',
39     'hashref'   => { 'custnum' => $opt{custnum} },
40     'order_by'  => 'ORDER BY _date',
41 });
42
43 </%init>