Index: openacs-4/packages/invoices/www/invoice-ae.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/invoices/www/invoice-ae.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/invoices/www/invoice-ae.tcl 14 Oct 2005 06:25:03 -0000 1.7 +++ openacs-4/packages/invoices/www/invoice-ae.tcl 26 Oct 2005 06:37:32 -0000 1.8 @@ -16,6 +16,17 @@ page_title:onevalue } +####### FIXME ######## +# First try to find the organization_id +if {[empty_string_p $organization_id]} { + set organisations [db_list organizations "select distinct customer_id from pm_projects where project_id in ([join $project_id ","])"] + if {[llength $organisations] == 1} { + set organization_id [lindex $organisations 0] + } else { + ad_return_error "More than one customer" "You have selected more than one customer. We are unable to produce one invoice for multiple customers" + } +} + set package_id [ad_conn package_id] set user_id [auth::require_login] set date_format "YYYY-MM-DD"