Index: openacs-4/packages/invoices/lib/report-invoice-items.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/invoices/lib/report-invoice-items.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/invoices/lib/report-invoice-items.xql 9 Nov 2005 19:29:27 -0000 1.1 +++ openacs-4/packages/invoices/lib/report-invoice-items.xql 9 Nov 2005 21:30:12 -0000 1.2 @@ -7,15 +7,19 @@ ii.iv_item_id, ii.title as item_title, to_char(ii.creation_date, 'YYYY-MM-DD') as creation_date, - ii.amount_total + ii.amount_total, + ii.offer_item_id, + com.category_id from iv_invoice_itemsx ii, iv_invoicesx iv, + category_object_map com, cr_items i where iv.item_id = i.item_id and ii.invoice_id = iv.invoice_id and ii.invoice_id = i.latest_revision + and ii.offer_item_id = com.object_id $extra_query [template::list::filter_where_clauses -and -name "reports"] @@ -28,13 +32,50 @@ from iv_invoice_itemsx ii, iv_invoicesx iv, + category_object_map com, cr_items i where iv.item_id = i.item_id and ii.invoice_id = iv.invoice_id and ii.invoice_id = i.latest_revision + and ii.offer_item_id = com.object_id $extra_query + [template::list::filter_where_clauses -and -name "reports"] + + + select + distinct + o.title, + c.tree_id + from + category_object_map com, + iv_offer_items io, + acs_objects o, + categories c + where + com.object_id = io.offer_item_id + and com.category_id = c.category_id + and c.tree_id = o.object_id + order by + o.title asc + + + + + + select + o.title, + c.category_id + from + categories c, + acs_objects o + where + o.object_id = c.category_id + and c.tree_id in ([template::util::tcl_to_sql_list $tree_ids]) + + + \ No newline at end of file