Index: openacs-4/packages/ecommerce/www/admin/orders/one.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/one.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/ecommerce/www/admin/orders/one.adp 17 Aug 2008 11:35:18 -0000 1.1 @@ -0,0 +1,69 @@ + + @title;noquote@ + @context;noquote@ +

@title@

+ +

Overview

+@order_state_table_html;noquote@ + + Order ID + @order_id@ + +@order_state_gc_html;noquote@ + + + + Ordered by + @first_names@ @last_name@
+ +@user_admin_page_html;noquote@ + +@email@ + + + + + Confirmed date + @confirmed_date_html;noquote@ + + + Order state + @order_state_void_html;noquote@ + + + +

Details of Void

+
+ Voided by: @details_of_void_html;noquote@ +
+
+@comments_html;noquote@ + +

Items

+
    +@items_ul;noquote@ +
+

Details

+ + +@order_details_html;noquote@ +
+

Financial Transactions

+@financial_transaction_html;noquote@ + +

Shipments

+
+@shipments_html;noquote@ +
+ +

Returns

+
+@refunds_html;noquote@ +
+ + +

Actions

+
    +@actions_html;noquote@ +
+
Index: openacs-4/packages/ecommerce/www/admin/orders/one.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/one.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/ecommerce/www/admin/orders/one.tcl 16 Aug 2008 13:00:45 -0000 1.6 +++ openacs-4/packages/ecommerce/www/admin/orders/one.tcl 17 Aug 2008 11:35:18 -0000 1.7 @@ -14,8 +14,6 @@ ad_require_permission [ad_conn package_id] admin - - db_1row order_select " select o.order_state, o.creditcard_id, o.confirmed_date, o.cs_comments, o.shipping_method, o.shipping_address, o.in_basket_date, @@ -30,64 +28,26 @@ db_0or1row user_info_select " select email from cc_users where user_id = :user_id" -doc_body_append " - [ad_admin_header "One Order"] +set title "One Order" +set context [list [list index "Orders / Shipments / Refunds"] $title] -

One Order

