From fddb19d880bcb2558dd0fe15f5b74547d88cc0ef Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Tue, 13 Apr 2010 16:02:43 +0000 Subject: [PATCH] =?UTF-8?q?Utilisation=20du=20premier=20tribunal=20disponi?= =?UTF-8?q?ble=20dans=20la=20liste=20des=20comp=C3=A9tences?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- www/pages_saisie/gencourrier.php | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/www/pages_saisie/gencourrier.php b/www/pages_saisie/gencourrier.php index 9f87a27c3..51ebf2c77 100644 --- a/www/pages_saisie/gencourrier.php +++ b/www/pages_saisie/gencourrier.php @@ -81,14 +81,18 @@ $client = new SoapClient(null, array( $O = $client->getIdentite($siren, '', false); $etab = $O['result']; - -$tribunalCode = $etab['TribunalCode']; $codeCommune = $etab['codeCommune']; $dept = $etab['Dept']; $siret = $etab['Siret']; - $numRC = $etab['NumRC']; -$tribunalLib = $etab['TribunalLib']; + +//Adresse du tribunal de commerce +$O = $client->getListeCompetences($siret, 'tri', $dept.$codeCommune); +$competences = $O['result']; +$competence = $competences[0]; + +$tribunalCode = $competence['Code']; +$tribunalLib = $comptence['Nom']; if (preg_match('/(A|B|C|D)/i', $numRC)) { $libTrib = ' RCS '.preg_replace('/(^TC |^TI |^TGIcc |^TMX )/i','',$tribunalLib); @@ -107,17 +111,7 @@ $pdfInfo->adresse[] = $etab['Adresse']; $pdfInfo->adresse[] = $etab['Adresse2']; $pdfInfo->adresse[] = $etab['CP'].' '.$etab['Ville']; -//Adresse du tribunal de commerce -$O = $client->getListeCompetences($siret, 'tri', $dept.$codeCommune); -$competences = $O['result']; -foreach($competences as $competence) -{ - if($competence['Code']==$tribunalCode) - { - $pdfInfo->tribunal = $competence; - break; - } -} +$pdfInfo->tribunal = $competence; //Prix $q = Doctrine_Query::create()