ajout gestion bilan confidentiel

This commit is contained in:
benoitpotier 2017-03-17 11:59:12 +01:00
parent 45434cdd18
commit 438c98ba01
4 changed files with 76 additions and 62 deletions

View File

@ -364,7 +364,7 @@ class Metier_Partenaires_MBilans
$where.= " LIMIT 0, $nbMaxBilans";
}
$fields = "typeBilan, dateProvPartenaire, dateExercice, dateExercicePre, dureeExercice, dureeExercicePre, monnaieOrigine, dateInsert, partenaire";
$fields = "typeBilan, dateProvPartenaire, dateExercice, dateExercicePre, dureeExercice, dureeExercicePre, monnaieOrigine, dateInsert, partenaire, confidentiel";
$listeNb = 0;
try {
$listeSql = "SELECT $fields FROM jo.bilans WHERE $where";
@ -392,6 +392,7 @@ class Metier_Partenaires_MBilans
'dureeExercicePre' => $bil['dureeExercicePre'],
'monnaie' => $bil['monnaieOrigine'],
'source' => $bil['partenaire'],
'confidentiel' => $bil['confidentiel'],
);
$tabTri[''.$bil['dateExercice'].'-'.$bil['typeBilan']] = $bil['typeBilan'].$millesime;
}

View File

@ -4330,6 +4330,7 @@ class Entreprise extends Scores_Ws_Server
$element->dureeExercicePre = $bilan['dureeExercicePre'];
$element->monnaie = $bilan['monnaie'];
$element->source = $bilan['source'];
$element->confidentiel = $bilan['confidentiel'];
$tabRet[] = $element;
}

View File

@ -269,10 +269,10 @@ class Identite
*/
public $NbEtab;
/**
* Numéro isin
* @var string
*/
/**
* Numéro isin
* @var string
*/
public $Isin;
/**
@ -2366,6 +2366,11 @@ class ListeBilans
* @var int
*/
public $source;
/** Confidentialité du bilan (1 si confidentiel, 0 sinon)
* @var int
*/
public $confidentiel;
}
class SetSurveillanceReturn
@ -2550,6 +2555,11 @@ class Bilan
*/
public $SOURCE;
/** Bilan confidentiel ou non
* @var string
*/
public $TOP_CONFIDENTIEL;
/** Tableau de postes du bilan dans le formalisme associé au Type de bilan
* @var BilanPoste[]
*/

View File

