Index: openacs-4/packages/ecommerce/www/admin/orders/refunds.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/refunds.tcl,v
diff -u -r1.5 -r1.6
--- openacs-4/packages/ecommerce/www/admin/orders/refunds.tcl 9 Mar 2004 00:59:50 -0000 1.5
+++ openacs-4/packages/ecommerce/www/admin/orders/refunds.tcl 17 Aug 2008 23:03:15 -0000 1.6
@@ -15,43 +15,22 @@
ad_require_permission [ad_conn package_id] admin
-doc_body_append "
- [ad_admin_header "Refund History"]
+set title "Refund History"
+set context [list [list index "Orders / Shipments / Refunds"] $title]
-
Refund History
-
- [ad_context_bar [list "../" "Ecommerce([ec_system_name])"] [list "index" "Orders"] "Refund History"]
-
-
-
-
-
- Refund Date |
-
-
- "
-
set refund_date_list [list [list last_24 "last 24 hrs"] [list last_week "last week"] [list last_month "last month"] [list all all]]
set linked_refund_date_list [list]
-
foreach refund_date $refund_date_list {
if {$view_refund_date == [lindex $refund_date 0]} {
- lappend linked_refund_date_list "[lindex $refund_date 1]"
+ lappend linked_refund_date_list "[lindex $refund_date 1]"
} else {
- lappend linked_refund_date_list "[lindex $refund_date 1]"
+ lappend linked_refund_date_list "[lindex $refund_date 1]"
}
}
-doc_body_append "
- \[ [join $linked_refund_date_list " | "] \]
- |
-
-
+set linked_refund_date_list_html "\[ [join $linked_refund_date_list " | "] \]"
-
- "
-
if { $view_refund_date == "last_24" } {
set refund_date_query_bit [db_map last_24]
} elseif { $view_refund_date == "last_week" } {
@@ -65,12 +44,12 @@
set link_beginning "refunds?[export_url_vars view_refund_date]"
set order_by_clause [ec_decode $order_by \
- "refund_id" "r.refund_id" \
- "refund_date" "r.refund_date" \
- "order_id" "r.order_id" \
- "refund_amount" "r.refund_amount" \
- "n_items" "n_items" \
- "name" "u.last_name, u.first_names"]
+ "refund_id" "r.refund_id" \
+ "refund_date" "r.refund_date" \
+ "order_id" "r.order_id" \
+ "refund_amount" "r.refund_amount" \
+ "n_items" "n_items" \
+ "name" "u.last_name, u.first_names"]
set table_header "
@@ -84,6 +63,7 @@
"
set row_counter 0
+set refunds_select_html ""
db_foreach refunds_select "
select r.refund_id, r.refund_date, r.order_id, r.refund_amount, r.refunded_by, u.first_names, u.last_name, count(*) as n_items
from ec_refunds r, cc_users u, ec_items i
@@ -93,35 +73,19 @@
group by r.refund_id, r.refund_date, r.order_id, r.refund_amount, r.refunded_by, u.first_names, u.last_name
order by $order_by_clause" {
- if { $row_counter == 0 } {
- doc_body_append $table_header
- }
-
# Even rows are white, odd are grey
-
if { [expr floor($row_counter/2.)] == [expr $row_counter/2.] } {
- set bgcolor "white"
+ set bgcolor "#white"
} else {
- set bgcolor "ececec"
+ set bgcolor "#ececec"
}
- doc_body_append "
-
- $refund_id |
- [util_AnsiDatetoPrettyDate $refund_date] |
- $order_id |
- [ec_pretty_price $refund_amount] |
- $n_items |
- $last_name, $first_names |
"
+ append refunds_select_html "
+ $refund_id |
+ [util_AnsiDatetoPrettyDate $refund_date] |
+ $order_id |
+ [ec_pretty_pure_price $refund_amount] |
+ $n_items |
+ $last_name, $first_names |
"
incr row_counter
}
-if { $row_counter != 0 } {
- doc_body_append "
"
-} else {
- doc_body_append "None Found"
-}
-
-doc_body_append "
-
-
- [ad_admin_footer]"