Index: openacs-4/packages/ecommerce/tcl/ecommerce-credit-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/tcl/ecommerce-credit-procs-postgresql.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/ecommerce/tcl/ecommerce-credit-procs-postgresql.xql 16 Jul 2001 04:12:04 -0000 1.2 +++ openacs-4/packages/ecommerce/tcl/ecommerce-credit-procs-postgresql.xql 16 Jul 2001 20:07:06 -0000 1.3 @@ -8,7 +8,7 @@ select ec_order_cost(:order_id) as total_amount, creditcard_id, - case when extract(day from current_timestamp - confirmed_date) > 1 then 0 when extract(hour from current_timestamp - confirmed_date)/24 < 0.95 then 1 else 0 end as youth + case when now() - confirmed_date < timespan_days(0.95) then 1 else 0 end as youth from ec_orders where order_id = :order_id @@ -21,7 +21,7 @@ select transaction_amount as total_amount, creditcard_id, - case when extract(day from current_timestamp - inserted_date) > 1 then 0 when extract(hour from current_timestamp-inserted_date)/24 < 0.95 then 1 else 0 end as youth + case when now() - inserted_date < timespan_days(0.95) then 1 else 0 end as youth from ec_financial_transactions where transaction_id = :transaction_id @@ -42,7 +42,7 @@ - select to_char(:n_hours_to_add / 24 + to_date(:the_date, 'YYYY-MM-DD HH24:MI:SS'), 'YYYYMMDDHH24MISS') + select to_char(timespan_days(:n_hours_to_add/24::float) + to_date(:the_date, 'YYYY-MM-DD HH24:MI:SS'), 'YYYYMMDDHH24MISS') Index: openacs-4/packages/ecommerce/tcl/ecommerce-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/tcl/ecommerce-procs-postgresql.xql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/ecommerce/tcl/ecommerce-procs-postgresql.xql 15 Jul 2001 17:01:28 -0000 1.5 +++ openacs-4/packages/ecommerce/tcl/ecommerce-procs-postgresql.xql 16 Jul 2001 20:07:06 -0000 1.6 @@ -49,7 +49,7 @@ - select case when current_timestamp-available_date > 0 then 1 when current_timestamp-available_date is NULL then 1 else 0 end as available_p, + select case when current_timestamp > available_date then 1 when current_timestamp-available_date is NULL then 1 else 0 end as available_p, color_list, size_list, style_list, no_shipping_avail_p from ec_products where product_id = :product_id Index: openacs-4/packages/ecommerce/tcl/ecommerce-scheduled-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/tcl/ecommerce-scheduled-procs-postgresql.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/ecommerce/tcl/ecommerce-scheduled-procs-postgresql.xql 16 Jul 2001 04:12:04 -0000 1.2 +++ openacs-4/packages/ecommerce/tcl/ecommerce-scheduled-procs-postgresql.xql 16 Jul 2001 20:07:06 -0000 1.3 @@ -9,7 +9,7 @@ select order_id, ec_order_cost(order_id) as total_order_price from ec_orders where order_state = 'confirmed' - and (current_timestamp - confirmed_date) > 1/96 + and (current_timestamp - confirmed_date) > timespan_days(1/96::float) @@ -34,7 +34,7 @@ from ec_gift_certificates g, ec_financial_transactions t where g.gift_certificate_id=t.gift_certificate_id and g.gift_certificate_state = 'confirmed' - and (current_timestamp - g.issue_date) > 1/96 + and (current_timestamp - g.issue_date) > timespan_days(1/96::float) @@ -66,7 +66,7 @@ - update ec_orders set order_state='expired', expired_date=current_timestamp where order_state='in_basket' and current_timestamp-in_basket_date > [util_memoize {ad_parameter -package_id [ec_id] CartDuration ecommerce} [ec_cache_refresh]] + update ec_orders set order_state='expired', expired_date=current_timestamp where order_state='in_basket' and current_timestamp-in_basket_date > timespan_days([util_memoize {ad_parameter -package_id [ec_id] CartDuration ecommerce} [ec_cache_refresh]]::float) @@ -83,7 +83,7 @@ select transaction_id, order_id from ec_financial_transactions where to_be_captured_p='t' - and current_timestamp-to_be_captured_date > 1/48 + and current_timestamp-to_be_captured_date > timespan_days(1/48::float) and authorized_date is null and failed_p='f' @@ -162,7 +162,7 @@ - select case when extract(day from (current_timestamp-marked_date)) >= 2 then 1 else 0 end from ec_financial_transactions where transaction_id=:transaction_id + select case when marked_date + '2 days'::interval < now() then 1 else 0 end from ec_financial_transactions where transaction_id=:transaction_id @@ -184,7 +184,7 @@ select transaction_id, order_id from ec_financial_transactions where transaction_type='refund' - and current_timestamp - inserted_date > 1/48 + and current_timestamp - inserted_date > timespan_days(1/48::float) and refunded_date is null and failed_p='f' @@ -227,7 +227,7 @@ - select case when extract(day from (current_timestamp-marked_date)) >= 2 then 1 else 0 end from ec_financial_transactions where transaction_id=:transaction_id + select case when refunded_date + '2 days'::interval < now() then 1 else 0 end from ec_financial_transactions where transaction_id=:transaction_id