Index: openacs-4/packages/ecommerce/www/finalize-order-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/finalize-order-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/finalize-order-postgresql.xql 10 Jul 2001 20:42:02 -0000 1.1 +++ openacs-4/packages/ecommerce/www/finalize-order-postgresql.xql 26 May 2002 04:36:50 -0000 1.2 @@ -1,13 +1,93 @@ - postgresql7.1 + + postgresql + 7.1 + - - - select ec_gift_certificate_balance(:user_id) - - + + + select ec_gift_certificate_balance(:user_id) + + - + + + select ec_order_gift_cert_amount(:order_id) + + + + + + select coalesce(sum(i.price_charged),0) - coalesce(sum(i.price_refunded),0) as soft_goods_cost + from ec_items i, ec_products p + where i.order_id = :order_id + and i.item_state <> 'void' + and i.product_id = p.product_id + and p.no_shipping_avail_p = 't' + + + + + + select coalesce(sum(i.price_charged),0) - coalesce(sum(i.price_refunded),0) as hard_goods_cost + from ec_items i, ec_products p + where i.order_id = :order_id + and i.item_state <> 'void' + and i.product_id = p.product_id + and p.no_shipping_avail_p = 'f' + + + + + + insert into ec_financial_transactions + (transaction_id, order_id, transaction_amount, transaction_type, inserted_date) + values + (:transaction_id, :order_id, :transaction_amount, 'charge', current_timestamp) + + + + + + update ec_financial_transactions + set authorized_date = current_timestamp + where transaction_id = :transaction_id + *op + + + + + update ec_financial_transactions + set authorized_date = current_timestamp, to_be_captured_p = 't', to_be_captured_date = current_timestamp + where transaction_id = :transaction_id + + + + + + update ec_financial_transactions + set to_be_captured_p = 't', to_be_captured_date = current_timestamp + where transaction_id = :transaction_id + + + + + + insert into ec_problems_log + (problem_id, problem_date, problem_details, order_id) + values + (ec_problem_id_sequence.nextval, current_timestamp, :problem_details, :order_id) + + + + + + update ec_financial_transactions + set marked_date = current_timestamp + where transaction_id = :pgw_transaction_id + + +