X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Ftr-select-invoice.html;h=d35813fc5aaf3f35f26ffb8f1ce39ef8ab5530ea;hb=cf7e1d51019f20497aac630017d2c35b427369c9;hp=70923b633946aebb587e39abe54c177747e7d2d0;hpb=8f20806ac6eb7487c97f7d1c6d1b44acf0ad7674;p=freeside.git diff --git a/httemplate/elements/tr-select-invoice.html b/httemplate/elements/tr-select-invoice.html index 70923b633..d35813fc5 100644 --- a/httemplate/elements/tr-select-invoice.html +++ b/httemplate/elements/tr-select-invoice.html @@ -1,32 +1,51 @@ +<%doc> + +Example: + + include( '/elements/tr-select-invoice.html', + + #opt - most get used in /elements/tr-amount-fee + 'cust_main' => $cust_main, # cust_main, + 'status' => 'open' # type of invoices to show. Possible values are: + # open - shows only open invoices + # void - shows only voided invoices + # all - shows all invoices, this is default if no status is set. + 'prefix' => 'pre', # prefix to fields and row ID's + ) + + <% mt('Open invoices') |h %> - + '; + % } - + + + <% $hidden %> + <%init> my %opt = @_; +my $status = $opt{'status'} ? $opt{'status'} : 'all'; +my $hidden; -my @records = qsearch( { - 'select' => '*', - 'table' => 'cust_bill', - 'hashref' => { 'custnum' => $opt{custnum} }, - 'order_by' => 'ORDER BY _date', -}); +my @invoices; +if ($status eq "all") { @invoices = $opt{'cust_main'}->cust_bill; } +elsif ($status eq "open") { @invoices = $opt{'cust_main'}->open_cust_bill; } +elsif ($status eq "void") { @invoices = $opt{'cust_main'}->cust_bill_void; }