osCmax v2.5 User Manual
Results 1 to 7 of 7

Tax Display

This is a discussion on Tax Display within the osCommerce 2.2 Installation Help forums, part of the osCommerce 2.2 Forums category; With 'Display prices with tax' set to true then the prices displayed correctly include tax (VAT). With 'Display prices with ...

      
  1. #1
    Member
    Join Date
    Aug 2003
    Location
    Southampton UK
    Posts
    63
    Rep Power
    0


    Default Tax Display

    With 'Display prices with tax' set to true then the prices displayed correctly include tax (VAT). With 'Display prices with tax' set to false the prices correctly exclude tax, but the tax should be identified during the order process and this doesn't work.

    In 'Administration | Modules | Order Total' I have checked that 'Tax' is installed.

    The entries in my tables are as follows:

    products
    tax_class_id=2

    tax_class:
    tax_class_id=2
    tax_class_title=VAT
    (2 records)

    tax_rates:
    tax_class_id=2
    tax_rate=17.5
    tax_description=Value Added Tax
    tax_zone_id=1
    (2 records)

    zones
    zone_id=1
    zone_country_id=222
    zone_name=United Kingdom
    (1 record)

    zone_to_geo_zones:
    zone_id=1
    zone_country_id=222
    geo_zone_id=1
    (239 records - all other zone_id's=0)

    geo_zones:
    geo_zone_id=1
    geo_zone_name=Europe(17.5%)
    (2 records)


    Therefore:
    products.tax_class_id = tax_class.tax_class_id = tax_rates.tax_class_id = 2 (VAT)
    tax_rates.tax_rates_id = zone.zones_id = zone_to_geo_zones.zone_id = 1 (UK)
    zone_to_geo_zones.geo_zone_id = geo_zones.geo_zone_id = 1 (Europe)

    Can anyone advise what else I should check please to get the tax to display at checkout?

  2. #2
    Member
    Join Date
    Aug 2003
    Location
    Southampton UK
    Posts
    63
    Rep Power
    0


    Default

    I tried changing the zero rating to 1% just incase it was reading the wrong tax %age, but no tax values showed.

    I've had a look in checkout_confirmation.php and I think the product quantity and tax etc are stored in the 'products' array:

    $order->products[$i]['tax']

    Can someone remind me what C++/Java style syntax '->' means?
    I believe it's returning the 'products' array from the 'order' class with the class 'order'.

    I've confirmed with some debugging code that the value in products[$i]['tax'] = 0%

    and:

    $order->products[$i]['tax_description'] = Unknown tax rate %

    $order->products[$i]['tax_class_id'] = %


    "Unknown tax rate" is returned by the function tep_get_tax_description() in general.php
    Code:
      function tep_get_tax_description($class_id, $country_id, $zone_id) {
        $tax_query = tep_db_query("select tax_description from " . TABLE_TAX_RATES . " tr left join " . TABLE_ZONES_TO_GEO_ZONES . " za on (tr.tax_zone_id = za.geo_zone_id) left join " . TABLE_GEO_ZONES . " tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '" . (int)$country_id . "') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '" . (int)$zone_id . "') and tr.tax_class_id = '" . (int)$class_id . "' order by tr.tax_priority");
        if (tep_db_num_rows($tax_query)) {
          $tax_description = '';
          while ($tax = tep_db_fetch_array($tax_query)) {
            $tax_description .= $tax['tax_description'] . ' + ';
          }
          $tax_description = substr($tax_description, 0, -3);
    
          return $tax_description;
        } else {
          return TEXT_UNKNOWN_TAX_RATE;
        }
      }

  3. #3
    Member
    Join Date
    Aug 2003
    Location
    Southampton UK
    Posts
    63
    Rep Power
    0


    Default

    If I copy the following sql to PhpMyadmin then I correctly get 1 record returned which is "Value added tax"
    Code:
    select tax_description from tax_rates as tr left join zones_to_geo_zones as za on (tr.tax_zone_id = za.geo_zone_id) left join geo_zones as tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '222') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '1') and tr.tax_class_id = '2' order by tr.tax_priority
    How can I check that, in building the products array in the orders class, the correct parameters are being used for:
    $products[$i]['tax_class_id']
    $tax_address['entry_country_id']
    $tax_address['entry_zone_id']

  4. #4
    Member
    Join Date
    Aug 2003
    Location
    Southampton UK
    Posts
    63
    Rep Power
    0


    Default

    I've added the contribution 'VAT Price Incl and Excl' and set 'Display prices with tax' to true and it now works.

  5. #5
    Member
    Join Date
    Aug 2003
    Location
    Southampton UK
    Posts
    63
    Rep Power
    0


    Default

    Still not working for Admin | Customers | Orders, tax appears as 0%!

  6. #6
    jpf
    jpf is offline
    osCMax Testing Team
    jpf's Avatar
    Join Date
    Sep 2003
    Location
    Manitoba, Canada
    Posts
    2,699
    Rep Power
    22


    Default

    I would reinstall a fresh copy of your version of OSC. It works out of the box just fine. There may have been something you added/changed/modified that BROKE this.
    JPF - osCMax Fourm Moderator - To contact, post on the forum or click here
    Try out our osCMax at: Live Catalog Demo
    Limited access Admin: Live Admin Demo
    Feel free to add products they way you want and then purchase them -=+=- Sorry nothing will be billed or shipped!

  7. #7
    Member
    Join Date
    Aug 2003
    Location
    Southampton UK
    Posts
    63
    Rep Power
    0


    Default

    I've solved it!

    The prices inc and ex VAT were being calculated correctly before customer login, but once logged in then the inc and ex VAT prices were the same (ie 0% tax). I found that because I had changed the zone details etc after having created an account, the value in the entry_zone_id field in the address_book table was incorrect, and once changed to the correct zone value then it worked ok.

Similar Threads

  1. X-sell display
    By spurs20 in forum osCommerce 2.2 Modification Help
    Replies: 1
    Last Post: 08-09-2005, 09:44 AM
  2. no display at all after install
    By kellycog61 in forum osCommerce 2.2 Installation Help
    Replies: 1
    Last Post: 07-18-2005, 07:56 AM
  3. Help! How to display the percentage value?
    By lolamery in forum osCommerce 2.2 Modification Help
    Replies: 0
    Last Post: 05-20-2005, 02:06 AM
  4. New Products Display
    By warrenthewindmill in forum osCmax v1.7 Discussion
    Replies: 1
    Last Post: 11-22-2003, 02:45 PM
  5. Tax (U.K. VAT) display both
    By byson in forum osCommerce 2.2 Modification Help
    Replies: 0
    Last Post: 03-28-2003, 04:36 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •