Guest Posted June 3, 2004 Posted June 3, 2004 Hi All, I am using the Intracom VAT software and fingers crossed its working well.... The only problem is that the customers vat number does not appear in the invoice (catalog/admin/invoice.php) , is there a command (a line ) I could put in for this to appear? Many Thanks in Advance Chris.
JeanLuc Posted June 8, 2004 Posted June 8, 2004 Hi Happy to know that many people are using my contribution... Hope it will be usefull. For having the shop intracom. VAT number in the invoice, don't forget to do the changes in the file as explained in the install.txt file, especially: ================== In admin/Invoice.php Replace (around line 54): <td class="main"><?php echo tep_address_format($order->customer['format_id'], $order->customer, 1, '', '<br>'); ?></td> By: <!--BOF for VAT INTRACOM_v3.3 //--> <td class="main"><?php echo tep_address_format($order->billing['format_id'], $order->billing, 1, '', '<br>'); ?></td> <!-- EOF for TVA_INTRACOM_v3.3 //--> Regards. JeanLuc OsC: MS2
helohelo Posted June 8, 2004 Author Posted June 8, 2004 PS I have already added a tax zone and added all countries in the EU tax zone I am or was presuming that this worked like this registered vat number reconised turn off tax, simple! no valid registered vat number keep taxes as they are :) Andrew yes thats the way it works Andrew! Keesjan
Stefan De Posted June 22, 2004 Posted June 22, 2004 I have installed the contributions and it work great. I only have a problem with the shipping cost. I'm using a shipping modul with zones and tax. Sub-Total: 100,00 EUR Shipping cost: 11,26 EUR + Vat 16 %: 1,80 EUR ---------------------------------- Total: 113,06 EUR It's not correct that it computes the Vat for the shipping cost. Have sombody an idea? Thanks Stefan
meandrew Posted June 22, 2004 Posted June 22, 2004 I have only just noticed this too and cant work out how to turn off the vat for shipping is this supposed to happen I am sure its not Andrew
JeanLuc Posted June 28, 2004 Posted June 28, 2004 I have installed the contributions and it work great.I only have a problem with the shipping cost. I'm using a shipping modul with zones and tax. Sub-Total: 100,00 EUR Shipping cost: 11,26 EUR + Vat 16 %: 1,80 EUR ---------------------------------- Total: 113,06 EUR It's not correct that it computes the Vat for the shipping cost. Have sombody an idea? Thanks Stefan For not having VAT on shipping cost if the conditions about VAT intracom are OK: in catalog/includes/modules/order_total/ot_shipping.php, find these two lines (about 52): $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']); and replace them by: // BOF for TVA_intracom_v3.4 if ($order->billing['company'] != '' && $order->billing['tva_intracom'] != '' && $order->billing['country']['id'] != STORE_COUNTRY && $order->delivery['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 Just be carefull and check if it's OK but I think it is: it's just put the VAT on shipping as '0'. enjoy... :) JeanLuc OsC: MS2
meandrew Posted July 1, 2004 Posted July 1, 2004 Thanks Jean Luc I think that this is working as you have posted it, I have just run a couple of checks and its seems great, no vat on the shipping there is a slight anomoly which I believe maybe due to zones as the uk shipping wasn't switch off when the country was only referencing a zone which couls mean I have to create more zones I am sure it is something simple... On a different note the EU VAT checking website is down, presumably there is nothing we can do about this, that is unless they have chnaged address or blocked an ip address, do they mind us feeding into their vat checker? Very Best wishes Andrew
meandrew Posted July 1, 2004 Posted July 1, 2004 the europa site has come back to life again so now the checking continues, maybe a nice little check in cases when the checker site isn't available would be nice. I'll see what I can come up with... it obviously needs to allow the check to continue if the site is live but if the check continues we could trust the account creator and then check it their number again later in the admion when the site is back up and running, any ideas? Andrew
JeanLuc Posted July 1, 2004 Posted July 1, 2004 I'll see what I can come up with... it obviously needs to allow the check to continue if the site is live but if the check continues we could trust the account creator and then check it their number again later in the admion when the site is back up and running, any ideas? The simple solution is change the message displayed when the site is out. This message is located in catalog/includes/languages/english.php and admin/includes/languages/english.php: Find this: define('ENTRY_NO_VERIF_TVA_INTRACOM', 'Impossible to check your VAT number: leave it empty'); and change it with (for exemple): define('ENTRY_NO_VERIF_TVA_INTRACOM', 'Impossible to check your VAT number: leave it empty for the moment. Add your VAT number in comment when you order (Payment Information in Checkout Procedure).'); Sorry for my English... JLuc JeanLuc OsC: MS2
meandrew Posted July 2, 2004 Posted July 2, 2004 Hi JeanLuc the problem wasn't with this error display message, yesterday we were getting the couln't connect to the selected soc and more of an ugly php error at the top of the page, lets hope their site can handle the volume of trafic heading their way ;) On a different topic the registered country of the shop will allow for a vat number of that country to be register from outside of that country! I am not sure of the implicatins of this but it suddenly occurred to me when I was checking the on / off vat with our uk vat number for various other EU countries. Of course it will easily be spotted when this happens so no real reason to worry. Also I may have mention that the UK vat wouldn't turn off. Now I realsie that I dont want the UK vat turned off even if a valid vat number is supplied :) was this built in the recognise the country of the shop owner to not turn off vat from that country. Looks like everything is fine now Best wishes Andrew
JeanLuc Posted July 5, 2004 Posted July 5, 2004 On a different topic the registered country of the shop will allow for a vat number of that country to be register from outside of that country! I am not sure of the implicatins of this but it suddenly occurred to me when I was checking the on / off vat with our uk vat number for various other EU countries. Of course it will easily be spotted when this happens so no real reason to worry. Also I may have mention that the UK vat wouldn't turn off. Now I realsie that I dont want the UK vat turned off even if a valid vat number is supplied :) was this built in the recognise the country of the shop owner to not turn off vat from that country. What do you mean? Could you explain? the registered country of the shop will allow for a vat number of that country to be register from outside of that countryWhat is the pb? when I was checking the on / off vat with our uk vat number for various other EU countriesI don't understand... :unsure: Also I may have mention that the UK vat wouldn't turn offDo you mean that UK would give up the VAT number system??? :wacko: Sure it's my english .... :unsure: JeanLuc OsC: MS2
meandrew Posted July 5, 2004 Posted July 5, 2004 Hi JeanLuc I will try to explain more slowly, I may be incorrect on the first point I hope I am not. If your shop is in the UK and you have this cool vat mod turned on, (it only works if you have a valid vat number- am I right on this point?) then the vat stays ON for your country regardless if someone in your own country supplies a valid vat number? I think this is what is happening, and I hope so :) 2nd point anywhere outside the shops country and anywhere where we have nominated countries to turn the vat off if a valid vat number is given any vat number can be used regardless of country. does that make sense? I will be rigorously testing our system next week so fingers crossed :) Andrew
JeanLuc Posted July 6, 2004 Posted July 6, 2004 2nd point anywhere outside the shops country and anywhere where we have nominated countries to turn the vat off if a valid vat number is given any vat number can be used regardless of country. Understood (I hope so.... ^_^ ) You're right. The checking of the vat number doesn't care about the country the customer choose. It just checked if it is a valid vat number in the EU. For exemple, with the vat number checking turn on, a french company (country = France) can type a valid english vat number... I try to fix that... Regards. Jean-Luc JeanLuc OsC: MS2
JeanLuc Posted July 6, 2004 Posted July 6, 2004 Because I'm working at the moment on the update of the contribution, I found a pb when the customer enters the VAT number in lower case (especially the first letters...), the ckecking returns false. If you don't want that, replace in: admin/customers.php catalog/create_account.php catalog/address_book_process.php catalog/checkout_shipping_address.php catalog/checkout_payment_address.php catalog/account_edit.php the folowing line: $result_tva = tep_verif_tva(rtrim($tva_intracom)); by this one: $result_tva = tep_verif_tva(strtoupper(rtrim($tva_intracom))); enjoy... :) JeanLuc OsC: MS2
JeanLuc Posted July 6, 2004 Posted July 6, 2004 Take care about admin/customers.php, the variable is not the same as the others, so there, replace $result_tva = tep_verif_tva(rtrim($entry_tva_intracom)); by $result_tva = tep_verif_tva(strtoupper(rtrim($entry_tva_intracom))); JeanLuc OsC: MS2
JeanLuc Posted July 8, 2004 Posted July 8, 2004 New version of the contribution: E.U. VAT Intracom Number 3.9 New functionality for this update: this version check if the vat number entered by the customer correspond to his country. For those who had already intalled previous version, there is an "update.txt" file which explain the steps of the modifications. enjoy. JeanLuc OsC: MS2
mx5gr Posted July 12, 2004 Posted July 12, 2004 We experience the following issue after installing v3.82 and then upgrading to 3.9. When a new user tries to register (create_account.php), when all fields are completed (irrespective if company name and EU VAT number have been entered), we get the following popup: Error: a runtime error has occured Line: 91 Error: 'company' is undefined And immediately after: Query was empty - Query was empty Query was empty [TEP STOP] We get the same results in address_book_process.php, but without the TEP STOP errors. We double checked the code mod and it is as the instructions imply. Where should we check for a possible error?
JeanLuc Posted July 19, 2004 Posted July 19, 2004 Error: a runtime error has occuredLine: 91 Error: 'company' is undefined There is an error in the add in catalog/includes/form_check.js.php In the install.txt file , it is said to add this code: <!--BOF for VAT INTRACOM_v3.3 //--> function check_company(field_name, field_size, message) { if ( form.elements[company].value != '' && form.elements[field_name].value < field_size ) { ? ? ? ?error = true; ?error_message = error_message + "* " + message + "\n"; } } <!-- EOF for TVA_INTRACOM_v3.3 //--> In fact you must replace it by this code (I replaced "company" by "field_name"): <!--BOF for VAT INTRACOM_v3.3 //--> function check_company(field_name, field_size, message) { if ( form.elements[field_name].value != '' && form.elements[field_name].value < field_size ) { ? ? ? ?error = true; ?error_message = error_message + "* " + message + "\n"; } } <!-- EOF for TVA_INTRACOM_v3.3 //--> I put an update... <_< JeanLuc OsC: MS2
JeanLuc Posted July 21, 2004 Posted July 21, 2004 Because of a change in the cgi-bin (or something else...) in the europa.eu.int site (the checking site of the VAT n?), the automatic checking of the VAT number is not available anymore.... That circumstance was not planned... <_< To solve the problem for the moment, we have to change the condition of display of the error message in both catalog/includes/functions/validations.php and catalog/admin/includes/functions/validations.php, change these lines (in tep_verif_tva function): if (is_string($verif)) { $str = str_replace("\n", "", $verif); preg_match('/<\/form> *(Oui|Non)/i', $str, $a); if ($a[1] == 'Oui') { return 'true'; } else { return 'false'; } } else { return 'no_verif'; // no check available } with these lines : if (is_string($verif)) { $str = str_replace("\n", "", $verif); preg_match('/<\/form> *(Oui|Non)/i', $str, $a); if ($a[1] == 'Oui') { return 'true'; } elseif ($a[1] == 'Non'){ return 'false'; } else { return 'no_verif'; // no check available } } else { return 'no_verif'; // no check available }[/ With those changes, we have an error message displayed even the answer of the europa site is not "Oui" or "Non". I 'm putting an update of the contribution. It's an emergency solution but I send a call for people who know better than me the cgi-bin pb to try solving this trouble... JeanLuc OsC: MS2
helohelo Posted July 21, 2004 Author Posted July 21, 2004 mmm, thanks jean Luc, The Eu gives us more problems then solutions isn't it? If you can find a solution, please post it here! Keesjan
helohelo Posted July 21, 2004 Author Posted July 21, 2004 I've found a solution for the tax calculation being based in the shipping address instead of the billing address! :D In the catalog/includes/classes/order.php find the $tax_address_query replace it by the $billing_address_query (find it a couple of lines before). In the following line: $billing_address = tep_db_fetch_array($tax_address_query); replace it by: $billing_address = tep_db_fetch_array($billing_address_query); And that's it! You now have the tax calculated according to the billing address. With this canhge and the alterations made by JeanLuc this should work fine for the EU VAT rules. Jean luc, is this implimented in the last version? This is importent according to my tax foreign acency in the Netherlands: when Philips HonkKong buy my service and its shipped to Philips Belgium, the vat rules from belguim are applied, so shipping adress is more importent to calculate VAT then teh billing adress Keesjan
JeanLuc Posted July 21, 2004 Posted July 21, 2004 This is not implemented in the last version... Do it by your own.... :) JeanLuc OsC: MS2
helohelo Posted July 21, 2004 Author Posted July 21, 2004 Because of a change in the cgi-bin (or something else...) in the europa.eu.int site (the checking site of the VAT n?), the automatic checking of the VAT number is not available anymore.... At http://europa.eu.int/comm/taxation_customs...vies.htm#item16 the still investigate the possibility of an open interface. Till then we have to tri other things... Any one that now how the get the good things to http://www.europa.eu.int/comm/taxation_cus...en/vieshome.htm to verify the VAT? Keesjan
helohelo Posted July 21, 2004 Author Posted July 21, 2004 Jean Luc, it has to do with the ISO country prefix: from the form http://www.europa.eu.int/comm/taxation_cus...en/vieshome.htm there are now 2 text inputs importent: <input type="text" size="2" maxlength="2" name="ISO" readonly="readonly" onFocus="setTimeout('document.myform.ISO.blur()',1);" value="---" style ="bottom:auto; background:#FFFFFFF; border: #FFFFFFF"> <input type="text" size="20" maxlength="12" name="VAT"> Now its yust one: vat, should be devided in 2 ISO and vatnumber. when keeping the same ISO select form as on the eu form also the wrong type of upper, lower case things will be skipt. <form action="/comm/taxation_customs/vies/cgi-bin/viesquer" method="post" onsubmit="return check_fields(this)" name="myform"> <input type="hidden" name="Lang" value="EN"> <table align="center" border="0" width="70%" size="0"> <tr> <td width="20%"><font face="Verdana" size="2">Member State</td> <td width="50%" align="left"> <font face="Verdana" size="2"> <select name="MS" onChange="MS_change();"><option value="">----------</option> <option value="AT">AT-Austria</option> <option value="BE">BE-Belgium</option> <option value="CY">CY-Cyprus</option> <option value="CZ">CZ-Czech Republic</option> <option value="DE">DE-Germany</option> <option value="DK">DK-Denmark</option> <option value="EE">EE-Estonia</option> <option value="EL">EL-Greece</option> <option value="ES">ES-Spain</option> <option value="FI">FI-Finland</option> <option value="FR">FR-France </option> <option value="GB">GB-United Kingdom</option> <option value="HU">HU-Hungary</option> <option value="IE">IE-Ireland</option> <option value="IT">IT-Italy</option> <option value="LT">LT-Lithuania</option> <option value="LU">LU-Luxembourg</option> <option value="LV">LV-Latvia</option> <option value="MT">MT-Malta</option> <option value="NL">NL-The Netherlands</option> <option value="PL">PL-Poland</option> <option value="PT">PT-Portugal</option> <option value="SE">SE-Sweden</option> <option value="SI">SI-Slovenia</option> <option value="SK">SK-Slovakia</option> </select> </td> </tr> <tr> <td width="20%"><font face="Verdana" size="2">VAT Number</td> <td width="50%" align="left"> <font face="Verdana" size="2"> <input type="text" size="2" maxlength="2" name="ISO" readonly="readonly" onFocus="setTimeout('document.myform.ISO.blur()',1);" value="---" style ="bottom:auto; background:#FFFFFFF; border: #FFFFFFF"> <input type="text" size="20" maxlength="12" name="VAT"> </td> </tr> <tr> <td width="20%"><font face="Verdana" size="2">Current Date</td> <td width="50%" align="left"> <font face="Verdana" size="2"> <script>printCurrentDate();</script>(dd/mm/yyyy) </td> </tr> <tr> <td> </td> </tr> <tr> <td colspan="2" align="center"> <font face="Verdana" size="2"> <input type="Submit" value="Verify"> </td> </tr> </table> </form> Keesjan
JeanLuc Posted July 21, 2004 Posted July 21, 2004 There is no change with the previous form.... The pb is not in the source code but with the cgi program... :( JeanLuc OsC: MS2
Recommended Posts
Archived
This topic is now archived and is closed to further replies.