Index: openacs-4/packages/invoices/lib/invoice-list.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/invoices/lib/invoice-list.tcl,v diff -u -r1.16 -r1.17 --- openacs-4/packages/invoices/lib/invoice-list.tcl 24 May 2006 09:40:38 -0000 1.16 +++ openacs-4/packages/invoices/lib/invoice-list.tcl 18 Jun 2006 14:17:54 -0000 1.17 @@ -33,6 +33,18 @@ } } +# Status filter +set status_options_list [list [list "" ""]] +db_foreach status {select distinct status as option from iv_invoices} { + lappend status_options_list [list [_ invoices.iv_invoice_status_$option] $option] +} + +if {[exists_and_not_null status]} { + set status_where_clause "t.status = :status" +} else { + set status_where_clause "" +} + set start_where_clause "1 = 1" if {[exists_and_not_null start_date] && $start_date != "YYYY-MM-DD" && [regexp {^([0-9]+)\-([0-9]+)\-([0-9]+)} $start_date match year month day]} { set start_where_clause "o.creation_date >= to_timestamp(:start_date, 'YYYY-MM-DD')" @@ -47,6 +59,7 @@ unset end_date } + set user_id [ad_conn user_id] set timestamp_format "YYYY-MM-DD HH24:MI:SS" set bulk_actions [list "[_ invoices.iv_invoice_pay]" "${base_url}invoice-pay" "[_ invoices.iv_invoice_pay]"] @@ -196,6 +209,11 @@ end_date { where_clause $end_where_clause } + status { + label {[_ invoices.iv_invoice_status]} + values $status_options_list + where_clause $status_where_clause + } } \ -formats { normal {