Index: openacs-4/packages/ecommerce/www/admin/orders/address-add-3.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/address-add-3.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/ecommerce/www/admin/orders/address-add-3.tcl 20 Apr 2001 20:51:14 -0000 1.1
+++ openacs-4/packages/ecommerce/www/admin/orders/address-add-3.tcl 29 Jan 2002 00:11:46 -0000 1.2
@@ -25,16 +25,16 @@
# insert the address into ec_addresses, update the address in ec_orders
db_transaction {
- set address_id [db_string address_id_select "select ec_address_id_sequence.nextval from dual"]
- set user_id [db_string user_id_select "select user_id from ec_orders where order_id=:order_id"]
+ set address_id [db_nextval ec_address_id_sequence]
+ set user_id [db_string user_id_select "select user_id from ec_orders where order_id=:order_id"]
- db_dml address_insert "insert into ec_addresses
+ db_dml address_insert "insert into ec_addresses
(address_id, user_id, address_type, attn, line1, line2, city, usps_abbrev, full_state_name, zip_code, country_code, phone, phone_time)
values
(:address_id, :user_id, 'shipping', :attn, :line1, :line2, :city, :usps_abbrev, :full_state_name, :zip_code, :country_code, :phone, :phone_time)
"
- db_dml ec_orders_update "update ec_orders set shipping_address=:address_id where order_id=:order_id"
+ db_dml ec_orders_update "update ec_orders set shipping_address=:address_id where order_id=:order_id"
}
ad_returnredirect "one?[export_url_vars order_id]"
Index: openacs-4/packages/ecommerce/www/admin/orders/creditcard-add-3.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/creditcard-add-3.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/ecommerce/www/admin/orders/creditcard-add-3.tcl 20 Apr 2001 20:51:14 -0000 1.1
+++ openacs-4/packages/ecommerce/www/admin/orders/creditcard-add-3.tcl 29 Jan 2002 00:11:46 -0000 1.2
@@ -20,7 +20,7 @@
set user_id [db_string user_id_select "select user_id from ec_orders where order_id=:order_id"]
- set creditcard_id [db_string creditcard_id_select "select ec_creditcard_id_sequence.nextval from dual"]
+ set creditcard_id [db_nextval ec_creditcard_id_sequence]
set creditcard_last_four [string range $creditcard_number [expr [string length $creditcard_number] -4] [expr [string length $creditcard_number] -1]]
set creditcard_expire "$creditcard_expire_1/$creditcard_expire_2"
Index: openacs-4/packages/ecommerce/www/admin/orders/fulfill-2.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/fulfill-2.tcl,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/ecommerce/www/admin/orders/fulfill-2.tcl 22 Aug 2001 04:20:41 -0000 1.3
+++ openacs-4/packages/ecommerce/www/admin/orders/fulfill-2.tcl 29 Jan 2002 00:11:46 -0000 1.4
@@ -102,7 +102,7 @@
"
-set shipment_id [db_string get_new_ship_seq "select ec_shipment_id_sequence.nextval from dual"]
+set shipment_id [db_nextval ec_shipment_id_sequence]
if { [info exists item_id] && ![empty_string_p item_id] } {
set sql "select i.item_id, p.product_name, p.one_line_description, p.product_id, i.price_charged, i.price_name, i.color_choice, i.size_choice, i.style_choice
Index: openacs-4/packages/ecommerce/www/admin/orders/fulfill-3-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/fulfill-3-oracle.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/ecommerce/www/admin/orders/fulfill-3-oracle.xql 10 Jul 2001 20:33:53 -0000 1.1
+++ openacs-4/packages/ecommerce/www/admin/orders/fulfill-3-oracle.xql 29 Jan 2002 00:11:46 -0000 1.2
@@ -1,125 +1,105 @@
- oracle8.1.6
+ oracle8.1.6
-
-
+
+
select nvl(sum(price_charged),0) from ec_items where item_id in ([join $item_id_vars ", "])
-
-
-
-
-
-
+
+
+
+
+
select nvl(sum(shipping_charged),0) from ec_items where item_id in ([join $item_id_vars ", "])
-
-
-
-
-
-
+
+
+
+
+
select ec_tax(:total_price_of_items, :total_shipping_of_items, :order_id) from dual
-
-
-
-
-
-
+
+
+
+
+
insert into ec_shipments
- (shipment_id, order_id, shipment_date, expected_arrival_date, carrier, tracking_number, shippable_p, last_modified, last_modifying_user, modified_ip_address)
- values
- (:shipment_id, :order_id, to_date(:shipment_date, 'YYYY-MM-DD HH12:MI:SSAM'), to_date(:expected_arrival_date, 'YYYY-MM-DD HH12:MI:SSAM'), :carrier, :tracking_number, :shippable_p_tf, sysdate, :customer_service_rep, :peeraddr)
+ (shipment_id, order_id, shipment_date, expected_arrival_date, carrier, tracking_number, shippable_p, last_modified, last_modifying_user, modified_ip_address)
+ values
+ (:shipment_id, :order_id, to_date(:shipment_date, 'YYYY-MM-DD HH12:MI:SSAM'), to_date(:expected_arrival_date, 'YYYY-MM-DD HH12:MI:SSAM'), :carrier, :tracking_number, :shippable_p_tf, sysdate, :customer_service_rep, :peeraddr)
+
+
-
-
-
-
-
-
+
+
select ec_shipment_cost(:shipment_id) from dual
-
-
-
-
-
-
+
+
+
+
+
select ec_order_cost(:order_id) from dual
-
-
-
-
-
-
+
+
+
+
+
update ec_financial_transactions set shipment_id=:shipment_id, to_be_captured_p='t', to_be_captured_date=sysdate where transaction_id=:transaction_id
-
-
+
+
-
-
-
- insert into ec_problems_log
- (problem_id, problem_date, problem_details, order_id)
- values
- (ec_problem_id_sequence.nextval, sysdate, :problem_details, :order_id)
-
-
-
-
-
-
-
- update ec_financial_transactions set marked_date=sysdate where transaction_id=:transaction_id
-
-
-
-
-
-
+
+
insert into ec_financial_transactions
(transaction_id, order_id, shipment_id, transaction_amount, transaction_type, to_be_captured_p, inserted_date, to_be_captured_date)
values
- (:transaction_id, :order_id, :shipment_id, :shipment_cost, 'charge','t',sysdate,sysdate)
-
-
-
+ (:transaction_id, :order_id, :shipment_id, :shipment_cost, 'charge','t',sysdate, sysdate)
+
+
+
+
+
+ insert into ec_problems_log
+ (problem_id, problem_date, problem_details, order_id)
+ values
+ (ec_problem_id_sequence.nextval, sysdate, :problem_details, :order_id)
+
+
+
+
+
+ update ec_financial_transactions set marked_date=sysdate where transaction_id=:transaction_id
+
+
-
-
-
-
- insert into ec_problems_log
- (problem_id, problem_date, problem_details, order_id)
- values
- (ec_problem_id_sequence.nextval, sysdate, :problem_details, :order_id)
-
-
-
-
-
-
-
+
+
+ insert into ec_problems_log
+ (problem_id, problem_date, problem_details, order_id)
+ values
+ (ec_problem_id_sequence.nextval, sysdate, :problem_details, :order_id)
+
+
+
+
+
update ec_financial_transactions set authorized_date=sysdate where transaction_id=:transaction_id
-
-
+
+
-
-
-
+
+
insert into ec_problems_log
- (problem_id, problem_date, problem_details, order_id)
- values
- (ec_problem_id_sequence.nextval, sysdate, :problem_details, :order_id)
-
-
-
-
-
-
-
+ (problem_id, problem_date, problem_details, order_id)
+ values
+ (ec_problem_id_sequence.nextval, sysdate, :problem_details, :order_id)
+
+
+
+
+
update ec_financial_transactions set marked_date=sysdate where transaction_id=:transaction_id
-
-
-
-
+
+
+
Index: openacs-4/packages/ecommerce/www/admin/orders/fulfill-3-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/fulfill-3-postgresql.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/ecommerce/www/admin/orders/fulfill-3-postgresql.xql 10 Jul 2001 20:33:53 -0000 1.1
+++ openacs-4/packages/ecommerce/www/admin/orders/fulfill-3-postgresql.xql 29 Jan 2002 00:11:46 -0000 1.2
@@ -1,111 +1,85 @@
- postgresql7.1
+ postgresql7.1
-
-
+
+
select ec_tax(:total_price_of_items, :total_shipping_of_items, :order_id)
-
-
-
-
-
-
+
+
+
+
+
insert into ec_shipments
- (shipment_id, order_id, shipment_date, expected_arrival_date, carrier, tracking_number, shippable_p, last_modified, last_modifying_user, modified_ip_address)
- values
- (:shipment_id, :order_id, to_date(:shipment_date, 'YYYY-MM-DD HH12:MI:SSAM'), to_date(:expected_arrival_date, 'YYYY-MM-DD HH12:MI:SSAM'), :carrier, :tracking_number, :shippable_p_tf, current_timestamp, :customer_service_rep, :peeraddr)
+ (shipment_id, order_id, shipment_date, expected_arrival_date, carrier, tracking_number, shippable_p, last_modified, last_modifying_user, modified_ip_address)
+ values
+ (:shipment_id, :order_id, to_date(:shipment_date, 'YYYY-MM-DD HH12:MI:SSAM'), to_date(:expected_arrival_date, 'YYYY-MM-DD HH12:MI:SSAM'), :carrier, :tracking_number, :shippable_p_tf, current_timestamp, :customer_service_rep, :peeraddr)
+
+
-
-
-
-
-
-
+
+
select ec_shipment_cost(:shipment_id)
-
-
-
-
-
-
+
+
+
+
+
select ec_order_cost(:order_id)
-
-
-
-
-
-
+
+
+
+
+
update ec_financial_transactions set shipment_id=:shipment_id, 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=:transaction_id
-
-
-
-
-
-
+
+
insert into ec_financial_transactions
(transaction_id, order_id, shipment_id, transaction_amount, transaction_type, to_be_captured_p, inserted_date, to_be_captured_date)
values
- (:transaction_id, :order_id, :shipment_id, :shipment_cost, 'charge','t',current_timestamp,current_timestamp)
+ (:transaction_id, :order_id, :shipment_id, :shipment_cost, 'charge','t', current_timestamp, current_timestamp)
+
+
+
+
+
+ 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=: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 authorized_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)
-
-
-
+ (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=:transaction_id
-
-
-
-
+
+
+
Index: openacs-4/packages/ecommerce/www/admin/orders/fulfill-3.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/fulfill-3.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/ecommerce/www/admin/orders/fulfill-3.tcl 20 Apr 2001 20:51:14 -0000 1.1
+++ openacs-4/packages/ecommerce/www/admin/orders/fulfill-3.tcl 29 Jan 2002 00:11:46 -0000 1.2
@@ -1,19 +1,19 @@
# /www/[ec_url_concat [ec_url] /admin]/orders/fulfill-3.tcl
ad_page_contract {
- @author Eve Andersson (eveander@arsdigita.com)
- @creation-date Summer 1999
- @cvs-id fulfill-3.tcl,v 3.4.2.6 2000/08/18 21:46:57 stevenp Exp
- @author ported by Jerry Asher (jerry@theashergroup.com)
+ @author Eve Andersson (eveander@arsdigita.com)
+ @creation-date Summer 1999
+ @cvs-id fulfill-3.tcl,v 3.4.2.6 2000/08/18 21:46:57 stevenp Exp
+ @author ported by Jerry Asher (jerry@theashergroup.com)
} {
- shipment_id:integer,notnull
- order_id:integer,notnull
- shipment_date:notnull
- expected_arrival_date
- carrier:optional
- carrier_other:optional
- tracking_number:optional
- item_id
+ shipment_id:integer,notnull
+ order_id:integer,notnull
+ shipment_date:notnull
+ expected_arrival_date
+ carrier:optional
+ carrier_other:optional
+ tracking_number:optional
+ item_id
}
ad_require_permission [ad_conn package_id] admin
@@ -59,8 +59,8 @@
# doubleclick protection
if { [db_string doubleclick_select "select count(*) from ec_shipments where shipment_id=:shipment_id"] > 0 } {
- ad_returnredirect "fulfillment"
- return
+ ad_returnredirect "fulfillment"
+ return
}
set shipping_method [db_string shipping_method_select "select shipping_method from ec_orders where order_id=:order_id"]
@@ -71,30 +71,30 @@
set item_id_vars [list]
foreach item_id $item_id_list {
- set var_name "item_id_[llength $item_id_vars]"
- set $var_name $item_id
- lappend item_id_vars ":$var_name"
+ set var_name "item_id_[llength $item_id_vars]"
+ set $var_name $item_id
+ lappend item_id_vars ":$var_name"
}
set total_price_of_items [db_string total_price_of_items_select "select nvl(sum(price_charged),0) from ec_items where item_id in ([join $item_id_vars ", "])"]
if { $shippable_p } {
- # see if base shipping cost should be included in total_shipping_of_items
- set n_shipments_already [db_string n_shipments_already_select "select count(*) from ec_shipments where order_id=:order_id"]
-
- set shipping_of_items [db_string shipping_of_items_select "select nvl(sum(shipping_charged),0) from ec_items where item_id in ([join $item_id_vars ", "])"]
-
- if { $n_shipments_already == 0 } {
- set total_shipping_of_items [db_string total_shipping_of_items_select "select $shipping_of_items + shipping_charged from ec_orders where order_id=:order_id"]
- } else {
- set total_shipping_of_items $shipping_of_items
- }
+ # see if base shipping cost should be included in total_shipping_of_items
+ set n_shipments_already [db_string n_shipments_already_select "select count(*) from ec_shipments where order_id=:order_id"]
+
+ set shipping_of_items [db_string shipping_of_items_select "select nvl(sum(shipping_charged),0) from ec_items where item_id in ([join $item_id_vars ", "])"]
+
+ if { $n_shipments_already == 0 } {
+ set total_shipping_of_items [db_string total_shipping_of_items_select "select $shipping_of_items + shipping_charged from ec_orders where order_id=:order_id"]
+ } else {
+ set total_shipping_of_items $shipping_of_items
+ }
} else {
- # it's a pickup order
- set total_shipping_of_items 0
- set expected_arrival_date ""
- set carrier ""
- set tracking_number ""
+ # it's a pickup order
+ set total_shipping_of_items 0
+ set expected_arrival_date ""
+ set carrier ""
+ set tracking_number ""
}
set total_tax_of_items [db_string total_tax_of_items_select "select ec_tax(:total_price_of_items, :total_shipping_of_items, :order_id) from dual"]
@@ -103,124 +103,125 @@
set shippable_p_tf [ec_decode $shippable_p 0 f t]
db_transaction {
- db_dml insert_shipment_info "insert into ec_shipments
+ db_dml insert_shipment_info "insert into ec_shipments
(shipment_id, order_id, shipment_date, expected_arrival_date, carrier, tracking_number, shippable_p, last_modified, last_modifying_user, modified_ip_address)
values
(:shipment_id, :order_id, to_date(:shipment_date, 'YYYY-MM-DD HH12:MI:SSAM'), to_date(:expected_arrival_date, 'YYYY-MM-DD HH12:MI:SSAM'), :carrier, :tracking_number, :shippable_p_tf, sysdate, :customer_service_rep, :peeraddr)
"
- db_dml item_state_update "
+ db_dml item_state_update "
update ec_items
set item_state='shipped', shipment_id=:shipment_id
where item_id in ([join $item_id_vars ", "])
"
- # calculate the total shipment cost (price + shipping + tax - gift certificate) of the shipment
- set shipment_cost [db_string shipment_cost_select "select ec_shipment_cost(:shipment_id) from dual"]
+ # calculate the total shipment cost (price + shipping + tax - gift certificate) of the shipment
+ set shipment_cost [db_string shipment_cost_select "select ec_shipment_cost(:shipment_id) from dual"]
- # calculate the total order cost (price + shipping + tax - gift_certificate) so we'll
- # know if we can use the original transaction
- set order_cost [db_string order_cost_select "select ec_order_cost(:order_id) from dual"]
+ # calculate the total order cost (price + shipping + tax - gift_certificate) so we'll
+ # know if we can use the original transaction
+ set order_cost [db_string order_cost_select "select ec_order_cost(:order_id) from dual"]
- # It is conceivable, albeit unlikely, that a partial shipment,
- # return, and an addition of more items to the order by the site
- # administrator can make the order_cost equal the shipment_cost
- # even if it isn't the first shipment, which is fine. But if
- # this happens twice, this would have caused the system (which is
- # trying to minimize financial transactions) to try to reuse an old
- # transaction, which will fail, so I've added the 2nd half of the
- # "if statement" below to make sure that transaction doesn't get reused:
+ # It is conceivable, albeit unlikely, that a partial shipment,
+ # return, and an addition of more items to the order by the site
+ # administrator can make the order_cost equal the shipment_cost
+ # even if it isn't the first shipment, which is fine. But if
+ # this happens twice, this would have caused the system (which is
+ # trying to minimize financial transactions) to try to reuse an old
+ # transaction, which will fail, so I've added the 2nd half of the
+ # "if statement" below to make sure that transaction doesn't get reused:
- if { $shipment_cost == $order_cost && [db_string to_be_captured_p_select "select count(*) from ec_financial_transactions where order_id=:order_id and to_be_captured_p='t'"] == 0} {
- set transaction_id [db_string transaction_id_select "select max(transaction_id) from ec_financial_transactions where order_id=:order_id"]
- # 1999-08-11: added shipment_id to the update
-
- # 1999-08-29: put the update inside an if statement in case there is
- # no transaction to update
- if { ![empty_string_p $transaction_id] } {
- db_dml transaction_update "update ec_financial_transactions set shipment_id=:shipment_id, to_be_captured_p='t', to_be_captured_date=sysdate where transaction_id=:transaction_id"
- }
+ if { $shipment_cost == $order_cost && [db_string to_be_captured_p_select "select count(*) from ec_financial_transactions where order_id=:order_id and to_be_captured_p='t'"] == 0} {
+ set transaction_id [db_string transaction_id_select "select max(transaction_id) from ec_financial_transactions where order_id=:order_id"]
+ # 1999-08-11: added shipment_id to the update
+
+ # 1999-08-29: put the update inside an if statement in case there is
+ # no transaction to update
+ if { ![empty_string_p $transaction_id] } {
+ db_dml transaction_update "update ec_financial_transactions set shipment_id=:shipment_id, to_be_captured_p='t', to_be_captured_date=sysdate where transaction_id=:transaction_id"
+ }
- # try to mark the transaction
- # 1999-08-29: put the marking inside an if statement in case there is
- # no transaction to update
- if { ![empty_string_p $transaction_id] } {
+ # try to mark the transaction
+ # 1999-08-29: put the marking inside an if statement in case there is
+ # no transaction to update
+ if { ![empty_string_p $transaction_id] } {
- set cc_mark_result [ec_creditcard_marking $transaction_id]
- if { $cc_mark_result == "invalid_input" } {
- set problem_details "When trying to mark shipment $shipment_id (transaction $transaction_id) at [ad_conn url], the following result occurred: $cc_mark_result"
- db_dml problems_log_insert "insert into ec_problems_log
+ set cc_mark_result [ec_creditcard_marking $transaction_id]
+ if { $cc_mark_result == "invalid_input" } {
+ set problem_details "When trying to mark shipment $shipment_id (transaction $transaction_id) at [ad_conn url], the following result occurred: $cc_mark_result"
+ db_dml problems_log_insert "insert into ec_problems_log
(problem_id, problem_date, problem_details, order_id)
values
(ec_problem_id_sequence.nextval, sysdate, :problem_details, :order_id)
"
- } elseif { $cc_mark_result == "success" } {
- db_dml transaction_success_update "update ec_financial_transactions set marked_date=sysdate where transaction_id=:transaction_id"
- }
- }
- } else {
- if { $shipment_cost > 0 } {
- # 1. add a row to ec_financial_transactions with to_be_captured_p and to_be_captured_date set
- # 2. do a new authorization
- # 3. mark transaction
-
- # Note: 1 is the only one we want to do inside the transaction; if 2 & 3 fail, they will be
- # tried later with a cron job (they involve talking to CyberCash, so you never know what will
- # happen with them)
-
- set transaction_id [db_string transaction_id_select "select ec_transaction_id_sequence.nextval from dual"]
- # 1999-08-11: added shipment_id to the insert
-
- db_dml transaction_id_insert "insert into ec_financial_transactions
+ } elseif { $cc_mark_result == "success" } {
+ db_dml transaction_success_update "update ec_financial_transactions set marked_date=sysdate where transaction_id=:transaction_id"
+ }
+ }
+ } else {
+ if { $shipment_cost >= 0 } {
+ # 1. add a row to ec_financial_transactions with to_be_captured_p and to_be_captured_date set
+ # 2. do a new authorization
+ # 3. mark transaction
+
+ # Note: 1 is the only one we want to do inside the transaction; if 2 & 3 fail, they will be
+ # tried later with a cron job (they involve talking to CyberCash, so you never know what will
+ # happen with them)
+
+ # Get id for the new transaction.
+ set transaction_id [db_nextval ec_transaction_id_sequence]
+ # 1999-08-11: added shipment_id to the insert
+
+ db_dml transaction_insert "insert into ec_financial_transactions
(transaction_id, order_id, shipment_id, transaction_amount, transaction_type, to_be_captured_p, inserted_date, to_be_captured_date)
values
- (:transaction_id, :order_id, :shipment_id, :shipment_cost, 'charge','t',sysdate,sysdate)
+ (:transaction_id, :order_id, :shipment_id, :shipment_cost, 'charge','t',sysdate, sysdate)
"
- # CyberCash stuff
- # this attempts an auth and returns failed_authorization, authorized_plus_avs, authorized_minus_avs, no_recommendation, or invalid_input
- set cc_result [ec_creditcard_authorization $order_id $transaction_id]
- if { $cc_result == "failed_authorization" || $cc_result == "invalid_input" } {
- set problem_details "When trying to authorize shipment $shipment_id (transaction $transaction_id) at [ad_conn url], the following result occurred: $cc_result"
- db_dml problems_insert "
+ # CyberCash stuff
+ # this attempts an auth and returns failed_authorization, authorized_plus_avs, authorized_minus_avs, no_recommendation, or invalid_input
+ set cc_result [ec_creditcard_authorization $order_id $transaction_id]
+ if { $cc_result == "failed_authorization" || $cc_result == "invalid_input" } {
+ set problem_details "When trying to authorize shipment $shipment_id (transaction $transaction_id) at [ad_conn url], the following result occurred: $cc_result"
+ db_dml problems_insert "
insert into ec_problems_log
(problem_id, problem_date, problem_details, order_id)
values
(ec_problem_id_sequence.nextval, sysdate, :problem_details, :order_id)
"
- if { [util_memoize {ad_parameter -package_id [ec_id] DisplayTransactionMessagesDuringFulfillmentP ecommerce} [ec_cache_refresh]] } {
- ad_return_warning "Credit Card Failure" "Warning: the credit card authorization for this shipment (shipment_id $shipment_id) of order_id $order_id failed. You may wish to abort the shipment (if possible) until this is issue is resolved. A note has been made in the problems log.Continue with order fulfillment."
- return
- }
- if { $cc_result == "failed_p" } {
- db_dml transaction_failed_update "update ec_financial_transactions set failed_p='t' where transaction_id=:transaction_id"
- }
- } elseif { $cc_result == "authorized_plus_avs" || $cc_result == "authorized_minus_avs" } {
- # put authorized_date into ec_financial_transacions
- db_dml transaction_authorized_udpate "update ec_financial_transactions set authorized_date=sysdate where transaction_id=:transaction_id"
- # try to mark the transaction
- set cc_mark_result [ec_creditcard_marking $transaction_id]
- ns_log Notice "fulfill-3.tcl: cc_mark_result is $cc_mark_result"
- if { $cc_mark_result == "invalid_input" } {
- set problem_details "When trying to mark shipment $shipment_id (transaction $transaction_id) at [ad_conn url], the following result occurred: $cc_mark_result"
- db_dml problems_insert "insert into ec_problems_log
+ if { [util_memoize {ad_parameter -package_id [ec_id] DisplayTransactionMessagesDuringFulfillmentP ecommerce} [ec_cache_refresh]] } {
+ ad_return_warning "Credit Card Failure" "Warning: the credit card authorization for this shipment (shipment_id $shipment_id) of order_id $order_id failed. You may wish to abort the shipment (if possible) until this is issue is resolved. A note has been made in the problems log.
Continue with order fulfillment."
+ return
+ }
+ if { $cc_result == "failed_p" } {
+ db_dml transaction_failed_update "update ec_financial_transactions set failed_p='t' where transaction_id=:transaction_id"
+ }
+ } elseif { $cc_result == "authorized_plus_avs" || $cc_result == "authorized_minus_avs" } {
+ # put authorized_date into ec_financial_transacions
+ db_dml transaction_authorized_udpate "update ec_financial_transactions set authorized_date=sysdate where transaction_id=:transaction_id"
+ # try to mark the transaction
+ set cc_mark_result [ec_creditcard_marking $transaction_id]
+ ns_log Notice "fulfill-3.tcl: cc_mark_result is $cc_mark_result"
+ if { $cc_mark_result == "invalid_input" } {
+ set problem_details "When trying to mark shipment $shipment_id (transaction $transaction_id) at [ad_conn url], the following result occurred: $cc_mark_result"
+ db_dml problems_insert "insert into ec_problems_log
(problem_id, problem_date, problem_details, order_id)
values
(ec_problem_id_sequence.nextval, sysdate, :problem_details, :order_id)
"
- } elseif { $cc_mark_result == "success" } {
- db_dml transaction_success_update "update ec_financial_transactions set marked_date=sysdate where transaction_id=:transaction_id"
+ } elseif { $cc_mark_result == "success" } {
+ db_dml transaction_success_update "update ec_financial_transactions set marked_date=sysdate where transaction_id=:transaction_id"
+ }
+ }
}
- }
}
- }
}
# send the "Order Shipped" email iff it was a shippable order
if { $shippable_p } {
- ec_email_order_shipped $shipment_id
+ ec_email_order_shipped $shipment_id
}
ad_returnredirect "fulfillment"
Index: openacs-4/packages/ecommerce/www/admin/orders/fulfillment-items-needed.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/fulfillment-items-needed.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/ecommerce/www/admin/orders/fulfillment-items-needed.tcl 20 Apr 2001 20:51:14 -0000 1.1
+++ openacs-4/packages/ecommerce/www/admin/orders/fulfillment-items-needed.tcl 29 Jan 2002 00:11:46 -0000 1.2
@@ -21,7 +21,7 @@
The following items are needed in order to fulfill all outstanding orders:
-Quantity | Product |
+Quantity | SKU | Product |
"
db_foreach items_needed_select "
@@ -46,7 +46,7 @@
}
set options [join $option_list ", "]
- doc_body_append "$quantity | $product_name[ec_decode $options "" "" "; $options"] |
\n"
+ doc_body_append "$quantity | $sku | $product_name[ec_decode $options "" "" "; $options"] |
\n"
}
doc_body_append "
Index: openacs-4/packages/ecommerce/www/admin/orders/fulfillment-items-needed.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/fulfillment-items-needed.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/ecommerce/www/admin/orders/fulfillment-items-needed.xql 10 Jul 2001 20:33:53 -0000 1.1
+++ openacs-4/packages/ecommerce/www/admin/orders/fulfillment-items-needed.xql 29 Jan 2002 00:11:46 -0000 1.2
@@ -4,12 +4,12 @@
- select p.product_id, p.product_name,
+ select p.product_id, p.product_name, p.sku,
i.color_choice, i.size_choice, i.style_choice,
count(*) as quantity
from ec_products p, ec_items_shippable i
where p.product_id=i.product_id
- group by p.product_id, p.product_name,
+ group by p.product_id, p.product_name, p.sku,
i.color_choice, i.size_choice, i.style_choice
order by quantity desc
Index: openacs-4/packages/ecommerce/www/admin/orders/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/orders/index.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/ecommerce/www/admin/orders/index.tcl 20 Apr 2001 20:51:14 -0000 1.1
+++ openacs-4/packages/ecommerce/www/admin/orders/index.tcl 29 Jan 2002 00:11:46 -0000 1.2
@@ -60,8 +60,8 @@
from ec_refunds
"
-set n_standard_to_ship [db_string unused "select count(*) from ec_orders_shippable where shipping_method='standard'"]
-set n_express_to_ship [db_string unused "select count(*) from ec_orders_shippable where shipping_method='express'"]
+set n_standard_to_ship [db_string standard_shipping "select count(*) from ec_orders_shippable where shipping_method='standard'"]
+set n_express_to_ship [db_string express_shipping "select count(*) from ec_orders_shippable where shipping_method='express'"]
doc_body_append "
Orders ($n_o_in_last_24_hours in last 24 hours; $n_o_in_last_7_days in last 7 days)
@@ -86,6 +86,10 @@