AvisRNCS : Création du fichier pdf et modification de l'affichage des données, issue #0001920
This commit is contained in:
parent
c4bc27dabe
commit
51fef82a50
@ -1619,7 +1619,7 @@ class IdentiteController extends Zend_Controller_Action
|
||||
{
|
||||
//Vérification des permissions
|
||||
$user = new Scores_Utilisateur();
|
||||
if( $user->getIdClient()!=1 /*!$user->checkPerm('avisrncs')*/ ){
|
||||
if( !$user->checkPerm('avisrncs') ){
|
||||
$this->forward('perms', 'error');
|
||||
}
|
||||
|
||||
@ -1755,8 +1755,8 @@ class IdentiteController extends Zend_Controller_Action
|
||||
$this->view->assign('Origine', '-');
|
||||
}
|
||||
|
||||
$this->view->assign('Activite', $result->Activite);
|
||||
$this->view->assign('BodaccActivite', $result->BodaccActivite);
|
||||
$this->view->assign('Activite', $result->NafCode.' : '.$result->NafLabel);
|
||||
$this->view->assign('BodaccActivite', $result->Activite);
|
||||
|
||||
if ( $result->ActiviteDate === null || $result->ActiviteDate == '0000-00-00 00:00:00') {
|
||||
$this->view->assign('ActiviteDate', '');
|
||||
@ -1791,4 +1791,365 @@ class IdentiteController extends Zend_Controller_Action
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Avis de situation RNCS au format PDF
|
||||
*/
|
||||
public function avisrncspdfAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
|
||||
//Vérification des permissions
|
||||
$user = new Scores_Utilisateur();
|
||||
if ( !$user->checkPerm('avisrncs') ) {
|
||||
$this->forward('perms', 'error');
|
||||
}
|
||||
|
||||
$request = $this->getRequest();
|
||||
|
||||
$this->view->assign('siret', $this->siret);
|
||||
$siren = substr($this->siret, 0, 9);
|
||||
|
||||
$infos = null;
|
||||
|
||||
$ws = new WsScores();
|
||||
$result = $ws->getEntrepriseAvisRncs($siren);
|
||||
Zend_Registry::get('firebug')->info($result);
|
||||
|
||||
if ( $result === false ) {
|
||||
$this->view->assign('error', true);
|
||||
}
|
||||
elseif ( is_string($result) ) {
|
||||
$this->view->assign('message', $result);
|
||||
} else {
|
||||
// --- Variables
|
||||
$locale = new Zend_Locale('fr_FR');
|
||||
|
||||
$date = new Zend_Date();
|
||||
$AvisDateTxt = $date->toString(Zend_Date::DATE_LONG);
|
||||
|
||||
if ($result->RadiationDate !== null && $result->RadiationDate != '0000-00-00' ) {
|
||||
$date = new Zend_Date($result->RadiationDate, 'yyyy-MM-dd');
|
||||
$RadiationDate = $date->toString('dd/MM/yyyy');
|
||||
}
|
||||
|
||||
$Nom = $result->Nom;
|
||||
$Sigle = $result->Sigle;
|
||||
$Enseigne = $result->Enseigne;
|
||||
$NomCommercial = $result->NomCommercial;
|
||||
$Siren = $result->Siren;
|
||||
$Tribunal = $result->TribunalLabel;
|
||||
|
||||
$NumGest = $result->NumGest; // 4 ou 2 + 1 lettre +
|
||||
|
||||
if ($result->ImmatDate === null || $result->ImmatDate=='0000-00-00 00:00:00' ) {
|
||||
$ImmatDate = '';
|
||||
} else {
|
||||
$date = new Zend_Date($result->ImmatDate, 'yyyy-MM-dd');
|
||||
$ImmatDate = $date->toString('dd/MM/yyyy');
|
||||
}
|
||||
|
||||
$FormeJuridique = $result->FjLabel;
|
||||
$Capital = number_format($result->Capital, 0, ',', ' ').' '.$result->CapitalDev;
|
||||
$SiegeAdresse = $result->SiegeAdresseNum . ' ' .
|
||||
$result->SiegeAdresseVoieType . ' ' .
|
||||
$result->SiegeAdresseVoieLabel . ' ' .
|
||||
$result->SiegeAdresseCP . ' ' .
|
||||
$result->SiegeAdresseVille;
|
||||
|
||||
|
||||
if ( $result->CompteArretMois === null ) {
|
||||
$CompteArretDate = '';
|
||||
} else {
|
||||
$date = new Zend_Date();
|
||||
$date->set($result->CompteArretMois, Zend_Date::MONTH, $locale);
|
||||
$CompteArretDate = $result->CompteArretJour . ' ' . $date->toString(Zend_Date::MONTH_NAME);
|
||||
}
|
||||
|
||||
if ( $result->ConstitutionDepotDate === null || $result->ConstitutionDepotDate == '0000-00-00 00:00:00') {
|
||||
$ConstitutionDepotDate = '-';
|
||||
} else {
|
||||
$date = new Zend_Date($result->ConstitutionDepotDate, 'yyyy-MM-dd');
|
||||
$ConstitutionDepotDate = $date->toString('dd/MM/yyyy');
|
||||
}
|
||||
|
||||
if ( $result->ConstitutionActeDate === null || $result->ConstitutionActeDate == '0000-00-00 00:00:00') {
|
||||
$ConstitutionActeDate = '-';
|
||||
} else {
|
||||
$date = new Zend_Date($result->ConstitutionActeDate, 'yyyy-MM-dd');
|
||||
$ConstitutionActeDate = $date->toString('dd/MM/yyyy');
|
||||
}
|
||||
|
||||
$administration = array();
|
||||
foreach ($result->Administration->item as $item) {
|
||||
|
||||
$lineP1 = $item->Label;
|
||||
|
||||
if ( $item->CompanyName != '' ) {
|
||||
$lineP2 = $item->CompanyName;
|
||||
if ( intval($item->CompanyId) != 0 ) {
|
||||
$lineP2.= ' ('.$item->CompanyId.')';
|
||||
}
|
||||
} else {
|
||||
$lineP2 = $item->Civilite . ' ' . $item->Nom . ' ' . $item->Prenom;
|
||||
if ( $item->NaissanceDate != '' ) {
|
||||
$lineP2.= ' né le ' . $item->NaissanceDate;
|
||||
}
|
||||
if ( $item->NaissanceVille != '' ) {
|
||||
$lineP2.= ' à ' . $item->NaissanceVille;
|
||||
}
|
||||
if ( $item->NaissanceCp!= '' ) {
|
||||
$lineP2.= ' (' . $item->NaissanceCp . ')';
|
||||
}
|
||||
}
|
||||
|
||||
$administration[] = array(
|
||||
'Fct' => $lineP1,
|
||||
'Txt' => $lineP2,
|
||||
);
|
||||
}
|
||||
$Administration = $administration;
|
||||
|
||||
$tabCreation = array(
|
||||
'a1' => 'Création',
|
||||
'a2' => 'Création suite à déménagement',
|
||||
'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',
|
||||
);
|
||||
|
||||
$OrigineCreaction = $result->Origine;
|
||||
|
||||
if ( ( $OrigineCreaction*1>0 && $OrigineCreaction*1<9 )
|
||||
|| in_array($OrigineCreaction, array('A', 'B', 'C', 'D', 'E')) ){
|
||||
$Origine = $tabCreation['a'.$OrigineCreaction];
|
||||
} else {
|
||||
$Origine = '-';
|
||||
}
|
||||
|
||||
$Activite = $result->NafCode.' : '.$result->NafLabel;
|
||||
$BodaccActivite = $result->Activite;
|
||||
|
||||
if ( $result->ActiviteDate === null || $result->ActiviteDate == '0000-00-00 00:00:00') {
|
||||
$ActiviteDate = '';
|
||||
} else {
|
||||
$date = new Zend_Date($result->ActiviteDate, 'yyyy-MM-dd');
|
||||
$ActiviteDate = $date->toString('dd/MM/yyyy');
|
||||
}
|
||||
|
||||
$tabTypeExploitation = array(
|
||||
0 => "-",
|
||||
1 => "Locataire du fond de commerce",
|
||||
2 => "Loueur du fond de commerce",
|
||||
3 => "Prestation de personnel",
|
||||
10 => "Exploitation directe"
|
||||
);
|
||||
$Exploitation = $tabTypeExploitation[$result->Exploitation];
|
||||
|
||||
$Evenements = $result->Evenements->item;
|
||||
|
||||
$Depots = $result->Depots->item;
|
||||
|
||||
$Etablissements = $result->Etablissements->item;
|
||||
|
||||
if ( $result->DateMajRCS === null || $result->DateMajRCS == '0000-00-00 00:00:00') {
|
||||
$DateMajRCS = '';
|
||||
} else {
|
||||
$date = new Zend_Date($result->DateMajRCS, 'yyyy-MM-dd');
|
||||
$DateMajRCS = $date->toString('dd/MM/yyyy');
|
||||
}
|
||||
|
||||
// --- Création du PDF
|
||||
$c = Zend_Registry::get('config');
|
||||
$filepdf = $c->profil->path->files.'/avisrncs-'.$siren.'.pdf';
|
||||
try {
|
||||
$pdf = new Scores_Pdf_Tcpdf();
|
||||
$pdf->SetBackgroundImage('libs/modeles/avisrncs.jpg');
|
||||
$pdf->SetProtection(array('modify', 'copy'), '', null, 0, null);
|
||||
$pdf->SetCreator("Scores & Décisions");
|
||||
$pdf->SetAuthor("Scores & Décisions");
|
||||
$pdf->SetTitle('Avis de Situation RNCS');
|
||||
$pdf->SetSubject('Avis de Situation RNCS');
|
||||
|
||||
$pdf->SetAutoPageBreak(true, 0);
|
||||
$pdf->AddPage();
|
||||
|
||||
$pdf->SetFont('times', '', 12);
|
||||
$pdf->setColorArray('fill', array(0,0,140));
|
||||
$pdf->setColorArray('text', array(255,255,255));
|
||||
$pdf->Cell(0, 0, "AVIS DE SITUATION RNCS", 0, 1, 'C', true);
|
||||
$pdf->Cell(0, 0, "", 0, 1, 'L');
|
||||
|
||||
$pdf->SetFont('times', '', 10);
|
||||
$pdf->setColorArray('text', array(0,0,0));
|
||||
$pdf->Cell(0, 0, "REGISTRE NATIONAL DU COMMERCES ET DES SOCIETES", 0, 1, 'C');
|
||||
$pdf->Cell(0, 0, "", 0, 1, 'L');
|
||||
$pdf->Cell(0, 0, "Avis en date du ".$AvisDateTxt, 0, 1, 'C');
|
||||
$pdf->Cell(0, 0, "", 0, 1, 'L');
|
||||
|
||||
$border = array('B' => array('width' => 0.1, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)));
|
||||
$pdf->SetFont('times', 'B', 10);
|
||||
$pdf->Cell(0, 0, "IDENTIFICATION", $border, 1, 'L');
|
||||
$pdf->SetFont('times', '', 10);
|
||||
$pdf->Ln(1);
|
||||
if ($RadiationDate) {
|
||||
//@todo : Couleur texte rouge
|
||||
$pdf->Cell(0, 0, "Cette entreprise est radiée au RNCS.", 0, 1, 'C');
|
||||
}
|
||||
$pdf->Cell(0, 0, "Dénomination sociale : ".$Nom, 0, 1, 'L');
|
||||
if( empty($Sigle) ) {
|
||||
$pdf->Cell(0, 0, "Sigle : -", 0, 1, 'L');
|
||||
} else {
|
||||
$pdf->Cell(0, 0, "Sigle : ".$Sigle, 0, 1, 'L');
|
||||
}
|
||||
if( empty($Enseigne) ) {
|
||||
$pdf->Cell(0, 0, "Enseigne : -", 0, 1, 'L');
|
||||
} else {
|
||||
$pdf->Cell(0, 0, "Enseigne : ".$Enseigne, 0, 1, 'L');
|
||||
}
|
||||
if( empty($Sigle) ) {
|
||||
$pdf->Cell(0, 0, "Nom Commercial : -", 0, 1, 'L');
|
||||
} else {
|
||||
$pdf->Cell(0, 0, "Nom Commercial : ".$NomComercial, 0, 1, 'L');
|
||||
}
|
||||
$pdf->Cell(0, 0, "Numéro d'identification : ".$Siren." RCS ".$Tribunal, 0, 1, 'L');
|
||||
$pdf->Cell(0, 0, "Numéro de gestion : ".$NumGest, 0, 1, 'L');
|
||||
$pdf->Cell(0, 0, "Date d'immatriculation : ".$ImmatDate, 0, 1, 'L');
|
||||
if ($RadiationDate) {
|
||||
$pdf->Cell(0, 0, "", 0, 1, 'L');
|
||||
$pdf->Cell(0, 0, "Date de radiation : $RadiationDate", 0, 1, 'L');
|
||||
} else {
|
||||
$pdf->Cell(0, 0, "", 0, 1, 'L');
|
||||
|
||||
$pdf->SetFont('times', 'B', 10);
|
||||
$pdf->Cell(0, 0, "RENSEIGNEMENT RELATIF A L'IDENTITE", $border, 1, 'L');
|
||||
$pdf->SetFont('times', '', 10);
|
||||
$pdf->Ln(1);
|
||||
$pdf->Cell(0, 0, "Forme Juridique : $FormeJuridique", 0, 1, 'L');
|
||||
$pdf->Cell(0, 0, "Au capital de : $Capital", 0, 1, 'L');
|
||||
$pdf->Cell(0, 0, "Adresse du siège : $SiegeAdresse", 0, 1, 'L');
|
||||
$pdf->Cell(0, 0, "Date d’arrêté des comptes : $CompteArretDate", 0, 1, 'L');
|
||||
$pdf->Cell(0, 0, "Constitution : $ConstitutionActeDate", 0, 1, 'L');
|
||||
$pdf->Cell(0, 0, "Dépôt de l'acte constitutif: $ConstitutionDepotDate", 0, 1, 'L');
|
||||
$pdf->Cell(0, 0, "", 0, 1, 'L');
|
||||
|
||||
$pdf->SetFont('times', 'B', 10);
|
||||
$pdf->Cell(0, 0, "ADMINISTRATION", $border, 1, 'L');
|
||||
$pdf->SetFont('times', '', 10);
|
||||
$pdf->Ln(1);
|
||||
foreach ( $Administration as $item ) {
|
||||
$pdf->Cell(0, 0, $item['Fct']." : ".$item['Txt'], 0, 1, 'L');
|
||||
}
|
||||
$pdf->Cell(0, 0, "", 0, 1, 'L');
|
||||
|
||||
$pdf->SetFont('times', 'B', 10);
|
||||
$pdf->Cell(0, 0, "RENSEIGNEMENT RELATIF A L'ACTIVITE", $border, 1, 'L');
|
||||
$pdf->SetFont('times', '', 10);
|
||||
$pdf->Ln(1);
|
||||
$pdf->Cell(0, 0, "Origine de la société $Origine", 0, 1, 'L');
|
||||
$pdf->MultiCell(0, 0, "Activité : $Activite", 0, 'L', 0, 1);
|
||||
$pdf->MultiCell(0, 0, "Activité déclarée au BODACC : $BodaccActivite", 0, 'L', 0, 1);
|
||||
$pdf->Cell(0, 0, "Commencement de l'activité : $ActiviteDate", 0, 1, 'L');
|
||||
$pdf->Cell(0, 0, "Mode d'exploitation : $Exploitation", 0, 1, 'L');
|
||||
$pdf->Cell(0, 0, "", 0, 1, 'L');
|
||||
|
||||
$pdf->SetFont('times', 'B', 10);
|
||||
$pdf->Cell(0, 0, "JUGEMENTS RNCS", $border, 1, 'L');
|
||||
$pdf->SetFont('times', '', 10);
|
||||
$pdf->Ln(1);
|
||||
$pdf->Cell(0, 0, "Evénements :", 0, 1, 'L');
|
||||
//$pdf->SetMargins(50, 0);
|
||||
if (count($Evenements)>0) {
|
||||
foreach ( $Evenements as $item ) {
|
||||
$pdf->Cell(0, 0, $item, 0, 1, 'L');
|
||||
}
|
||||
} else {
|
||||
$pdf->SetX($pdf->GetX() + 20);
|
||||
$pdf->Cell(0, 0, "Néant.", 0, 1, 'L');
|
||||
}
|
||||
$pdf->Cell(0, 0, "", 0, 1, 'L');
|
||||
//$pdf->SetMargins(0, 0);
|
||||
|
||||
$pdf->SetFont('times', 'B', 10);
|
||||
$pdf->Cell(0, 0, "DEPOT LEGAL", $border, 1, 'L');
|
||||
$pdf->SetFont('times', '', 10);
|
||||
$pdf->Ln(1);
|
||||
$pdf->Cell(0, 0, "Décisions :", 0, 1, 'L');
|
||||
if ( count($Depots)>0 ) {
|
||||
foreach ( $Depots as $item ) {
|
||||
$depot = "Acte n°".$item->ActeNum;
|
||||
if ( $item->ActeDate != '0000-00-00' ) {
|
||||
$depot.= " du ".substr($item->ActeDate,8,2)."/".substr($item->ActeDate,5,2)."/".substr($item->ActeDate,0,4);
|
||||
}
|
||||
$depot.= " - Depot n°".$item->DepotNum." du ".substr($item->DepotDate,8,2)."/".substr($item->DepotDate,5,2)."/".substr($item->DepotDate,0,4);
|
||||
$pdf->SetX($pdf->GetX() + 20);
|
||||
$pdf->Cell(0, 0, $depot, 0, 1, 'L');
|
||||
$pdf->SetX($pdf->GetX() + 20);
|
||||
$pdf->Cell(0, 0, $item->ActeTypeLabel, 0, 1, 'L');
|
||||
foreach ($item->infos->item as $detail) {
|
||||
$pdf->SetX($pdf->GetX() + 20);
|
||||
$pdf->Cell(0, 0, $detail, 0, 1, 'L');
|
||||
}
|
||||
$pdf->Ln(2);
|
||||
}
|
||||
$pdf->Ln(1);
|
||||
$pdf->SetFont('times', 'I', 10);
|
||||
$pdf->Cell(0, 0, "Liste non exhaustive", 0, 1, 'L');
|
||||
}
|
||||
$pdf->Cell(0, 0, "", 0, 1, 'L');
|
||||
|
||||
$pdf->SetFont('times', 'B', 10);
|
||||
$pdf->Cell(0, 0, "AUTRES ETABLISSEMENTS", $border, 1, 'L');
|
||||
$pdf->SetFont('times', '', 10);
|
||||
$pdf->Ln(1);
|
||||
$pdf->Cell(0, 0, "Liste des établissements actifs :", 0, 1, 'L');
|
||||
$pdf->Ln(1);
|
||||
foreach ( $Etablissements as $etab ) {
|
||||
$pdf->SetX($pdf->GetX() + 20);
|
||||
$pdf->Cell(0, 0, $etab, 0, 1, 'L');
|
||||
$pdf->Ln(1);
|
||||
}
|
||||
}
|
||||
|
||||
$pdf->SetFont('times', '', 10);
|
||||
$pdf->Cell(0, 0, "", 0, 1, 'L');
|
||||
$pdf->Cell(0, 0, "Fin de l'avis de situation", 0, 1, 'C');
|
||||
$pdf->Cell(0, 0, "", 0, 1, 'L');
|
||||
$cgu = "Informations légales issues des données du Registre National du Commerce et des Sociétés".
|
||||
"issues de licence 2 dite de distribution RNCS IMR pour Scores & Decisions SAS contractée le 20 novembre 2009\n".
|
||||
"Scores & Decisions SAS est rediffuseur officiel du RNCS et propose un service privé, distinct du Registre public cité.";
|
||||
$pdf->SetFont('times', 'I', 8);
|
||||
$pdf->MultiCell(0, 0, $cgu, 0, 'L', 0, 1);
|
||||
|
||||
|
||||
$pdf->Output($filepdf, 'F');
|
||||
|
||||
} catch(Exception $e) {
|
||||
echo "Erreur à la création du PDF";
|
||||
}
|
||||
// --- Fin création PDF
|
||||
$content_type = 'application/pdf';
|
||||
if(file_exists($filepdf) && filesize($filepdf)>0) {
|
||||
header('Content-Transfer-Encoding: none');
|
||||
header('Content-type: ' . $content_type.'');
|
||||
header('Content-Length: ' . filesize($filepdf));
|
||||
header('Content-MD5: ' . base64_encode(md5_file($filepdf)));
|
||||
header('Content-Disposition: filename="' . basename($filepdf) . '"');
|
||||
header('Cache-Control: private, max-age=0, must-revalidate');
|
||||
header('Pragma: public');
|
||||
ini_set('zlib.output_compression', '0');
|
||||
echo file_get_contents($filepdf);
|
||||
} else {
|
||||
echo "Erreur lors de l'affichage du fichier.";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -69,7 +69,7 @@ div.avisrncs-footer p { margin:0; padding:0; }
|
||||
<p><?=$item['Fct']?> : <?=$item['Txt']?></p>
|
||||
<?php }?>
|
||||
|
||||
<h3><?=$this->translate("RENSEIGNEMENT RELATIFS A L'ACTIVITE")?></h3>
|
||||
<h3><?=$this->translate("RENSEIGNEMENT RELATIF A L'ACTIVITE")?></h3>
|
||||
|
||||
<p>Origine de la société : <?=$this->Origine?></p>
|
||||
<p>Activité : <?=$this->Activite?></p>
|
||||
|
61
application/views/default/scripts/identite/avisrncspdf.phtml
Normal file
61
application/views/default/scripts/identite/avisrncspdf.phtml
Normal file
@ -0,0 +1,61 @@
|
||||
<?php if (empty($this->AutrePage)) {?>
|
||||
<div id="center">
|
||||
<?php }?>
|
||||
|
||||
<?php if ( $this->error ) {?>
|
||||
|
||||
<div class="paragraph">
|
||||
Erreur
|
||||
</div>
|
||||
|
||||
<?php } elseif ( $this->message ) {?>
|
||||
|
||||
<?=$this->message?>
|
||||
|
||||
<?php } else {?>
|
||||
|
||||
<style>
|
||||
div.avisrncs-title { text-align:center; }
|
||||
div.avisrncs-title h1 { background:none !important; color:#000000 !important; }
|
||||
div.avisrncs-content h3 { border-bottom:1px solid; }
|
||||
div.avisrncs-header p { margin:0; padding:0; }
|
||||
div.avisrncs-footer p { margin:0; padding:0; }
|
||||
</style>
|
||||
|
||||
<div class="paragraph">
|
||||
<div class="avisrncs-header">
|
||||
<p>Avis de situtation RNCS édité le <?=$this->AvisDateTxt?></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="avisrncs-title">
|
||||
<h2><?=$this->translate("AVIS DE SITUATION RNCS")?></h2>
|
||||
<p><?=$this->translate("REGISTRE NATIONAL DU COMMERCES ET DES SOCIETES")?></p>
|
||||
<p><?=$this->translate("Avis en date du ")?><?=$this->AvisDateTxt?></p>
|
||||
</div>
|
||||
|
||||
<div class="paragraph">
|
||||
<div class="avisrncs-content">
|
||||
<h3><?=$this->translate("IDENTIFICATION")?></h3>
|
||||
|
||||
<?php if ($this->RadiationDate) {?>
|
||||
<p style="font:weight;">Cette entreprise est radiée au RNCS.</p>
|
||||
<?php }?>
|
||||
|
||||
<p>Dénomination sociale : <?=$this->Nom?></p>
|
||||
<p>Sigle : <?=$this->Sigle?></p>
|
||||
<p>Enseigne : <?=$this->Enseigne?></p>
|
||||
<p>Nom Commercial : <?=$this->NomComercial?></p>
|
||||
<p>Numéro d'identification : <?=$this->SirenTexte($this->Siren)?> RCS <?=$this->Tribunal?></p>
|
||||
<p>Numéro de gestion : <?=$this->NumGest?></p>
|
||||
<p>Date d'immatriculation : <?=$this->ImmatDate?></p>
|
||||
|
||||
<?php if ($this->RadiationDate) {?>
|
||||
<p>Date de radiation : <?=$this->RadiationDate?></p>
|
||||
<?php } ?>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<?php if (empty($this->AutrePage)) {?>
|
||||
</div>
|
||||
<?php }?>
|
@ -358,8 +358,8 @@ class IdentiteEntreprise
|
||||
{
|
||||
$user = new Scores_Utilisateur();
|
||||
$data = '';
|
||||
if ( intval($this->identite->Siren)!=0 && $user->getIdClient()==1 /*$user->checkPerm('avisrncs')*/ ) {
|
||||
$data ='<a title="Voir l\'avis de situation RNCS" target="_blank" href="/identite/avisrncs/siret/'.
|
||||
if ( intval($this->identite->Siren)!=0 && $user->checkPerm('avisrncs') ) {
|
||||
$data ='<a title="Voir l\'avis de situation RNCS" target="_blank" href="/identite/avisrncspdf/siret/'.
|
||||
$this->identite->Siret.'">Situation au répertoire RNCS</a>';
|
||||
}
|
||||
|
||||
|
30
library/Scores/Pdf/Fpdi.php
Normal file
30
library/Scores/Pdf/Fpdi.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
require_once 'Vendors/tcpdf/tcpdf.php';
|
||||
|
||||
require_once 'Vendors/fpdi/fpdi.php';
|
||||
|
||||
class Scores_Pdf_Fpdi extends FPDI
|
||||
{
|
||||
/**
|
||||
* "Remembers" the template id of the imported page
|
||||
*/
|
||||
var $_tplIdx;
|
||||
|
||||
/**
|
||||
* Draw an imported PDF logo on every page
|
||||
* @param string $template
|
||||
*/
|
||||
function Header()
|
||||
{
|
||||
if (is_null($this->_tplIdx)) {
|
||||
$this->setSourceFile($template);
|
||||
$this->_tplIdx = $this->importPage(1);
|
||||
}
|
||||
$this->useTemplate($this->_tplIdx);
|
||||
}
|
||||
|
||||
function Footer()
|
||||
{
|
||||
// emtpy method body
|
||||
}
|
||||
}
|
65
library/Scores/Pdf/Page.php
Normal file
65
library/Scores/Pdf/Page.php
Normal file
@ -0,0 +1,65 @@
|
||||
<?php
|
||||
class Scores_Pdf_Page extends Zend_Pdf_Page
|
||||
{
|
||||
|
||||
/**
|
||||
* Cette fonction retourne la largeur typographique d'un string.
|
||||
* @param string $text_line le texte à utiliser
|
||||
* @return integer la largeur du texte
|
||||
*/
|
||||
protected function _getTextWidth($text_line)
|
||||
{
|
||||
$current_font = $this->getFont() ;
|
||||
$font_size = $this->getFontSize() ;
|
||||
// initialisation des tableaux
|
||||
$glyph_array = $char_array = array();
|
||||
$total_item_width = 0;
|
||||
// on converti le texte en tableau et on récupère les codes ASCII
|
||||
$text_array = str_split($text_line, 1);
|
||||
foreach($text_array as $character) {
|
||||
$char_array[] = ord($character);
|
||||
}
|
||||
// on récupère ensuite le numéro du glyphe d'après le code ASCII
|
||||
$glyph_array = $current_font->glyphNumbersForCharacters($char_array) ;
|
||||
// Zend_Pdf_Font nous permet de récupérer la largeur des glyphes
|
||||
$text_width = $current_font->widthsForGlyphs($glyph_array);
|
||||
// on additionne tous les caractères pour obtenir la largeur totale
|
||||
foreach($text_width as $char_width) {
|
||||
$total_item_width += $char_width;
|
||||
}
|
||||
// petite transformation pour obtenir notre taille en quelque chose d'utilisable
|
||||
return ($total_item_width / 1000) * $font_size;
|
||||
}
|
||||
|
||||
/**
|
||||
* Dessine du texte aligné à droite de $x
|
||||
*/
|
||||
public function drawTextAlignRight($text, $x, $y)
|
||||
{
|
||||
$width = $this->_getTextWidth($text) ;
|
||||
// on écrit le texte à la position donnée - la largeur du texte
|
||||
$this->drawText($text, $x - $width, $y) ;
|
||||
}
|
||||
|
||||
/**
|
||||
* Dessine du texte centré sur $x
|
||||
*/
|
||||
public function drawTextAlignCenter($text, $x, $y)
|
||||
{
|
||||
$width = $this->_getTextWidth($text) ;
|
||||
// on écrit le texte à la position donnée - la moitié de la largeur du texte
|
||||
$this->drawText($text, $x - ($width / 2), $y) ;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param number $bottom
|
||||
*/
|
||||
public function heightWithMargin($bottom = 0)
|
||||
{
|
||||
$current_font = $this->getFont();
|
||||
return $current_font->getLineHeight() + $bottom;
|
||||
}
|
||||
|
||||
|
||||
}
|
50
library/Scores/Pdf/Tcpdf.php
Normal file
50
library/Scores/Pdf/Tcpdf.php
Normal file
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
require_once 'Vendors/tcpdf/tcpdf.php';
|
||||
|
||||
class Scores_Pdf_Tcpdf extends TCPDF
|
||||
{
|
||||
protected $bgimage = null;
|
||||
|
||||
public function SetBackgroundImage($file)
|
||||
{
|
||||
$this->bgimage = $file;
|
||||
}
|
||||
|
||||
/**
|
||||
* (non-PHPdoc)
|
||||
* @see TCPDF::Header()
|
||||
*/
|
||||
public function Header()
|
||||
{
|
||||
if ($this->bgimage) {
|
||||
// get the current page break margin
|
||||
$bMargin = $this->getBreakMargin();
|
||||
// get current auto-page-break mode
|
||||
$auto_page_break = $this->AutoPageBreak;
|
||||
// disable auto-page-break
|
||||
$this->SetAutoPageBreak(false, 0);
|
||||
// set bacground image
|
||||
$this->Image($this->bgimage, 0, 0, 210, 297, '', '', '', false, 300, '', false, false, 0);
|
||||
// restore auto-page-break status
|
||||
$this->SetAutoPageBreak($auto_page_break, 20);
|
||||
// set the starting point for the page content
|
||||
$this->setPageMark();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* (non-PHPdoc)
|
||||
* @see TCPDF::Footer()
|
||||
*/
|
||||
public function Footer()
|
||||
{
|
||||
// Position at 15 mm from bottom
|
||||
$this->SetY(-15);
|
||||
// Set font
|
||||
$this->SetFont('helvetica', 'I', 8);
|
||||
// Page number
|
||||
$this->Cell(0, 10, 'Page '.$this->getAliasNumPage().'/'.$this->getAliasNbPages(), 0, false, 'C', 0, '', 0, false, 'T', 'M');
|
||||
}
|
||||
|
||||
|
||||
}
|
BIN
public/libs/modeles/avisrncs.jpg
Normal file
BIN
public/libs/modeles/avisrncs.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 16 KiB |
BIN
public/libs/modeles/avisrncs.pdf
Normal file
BIN
public/libs/modeles/avisrncs.pdf
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user