Index: openacs-4/packages/invoices/lib/invoice-list.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/invoices/lib/invoice-list.adp,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/invoices/lib/invoice-list.adp 16 Aug 2005 20:04:31 -0000 1.1
+++ openacs-4/packages/invoices/lib/invoice-list.adp 18 Jun 2006 14:17:54 -0000 1.2
@@ -1 +1,2 @@
+
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 {
Index: openacs-4/packages/invoices/lib/offer-list.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/invoices/lib/offer-list.tcl,v
diff -u -r1.15 -r1.16
--- openacs-4/packages/invoices/lib/offer-list.tcl 5 Jun 2006 14:07:36 -0000 1.15
+++ openacs-4/packages/invoices/lib/offer-list.tcl 18 Jun 2006 14:17:54 -0000 1.16
@@ -1,5 +1,5 @@
set required_param_list [list]
-set optional_param_list [list orderby elements base_url package_id page_num]
+set optional_param_list [list orderby elements base_url package_id page_num subproject_p]
set optional_unset_list [list organization_id party_id]
foreach required_param $required_param_list {
@@ -38,9 +38,17 @@
set show_filter_p 0
}
+if {$subproject_p == "f"} {
+ set subproject_where_clause "cf2.folder_id = pi.parent_id"
+ set subproject_from ", cr_folders cf2"
+} else {
+ set subproject_where_clause ""
+ set subproject_from ""
+}
+
set party_id_where_clause ""
if {[exists_and_not_null party_id]} {
- set assigned_projects [pm::util::assigned_projects -party_id $party_id]
+ set assigned_projects [pm::util::assigned_projects -party_id $party_id -status_id $status_id]
lappend assigned_projects 0
set party_id_where_clause "pi.item_id in ([join $assigned_projects ","])"
@@ -63,7 +71,6 @@
set project_where_clause "pi.item_id in ([join $project_ids ,])"
}
-
foreach element $elements {
append row_list "$element {}\n"
}
@@ -112,9 +119,11 @@
}
description {
label {[_ invoices.iv_offer_Description]}
+ display_template {@iv_offer.description;noquote@}
}
comment {
label {[_ invoices.iv_offer_comment]}
+ display_template {@iv_offer.comment;noquote@}
}
project_id {
label {[_ invoices.iv_offer_project]}
@@ -226,6 +235,9 @@
party_id {
where_clause {$party_id_where_clause}
}
+ subproject_p {
+ where_clause {$subproject_where_clause}
+ }
page_num {}
} \
-formats {
@@ -268,9 +280,10 @@
set creation_date [lc_time_fmt $creation_date $time_format]
set accepted_date [lc_time_fmt $accepted_date $time_format]
set finish_date [lc_time_fmt $finish_date $time_format]
+
}
+# If we call this in the db_multirow we run out of database pools...
multirow foreach iv_offer {
- contact::employee::get -employee_id $contact_id -array contact_data -use_cache
- set contact_phone [ad_html_to_text -no_format $contact_data(directphoneno)]
+ set contact_phone [contact::employee::direct_phone -employee_id $contact_id -format "text"]
}
Index: openacs-4/packages/invoices/lib/offer-list.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/invoices/lib/offer-list.xql,v
diff -u -r1.11 -r1.12
--- openacs-4/packages/invoices/lib/offer-list.xql 15 Mar 2006 17:05:05 -0000 1.11
+++ openacs-4/packages/invoices/lib/offer-list.xql 18 Jun 2006 14:17:54 -0000 1.12
@@ -26,7 +26,7 @@
pp.customer_id
from cr_folders cf, cr_revisions cr, iv_offers t,
acs_objects o, persons p, cr_items ci, acs_data_links r,
- cr_items pi, cr_revisions pr, pm_projects pp, persons p2
+ cr_items pi, cr_revisions pr, pm_projects pp, persons p2 $subproject_from
where cr.revision_id = ci.latest_revision
and t.offer_id = cr.revision_id
and ci.parent_id = cf.folder_id
@@ -51,7 +51,7 @@
select cr.item_id
from cr_folders cf, cr_revisions cr, iv_offers t,
acs_objects o, persons p, cr_items ci, acs_data_links r,
- cr_items pi, cr_revisions pr, pm_projects pp, persons p2
+ cr_items pi, cr_revisions pr, pm_projects pp, persons p2 $subproject_from
where cr.revision_id = ci.latest_revision
and t.offer_id = cr.revision_id
and ci.parent_id = cf.folder_id
Index: openacs-4/packages/invoices/www/invoice-list.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/invoices/www/invoice-list.adp,v
diff -u -r1.6 -r1.7
--- openacs-4/packages/invoices/www/invoice-list.adp 13 Apr 2006 12:53:57 -0000 1.6
+++ openacs-4/packages/invoices/www/invoice-list.adp 18 Jun 2006 14:17:54 -0000 1.7
@@ -11,6 +11,7 @@
#invoices.iv_invoice_start_date# |
#invoices.iv_invoice_end_date# |
+
|
@@ -38,4 +39,4 @@
+ start_date="@start_date@" end_date="@end_date@" status="@status@">
Index: openacs-4/packages/invoices/www/invoice-list.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/invoices/www/invoice-list.tcl,v
diff -u -r1.7 -r1.8
--- openacs-4/packages/invoices/www/invoice-list.tcl 2 Apr 2006 22:08:02 -0000 1.7
+++ openacs-4/packages/invoices/www/invoice-list.tcl 18 Jun 2006 14:17:54 -0000 1.8
@@ -11,6 +11,7 @@
{organization_id ""}
{start_date "YYYY-MM-DD"}
{end_date "YYYY-MM-DD"}
+ {status ""}
} -properties {
context:onevalue
page_title:onevalue