5 include( '/elements/tr-select-invoice.html',
7 #opt - most get used in /elements/tr-amount-fee
8 'cust_main' => $cust_main, # cust_main,
9 'status' => 'open' # type of invoices to show. Possible values are:
10 # open - shows only open invoices
11 # void - shows only voided invoices
12 # all - shows all invoices, this is default if no status is set.
13 'prefix' => 'pre', # prefix to fields and row ID's
18 <TR ID="invoice_row" STYLE="display:none;">
19 <TH ALIGN="right"><% mt('Open invoices') |h %></TH>
22 ID = "<% $opt{prefix} %>invoice"
23 NAME = "<% $opt{prefix} %>invoice"
24 onChange = "<% $opt{prefix} %>invoice_select_changed(this)"
26 <OPTION VALUE="select">Select an invoice to pay</OPTION>
27 % foreach my $record (@invoices) {
28 % my $read_date = time2str("%b %o, %Y", $record->_date);
29 % $hidden .= '<INPUT TYPE="hidden" ID="inv'.$record->invnum.'" NAME="inv'.$record->invnum.'" VALUE="'.$record->owed.'">';
30 <OPTION VALUE="<% $record->invnum %>"><% $record->invnum %> (<% $read_date %>) - <% $record->owed %></OPTION>
43 my $status = $opt{'status'} ? $opt{'status'} : 'all';
47 if ($status eq "all") { @invoices = $opt{'cust_main'}->cust_bill; }
48 elsif ($status eq "open") { @invoices = $opt{'cust_main'}->open_cust_bill; }
49 elsif ($status eq "void") { @invoices = $opt{'cust_main'}->cust_bill_void; }