Index: openacs-4/packages/dotlrn-ecommerce/lib/financial-transactions.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/lib/financial-transactions.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-ecommerce/lib/financial-transactions.adp 14 Aug 2005 05:00:14 -0000 1.1 @@ -0,0 +1,84 @@ +
+ + This order was paid by invoice. + +++ Payments +
+ + TOTAL: <%=[ec_pretty_price $total_price]%> ++ + +- Date: @invoice_payments.pretty_payment_date@, Amount: @invoice_payments.amount@, Via: @invoice_payments.invoice_method@
++ + +- No payments have been made
++ + +- Add Payment
+
+ Balance: <%=[ec_pretty_price [expr $total_price - $invoice_payment_sum + $total_refunds]]%> +
This order was fully paid by scholarship. +
This order was partially paid by scholarship. +
ID | +Date | +Creditcard Last 4 | +Amount | +Type | +To Be Captured | +Auth Date | +Mark Date | +Refund Date | +Failed | +
---|---|---|---|---|---|---|---|---|---|
@financial_transactions.transaction_id@ | +@financial_transactions.inserted_date@ | +@financial_transactions.creditcard_last_four@ | +@financial_transactions.transaction_amount@ | +@financial_transactions.transaction_type@ | +@financial_transactions.to_be_captured_p@ | +@financial_transactions.authorized_date@ | +@financial_transactions.marked_date@ | +@financial_transactions.refunded_date@ | +@financial_transactions.failed_p@ | +
This order was fully paid by check.+
No credit card transactions+
+ ++ Index: openacs-4/packages/dotlrn-ecommerce/lib/refunds.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/lib/refunds.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-ecommerce/lib/refunds.tcl 14 Aug 2005 05:00:14 -0000 1.1 @@ -0,0 +1,32 @@ +# packages/dotlrn-ecommerce/lib/refunds.tcl +# +# Refunds +# +# @author Roel Canicula (roelmc@pldtdsl.net) +# @creation-date 2005-08-14 +# @arch-tag: a2801cc7-9b21-4cf9-80b2-66d9f2a42425 +# @cvs-id $Id: refunds.tcl,v 1.1 2005/08/14 05:00:14 roelc Exp $ + +foreach required_param {order_id} { + if {![info exists $required_param]} { + return -code error "$required_param is a required parameter." + } +} +foreach optional_param {} { + if {![info exists $optional_param]} { + set $optional_param {} + } +} + +db_multirow refunds 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 + where r.order_id=:order_id + and r.refunded_by=u.user_id + and i.refund_id=r.refund_id + 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 +} { + set refund_date [ec_formatted_full_date $refund_date] + set refund_amount [ec_pretty_price $refund_amount] +} \ No newline at end of file Index: openacs-4/packages/dotlrn-ecommerce/www/admin/ecommerce/one.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/www/admin/ecommerce/one.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/dotlrn-ecommerce/www/admin/ecommerce/one.tcl 10 Aug 2005 21:30:05 -0000 1.5 +++ openacs-4/packages/dotlrn-ecommerce/www/admin/ecommerce/one.tcl 14 Aug 2005 05:00:14 -0000 1.6 @@ -228,156 +228,15 @@+ ++ + ++ + ++ + + Refund ID: @refunds.refund_id@
+ Date: @refunds.refund_date@
+ Amount: @refunds.refund_amount@
+ Refunded by: @refunds.first_names@ @refunds.last_name@
+ Reason: @refunds.refund_reasons@ ++
Quantity @refunds.quantity@: @refunds.product_name@ ++ No Returns Have Been Made + + +
ID | -Date | -Creditcard Last 4 | -Amount | -Type | -To Be Captured | -Auth Date | -Mark Date | -Refund Date | -Failed | -
---|---|---|---|---|---|---|---|---|---|
$transaction_id | -[ec_nbsp_if_null [ec_formatted_full_date $inserted_date]] | -$creditcard_last_four | -[ec_pretty_price $transaction_amount] | -[ec_decode $transaction_type "charge" "authorization to charge" "intent to refund"] | -[ec_nbsp_if_null [ec_decode $transaction_type "refund" "Yes" [ec_decode $to_be_captured_p "t" "Yes" "f" "No" ""]]] | -[ec_nbsp_if_null [ec_formatted_full_date $authorized_date]] | -[ec_nbsp_if_null [ec_formatted_full_date $marked_date]] | -[ec_nbsp_if_null [ec_formatted_full_date $refunded_date]] | -[ec_nbsp_if_null [ec_decode $failed_p "t" "Yes" "f" "No" ""]] | -
This order was fully paid by ${method}." - } - cc { - doc_body_append "
No credit card transactions" - } - invoice - - scholarship {} - } -} - doc_body_append " +[eval $financial_transactions] +
" @@ -428,46 +287,14 @@ } doc_body_append " -+ " -
" +doc_body_append "[eval $refunds]" -set old_refund_id 0 - -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 - where r.order_id=:order_id - and r.refunded_by=u.user_id - and i.refund_id=r.refund_id - 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 " - Refund ID: $refund_id" - if { $order_state != "void" } { doc_body_append "
- Date: [ec_formatted_full_date $refund_date]
- Amount: [ec_pretty_price $refund_amount]
- Refunded by: $first_names $last_name
- Reason: $refund_reasons -" - } - doc_body_append "
" -} - -doc_body_append "- Quantity $quantity: $product_name
" - set old_refund_id $refund_id -} - -if { $old_refund_id == 0 } { - doc_body_append "No Returns Have Been Made" -} else { - doc_body_append "