Modify to work with 1.4.0.1

tables 'sales_flat_order' and 'sales_flat_order_payment' do not exist in 1.4.0.1

Replaced those calls with tables 'sales_order' and 'sales_payment_transaction'