Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

TVA intracom no VAT showing for EU companies


karinha

Recommended Posts

Hi everybody!

 

I have successfully installed the TVA intracom_v5 in order to check the VAT number and to be able to differentiate between companies located inside the EU, but outside the store's country and companies situated in the store country.

The contribution works fine in terms of checking the VAT number, but I can't figure out how to make the price shown without tax for the companies in the EU, but (in my case) outside of France. I did everything the way it is explained in the installation file (as far as I know off and I understood. I DID uncomment the lines in the two files: catalog/includes/classes/order.php and catalog/includes/modules/order_total/ot_shipping.php, but nothing is happening.

 

Now my question, do I also need to set up an extra taxzone for those companies with zero tax rate? If yes how exactly do I do that step by step? I thought the contribution automatically charges 0 tax for the companies with VAT. I don't need to set the "check the Intracom VAT number" set on true in order for it to work, or do I? I don't know any real VAT number I could put in there and how else could i check, if it is showing prices without tax?

 

Can anybody please solve this mystery for me???

 

Thanks a lot in advance!

Link to comment
Share on other sites

Actually I today completed the exact thing that you appear to be asking for.

 

The changes I made where in the two files that you mentioned.

 

in catalog/includes/classes/orders.php around line 222:

I changed

       $this->products[$index] = array('qty' => $products[$i]['quantity'],
                                       'name' => $products[$i]['name'],
                                       'model' => $products[$i]['model'],
                                       'tax' => tep_get_tax_rate($products[$i]['tax_class_id'], $tax_address['entry_country_id'], $tax_address['entry_zone_id']),
                                       'tax_description' => tep_get_tax_description($products[$i]['tax_class_id'], $tax_address['entry_country_id'], $tax_address['entry_zone_id']),
                                       'price' => $products[$i]['price'],
                                       'final_price' => $products[$i]['price'] + $cart->attributes_price($products[$i]['id']),
                                       'weight' => $products[$i]['weight'],
                                       'id' => $products[$i]['id']);

into

         if ( $this->billing['company'] != ''
           && $this->billing['tva_intracom'] != ''
           && $this->billing['country']['id'] != STORE_COUNTRY) {
       $this->products[$index] = array('qty' => $products[$i]['quantity'],
                                       'name' => $products[$i]['name'],
                                       'model' => $products[$i]['model'],
                                       'tax' => 0,
                                       'tax_description' => NO_TAX,
                                       'price' => $products[$i]['price'],
                                       'final_price' => $products[$i]['price'] + $cart->attributes_price($products[$i]['id']),
                                       'weight' => $products[$i]['weight'],
                                       'id' => $products[$i]['id']);

         } else {
       $this->products[$index] = array('qty' => $products[$i]['quantity'],
                                       'name' => $products[$i]['name'],
                                       'model' => $products[$i]['model'],
                                       'tax' => tep_get_tax_rate($products[$i]['tax_class_id'], $tax_address['entry_country_id'], $tax_address['entry_zone_id']),
                                       'tax_description' => tep_get_tax_description($products[$i]['tax_class_id'], $tax_address['entry_country_id'], $tax_address['entry_zone_id']),
                                       'price' => $products[$i]['price'],
                                       'final_price' => $products[$i]['price'] + $cart->attributes_price($products[$i]['id']),
                                       'weight' => $products[$i]['weight'],
                                       'id' => $products[$i]['id']);
         }

basically saying that if this is a company based outside of the store country forget about the tax calculation for this product and set it to 0

 

The other change is similar but different and mentioned in other threads on this forum.

 

in catalog/includes/modules/order_total/ot_shipping.php around line 52:

