Index: openacs-4/packages/invoices/tcl/price-list-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/invoices/tcl/price-list-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/invoices/tcl/price-list-procs.tcl 11 Oct 2005 15:23:28 -0000 1.2 +++ openacs-4/packages/invoices/tcl/price-list-procs.tcl 5 Jun 2006 11:34:17 -0000 1.3 @@ -109,3 +109,25 @@ return "" } } + +ad_proc -public iv::price_list::get_price { + -organization_id:required + -category_id:required + {-package_id ""} +} { + @author Timo Hentschel (timo@timohentschel.de) + @creation-date 2005-07-01 + + Get id of customer price for a certain category +} { + if {[empty_string_p $package_id]} { + set package_id [ad_conn package_id] + } + + set list_id [iv::price_list::get_list_id -organization_id $organization_id -package_id $package_id] + if {$list_id eq ""} { + return "" + } else { + return [db_string get_price "select amount from iv_prices p, cr_items i where i.latest_revision = p.price_id and p.list_id = :list_id and category_id = :category_id" -default ""] + } +}