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.2 -r1.3 --- openacs-4/packages/invoices/tcl/invoice-procs.xql 11 Oct 2005 15:23:28 -0000 1.2 +++ openacs-4/packages/invoices/tcl/invoice-procs.xql 23 Oct 2005 18:27:17 -0000 1.3 @@ -1,12 +1,12 @@ - + update iv_invoices set status = :status - where offer_id = (select latest_revision + where invoice_id = (select latest_revision from cr_items where item_id = :invoice_id) Index: openacs-4/packages/invoices/www/invoice-pdf.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/invoices/www/invoice-pdf.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/invoices/www/invoice-pdf.tcl 12 Oct 2005 23:11:27 -0000 1.2 +++ openacs-4/packages/invoices/www/invoice-pdf.tcl 23 Oct 2005 18:27:17 -0000 1.3 @@ -21,11 +21,11 @@ } set root_folder_id [lindex [application_data_link::get_linked -from_object_id $organization_id -to_object_type content_folder] 0] -set invoice_folder_id [lindex [application_data_link::get_linked -from_object_id $root_folder_id -to_object_type content_item] 0] - +set invoice_folder_id [fs::get_folder -name "invoices" -parent_id $root_folder_id] db_transaction { # move file to invoice_folder - content::item::move -item_id $file_id -target_folder_id $invoice_folder_id + set file_item_id [content::revision::item_id -revision_id $file_id] + content::item::move -item_id $file_item_id -target_folder_id $invoice_folder_id application_data_link::new -this_object_id $invoice_id -target_object_id $file_id iv::invoice::set_status -invoice_id $invoice_id -status "billed" }