Merge branch 'develop'
This commit is contained in:
commit
eabed655f0
@ -79,7 +79,7 @@ $requests = array(
|
||||
"SET @sumSirene := (SELECT SUM(nbSirene) FROM jo.tabFJur);",
|
||||
"SELECT code, libelle, libelleCourt, (nbSirene/@sumSirene )*100 AS pourcentage
|
||||
FROM jo.tabFJur
|
||||
WHERE code>999 AND libelle <> ''
|
||||
WHERE code>999 AND libelle!='' AND anneeSuppr<1000
|
||||
ORDER BY pourcentage DESC;"
|
||||
),
|
||||
),
|
||||
|
@ -228,7 +228,7 @@ return array(
|
||||
array( 'var' => 'Situation', 'op' => 'SET', 'value' => ''),
|
||||
),
|
||||
),
|
||||
// --- Absorbé
|
||||
// --- Absorbé ?? ICI uniquement lorsque Situation = ''
|
||||
array(
|
||||
'name' => 'ABSORPTION',
|
||||
'value' => 'CONTINUE',
|
||||
|
@ -2039,6 +2039,7 @@ class Metier_Insee_MInsee extends Metier_Insee_Table
|
||||
$iTva = new Metier_Partenaires_MTva($this->iDb);
|
||||
$iTva->setCompanyId($siren);
|
||||
$iTva->setRemote();
|
||||
$iTva->getTVA();
|
||||
$vatNumber = $iTva->vatNumber;
|
||||
$vatDefined = $iTva->vatDefined;
|
||||
|
||||
@ -5206,13 +5207,13 @@ class Metier_Insee_MInsee extends Metier_Insee_Table
|
||||
}
|
||||
} else {
|
||||
switch ($ann['Rubrique']) {
|
||||
case 'mmd': $codeEven='2313'; $libEven = "Modification(s) diverse(s)"; break;
|
||||
case 'comptes': $codeEven='3999'; $libEven = "Dépôt des comptes"; break;
|
||||
case 'creations': $codeEven='4999'; $libEven = "Création d'entreprise"; break;
|
||||
case 'procol': $codeEven='1999'; $libEven = "Procédure collective"; break;
|
||||
case 'radiations': $codeEven='6700'; $libEven = "Radiation"; break;
|
||||
case 'ventes': $codeEven='5999'; $libEven = "Vente/Cession"; break;
|
||||
default: $codeEven='0000'; $libEven = $ann['Rubrique']; break;
|
||||
case 'mmd': $codeEven='2313'; $libEven = "Modification(s) diverse(s)"; break;
|
||||
case 'comptes': $codeEven='3999'; $libEven = "Dépôt des comptes"; break;
|
||||
case 'creations': $codeEven='4999'; $libEven = "Création d'entreprise"; break;
|
||||
case 'procol': $codeEven='1999'; $libEven = "Procédure collective"; break;
|
||||
case 'radiations': $codeEven='6700'; $libEven = "Radiation"; break;
|
||||
case 'ventes': $codeEven='5999'; $libEven = "Vente/Cession"; break;
|
||||
default: $codeEven='0000'; $libEven = $ann['Rubrique']; break;
|
||||
}
|
||||
$tabRetEven[] = array(
|
||||
'CodeEven' => $codeEven,
|
||||
@ -5277,25 +5278,30 @@ class Metier_Insee_MInsee extends Metier_Insee_Table
|
||||
} elseif ($ann['JAL']==200) {
|
||||
$Bodacc_Code='BODB';
|
||||
}
|
||||
|
||||
// 4xxx
|
||||
if ($ann['CODEVE']<20) {
|
||||
$rub='creations';
|
||||
} // 4xxx
|
||||
}
|
||||
// 5xxx
|
||||
elseif ($ann['CODEVE']<=25) {
|
||||
$rub='ventes';
|
||||
} // 5xxx
|
||||
}
|
||||
// 2xxx
|
||||
elseif ($ann['CODEVE']<40) {
|
||||
$rub='mmd';
|
||||
} // 2xxx
|
||||
}
|
||||
// 6xxx
|
||||
elseif ($ann['CODEVE']<42) {
|
||||
$rub='radiations';
|
||||
} // 6xxx
|
||||
}
|
||||
// 2xxx
|
||||
elseif ($ann['CODEVE']<50) {
|
||||
$rub='mmd';
|
||||
} // 2xxx
|
||||
}
|
||||
// 1xxx
|
||||
elseif ($ann['CODEVE']<80) {
|
||||
$rub='procol';
|
||||
} // 1xxx
|
||||
}
|
||||
|
||||
$tabEvens = array();
|
||||
$newCodeEven = $this->HistoEvenConvert[$ann['CODEVE']];
|
||||
@ -5508,20 +5514,20 @@ class Metier_Insee_MInsee extends Metier_Insee_Table
|
||||
'LibEven' => $this->iBodacc->getEvenement($even)
|
||||
);
|
||||
if ($even>=1000 && $even<2000) {
|
||||
$rubriqueRet='procol';
|
||||
$rubriqueRet = 'procol';
|
||||
} elseif ($even>=2000 && $even<3000) {
|
||||
$rubriqueRet='mmd';
|
||||
} elseif ($even>=3000 && $even<4000) {
|
||||
$rubriqueRet='comptes';
|
||||
$rubriqueRet = 'comptes';
|
||||
} elseif ($even>=4000 && $even<5000) {
|
||||
$rubriqueRet='creations';
|
||||
$rubriqueRet = 'creations';
|
||||
} elseif ($even>=5000 && $even<6000) {
|
||||
$rubriqueRet='ventes';
|
||||
$rubriqueRet = 'ventes';
|
||||
} elseif ($even>=6000 && $even<7000) {
|
||||
$rubriqueRet='radiations';
|
||||
$rubriqueRet = 'radiations';
|
||||
}
|
||||
if ($even==2102 || $even==2100) {
|
||||
$capital=true;
|
||||
$capital = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -28,6 +28,11 @@ class Metier_Partenaires_MTva
|
||||
*/
|
||||
protected $remote = false;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param unknown $db
|
||||
* @return boolean
|
||||
*/
|
||||
public function __construct($db = null)
|
||||
{
|
||||
if ($this->siren * 1 < 000001000) {
|
||||
@ -42,6 +47,27 @@ class Metier_Partenaires_MTva
|
||||
} else {
|
||||
$this->iDb = $db;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return TVA Struct
|
||||
* @param unknown $db
|
||||
* @return boolean
|
||||
*/
|
||||
public function getTVA()
|
||||
{
|
||||
if ($this->siren * 1 < 000001000) {
|
||||
$this->vatNumber = 'FR00000000000';
|
||||
$this->vatDefined = false;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($db === null) {
|
||||
$this->iDb = new Metier_Util_Db();
|
||||
} else {
|
||||
$this->iDb = $db;
|
||||
}
|
||||
|
||||
$cleAlgo = $this->genereCleFr();
|
||||
if ($cleAlgo < 10) {
|
||||
@ -62,18 +88,17 @@ class Metier_Partenaires_MTva
|
||||
"siren=$this->siren", false, MYSQL_ASSOC);
|
||||
if (count($tab) > 0) {
|
||||
$tab = $info[0];
|
||||
if ($tab['cle'] !== null || ($tab['cle'] === null &&
|
||||
$tab['DateMAJ'] >= date('Ymd', mktime(0, 0, 0, date('m')-6, date('d'), date('Y'))))) {
|
||||
$cle = $tab['cle'];
|
||||
if ($cle == null) {
|
||||
$attribue = false;
|
||||
$cle = $this->cle;
|
||||
} else {
|
||||
$attribue = true;
|
||||
}
|
||||
$this->vatNumber = "FR".$cle.$this->siren;
|
||||
$this->vatDefined = $attribue;
|
||||
|
||||
$cle = $tab['cle'];
|
||||
$dateRef = new DateTime();
|
||||
$dateRef->sub(new DateInterval('P6M'));
|
||||
$dateMaj = DateTime::createFromFormat('Ymd', $tab['DateMAJ']);
|
||||
$this->vatNumber = "FR".$cle.$this->siren;
|
||||
if ($cle !== null) {
|
||||
$this->vatDefined = true;
|
||||
return true;
|
||||
} elseif ($cle === null && $dateMaj >= $dateRef) {
|
||||
$cle = $this->cle;
|
||||
$this->vatDefined = false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -81,11 +106,10 @@ class Metier_Partenaires_MTva
|
||||
if ($this->remote) {
|
||||
return $this->getRemoteVAT();
|
||||
} else {
|
||||
$this->errnum = 999;
|
||||
$this->errmsg = "Pas d'accès à la base TVA";
|
||||
$this->vatNumber = "FR".$this->cle.$this->siren;
|
||||
$this->vatDefined = false;
|
||||
|
||||
$this->errnum = 999;
|
||||
$this->errmsg = "Pas d'accès à la base TVA";
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -120,13 +144,19 @@ class Metier_Partenaires_MTva
|
||||
$nbIndispo = 0;
|
||||
while (true) {
|
||||
$postData = array(
|
||||
'ms' => 'FR',
|
||||
'iso' => 'FR',
|
||||
'vat' => $this->cle.$this->siren,
|
||||
'BtnSubmitVat' => 'Verify'
|
||||
'memberStateCode' => "FR",
|
||||
'number' => $this->cle.$this->siren,
|
||||
'traderName' => "",
|
||||
'traderStreet' => "",
|
||||
'traderPostalCode' => "",
|
||||
'traderCity' => "",
|
||||
'requesterMemberStateCode' => "",
|
||||
'requesterNumber' => "",
|
||||
'action' => "check",
|
||||
'check' => "Vérifier",
|
||||
);
|
||||
$tdeb = microtime(true);
|
||||
$url = 'http://ec.europa.eu/taxation_customs/vies/viesquer.do';
|
||||
$url = 'http://ec.europa.eu/taxation_customs/vies/vatRequest.html';
|
||||
$referer = 'http://ec.europa.eu/taxation_customs/vies/';
|
||||
$page = getUrl($url, '', $postData, $referer, false, 'ec.europa.eu', '', 15);
|
||||
$duree = round(microtime(true)-$tdeb, 3);
|
||||
@ -141,24 +171,24 @@ class Metier_Partenaires_MTva
|
||||
$code = $page['code'];// Code réponse Serveur
|
||||
$body = $page['body'];
|
||||
$header = $page['header'];
|
||||
if (preg_match('/Yes, valid VAT number/i', $body)) {
|
||||
if (preg_match('/Yes, valid VAT number/i', $body) || preg_match('/Oui, numéro de TVA valide/i', $body)) {
|
||||
$tabInsert = array(
|
||||
'siren' => $this->siren,
|
||||
'cle' => $this->cle,
|
||||
'duree' => $duree
|
||||
);
|
||||
$tabUpdate = array(
|
||||
'cle' => $this->cle,
|
||||
'duree' => $duree
|
||||
);
|
||||
if (!$this->iDb->insert('sdv1.siren_tva', $tabInsert)) {
|
||||
$tabUpdate = array(
|
||||
'cle' => $this->cle,
|
||||
'duree' => $duree
|
||||
);
|
||||
if (!$this->iDb->update('sdv1.siren_tva', $tabUpdate, "siren=$this->siren")) {
|
||||
Metier_Util_Log::write('W', "Siren $this->siren, numéro de TVA = FR $this->cle $this->siren, impossible de MAJ la clef ($duree s) - ERREUR MySql n°". mysql_errno() .' : '. mysql_error(), __LINE__, __FILE__, __FUNCTION__, __CLASS__);
|
||||
}
|
||||
}
|
||||
Metier_Util_Log::write('I', "Siren $this->siren, numéro de TVA = FR $$this->cle $siren ($duree s)", __LINE__, __FILE__, __FUNCTION__, __CLASS__);
|
||||
$this->vatNumber = "FR".$this->cle.$this->siren;
|
||||
$this->vatDefined=true;
|
||||
$this->vatDefined = true;
|
||||
return true;
|
||||
} elseif (strpos($body, 'Service non disponible') > 0 || strpos($body, 'ponse trop long.') > 0) {
|
||||
$nbIndispo++;
|
||||
@ -183,20 +213,20 @@ class Metier_Partenaires_MTva
|
||||
}
|
||||
Metier_Util_Log::write('I', "Siren $this->siren, numéro de TVA = FR $this->cle $this->siren vérification non disponible ($duree s)", __LINE__, __FILE__, __FUNCTION__, __CLASS__);
|
||||
$this->vatNumber = "FR".$this->cle.$this->siren;
|
||||
$this->vatDefined=false;
|
||||
$this->vatDefined = false;
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
$tabInsert = array(
|
||||
'siren' => $this->siren,
|
||||
'cle' => 'NULL',
|
||||
'duree' => $duree
|
||||
);
|
||||
$tabUpdate = array(
|
||||
'cle' => 'NULL',
|
||||
'cle' => 'NULL',
|
||||
'duree' => $duree
|
||||
);
|
||||
if (!$this->iDb->insert('sdv1.siren_tva', $tabInsert)) {
|
||||
$tabUpdate = array(
|
||||
'cle' => 'NULL',
|
||||
'duree' => $duree
|
||||
);
|
||||
if (!$this->iDb->update('sdv1.siren_tva', $tabUpdate, "siren=$this->siren")) {
|
||||
Metier_Util_Log::write('W', "Siren $this->siren, numéro de TVA = FR $this->cle $this->siren, impossible de MAJ la clef ($duree s) - ERREUR MySql n°". mysql_errno() .' : '. mysql_error(), __LINE__, __FILE__, __FUNCTION__, __CLASS__);
|
||||
}
|
||||
|
@ -2203,24 +2203,22 @@ class Metier_Scores_ICotation
|
||||
$this->reTrtAuto = $retraitementAutomatique;
|
||||
$this->tabBilan = $tabBilan;
|
||||
|
||||
/** Situat° Remarque Notation Equiv. Grades Probabilité de
|
||||
** financière BDF Moody's Grades S&P défaillance
|
||||
**/
|
||||
$this->tabNotation['A+']=array('Excellente', 'Exceptionnelle', 'A3++', 'Aaa', 'AAA' ,'0.001');
|
||||
$this->tabNotation['A'] =array('Excellente', 'Excellente', 'A3+', 'Aa1 Aa2 Aa3', 'AA+ AA AA-','0.01');
|
||||
$this->tabNotation['B+']=array('Excellente', 'Très bonne', '3++', 'A1', 'A+' ,'0.02');
|
||||
$this->tabNotation['B'] =array('Bonne', 'Bonne', '3+', 'A2 A3', 'A A-' ,'0.04');
|
||||
$this->tabNotation['C+']=array('Bonne', 'Relativement correcte', '3', 'Baa1', 'BBB+' ,'0.15');
|
||||
$this->tabNotation['C'] =array('Bonne', 'Correcte', '3', 'Baa2', 'BBB' ,'0.30');
|
||||
$this->tabNotation['C-']=array('Bonne', 'Moyenne', '3', 'Baa3', 'BBB-' ,'0.60');
|
||||
$this->tabNotation['D+']=array('Moyenne', 'Passable', '4+', 'Ba1', 'BB+' ,'0.90');
|
||||
$this->tabNotation['D'] =array('Moyenne', 'Médiocre', '4', 'Ba2', 'BB' ,'1.25');
|
||||
$this->tabNotation['D-']=array('Moyenne', 'Très médiocre', '4', 'Ba3', 'BB-' ,'1.60');
|
||||
$this->tabNotation['E+']=array('Mauvaise', 'Assez mauvaise', '5', 'B1 B2 B3', 'B+ B B-', '5.00');
|
||||
$this->tabNotation['E'] =array('Mauvaise', 'Mauvaise', '6', 'Caa', 'CCC', '14.00');
|
||||
$this->tabNotation['E-']=array('Mauvaise', 'Très mauvais', '8', 'Ca C', 'CC C', '17.00');
|
||||
$this->tabNotation['F'] =array('Mauvaise', 'Signe de défaut', '8 9', 'D', 'D', 'En défaut');
|
||||
$this->tabNotation['Z'] =array('Mauvaise', 'Signe de défaut', 'P', '', '', 'En défaut');
|
||||
/* Situation Fiancière Remarque Notation BDF Equiv. Moody's Grades S&P Probabilité dedéfaillance */
|
||||
$this->tabNotation['A+']=array('Excellente', 'Exceptionnelle', 'A3++', 'Aaa', 'AAA', '0.001');
|
||||
$this->tabNotation['A'] =array('Excellente', 'Excellente', 'A3+', 'Aa1 Aa2 Aa3', 'AA+ AA AA-', '0.01');
|
||||
$this->tabNotation['B+']=array('Excellente', 'Très bonne', '3++', 'A1', 'A+', '0.02');
|
||||
$this->tabNotation['B'] =array('Bonne', 'Bonne', '3+', 'A2 A3', 'A A-', '0.04');
|
||||
$this->tabNotation['C+']=array('Bonne', 'Relativement correcte', '3', 'Baa1', 'BBB+', '0.15');
|
||||
$this->tabNotation['C'] =array('Bonne', 'Correcte', '3', 'Baa2', 'BBB', '0.30');
|
||||
$this->tabNotation['C-']=array('Bonne', 'Moyenne', '3', 'Baa3', 'BBB-', '0.60');
|
||||
$this->tabNotation['D+']=array('Moyenne', 'Passable', '4+', 'Ba1', 'BB+', '0.90');
|
||||
$this->tabNotation['D'] =array('Moyenne', 'Médiocre', '4', 'Ba2', 'BB', '1.25');
|
||||
$this->tabNotation['D-']=array('Moyenne', 'Très médiocre', '4', 'Ba3', 'BB-', '1.60');
|
||||
$this->tabNotation['E+']=array('Mauvaise', 'Assez mauvaise', '5', 'B1 B2 B3', 'B+ B B-', '5.00');
|
||||
$this->tabNotation['E'] =array('Mauvaise', 'Mauvaise', '6', 'Caa', 'CCC', '14.00');
|
||||
$this->tabNotation['E-']=array('Mauvaise', 'Très mauvais', '8', 'Ca C', 'CC C', '17.00');
|
||||
$this->tabNotation['F'] =array('Mauvaise', 'Signe de défaut', '8 9', 'D', 'D', 'En défaut');
|
||||
$this->tabNotation['Z'] =array('Mauvaise', 'Signe de défaut', 'P', '', '', 'En défaut');
|
||||
|
||||
$this->tabLibActivite[0]='';
|
||||
$this->tabLibActivite[15]='Industries Alimentaires : Collecte Appro';
|
||||
|
@ -213,8 +213,8 @@ class Scores_Ws_Server
|
||||
public $listError = array(
|
||||
'0000' => "Erreur indeterminé",
|
||||
'0900' => "Identifiant ou mot de passe incorrect",
|
||||
'0901' => "Accès WS non authorisé pour cet utilisateur",
|
||||
'0902' => "Méthode non authorisée dans votre profil",
|
||||
'0901' => "Accès WS non autorisé pour cet utilisateur",
|
||||
'0902' => "Méthode non autorisée dans votre profil",
|
||||
'0903' => "Période d'accès au service invalide",
|
||||
'0904' => "Adresse IP Invalide",
|
||||
'0905' => "Accès environnement de test non autorisé",
|
||||
|
Loading…
Reference in New Issue
Block a user