I changed

           $shipping_tax = tep_get_tax_rate($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
           $shipping_tax_description = tep_get_tax_description($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);

into

         // BOF for TVA_intracom_v3.4
         if ( $order->billing['company'] != ''
           && $order->billing['tva_intracom'] != ''
           && $order->billing['country']['id'] != STORE_COUNTRY) {
           $shipping_tax = 0;
           $shipping_tax_description = NO_TAX;
         } else {
         // EOF for TVA_intracom_v3.4
           $shipping_tax = tep_get_tax_rate($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
           $shipping_tax_description = tep_get_tax_description($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
         // BOF for TVA_intracom_v3.4
         }
         // EOF for TVA_intracom_v3.4

 

note: *I love subversion*

 

Anyway....

Other changes I made where relevant to the combination of shipping module/tax zone which made me create just 1 tax zone and specify some various geo zones. But I guess this is something you';ll have to look at for your particular case.

The thing is that the tax calculating function might still calculate the wrong tax but it would also have done this without the change I suggest, this change only takes out the taxes for the specific case you describe.

 

Hope this helps?

 

ps, if the shipping needs to include the taxes in the case you specified then don't change the second file...

Link to comment
Share on other sites

Actually I today completed the exact thing that you appear to be asking for.

 

The changes I made where in the two files that you mentioned.

 

in catalog/includes/classes/orders.php around line 222:

I changed

       $this->products[$index] = array('qty' => $products[$i]['quantity'],
                                       'name' => $products[$i]['name'],
                                       'model' => $products[$i]['model'],
                                       'tax' => tep_get_tax_rate($products[$i]['tax_class_id'], $tax_address['entry_country_id'], $tax_address['entry_zone_id']),
                                       'tax_description' => tep_get_tax_description($products[$i]['tax_class_id'], $tax_address['entry_country_id'], $tax_address['entry_zone_id']),
                                       'price' => $products[$i]['price'],
                                       'final_price' => $products[$i]['price'] + $cart->attributes_price($products[$i]['id']),
                                       'weight' => $products[$i]['weight'],
                                       'id' => $products[$i]['id']);

into

         if ( $this->billing['company'] != ''
           && $this->billing['tva_intracom'] != ''
           && $this->billing['country']['id'] != STORE_COUNTRY) {
       $this->products[$index] = array('qty' => $products[$i]['quantity'],
                                       'name' => $products[$i]['name'],
                                       'model' => $products[$i]['model'],
                                       'tax' => 0,
                                       'tax_description' => NO_TAX,
                                       'price' => $products[$i]['price'],
                                       'final_price' => $products[$i]['price'] + $cart->attributes_price($products[$i]['id']),
                                       'weight' => $products[$i]['weight'],
                                       'id' => $products[$i]['id']);

         } else {
       $this->products[$index] = array('qty' => $products[$i]['quantity'],
                                       'name' => $products[$i]['name'],
                                       'model' => $products[$i]['model'],
                                       'tax' => tep_get_tax_rate($products[$i]['tax_class_id'], $tax_address['entry_country_id'], $tax_address['entry_zone_id']),
                                       'tax_description' => tep_get_tax_description($products[$i]['tax_class_id'], $tax_address['entry_country_id'], $tax_address['entry_zone_id']),
                                       'price' => $products[$i]['price'],
                                       'final_price' => $products[$i]['price'] + $cart->attributes_price($products[$i]['id']),
                                       'weight' => $products[$i]['weight'],
                                       'id' => $products[$i]['id']);
         }

basically saying that if this is a company based outside of the store country forget about the tax calculation for this product and set it to 0

 

The other change is similar but different and mentioned in other threads on this forum.

 

in catalog/includes/modules/order_total/ot_shipping.php around line 52:

I changed

           $shipping_tax = tep_get_tax_rate($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
           $shipping_tax_description = tep_get_tax_description($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);

into

         // BOF for TVA_intracom_v3.4
         if ( $order->billing['company'] != ''
           && $order->billing['tva_intracom'] != ''
           && $order->billing['country']['id'] != STORE_COUNTRY) {
           $shipping_tax = 0;
           $shipping_tax_description = NO_TAX;
         } else {
         // EOF for TVA_intracom_v3.4
           $shipping_tax = tep_get_tax_rate($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
           $shipping_tax_description = tep_get_tax_description($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
         // BOF for TVA_intracom_v3.4
         }
         // EOF for TVA_intracom_v3.4

 

note: *I love subversion*

 

Anyway....

Other changes I made where relevant to the combination of shipping module/tax zone which made me create just 1 tax zone and specify some various geo zones. But I guess this is something you';ll have to look at for your particular case.

The thing is that the tax calculating function might still calculate the wrong tax but it would also have done this without the change I suggest, this change only takes out the taxes for the specific case you describe.

 

Hope this helps?

 

ps, if the shipping needs to include the taxes in the case you specified then don't change the second file...

 

Thanks a lot! That worked like a mirakle! I had anther code in my installation description, I don't know if I missed out on anything there; anyways great that its working now. the only thing it deducts the tax only at the very end and not already at the beginning in the catalog itself, but I guess i will have to live with that? Or is there a way to change it? My dream would be, that the customer (having a valid european Vat number other than my country) sees the prices without tax right after logging in in the whole catalog and not only when checking out. If there is a way to do so, I'd be happy for any suggestions!

 

Thanks a lot RwD for your quick help! You made my day!

 

:thumbsup: Karin

Link to comment
Share on other sites

I honestly hadn't really thought of changing it anywhere but in the checkout part so I wouldn't know how to do it at the other places you suggest. But I imagine that it is sort of the same change. You could try and search through your code for the tax rate function (tep_get_tax_rate). When you find that you are probably at the places that need the adjustment like the ones above.

 

Note: If you ask me osCommerce is not really well written, these things have to be changed at waaay to many places.

Offtopic: osCommerce also clutters up the variable space and I really dislike the use of the register variables function of which the priniciple is very unsafe when you have users contributing to your code.

Link to comment
Share on other sites

Thanks for your reply again! I think I will leave the way it is for the moment; my client seems to be ok with it. I do have another problem though: the tax is immediately dedacted from a French company and it should not deduct any tax from a French company! So what did I do wrong? <_<

 

Karinha

 

PS: Well regarding that i would never be able to programm anything like oscommerce, I really don't want to complain...and I can't judge anyways ;)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...