+set order_state_table_html [ec_decode $order_state "void" "" "
"] +set order_state_gc_html [ec_decode $order_state "void" "" "
[ec_formatted_price_shipping_gift_certificate_and_tax_in_an_order $order_id]
"] - [ad_context_bar [list "../" "Ecommerce([ec_system_name])"] [list "index" "Orders"] "One Order"] +set user_admin_page_html "(user admin page)" +set confirmed_date_html "[ec_formatted_full_date $confirmed_date]" +set order_state_void_html [ec_decode $order_state "void" "void" $order_state] -
- -

Overview

- - [ec_decode $order_state "void" "
" "
"] - - - - - - - - - - - - - - - - - -
Order ID$order_id[ec_decode $order_state "void" "" "
[ec_formatted_price_shipping_gift_certificate_and_tax_in_an_order $order_id]
"]
Ordered by$first_names $last_name
${email}" - -if { ![string equal $email "no email"] } { - doc_body_append " (user admin page)" -} -doc_body_append "
Confirmed date[ec_formatted_full_date $confirmed_date]
Order state[ec_decode $order_state "void" "void" $order_state]
" - if { $order_state == "void" } { - doc_body_append " -

Details of Void

- -
- Voided by: [db_string voided_by_name_select " - select first_names || ' ' || last_name from cc_users where user_id = :voided_by" -default ""]
- Date: [ec_formatted_full_date $voided_date]
- [ec_decode $reason_for_void "" "" "Reason: [ec_display_as_html $reason_for_void]"] -
" + set details_of_void_html "[db_string voided_by_name_select " + select first_names || ' ' || last_name from cc_users where user_id = :voided_by" -default ""]
+ Date: [ec_formatted_full_date $voided_date]
+ [ec_decode $reason_for_void "" "" "Reason: [ec_display_as_html $reason_for_void]"]" } -doc_body_append " - [ec_decode $cs_comments "" "" "

Comments

\n
[ec_display_as_html $cs_comments]
"] +set comments_html "[ec_decode $cs_comments "" "" "

Comments

\n
[ec_display_as_html $cs_comments]
"] + " - - -

Items

-
    " - set items_ul "" # We want to display these by item (with all order states in parentheses), like: @@ -120,8 +80,7 @@ } set options [join $option_list ", "] - # It's OK to compare tcl lists with != because lists are really - # strings in tcl + # It's OK to compare tcl lists with != because lists are really strings in tcl if { $product_color_size_style_price_price_name != $old_product_color_size_style_price_price_name && [llength $old_product_color_size_style_price_price_name] != 0 } { append items_ul " @@ -179,40 +138,27 @@ " } -doc_body_append "$items_ul" if { $order_state == "authorized" || $order_state == "partially_fulfilled" } { - doc_body_append " + append items_ul "
  • Record a Shipment
  • Add Items
  • " } if { $order_state == "fulfilled" || $order_state == "partially_fulfilled" } { - doc_body_append " + append items_ul "
  • Mark Items Returned
  • " } -doc_body_append " -
- -

Details

- - - +set order_details_html " - " - if { ![empty_string_p $creditcard_id] } { - doc_body_append " - + append order_details_html " @@ -222,8 +168,7 @@ " } -doc_body_append " - +append order_details_html " @@ -238,13 +183,9 @@ - -
[ec_decode $shipping_method "pickup" "Address" "no shipping" "Address" "Ship to"] [ec_display_as_html [ec_pretty_mailing_address_from_ec_addresses $shipping_address]]
" if { $order_state == "confirmed" || $order_state == "authorized" || $order_state == "partially_fulfilled" } { - doc_body_append " - (modify)" + append order_details_html "(modify)" } -doc_body_append " -
Bill to [ec_display_as_html [ec_pretty_mailing_address_from_ec_addresses $billing_address]]
(modify)
In basket date [ec_formatted_full_date $in_basket_date]
Base shipping charged [ec_pretty_pure_price $shipping_charged] [ec_decode $shipping_method "pickup" "(Pickup)" "no shipping" "(No Shipping)" ""]
- -

Financial Transactions

" + " -set table_header " - +set table_header "table border> @@ -259,7 +200,7 @@ " set transaction_counter 0 - +set financial_transaction_html "" db_foreach financial_transactions_select " select t.transaction_id, t.inserted_date, t.transaction_amount, t.transaction_type, t.to_be_captured_p, t.authorized_date, t.marked_date, t.refunded_date, t.failed_p, c.creditcard_last_four @@ -269,10 +210,9 @@ order by transaction_id" { if { $transaction_counter == 0 } { - doc_body_append $table_header + append financial_transaction_html $table_header } - doc_body_append " - + append financial_transaction_html " @@ -286,19 +226,15 @@ " incr transaction_counter } - + if { $transaction_counter != 0 } { - doc_body_append "
ID Date
$transaction_id [ec_nbsp_if_null [ec_formatted_full_date $inserted_date]] $creditcard_last_four
" + append financial_transaction_html "" } else { - doc_body_append "
None Found
" + append financial_transaction_html "
None Found
" } -doc_body_append " -

Shipments

-
" - set old_shipment_id 0 - +set shipments_html "" db_foreach shipments_items_products_select " select s.shipment_id, s.address_id, s.shipment_date, s.expected_arrival_date, s.carrier, s.tracking_number, s.actual_arrival_date, s.actual_arrival_detail, p.product_name, p.product_id, i.price_name, i.price_charged, count(*) as quantity @@ -310,18 +246,17 @@ p.product_name, p.product_id, i.price_name, i.price_charged order by s.shipment_id" { if { $shipment_id != $old_shipment_id } { - if { $old_shipment_id != 0 } { - doc_body_append "" - } - doc_body_append " - + if { $old_shipment_id != 0 } { + append shipments_html "" + } + append shipments_html "
Shipment ID: $shipment_id
Date: [util_AnsiDatetoPrettyDate $shipment_date]
[ec_decode $expected_arrival_date "" "" "Expected Arrival: [util_AnsiDatetoPrettyDate $expected_arrival_date]
"] [ec_decode $carrier "" "" "Carrier: $carrier
"] - [ec_decode $tracking_number "" "" "Tracking #: $tracking_number
"] + [ec_decode $tracking_number "" "" "Tracking \#: $tracking_number
"] [ec_decode $actual_arrival_date "" "" "Actual Arrival Date: [util_AnsiDatetoPrettyDate $actual_arrival_date]
"] [ec_decode $actual_arrival_detail "" "" "Actual Arrival Detail: $actual_arrival_detail
"] (track) @@ -333,25 +268,18 @@
    " } - doc_body_append "
  • Quantity $quantity: $product_name
  • " + append shipments_html "
  • Quantity $quantity: $product_name
  • " set old_shipment_id $shipment_id } if { $old_shipment_id == 0 } { - doc_body_append "No Shipments Have Been Made" + append shipments_html "No Shipments Have Been Made" } else { - doc_body_append "
" + append shipments_html "" } -doc_body_append " -
- -

Returns

- -
" - set old_refund_id 0 - +set refunds_html "" db_foreach refunds_select " select r.refund_id, r.refund_date, r.refunded_by, r.refund_reasons, r.refund_amount, u.first_names, u.last_name, p.product_name, p.product_id, i.price_name, i.price_charged, count(*) as quantity from ec_refunds r, cc_users u, ec_items i, ec_products p @@ -361,34 +289,27 @@ and p.product_id=i.product_id group by r.refund_id, r.refund_date, r.refunded_by, r.refund_reasons, r.refund_amount, u.first_names, u.last_name, p.product_name, p.product_id, i.price_name, i.price_charged" { if { $refund_id != $old_refund_id } { - if { $old_refund_id != 0 } { - doc_body_append "" - } - doc_body_append " + if { $old_refund_id != 0 } { + append refunds_html "" + } + append refunds_html " Refund ID: $refund_id
Date: [ec_formatted_full_date $refund_date]
Amount: [ec_pretty_pure_price $refund_amount]
Refunded by: $first_names $last_name
Reason: $refund_reasons
    " } - doc_body_append "
  • Quantity $quantity: $product_name
  • " + append refunds_html "
  • Quantity $quantity: $product_name
  • " set old_refund_id $refund_id } if { $old_refund_id == 0 } { - doc_body_append "No Returns Have Been Made" + append refunds_html "No Returns Have Been Made" } else { - doc_body_append "
" + append refunds_html "" } -doc_body_append "
" - if { $order_state != "void" } { - doc_body_append " -

Actions

- -[ad_admin_footer]"