Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Need help with UK VAT Summary contribution


valley

Recommended Posts

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...