select count(*)
from ec_shipments
where shipment_id=:shipment_id
select shipping_method
from ec_orders
where order_id=:order_id
select creditcard_id
from ec_orders
where order_id=:order_id
select shipping_method
from ec_orders
where order_id=:order_id
select coalesce(sum(price_charged),0)
from ec_items
where item_id in ([join $item_id_list ", "])
select count(*)
from ec_shipments
where order_id=:order_id
select coalesce(sum(shipping_charged),0)
from ec_items
where item_id in ([join $item_id_list ", "])
update ec_items
set item_state='shipped', shipment_id=:shipment_id
where item_id in ([join $item_id_list ", "])
select transaction_amount
from ec_financial_transactions
where order_id = :order_id
and to_be_captured_p is null
and authorized_date is not null
and transaction_type = 'charge'
select transaction_id
from ec_financial_transactions
where order_id=:order_id
and to_be_captured_p is null
and transaction_type = 'charge'
select count(*)
from ec_items
where order_id = :order_id
and item_state = 'to_be_shipped'
and item_id not in ([join $item_id_list ", "])
update ec_financial_transactions
set failed_p='t'
where transaction_id=:transaction_id