@ -73,16 +73,16 @@ class Saisie extends Scores_Ws_Server
$tabScores = $tabInfos['score'];
//Valider le code Isin
if (strlen(trim($tabIdentite['isin']))) {
$iBourse = new Metier_Partenaires_MBourse();
if (!$iBourse->isIsin($tabIdentite['isin'])) {
$error->errnum = 1;
if (strlen(trim($tabIdentite['isin']))) {
$iBourse = new Metier_Partenaires_MBourse();
if (!$iBourse->isIsin($tabIdentite['isin'])) {
$error->errnum = 1;
$error->errmsg = 'Code Isin incorrect.';
$output = new SetInfosEntrepReturn();
$output->error = $error;
$output->result = $result;
return $output;
}
return $output;
}
}
// Mise à jour de l'identité
@ -1257,21 +1257,21 @@ class Saisie extends Scores_Ws_Server
break;
}
$iInsee = new Metier_Insee_MInsee();
$iInsee = new Metier_Insee_MInsee();
$entrep = $iInsee->getIdentiteLight($siren, $nic);
if ( empty($entrep['id']) || intval($entrep['id'])==0 ) {
$this->sendError('1020');
}
$data = array(
'siren' => $siren,
'nic' => $nic,
'dateProvPartenaire'=> date('Y').date('m').date('d'),
'typeTel' => $type,
'infoTel' => $info,
'telephone' => $value,
'actif' => 1,
'partenaire' => 175,
$data = array(
'siren' => $siren,
'nic' => $nic,
'dateProvPartenaire'=> date('Y').date('m').date('d'),
'typeTel' => $type,
'infoTel' => $info,
'telephone' => $value,
'actif' => 1,
'partenaire' => 175,
);
if ( $id === null ) {
@ -1386,16 +1386,18 @@ class Saisie extends Scores_Ws_Server
* Postes et Information du bilan
* @param string $step (normal|nocheck|onlycheck)
* Etape
* @param string $confidentiel (0: non|idCient: oui)
* Confidentialité
* @return int
* @throws SoapFault
*/
public function setBilan($siren, $cloture, $type, $data, $step = null)
public function setBilan($siren, $cloture, $type, $data, $step = null, $confidentiel=0)
{
$this->authenticate();
// --- Control input value
if ( strlen($siren)!=9 ) {
$this->sendError('1010');
// --- Control input value
if ( strlen($siren)!=9 ) {
$this->sendError('1010');
}
$tabPostes = array();
@ -1407,8 +1409,8 @@ class Saisie extends Scores_Ws_Server
if (!preg_match('/[0-9]{8}/', $data->dateCloture)) {
throw new SoapFault('MSG', "Erreur Date de cloture");
}
if ($data->dateCloturePre != 'AAAAMMJJ' && !preg_match('/[0-9]{8}/', $data->dateCloturePre)) {
throw new SoapFault('MSG', "Erreur Date de cloture précédente");
if ($data->dateCloturePre != 'AAAAMMJJ' && !preg_match('/[0-9]{8}/', $data->dateCloturePre)) {
throw new SoapFault('MSG', "Erreur Date de cloture précédente");
}
if ($data->dateCloturePre == 'AAAAMMJJ') {
$data->dateCloturePre = 0;
@ -1450,21 +1452,21 @@ class Saisie extends Scores_Ws_Server
}
// --- Insertion dans la bdd
else {
try {
$bilansM = new Application_Model_JoBilans();
$sql = $bilansM->select()
->where('siren=?', $siren)
->where('dateExercice=?', $cloture)
->where('typeBilan=?', $type);
->where('typeBilan=?', $type);
$row = $bilansM->fetchRow($sql);
} catch (Zend_Db_Exception $e) {
if ($this->User->idClient!=1) {
throw new SoapFault('ERR', "Application error");
} else {
throw new SoapFault('ERR', $e->getMessage());
}
} catch (Zend_Db_Exception $e) {
if ($this->User->idClient!=1) {
throw new SoapFault('ERR', "Application error");
} else {
throw new SoapFault('ERR', $e->getMessage());
}
}
$postesDiff = array();
@ -1485,7 +1487,7 @@ class Saisie extends Scores_Ws_Server
'unite' => $data->unite,
'postes' => $data->postes,
'partenaire' => 1,
'confidentiel' => 0,
'confidentiel' => $confidentiel,
'dateInsert' => date('YmdHis'),
);
@ -1532,7 +1534,7 @@ class Saisie extends Scores_Ws_Server
'unite' => $data->unite,
'postes' => $data->postes,
'partenaire' => 1,
'confidentiel' => 0,
'confidentiel' => $confidentiel,
'dateInsert' => date('YmdHis'),
);
@ -1555,7 +1557,7 @@ class Saisie extends Scores_Ws_Server
// --- Save user
$userM = new Application_Model_JoBilansUser();
try {
try {
$userM->insert(array(
'idUtilisateur' => $this->User->id,
'login' => $this->User->login,
@ -1564,13 +1566,13 @@ class Saisie extends Scores_Ws_Server
'typeBilan' => $data->typeBilan,
'dateAction' => date('YmdHis'),
'postesDiff' => implode(';', $postesDiff),
));
} catch (Zend_Db_Exception $e) {
if ($this->User->idClient!=1) {
throw new SoapFault('ERR', "Application error");
} else {
throw new SoapFault('ERR', $e->getMessage());
}
));
} catch (Zend_Db_Exception $e) {
if ($this->User->idClient!=1) {
throw new SoapFault('ERR', "Application error");
} else {
throw new SoapFault('ERR', $e->getMessage());
}
}
return $id;
@ -1749,8 +1751,8 @@ class Saisie extends Scores_Ws_Server
if (strlen(trim($dataRef['isin']))) {
$iBourse = new Metier_Partenaires_MBourse();
if (!$iBourse->isIsin($dataRef['isin'])) {
throw new SoapFault('ERR', 'Code Isin incorrect.');
if (!$iBourse->isIsin($dataRef['isin'])) {
throw new SoapFault('ERR', 'Code Isin incorrect.');
}
}
@ -2345,20 +2347,20 @@ class Saisie extends Scores_Ws_Server
}
if ($result) return true;
}
//Move active participations if TUP and Fusion selected
elseif ($action=='tupfusion')
{
try {
$result = $lienM->update(array('idAct'=>$id, 'idUpdate'=>$this->User->id),
"idAct=$idLien AND actif=1 AND dateSuppr='0000-00-00 00:00:00'");
} catch (Zend_Db_Exception $e) {
if ($this->User->idClient==1) {
throw new SoapFault('ERR', $e->getMessage());
} else {
throw new SoapFault('ERR', "Application error");
}
}
if ($result) return true;
//Move active participations if TUP and Fusion selected
elseif ($action=='tupfusion')
{
try {
$result = $lienM->update(array('idAct'=>$id, 'idUpdate'=>$this->User->id),
"idAct=$idLien AND actif=1 AND dateSuppr='0000-00-00 00:00:00'");
} catch (Zend_Db_Exception $e) {
if ($this->User->idClient==1) {
throw new SoapFault('ERR', $e->getMessage());
} else {
throw new SoapFault('ERR', "Application error");
}
}
if ($result) return true;
}
return false;
@ -2593,7 +2595,7 @@ class Saisie extends Scores_Ws_Server
}
return $result;
case 'edit':
case 'edit':
$tabRet['idUpdate'] = $userId;
try {
$result = $dirOp->update($tabRet, $where);