Closed IngeVanGemert closed 9 years ago
As stated, on the first page, I have not tested the code yet. I only updated it to the latest ZC release. I will try to make a test site this weekend.
I inserted a line in orders.php:
function zen_get_country_geo_zone_id($country_id){ global $db; $country_geo_zone_query = "select geo_zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where zone_country_id = '" . (int)$country_id . "' limit 1"; $country_geo_zone_id = $db->Execute($country_geo_zone_query); return $country_geo_zone_id->fields['geo_zone_id']; }
function zen_tva_geo_tax($tax_country_id, $billing_company, $billing_tva_intracom){ $tax_geo_zone_id = $this->zen_get_country_geo_zone_id($tax_country_id); if($tax_country_id == STORE_COUNTRY ) { return true; // store } if($tax_geo_zone_id == 0) { return true; // no geo-zone } if($tax_geo_zone_id != 0 && $billing_tva_intracom) return true; //added by me if($tax_geo_zone_id != 0 && !$billing_tva_intracom) { return true; // geo-zone & no vat } elseif(!$billing_company && !$billing_tva_intracom) { return false; // no vat } else { return false; } }
Installed in 1.5.4. A customer with a validated VAT number inside the EU, and outside the Shop country should not be charged VAT. At the moment this is not working, as there is VAT calculated in this case. This is the whole point of this mod. How can we fix it?