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.12 -r1.13 --- openacs-4/packages/invoices/tcl/invoice-procs.tcl 27 Dec 2005 20:17:40 -0000 1.12 +++ openacs-4/packages/invoices/tcl/invoice-procs.tcl 27 Dec 2005 21:51:43 -0000 1.13 @@ -221,27 +221,33 @@ # invoice contact data contact::employee::get -employee_id $data(contact_id) -array contact_data foreach attribute {name company_name_ext address town_line country country_code salutation salutation_letter} { - set data(contact_$attribute) [value_if_exists contact_data($attribute)] + if {[info exists contact_data($attribute)]} { + set data(contact_$attribute) $contact_data($attribute) + } else { + set data(contact_$attribute) "" + } } # invoice recipient data - if {[contact::organization_p -party_id $data(recipient_id)]} { + if {[organization::organization_p -party_id $data(recipient_id)]} { # recipient is organization 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 data(rec_address) [value_if_exists address_array(delivery_address)] - set data(rec_country_code) [value_if_exists address_array(country_code)] - set data(rec_country) [value_if_exists address_array(country)] - set data(rec_town_line) [value_if_exists address_array(town_line)] + set attribute_list {address town_line country country_code} } else { # recipient is person contact::employee::get -employee_id $data(recipient_id) -array recipient_data - foreach attribute {name company_name_ext address town_line country country_code salutation salutation_letter} { - set data(rec_$attribute) [value_if_exists recipient_data($attribute)] + set attribute_list {name company_name_ext address town_line country country_code salutation salutation_letter} + } + foreach attribute $attribute_list { + if {[info exists recipient_data($attribute)]} { + set data(rec_$attribute) $recipient_data($attribute) + } else { + set data(rec_$attribute) "" } } Index: openacs-4/packages/invoices/tcl/offer-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/invoices/tcl/offer-procs.tcl,v diff -u -r1.14 -r1.15 --- openacs-4/packages/invoices/tcl/offer-procs.tcl 27 Dec 2005 20:17:40 -0000 1.14 +++ openacs-4/packages/invoices/tcl/offer-procs.tcl 27 Dec 2005 21:51:43 -0000 1.15 @@ -214,7 +214,11 @@ # offer contact data contact::employee::get -employee_id $data(contact_id) -array contact_data foreach attribute {name company_name_ext address town_line country country_code salutation salutation_letter} { - set data(contact_$attribute) [value_if_exists contact_data($attribute)] + if {[info exists contact_data($attribute)]} { + set data(contact_$attribute) $contact_data($attribute) + } else { + set data(contact_$attribute) "" + } } set document_type $type Index: openacs-4/packages/invoices/www/invoice-send-1.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/invoices/www/invoice-send-1.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/invoices/www/invoice-send-1.tcl 27 Dec 2005 16:39:35 -0000 1.1 +++ openacs-4/packages/invoices/www/invoice-send-1.tcl 27 Dec 2005 21:51:43 -0000 1.2 @@ -37,14 +37,14 @@ {invoice_p:text(radio) {label "[_ invoices.iv_invoice_p]"} {options $boolean_options}} {copy_p:text(radio) {label "[_ invoices.iv_invoice_copy_p]"} {options $boolean_options}} } -edit_request { - set opening_p 1 - set invoice_p 0 + set opening_p 0 + set invoice_p 1 set copy_p [ad_decode $invoice_copy t 1 0] if {[empty_string_p $copy_p]} { set copy_p 0 } } -after_submit { - ad_returnredirect [export_vars "invoice-send" {invoice_id opening_p invoice_p copy_p}] + ad_returnredirect [export_vars -base "invoice-send" {invoice_id opening_p invoice_p copy_p}] ad_script_abort } Index: openacs-4/packages/invoices/www/offer-accept-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/invoices/www/offer-accept-2.tcl,v diff -u -r1.11 -r1.12 --- openacs-4/packages/invoices/www/offer-accept-2.tcl 27 Dec 2005 20:17:41 -0000 1.11 +++ openacs-4/packages/invoices/www/offer-accept-2.tcl 27 Dec 2005 21:51:43 -0000 1.12 @@ -45,7 +45,6 @@ # content::item::set_live_revision -revision_id $file_ids db_dml set_publish_status {} - ns_log notice "\#\#\# $file_ids" set return_url [export_vars -base offer-pdf {offer_id {file_id $file_ids}}] }