Modification kbis, Modification contenu rsynthesemin

This commit is contained in:
Michael RICOIS 2010-08-03 09:27:02 +00:00
commit 82cb50b4d3
8 changed files with 94 additions and 260 deletions

View File

@ -81,6 +81,7 @@ if($element!==false){ echo dRow($element['lib'], $element['data']); }
$element = formatElement('identite', 'autreid', array($etab['AutreId'], $etab['TribunalLib'], $etab['NumRC']));
if($element!==false){ echo dRow($element['lib'], $element['data']); }
//Actif INSEE
$element = formatElement('identite', 'actif',
array($etab['Siren'], $siret, $idEntreprise,
$etab['Siege'], $etab['Actif'],

View File

@ -414,7 +414,7 @@ function syntheseRatioMin()
'r16' => array('total'=>'r5', 'total_info'=>'% ca', 'op' => 1000, 'titre'=>'RESULTAT D\'EXPLOITATION'),
'r7' => array('total'=>'r5', 'total_info'=>'% ca', 'op' => 1000, 'titre'=>'RESULTAT COURANT'),
'r10' => array('total'=>'r5', 'total_info'=>'% ca', 'op' => 1000, 'titre'=>'RESULTAT NET'),
'r70' => array('total'=>'r22', 'total_info'=>'% bilan', 'op' => 1000, 'titre'=>'FONDS PROPRES'),
'r18' => array('total'=>'r22', 'total_info'=>'% bilan', 'op' => 1000, 'titre'=>'FONDS PROPRES'),
'r231' => array('total'=>'r22', 'total_info'=>'% bilan', 'op' => 1000, 'titre'=>'FONDS DE ROULEMENT'),
'r232' => array('total'=>'r22', 'total_info'=>'% bilan', 'op' => 1000, 'titre'=>'BESOIN EN FONDS DE ROULEMENT'),
'r63' => array('total'=>'', 'total_info'=>'', 'op' => 1000, 'titre'=>'TRESORERIE NETTE'),

View File

@ -1519,7 +1519,7 @@ var formAction=$('#frmSurv').attr('action');var href=$(location).attr('href');va
$('a[idobjet]').click(function()
{idObject=$(this).attr('idobjet');$('#document'+idObject).html('Construction du document en cours...');$.ajax({type:"POST",url:"/",data:"page=getmarques&idObject="+idObject,success:function(msg){$('#document'+idObject).html(msg);},error:function(){$('#document'+idObject).html('Erreur');}});});$('.datemaj').qtip({content:$(this).attr('alt'),style:{name:'cream',width:170},position:{corner:{target:'bottomMiddle',tooltip:'topMiddle'}}});$('u[tooltip]').each(function(){$(this).qtip({content:$(this).attr('tooltip'),style:{name:'dark'},position:{corner:{target:'topMiddle',tooltip:'bottomMiddle'}}});});if($('div.domiciliation').length){$('div.domiciliation').qtip({show:'click',hide:'unfocus',content:$('div.domiciliation span').html(),style:{name:'cream',width:200},position:{corner:{target:'bottomMiddle',tooltip:'topMiddle'}}});}
$('#goidentite').click(function(){var verif=false;var siret=$('input[name="formR[siret]"]').val().replace(/\s+/g,'');if(siret.length==9){verif=EstSirenValide(siret);}else if(siret.length==14){verif=EstSiretValide(siret);}
if(verif){$(location).attr('href','./?page=identite&siret='+siret);}});});function checkEmail(eMail){var isMail=eMail.length;var verif=/^[a-z0-9_.-]+@[a-z0-9_.-]+[.][a-z]{2,4}$/i;if(!isMail||verif.exec(eMail)==null){return false;}else{return true;}}
if(verif){$(location).attr('href','./?page=identite&siret='+siret);}else{$('input[name=submit]').click();}});});function checkEmail(eMail){var isMail=eMail.length;var verif=/^[a-z0-9_.-]+@[a-z0-9_.-]+[.][a-z]{2,4}$/i;if(!isMail||verif.exec(eMail)==null){return false;}else{return true;}}
function EstSirenValide(siren){var estValide;if((siren.length!=9)||(isNaN(siren)))
estValide=false;else{var somme=0;var tmp;for(var cpt=0;cpt<siren.length;cpt++){if((cpt%2)==1){tmp=siren.charAt(cpt)*2;if(tmp>9)
tmp-=9;}

View File

@ -1,11 +1,8 @@
(function($){$.fn.reportprogress=function(val,maxVal){var max=100;if(maxVal)
max=maxVal;return this.each(function(){var div=$(this);var innerdiv=div.find(".progress");if(innerdiv.length!=1){innerdiv=$("<div class='progress'></div>");div.append("<div class='text'> </div>");$("<span class='text'> </span>").css("width",div.width()).appendTo(innerdiv);div.append(innerdiv);}
var width=Math.round(val/max*100);innerdiv.css("width",width+"%");div.find(".text").html(width+" %");});};})(jQuery);var pct=0;var prec=0;var checkInterval=5;var url='';function checkKbis(start)
var width=Math.round(val/max*100);innerdiv.css("width",width+"%");div.find(".text").html(width+" %");});};})(jQuery);var pct=0;var prec=0;var checkInterval=10;var url='';function checkKbis(start)
{if(start>=1){$.post('pages/kbis2.php',{ajax:'true',start:start,siret:siren},function(data,textStatus){url=data;});}else{$.post('pages/kbis2.php',{ajax:'true',start:0,url:url,siret:siren},function(data,textStatus){if(data!=''&&data!='FALSE'){updateKbisInfo(data);}});}}
function updateKbis()
{$('#progressbar').reportprogress(++pct);if(pct==100){updateKbisInfo(message);pct=0;}
if(Math.floor(pct/checkInterval)!=prec){prec=Math.floor(pct/checkInterval);checkKbis(false);}}
function updateKbis(){$('#progressbar').reportprogress(++pct);if(pct==100){updateKbisInfo(message);pct=0;}
if(Math.floor(pct/checkInterval)!=prec||pct==1){prec=Math.floor(pct/checkInterval);checkKbis(false);}}
function updateKbisInfo(html){$('#result').html(html);clearInterval(holdTheInterval);}
$(document).ready(function()
{$('input[type=checkbox][name=sendmail]').live('click',function()
{if($(this).attr('checked')==true){$('#formMail').css('display','block');}else{$('#formMail').css('display','none');}});$('form[name=mailkbis]').submit(function(){var eMail=$('input[name=mail]').val();if(!checkEmail(eMail)){alert('Veuillez saisir une adresse email.');return false;}else{return true;}});});
$(document).ready(function(){$('input[type=checkbox][name=sendmail]').live('click',function(){if($(this).attr('checked')==true){$('#formMail').css('display','block');}else{$('#formMail').css('display','none');}});$('form[name=mailkbis]').submit(function(){var eMail=$('input[name=mail]').val();if(!checkEmail(eMail)){alert('Veuillez saisir une adresse email.');return false;}else{return true;}});});

