Index: openacs-4/packages/invoices-portlet/lib/projects-billable.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/invoices-portlet/lib/projects-billable.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/invoices-portlet/lib/projects-billable.tcl 27 Oct 2005 19:35:38 -0000 1.4 +++ openacs-4/packages/invoices-portlet/lib/projects-billable.tcl 28 Oct 2005 18:16:49 -0000 1.5 @@ -1,13 +1,6 @@ -set required_param_list [list organization_id] set optional_param_list [list orderby elements base_url package_id] -set optional_unset_list [list] +set optional_unset_list [list organization_id] -foreach required_param $required_param_list { - if {![info exists $required_param]} { - return -code error "$required_param is a required parameter." - } -} - foreach optional_param $optional_param_list { if {![info exists $optional_param]} { set $optional_param {} @@ -44,9 +37,6 @@ set base_url [apm_package_url_from_id [apm_package_id_from_key invoices]] } -set dotlrn_club_id [lindex [application_data_link::get_linked -from_object_id $organization_id -to_object_type "dotlrn_club"] 0] -set pm_base_url [apm_package_url_from_id [dotlrn_community::get_package_id_from_package_key -package_key "project-manager" -community_id $dotlrn_club_id]] - set p_closed_id [pm::project::default_status_closed] set t_closed_id [pm::task::default_status_closed] set date_format [lc_get formbuilder_date_format] @@ -59,6 +49,7 @@ } set actions [list "[_ invoices.iv_invoice_New]" "${base_url}invoice-ae" "[_ invoices.iv_invoice_New2]" ] +set bulk_id_list [list organization_id] template::list::create \ -name projects \ @@ -87,7 +78,7 @@ } amount_open { label {[_ invoices.iv_invoice_amount_open]} - display_template {@projects.amount_open@ @currency@} + display_template {@projects.amount_open@ @projects.currency@} } count_total { label {[_ invoices.iv_invoice_count_total]} @@ -99,11 +90,11 @@ label {[_ invoices.iv_invoice_closed_date]} } } -bulk_actions $actions \ - -bulk_action_export_vars {organization_id} \ + -bulk_action_export_vars $bulk_id_list \ -sub_class narrow \ -filters { organization_id { - where_clause {sub.customer_id = :organization_id} + where_clause {sub.organization_id = :organization_id} } } \ -formats { @@ -121,11 +112,12 @@ } - -db_multirow -extend {project_link recipient} projects projects_to_bill {} { - set project_link [export_vars -base "${pm_base_url}one" {{project_item_id $project_id}}] +db_multirow -extend {project_link currency} projects projects_to_bill {} { set amount_open [format "%.2f" $amount_open] - + set dotlrn_club_id [lindex [application_data_link::get_linked -from_object_id $organization_id -to_object_type "dotlrn_club"] 0] + set pm_base_url [apm_package_url_from_id [dotlrn_community::get_package_id_from_package_key -package_key "project-manager" -community_id $dotlrn_club_id]] + set project_link [export_vars -base "${pm_base_url}one" {{project_item_id $project_id}}] + set currency [iv::price_list::get_currency -organization_id $organization_id] if { $contacts_p } { set recipient "[contact::name -party_id $recipient_id]" } else { Index: openacs-4/packages/invoices-portlet/lib/projects-billable.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/invoices-portlet/lib/projects-billable.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/invoices-portlet/lib/projects-billable.xql 27 Oct 2005 19:35:38 -0000 1.3 +++ openacs-4/packages/invoices-portlet/lib/projects-billable.xql 28 Oct 2005 18:16:49 -0000 1.4 @@ -12,15 +12,16 @@ total.count_total, billed.count_billed, billed.recipient_id, - name + name, + sub.organization_id from ( select oi.item_id as offer_id, pr.revision_id, o.creation_date, sum(ofi.item_units * ofi.price_per_unit * (1-(ofi.rebate/100))) as amount_open, - p.customer_id, + p.customer_id as organization_id, (oz.name ) as name from cr_items pi,