This commit is contained in:
Aram HARUTYUNYAN 2014-02-11 10:55:23 +00:00
parent 790aa91b56
commit debe30b5a7
2 changed files with 97 additions and 66 deletions

View File

@ -0,0 +1,6 @@
<?php
class Application_Model_Sdv1GreffeCommandesKb extends Zend_Db_Table_Abstract
{
protected $_name = 'greffe_commandes_kb';
protected $_schema = 'sdv1';
}

View File

@ -8,11 +8,13 @@ class Pieces extends WsScore
* Récupération d'un kbis
* @param string $siren
* SIREN
* @param string $options
* To define
* @param string $diffusion
* Mode de diffusion (M|C)
* @param string $reference
* Reference du client
* @return string
*/
public function getKbis($siren, $options = '')
public function getKbis($siren, $diffusion, $reference = '')
{
$this->authenticate();
$this->permission('KBIS');
@ -24,6 +26,28 @@ class Pieces extends WsScore
$this->sendError('1020');
}
switch ( $diffusion ) {
case 'M':
case 'C':
$refCommande = uniqid();
$iInsee = new MInsee();
$identite = $iInsee->getIdentiteLight($siren);
$commande = new Application_Model_Sdv1GreffeCommandesKb();
$id = $commande->insert(array(
'refCommande' => $refCommande,
'login' => $this->tabInfoUser['login'],
'email' => $this->tabInfoUser['email'],
'refClient' => $reference,
'mode' => $diffusion,
'siren' => $siren,
'raisonSociale' => $identite['Nom'],
'dateInsert' => date('YmdHis'),
));
break;
default:
$hostname = 'http://'.$_SERVER['SERVER_NAME'];
if ($_SERVER['SERVER_PORT']!='80'){
$hostname.= ':'.$_SERVER['SERVER_PORT'];
@ -89,6 +113,7 @@ class Pieces extends WsScore
return $hostname.DOC_WEB_URL.'kbis/'.basename($filepdf);
}
}
}
/**
* Liste des bilans disponible au format image