+ Total refund amount: [ec_pretty_price [expr $total_amount_to_refund + $total_amount_to_refund_manually]] (price: [ec_pretty_price [expr $total_price_to_refund + $total_price_to_refund_manually]], shipping: [ec_pretty_price $total_shipping_to_refund], tax: [ec_pretty_price $total_tax_to_refund])
+ "
+
+if { $certificate_amount_to_reinstate > 0 } {
+ if { $method == "scholarship" } {
+ append doc_body "- [ec_pretty_price $certificate_amount_to_reinstate] will be reinstated in the scholarship fund.
"
+ } else {
+ append doc_body " - [ec_pretty_price $certificate_amount_to_reinstate] will be reinstated in gift certificates.
"
+ }
+}
+
+if { $method == "cc" } {
+ append doc_body "
+ - [ec_pretty_price $cash_amount_to_refund_cc] will be refunded to the customer's credit card.
"
+}
+
+append doc_body "
+ - [ec_pretty_price $cash_amount_to_refund_manually] will be refunded to the customer manually.
"
+
+append doc_body "
+
"
+
+# Request the credit card number to be re-entered if it is no longer
+# on file, yet there is money to refund.
+
+# Only ask for credit card info if credit card was used in purchase
+
if { [empty_string_p $creditcard_number] && $cash_amount_to_refund > 0 && $method == "cc" } {
append doc_body "
Please re-enter the credit card number of the card used for this order:
Index: openacs-4/packages/dotlrn-ecommerce/www/admin/ecommerce/items-return-4-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/www/admin/ecommerce/items-return-4-postgresql.xql,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/dotlrn-ecommerce/www/admin/ecommerce/items-return-4-postgresql.xql 5 Aug 2005 02:52:53 -0000 1.2
+++ openacs-4/packages/dotlrn-ecommerce/www/admin/ecommerce/items-return-4-postgresql.xql 12 Aug 2005 10:10:14 -0000 1.3
@@ -8,7 +8,7 @@
insert into ec_refunds
(refund_id, order_id, refund_amount, refund_date, refunded_by, refund_reasons)
values
- (:refund_id, :order_id, :cash_amount_to_refund, current_timestamp, :customer_service_rep,:reason_for_return)
+ (:refund_id, :order_id, :cash_amount_to_refund_cc, current_timestamp, :customer_service_rep,:reason_for_return)
Index: openacs-4/packages/dotlrn-ecommerce/www/admin/ecommerce/items-return-4.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/www/admin/ecommerce/items-return-4.tcl,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/dotlrn-ecommerce/www/admin/ecommerce/items-return-4.tcl 8 Aug 2005 13:10:07 -0000 1.4
+++ openacs-4/packages/dotlrn-ecommerce/www/admin/ecommerce/items-return-4.tcl 12 Aug 2005 10:10:14 -0000 1.5
@@ -32,10 +32,13 @@
received_back_datetime
reason_for_return
item_id_list:notnull
- price_to_refund:array
+ price_to_refund:array,optional
+ price_to_refund_manually:array
shipping_to_refund:array
base_shipping_to_refund
cash_amount_to_refund:optional
+ cash_amount_to_refund_cc:optional
+ cash_amount_to_refund_manually:optional
certificate_amount_to_reinstate
creditcard_id:optional
@@ -44,6 +47,12 @@
creditcard_last_four:optional
}
+if { ! [array exists price_to_refund] } {
+ foreach _item [array names price_to_refund_manually] {
+ set price_to_refund($_item) 0
+ }
+}
+
set method [db_string method {
select method
from dotlrn_ecommerce_transactions
@@ -95,7 +104,7 @@
# Check if money needs to be refunded and if the credit card number is
# still on file.
-if { [expr $cash_amount_to_refund] > 0 && $method == "cc" } {
+if { $cash_amount_to_refund > 0 && $method == "cc" } {
# Make sure that all the credit card information is there.
@@ -174,7 +183,7 @@
insert into ec_refunds
(refund_id, order_id, refund_amount, refund_date, refunded_by, refund_reasons)
values
- (:refund_id, :order_id, :cash_amount_to_refund, sysdate, :customer_service_rep,:reason_for_return)"
+ (:refund_id, :order_id, :cash_amount_to_refund_cc, sysdate, :customer_service_rep,:reason_for_return)"
foreach item_id $item_id_list {
@@ -238,7 +247,7 @@
# amount can exceed the charge amount when the order was shipped
# in parts and the customer returned items from various shipments.
-set refund_amount $cash_amount_to_refund
+set refund_amount $cash_amount_to_refund_cc
while { $refund_amount > 0 && $method == "cc" } {
# See if the refund matches a single charge transaction. The
@@ -512,6 +521,9 @@
set refunded_date=sysdate
where transaction_id=:pgw_transaction_id"
append results_explanation "Refund transaction $pgw_transaction_id for [ec_pretty_price $transaction_amount] is complete!
";#
+ if { $cash_amount_to_refund_manually > 0 } {
+ append results_explanation "The amount [ec_pretty_price $cash_amount_to_refund_manually] is to be refunded manually
";#
+ }
}
} else {
@@ -528,6 +540,9 @@
set page_title "No credit card refund needed."
set results_explanation "No credit card refund was necessary because the entire amount was refunded to the gift certificates the customer used when purchasing the order."
}
+} elseif { $cash_amount_to_refund_manually > 0 } {
+ set page_title "Refund results"
+ append results_explanation "The amount [ec_pretty_price $cash_amount_to_refund_manually] is to be refunded manually
";#
} else {
set page_title "No credit card refund needed."
set results_explanation "No credit card refund was necessary because the entire amount was refunded to the gift certificates the customer used when purchasing the order."