From b54d900729ffcc95de773c65c8d3e57e5cbe4fee Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Tue, 15 Jun 2010 12:46:12 +0000 Subject: [PATCH] =?UTF-8?q?G=C3=A9n=C3=A9ration=20courrier=20kbis=20(beta)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- includes/infogreffe/gestion.php | 21 +++++++++++--- www/pages_saisie/gencourrier.php | 49 +++++++++++++++++++++++--------- 2 files changed, 52 insertions(+), 18 deletions(-) diff --git a/includes/infogreffe/gestion.php b/includes/infogreffe/gestion.php index 4d8e775ad..1239d762b 100644 --- a/includes/infogreffe/gestion.php +++ b/includes/infogreffe/gestion.php @@ -301,8 +301,21 @@ function afficheCommande($commande, $type){ 'K' . $commande->id . '' . ''; + /* + * Formulaire pour modifier l'état d'une commande courrier S&D + */ + $contenuEtat = ''; + if ($typeCommande=='C' && hasModeEdition()){ + $cStatuts = listStatus(); + + $contenuEtat.= 'Générer le courrier'; + } + + + if ($colspan == 1){ - $output.= ''.''.''; + $output.= '' . $contenuEtat . ''; } $output.= ''; @@ -314,10 +327,10 @@ function afficheCommande($commande, $type){ ' '. ' '; - if ($commande->type=='C'){ + if ( $commande->type=='C' ) { $output.= 'Commmande de kbis original par courrier.'; - }elseif ($commande->type=='M'){ + } elseif ( $commande->type=='M' ) { $output.= 'Commmande de kbis par email.'; } @@ -403,7 +416,7 @@ function afficheCommande($commande, $type){ } $contenuEtat.= ''; - $contenuEtat.= 'idCommande.'"target="_blank">Générer le courrier'; } diff --git a/www/pages_saisie/gencourrier.php b/www/pages_saisie/gencourrier.php index bd6e88a27..cf0f37ea4 100644 --- a/www/pages_saisie/gencourrier.php +++ b/www/pages_saisie/gencourrier.php @@ -50,24 +50,39 @@ $pdfInfo = new StdClass(); // => Ref $id = $_REQUEST['id']; -$pdfInfo->ref = 'C'.$id; +$typeCommande = substr($id, 0, 1); +$pdfInfo->ref = substr($id, 1); -// => Info Commande -$q = Doctrine_Query::create() - ->from('Commandes') - ->where('idCommande = ?', $id) - ->andWhere('typeCommande = ?', 'C'); +if ( $typCommande == 'C' ) { -$commande = $q->fetchOne(); -if( preg_match('/^([0-9]{4}_).*?$/', $commande->refDocument, $matches) ) -{ - $typeDocument = 'bilans'; -} -else -{ - $typeDocument = 'actes'; + // => Info Commande + $q = Doctrine_Query::create() + ->from('Commandes') + ->where('idCommande = ?', $pdfInfo->ref) + ->andWhere('typeCommande = ?', 'C'); + + $commande = $q->fetchOne(); + if( preg_match('/^([0-9]{4}_).*?$/', $commande->refDocument, $matches) ) + { + $typeDocument = 'bilans'; + } + else + { + $typeDocument = 'actes'; + } + +} elseif ( $typeCommande == 'K'){ + // => Info Commande + $q = Doctrine_Query::create() + ->from('CommandesKbis') + ->where('idCommande = ?', $pdfInfo->ref) + ->andWhere('typeCommande = ?', 'C'); + + $commande = $q->fetchOne(); + $typeDocument = 'kbis'; } + // => Identite $siren = $commande->siren; @@ -208,6 +223,12 @@ elseif( $typeDocument == 'actes' ) substr($commande->refDocument,9,2).'/'. substr($commande->refDocument,7,2).'/'. substr($commande->refDocument,3,4); +} +elseif ($typeDocument == 'kbis' ) +{ + + + } $positionY = $pdf->GetY()+2;