Index: openacs-4/packages/invoices/tcl/invoice-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/invoices/tcl/invoice-procs.tcl,v diff -u -r1.17 -r1.18 --- openacs-4/packages/invoices/tcl/invoice-procs.tcl 29 Jan 2006 11:06:17 -0000 1.17 +++ openacs-4/packages/invoices/tcl/invoice-procs.tcl 30 Jan 2006 12:50:39 -0000 1.18 @@ -229,13 +229,8 @@ if {[organization::organization_p -party_id $data(recipient_id)]} { # recipient is organization set rec_organization_id $data(recipient_id) - set data(rec_name) [ams::value -object_id $data(recipient_id) -attribute_name name] - set data(rec_company_name_ext) [ams::value -object_id $data(recipient_id) -attribute_name company_name_ext] - set data(rec_salutation) [contact::salutation -party_id $data(recipient_id) -type salutation] - set data(rec_salutation_letter) "" - - contacts::postal_address::get -attribute_name "company_address" -party_id $data(recipient_id) -array address_array - set attribute_list {address town_line country country_code} + contact::employee::get -employee_id $data(recipient_id) -array recipient_data + set attribute_list {name company_name_ext address town_line country country_code salutation salutation_letter} } else { # recipient is person set rec_organization_id [contact::util::get_employee_organization -employee_id $data(recipient_id)] @@ -256,7 +251,7 @@ # get the invoice item data set sum 0. - db_multirow -local -extend {amount_sum amount_total amount_diff category} items invoice_items {} { + db_multirow -local -extend {amount_sum amount_total amount_diff contact_name category} items invoice_items {} { if {[empty_string_p $credit_percent]} { set credit_percent 0 } @@ -272,6 +267,7 @@ set rebate [lc_numeric [format "%.1f" $rebate] "" $locale] set last_modified [lc_time_fmt $last_modified $time_format] set category [lang::util::localize [category::get_name $category_id] $locale] + set contact_name [contact::name -party_id $contact_id] } # It is possible that you have an invoice without items, e.g. a credit invoice Index: openacs-4/packages/invoices/tcl/invoice-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/invoices/tcl/invoice-procs.xql,v diff -u -r1.9 -r1.10 --- openacs-4/packages/invoices/tcl/invoice-procs.xql 29 Jan 2006 14:21:58 -0000 1.9 +++ openacs-4/packages/invoices/tcl/invoice-procs.xql 30 Jan 2006 12:50:39 -0000 1.10 @@ -88,7 +88,7 @@ select cr.title, cr.description, cr.item_id, ii.offer_item_id, ii.item_units, ii.price_per_unit, ii.item_nr, ii.rebate, ii.vat, m.category_id, ofi.file_count, - ofi.page_count, pr.title as project_title, p.project_code, p.last_modified, + ofi.page_count, pr.title as project_title, p.project_code, p.last_modified, p.contact_id, pi.item_id as project_id, o.credit_percent from cr_items ci, cr_revisions cr, iv_invoice_items ii, cr_revisions oor, acs_data_links r, cr_items pi, cr_revisions pr, pm_projectsx p, iv_offers o, 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.24 -r1.25 --- openacs-4/packages/invoices/www/invoice-ae.tcl 29 Jan 2006 15:43:16 -0000 1.24 +++ openacs-4/packages/invoices/www/invoice-ae.tcl 30 Jan 2006 12:50:39 -0000 1.25 @@ -147,6 +147,8 @@ # The other query would show all of them. set contact_options [db_list_of_lists contacts {}] set recipient_options [db_list_of_lists recipients {}] + set rec_organization_id [contact::util::get_employee_organization -employee_id [lindex [lindex $recipient_options 0] 1]] + lappend recipient_options [list [organizations::name -organization_id $rec_organization_id] $rec_organization_id] }