X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Ftr-select-invoice.html;h=d35813fc5aaf3f35f26ffb8f1ce39ef8ab5530ea;hb=2b199169bd62b8582eedb872b4e76bee48899e81;hp=3728d348de63628bc7bf22f0a1af047377b3d950;hpb=77daf007ef522ae71041d9b094643cf868d8ecce;p=freeside.git diff --git a/httemplate/elements/tr-select-invoice.html b/httemplate/elements/tr-select-invoice.html index 3728d348d..d35813fc5 100644 --- a/httemplate/elements/tr-select-invoice.html +++ b/httemplate/elements/tr-select-invoice.html @@ -5,7 +5,11 @@ Example: include( '/elements/tr-select-invoice.html', #opt - most get used in /elements/tr-amount-fee - 'custnum' => 4, # customer number, + '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 ) @@ -13,31 +17,35 @@ Example: <% 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; }