postgresql
7.1
select coalesce(sum(price_charged),0)
from ec_items
where item_id in ([join $item_id_list ", "])
select coalesce(sum(shipping_charged),0)
from ec_items
where item_id in ([join $item_id_list ", "])
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)
select ec_shipment_cost(:shipment_id)
select coalesce(sum(i.price_charged),0) - coalesce(sum(i.price_refunded),0)
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'
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_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)
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
update ec_financial_transactions
set authorized_date=current_timestamp
where transaction_id=:pgw_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)
select coalesce(shipping_charged, 0)
from ec_orders
where order_id = :order_id
select ec_tax(0, :order_shipping, :order_id)