valley Posted November 23, 2003 Posted November 23, 2003 Hello Can someone using the UK VAT summary please help. The original contribution seems to assumes SORT ORDERS in the ORDERs_TOTAL table and default currency of GBP sort order 1-tax sort order 2- shipping cost sort order 3-Subtotal I have a different Sort order and use USD as the default currency sort order 3-tax sort order 2- shipping cost sort order 1-Subtotal Though by switching the sort order in the Querry building the TAX table I get the table right and the Tax amount(number) right, the Values shown in ? are wrong tep_db_query("INSERT INTO " . ORDERS_TEMP . " (orders_id, date_purchased, customers_name, customers_country, orders_status, currency, currency_value, text, sort_order) SELECT orders.orders_id, orders.date_purchased, orders.customers_name, orders.customers_country, orders.orders_status, orders.currency, orders.currency_value, orders_total.text, orders_total.sort_order FROM " . TABLE_ORDERS . ", orders_total WHERE orders.orders_id = orders_total.orders_id and orders.date_purchased > '" . $start_year. "-" . $start_date . " 00:00:00' and orders.date_purchased < '" . $end_year. "-" . $end_date . " 00:00:00'"); $sel_tax_1 = tep_db_query("select orders_id, date_purchased, customers_name, customers_country, orders_status, currency, currency_value, text from " . ORDERS_TEMP . " where sort_order = 3 order by orders_id asc"); $sel_tax_2 = tep_db_query("select orders_id, text from " . ORDERS_TEMP . " where sort_order = 2 order by orders_id asc"); $sel_tax_3 = tep_db_query("select orders_id, text from " . ORDERS_TEMP . " where sort_order = 1 order by orders_id asc"); The table get United Kingdom Order No. Purchase Date Customers Name Customers Country Original Currency VAT Amount Shipping Cost Total (pre tax/shipping) 51 2003-07-05 06:48:44 United Kingdom GBP ?4.63 ?8.00 ?24.00 52 2003-07-07 15:33:20 United Kingdom GBP ?5.14 ?8.00 ?24.00 55 2003-07-10 02:15:35 United Kingdom GBP ?2.23 ?8.00 ?57.28 66 2003-07-24 04:54:47 United Kingdom USD ?6.90 ?8.00 ?24. ++++++++++++++++++++++++++++++ If anyone is familiar with this contribution, I would apptreciate any help to get this great contribution working Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.