VAT check

Hello Eldy,

Right now VAT is checked through European VAT checker service. I am operating out of India, so do you know any VAT checker services available for India? and we can integrate that here?

Thanks

Hi mythri,

maybe this could help you find how, this is how I customize this.

In the file

/httpdocs/dolibarr/societe/class/societe.class.php

About line 2075 there are various entries, just try to edit one of them to meet your country, i did modify the ES line and it is working for me the way i like:

Good luck! :woohoo:

    /**
     *   Renvoi url de verification d'un identifiant professionnal
     *
     *   @param		int		$idprof         1,2,3,4 (Exemple: 1=siren,2=siret,3=naf,4=rcs/rm)
     *   @param 	Societe	$soc            Objet societe
     *   @return	string          		url ou chaine vide si aucune url connue
     *   TODO not in business class
     */
    function id_prof_url($idprof,$soc)
    {
        global $conf,$langs;

        if (! empty($conf->global->MAIN_DISABLEPROFIDRULES)) return '';

        $url='';

        if ($idprof == 1 && $soc->country_code == 'FR') $url='http://www.societe.com/cgi-bin/recherche?rncs='.$soc->idprof1;
        if ($idprof == 1 && $soc->country_code == 'GB') $url='http://www.companieshouse.gov.uk/WebCHeck/findinfolink/';
        if ($idprof == 1 && $soc->country_code == 'ES') $url='http://www.e-informa.es/servlet/app/portal/ENTP/screen/SProducto/prod/ETIQUETA_EMPRESA/nif/'.$soc->idprof1;

        if ($url) return '<a target="_blank" href="'.$url.'">['.$langs->trans("Check").']</a>';
        return '';
    }

By the way, I think you must type this in one of these lines for checking TIN, also changing the value FR, GB or ES by the one for INDIA ‘IN’

https://tinxsys.com/TinxsysInternetWeb/dealerControllerServlet?tinNumber=.$soc->idprof1;&searchBy=TIN&backPage=searchByTin_Inter.jsp’;

No, It didn’t work. I tried giving like this

if ($idprof == 1 && $soc->country_code == 'IN') $url='tinxsys.com/TinxsysInternetWeb/dealerCon...rServlet?tinNumber=.$soc->idprof1;&searchBy=TIN&backPage=searchByTin_Inter.jsp'.$soc->idprof1;

then like this

if ($idprof == 1 && $soc->country_code == 'IN') $url='tinxsys.com/TinxsysInternetWeb/dealerCon...rServlet?tinNumber=.$soc->idprof1;&searchBy=TIN&backPage=searchByTin_Inter.jsp';

But it again goes to european site itself. Not getting how to resolve this :unhappy:

I´m Sorry mythri :unhappy: , you are right dont know how did I test it, also I dont know a valid TIN to make a real test, but you try pasting this in your societe.class.php file, from 2059 to 2083, I did test it now, and seems to work, hope it helps.

But please be sure to backup before, im not programmer and can´t assure if this could bring any problem to your dolibarr, and remember, when you update dolibarr to a new version, maybe this will gone replacing by new files.

Special care, between 'and" must be '&searchBy=TIN&backPage=searchByTin_Inter.jsp"

Mark the changes in color at the bottom

[code]
/**
* Renvoi url de verification d’un identifiant professionnal
*
* @param int $idprof 1,2,3,4 (Exemple: 1=siren,2=siret,3=naf,4=rcs/rm)
* @param Societe $soc Objet societe
* @return string url ou chaine vide si aucune url connue
* TODO not in business class
*/
function id_prof_url($idprof,$soc)
{
global $conf,$langs;

    if (! empty($conf->global->MAIN_DISABLEPROFIDRULES)) return '';

    $url='';

    if ($idprof == 1 && $soc->country_code == 'FR') $url='http://www.societe.com/cgi-bin/recherche?rncs='.$soc->idprof1;
    if ($idprof == 1 && $soc->country_code == 'GB') $url='http://www.companieshouse.gov.uk/WebCHeck/findinfolink/';
    if ($idprof == 1 && $soc->country_code == 'ES') $url='https://tinxsys.com/TinxsysInternetWeb/dealerControllerServlet?tinNumber='.$soc->idprof1;

    if ($url) return '<a target="_blank" href="'.$url.'&searchBy=TIN&backPage=searchByTin_Inter.jsp">['.$langs->trans("Check").']</a>';
    return '';
}

/**[/code]

if ($idprof == 1 && $soc->country_code == ‘FR’) $url=‘http://www.societe.com/cgi-bin/recherche?rncs=’.$soc->idprof1;
if ($idprof == 1 && $soc->country_code == ‘GB’) $url=‘http://www.companieshouse.gov.uk/WebCHeck/findinfolink/’;
if ($idprof == 1 && $soc->country_code == ‘ES’) $url=‘https://tinxsys.com/TinxsysInternetWeb/dealerControllerServlet?tinNumber=’.$soc->idprof1;

    if ($url) return '<a target="_blank" href="'.$url.'[b][color=#008000]&searchBy=TIN&backPage=searchByTin_Inter.jsp[/color][/b]"\>['.$langs-\>trans("Check").']</a\>';
    return '';
}

hi, i am now testing the software and tweaked for Indian GST.
To check the GST number in india , i modified the contents in htdocs/societe/class/societe.class.php file .
i replaced the tinxsys.com reference to https://services.gst.gov.in/services/searchtp.

I replaced the following:

$url=‘http://www.tinxsys.com/TinxsysInternetWeb/dealerControllerServlet?tinNumber=’.$thirdparty->idprof1.’;&searchBy=TIN&backPage=searchByTin_Inter.jsp’;

with

$url=‘https://services.gst.gov.in/services/searchtp’;

It goes to the website and we have to enter the GST number manually to check .
But is there any way to automate this , for verification of GST number with a single click,

modified the contents in htdocs/societe/class/societe.class.php file .

I replaced the following:

$url=‘http://www.tinxsys.com/TinxsysInternetWeb/dealerControllerServlet?tinNumber=’.$thirdparty->idprof1.’;&searchBy=TIN&backPage=searchByTin_Inter.jsp’;

with

$url = ‘Request Rejected’.substr($strippedIdProf1,3,10);

it will autofill GST No