Index: openacs-4/packages/invoices/www/invoice-search.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/invoices/www/invoice-search.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/invoices/www/invoice-search.tcl 2 Apr 2006 22:09:09 -0000 1.1 @@ -0,0 +1,22 @@ +ad_page_contract { + Page to redirect to invoice. + + @author Timo Hentschel (timo@timohentschel.de) + @creation-date 2005-06-06 +} { + invoice_nr +} + +set match_invoices [db_list get_invoices {}] +set match_length [llength $match_invoices] + +if { [string equal $match_length 0] } { + # No Match just redirect + ad_returnredirect $return_url + +} else { + set invoice_id [lindex [lindex $match_invoices 0] 0] + + # Just redirect to the invoice + ad_returnredirect [export_vars -base invoice-ae {invoice_id {mode display}}] +} Index: openacs-4/packages/invoices/www/invoice-search.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/invoices/www/invoice-search.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/invoices/www/invoice-search.xql 2 Apr 2006 22:09:09 -0000 1.1 @@ -0,0 +1,13 @@ + + + + + + select ii.item_id + from iv_invoices i, cr_items ii + where i.invoice_id = ii.latest_revision + and i.invoice_nr = :invoice_nr + + + +