View File

@ -1,6 +1,6 @@
var pct = 0;
var prec = 0;
var checkInterval = 5;
var checkInterval = 10;
var url = '';
function checkKbis(start)
@ -20,14 +20,13 @@ function checkKbis(start)
}
}
function updateKbis()
{
function updateKbis(){
$('#progressbar').reportprogress(++pct);
if(pct==100){
updateKbisInfo(message);
pct=0;
}
if(Math.floor(pct/checkInterval)!=prec){
if( Math.floor(pct/checkInterval)!=prec || pct==1 ){
prec = Math.floor(pct/checkInterval);
checkKbis(false);
}
@ -38,10 +37,8 @@ function updateKbisInfo(html){
clearInterval(holdTheInterval);
}
$(document).ready(function()
{
$('input[type=checkbox][name=sendmail]').live('click', function()
{
$(document).ready(function(){
$('input[type=checkbox][name=sendmail]').live('click', function(){
if($(this).attr('checked')== true){
$('#formMail').css('display', 'block');
}else{

View File

@ -142,6 +142,8 @@ $(document).ready(function(){
}
if ( verif ){
$(location).attr('href', './?page=identite&siret='+siret);
} else {
$('input[name=submit]').click();
}
});

View File

@ -302,7 +302,7 @@ else
{
?>
checkKbis(start);
var holdTheInterval = setInterval(updateKbis, 1200);
var holdTheInterval = setInterval(updateKbis, 1800);
$('#progressbar').reportprogress(0);
<?php
}

View File

@ -3,44 +3,38 @@
if (!page_checkParams()) die('Paramètres incorrects !');
require_once 'scoresws/scoresws.php';
require_once 'scoresws/identite.php';
require_once 'common/dates.php';
require_once 'utils.php';
function dRow($lib, $data, $title = '')
{
$html = '<tr>'."\n";
$html.= ' <td width="30">&nbsp;</td>'."\n";
$html.= ' <td width="200" class="StyleInfoLib">'.$lib.'</td>'."\n";
if($title!='') $title = ' title="'.$title.'"';
$html.= ' <td width="350" class="StyleInfoData"'.$title.'>'.$data.'</td>'."\n";
$html.= '</tr>'."\n";
return $html;
}
$etab = scoresws_identite($siret, $siren, $idEntreprise);
?>
<div id="center">
<h1>RAPPORT DE SYNTHESE</h1>
<table>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Num&eacute;ro identifiant Siret du si&egrave;ge</td>
<td width="350" class="StyleInfoData"><?=substr($etab['SiretSiege'],0,3).' '.substr($etab['SiretSiege'],3,3).' '.substr($etab['SiretSiege'],6,3).'&nbsp; <i>'.substr($etab['SiretSiege'],9,5).'</i>'?></td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<?php
$numRC = $etab['NumRC'];
$tribunalLib = $etab['TribunalLib'];
if (isset($numRC) && $numRC!='')
{
$lib = 'Num&eacute;ro R.C.';
$libTrib = '';
if (preg_match('/(A|B|C|D)/i', $numRC))
{
$lib = 'Num&eacute;ro R.C.';
$libTrib = ' RCS '.preg_replace('/(^TC |^TI |^TGIcc |^TMX )/i','',$tribunalLib);
}
elseif (preg_match('/(P)/i', $numRC))
{
$lib = 'Num&eacute;ro R.S.A.C.';
$libTrib = ' RSAC '.preg_replace('/(^TC |^TI |^TGIcc |^TMX )/i','',$tribunalLib);
}
$data = $numRC.$libTrib;
}
?>
<td width="200" class="StyleInfoLib"><?=$lib?></td>
<td width="350" class="StyleInfoData"><?=$data?></td>
</tr>
<?php
//Siret siege
$element = formatElement('identite', 'siretsiege', array($etab['SiretSiege']));
echo dRow($element['lib'], $element['data']);
//Numéro RC
$element = formatElement('identite', 'numrc', array($etab['NumRC'], $etab['TribunalLib'], $etab['NumRM']));
if($element!==false){ echo dRow($element['lib'], $element['data']); }
//Actif INSEE
?>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Entreprise active INSEE</td>
@ -69,223 +63,69 @@ require_once 'surveillance/surveillance_identite.php';
<table>
<?php
//Nom
$title = '';
if(isset($etab['NomLong']) && $etab['NomLong']!='' && $etab['NomLong']!=$etab['Nom'] )
$title = $etab['NomLong'];
?>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Raison Sociale</td>
<td width="350" class="StyleInfoData" title="<?=$title?>">
<?=$etab['Nom']; if ($etab['Nom2']<>'') echo '<br/>'.$etab['Nom2'];?>
</td>
</tr>
<?php
//Forme juridique
?>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Forme juridique</td>
<td width="350" class="StyleInfoData"><?=$etab['FJ'].' : '.strWsToHtml($etab['FJ_lib']);?>
<?php
if(isset($etab['FJ2']) && $etab['FJ2']!='' && isset($etab['FJ2_Lib']) && $etab['FJ2_Lib']!='')
{
?>
<img src="./img/exclamation.png" title="Forme jurique au RCS : <?=$etab['FJ2_Lib']?> (<?=$etab['FJ2']?>)"/>
<?php
}
?>
</td>
</tr>
<?php
//Date d'immatriculation
$dateImmat = '';
if(isset($etab['DateImmat']) && $etab['DateImmat']!='' && $etab['DateImmat']!='0000-00-00'){
$dateImmat = WDate::dateT('Ymd', 'd/m/Y', str_replace('-','',$etab['DateImmat']));
}
if($dateImmat!=''){
?>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Date d'immatriculation</td>
<td width="350" class="StyleInfoData"><?=$dateImmat?></td>
</tr>
<?php
}
?>
<?php
//Date de création de l'établissement
?>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Cr&eacute;ation de l'&eacute;tablissement</td>
<td width="350" class="StyleInfoData">
<?php
$dateCreationEt=str_replace('-','',$etab['DateCreaEt']);
if ($dateCreationEt*1<>0) {
if (substr($dateCreationEt,-2)*1==0)
echo WDate::dateT('Ymd', 'm/Y', $dateCreationEt);
else
echo WDate::dateT('Ymd', 'd/m/Y', $dateCreationEt);
} else echo 'N/C';
?>
</td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Adresse</td>
<td width="350" class="StyleInfoData">
<?php
if($etab['AdresseRue'] == ''){ $voie = $etab['Adresse2']; }else{ $voie = $etab['AdresseRue']; }
?>
<a href="/?page=recherche&vue=list&formR[type]=ent&formR[numVoie]=<?=urlencode($etab['AdresseNum'])?>&formR[voie]=<?=urlencode($voie)?>&formR[cpVille]=<?=urlencode($etab['CP'])?>" title="Rechercher à partir de cette adresse">
<span class="adresse"><?php print $etab['Adresse'];?></span>
$element = formatElement('identite', 'raisonsociale', array($etab['Nom'], $etab['Nom2'], $etab['NomLong']));
if($element!==false){ echo dRow($element['lib'], $element['data'], $element['title']); }
<?php
if (preg_match('/CHEZ SOFRADOM/i',$etab['Adresse2']))
$etab['Adresse2']='<a title="Voir la fiche d\'identité du domiciliataire de cette entreprise" href="/?page=identite&siret=42495045900018&idEntreprise=6720043">CHEZ SOFRADOM</a>';
//http://extranet.devlocal.com/?page=identite&siret=42495045900018&idEntreprise=6720043
if ($etab['Adresse2']<>'')
print '<span class="adresse">'.$etab['Adresse2'].'</span>';
?>
<?php
$cp=$etab['CP']*1;
if ($cp<>0)
print '<span class="adresse">'.$etab['CP'].'&nbsp;'.strWsToHtml($etab['Ville']).'</span>';
if ($etab['Pays']<>'' && strtoupper(substr($etab['Pays'],0,3))<>'FRA')
print '<span class="adresse">'.strWsToHtml($etab['Pays']).'</span>';
?>
</a>
</td>
</tr>
// Forme juridique
$element = formatElement('identite', 'fj',
array($etab['FJ' ], $etab['FJ_lib' ],
(isset($etab['FJ2'])) ? $etab['FJ2'] : '',
$etab['FJ2_Lib']));
if($element!==false){ echo dRow($element['lib'], $element['data']); }
//Date d'immatriculation
$element = formatElement('identite', 'dateimmat', array($etab['DateImmat']));
if($element!==false){ echo dRow($element['lib'], $element['data']); }
//Date de création de l'établissement
$element = formatElement('identite', 'datecreaet', array($etab['DateCreaEt']));
if($element!==false){ echo dRow($element['lib'], $element['data']); }
//Adresse
$element = formatElement('identite', 'adresse',
array(
$etab['Adresse'],
$etab['Adresse2'],
$etab['AdresseNum'],
$etab['AdresseRue'],
$etab['CP'],
$etab['Ville'],
$etab['Pays'],
$etab['AdresseDom'],
$etab['AdresseDomEnt'],
$etab['AdresseDomNb'])
);
if($element!==false){ echo dRow($element['lib'], $element['data']); }
?>
</table>
<h2>Activité(s) &amp; Chiffre d'affaire</h2>
<table>
<?php
//Activité de l'entreprise
?>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Activit&eacute; de l'entreprise</td>
<td width="350" class="StyleInfoData">
<?php
if ($etab['Activite']<>'' && !preg_match('/non pr(e|é)cis(e|é)/i',utf8_decode($etab['Activite']))) {
$texte=preg_replace_callback("/((?:[0-9]{9,9})|(?:[0-9]{3,3} [0-9]{3,3} [0-9]{3,3})|(?:[0-9]{3,3}\.[0-9]{3,3}\.[0-9]{3,3})|(?:[0-9]{3,3}-[0-9]{3,3}-[0-9]{3,3}))/", replace_siren, strWsToHtml($etab['Activite']));
echo $texte.' ('.$etab['NafEnt'].' : '. strWsToHtml($etab['NafEntLib']).')';
} else
echo $etab['NafEnt'].' : '. strWsToHtml($etab['NafEntLib']);
?>
</td>
</tr>
<?php
//NAF4
if (preg_match('/\bNAF4\b/i', $_SESSION['tabInfo']['pref']) && trim(@$etab['Naf4Ent'])<>'') {
?>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Anciens codes NAF</td>
<td width="350" class="StyleInfoData"><b>Entr. :&nbsp;&nbsp;</b><?=$etab['Naf4Ent'].' - '. strWsToHtml($etab['Naf4EntLib']);?><br/><b>&Eacute;tab. :</b> <?=$etab['Naf4Etab'].' - '. strWsToHtml($etab['Naf4EtabLib']);?></td>
</tr>
<?php
}
?>
<?php
//Origine du fond
if ( ($etab['OrigineCreation']*1>0 && $etab['OrigineCreation']*1<9) ||
$etab['OrigineCreation']=='A' ||
$etab['OrigineCreation']=='B' ||
$etab['OrigineCreation']=='C' ||
$etab['OrigineCreation']=='D' ||
$etab['OrigineCreation']=='E' ){
$tabCreation = array(
'a1'=>'Création',
'a3'=>'Achat',
'a4'=>'Apport',
'a6'=>'Prise en location gérance',
'a7'=>'Partage',
'a8'=>'Reprise',
'aA'=>'Reprise globale de l\'exploitation agricole',
'aB'=>'Poursuite de l\'exploitation agricole par le conjoint',
'aC'=>'Transfert de propriété de l\'exploitation agricole',
'aD'=>'Apport d\'exploitation(s) agricole(s) individuelle(s)',
'aE'=>'Reprise d\'exploitation agricole individuelle',
);
?>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Origine du fonds</td>
<td width="350" class="StyleInfoData"><?=$tabCreation['a'.$etab['OrigineCreation']]?></td>
</tr>
<?php
}
?>
<?php
//Chiffre d'affaire
$title = '';
if(isset($etab['Bilan']['CA'])) $title.='Chiffre d\'affaire de '.moneyKM($etab['Bilan']['CA']).deviseText($etab['Bilan']['Devise']);
if(isset($etab['Bilan']['Resultat'])) $title.=' et Résultat de '.moneyKM($etab['Bilan']['Resultat']).deviseText($etab['Bilan']['Devise']);
if(isset($etab['Bilan']['Cloture'])) $title.=' au '.WDate::dateT('Ymd', 'd/m/Y', str_replace('-','',$etab['Bilan']['Cloture']));
?>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Chiffre d'affaire</td>
<td width="350" class="StyleInfoData" title="<?=$title?>">
<?php
if(isset($etab['Bilan']['CA']) && (!isset($etab['TrancheCALib']) || $etab['TrancheCALib']=='N/C'))
{
echo moneyKM($etab['Bilan']['CA']).deviseText($etab['Bilan']['Devise']).' au '.WDate::dateT('Ymd', 'd/m/Y', str_replace('-','',$etab['Bilan']['Cloture']));
}elseif(isset($etab['TrancheCALib']) && $etab['TrancheCALib']!='N/C'){
echo strWsToHtml($etab['TrancheCALib']);
}else{
echo 'N/C';
}
?>
</td>
</tr>
<?php
//Capital
if (isset($etab['Capital']) && $etab['Capital']*1>0)
{
$title = '';
if(isset($etab['Bilan']['Capital'])) $title.='Capital de '.moneyKM($etab['Bilan']['Capital']).deviseText($etab['Bilan']['Devise']);
if(isset($etab['Bilan']['Cloture'])) $title.=' au '.WDate::dateT('Ymd', 'd/m/Y', str_replace('-','',$etab['Bilan']['Cloture']));
?>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Capital <?php if (isset($etab['CapitalType']) && $etab['CapitalType']=='V'){echo 'variable';}?></td>
<td width="350" class="StyleInfoData" title="<?=$title?>"><?=number_format($etab['Capital'],0,',',' ')?>&nbsp;
<?php
if ($etab['CapitalDev']=='EUR') echo '&euro;';
else {
echo $etab['CapitalDev'].' ('.strWsToHtml($etab['CapitalLib']).')';
}
?>
</td>
</tr>
<?php
}
?>
<?php
//Type d'exploitation
if ( isset($etab['TypeExploitation']) && $etab['TypeExploitation']!=0 )
{
$tabTypeExploitation = array(
1 => "Locataire du fond de commerce",
2 => "Loueur du fond de commerce",
3 => "Prestation de personnel",
10 => "Exploitation directe"
);
?>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Type d'exploitation</td>
<td width="350" class="StyleInfoData"><?=$tabTypeExploitation[$etab['TypeExploitation']]?></td>
</tr>
<?php
}
?>
$element = formatElement('identite', 'activiteen', array($etab['Activite'], $etab['NafEnt'], $etab['NafEntLib']));
if($element!==false){ echo dRow($element['lib'], $element['data']); }
//NAF4
$element = formatElement('identite', 'naf4', array($etab['Naf4Ent'], $etab['Naf4EntLib'], $etab['Naf4Etab'], $etab['Naf4EtabLib']));
if($element!==false){ echo dRow($element['lib'], $element['data']); }
//Origine du fond
$element = formatElement('identite', 'originefond', array($etab['OrigineCreation']));
if($element!==false){ echo dRow($element['lib'], $element['data']); }
//Chiffre d'affaire
$element = formatElement('identite', 'ca', array($etab['Bilan'], $etab['TrancheCALib'], $etab['AnneeTCA']));
if($element!==false){ echo dRow($element['lib'], $element['data'], $element['title']); }
//Capital
$element = formatElement('identite', 'capital', array($etab['Capital'], $etab['CapitalDev'], $etab['CapitalLib'], $etab['CapitalType'], $etab['Bilan']));
if($element!==false){ echo dRow($element['lib'], $element['data'], $element['title']); }
//Type d'exploitation
$element = formatElement('identite', 'typeexploitation', array($etab['TypeExploitation']));
if($element!==false){ echo dRow($element['lib'], $element['data'], $element['title']); }
?>
</table>
<h2>Dirigeants</h2>
@ -705,14 +545,11 @@ if(!empty($indiscore))
?>
</td>
</tr>
<?php ?>
</table>
<p class="confidentiel blockh2">
<?php
require_once 'cgu/cgu.php';
echo afficheCgu();
?>
</p>
</div>