Merge branch 'bilanconfidentiel' into 'develop'
Bilanconfidentiel See merge request !1
This commit is contained in:
commit
66ecfde615
@ -349,7 +349,7 @@ class Metier_Partenaires_MBilans
|
||||
* Nombre de bilans maximums retournés
|
||||
* @return array
|
||||
*/
|
||||
public function listeBilans($accesPartenaire = false, $nbMaxBilans = 0)
|
||||
public function listeBilans($accesPartenaire = false, $nbMaxBilans = 0, $idClient = 0)
|
||||
{
|
||||
$dateDerDepot = 0;
|
||||
$tabRet = $tabRet2 = $tabRet3 = $tabRet = array();
|
||||
@ -358,12 +358,21 @@ class Metier_Partenaires_MBilans
|
||||
if ($this->companyEvenDateStop !== null) {
|
||||
$where.= " AND dateExercice<'".$this->companyEvenDateStop."'";
|
||||
}
|
||||
|
||||
// --- Si c'est un client qui consulte, alors il ne peut voir que ses bilans confidentiels ou tous les bilans publiques.
|
||||
// --- 0 : consultation de l'application (calcul du score ...)
|
||||
// --- 1 : consultation d'un membre de scores et décisions
|
||||
// --- 147 : consultation d'un opérateur de l'arménie
|
||||
if ($idClient > 1 && $idClient != 147) {
|
||||
$where.= " AND (confidentiel_client = ".$idClient." OR confidentiel = 0)";
|
||||
}
|
||||
|
||||
$where.= " ORDER BY dateExercice DESC, CASE typeBilan WHEN 'N' THEN 1 WHEN 'S' THEN 2 ELSE 3 END";
|
||||
if ($nbMaxBilans > 0) {
|
||||
$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, confidentiel_client";
|
||||
$listeNb = 0;
|
||||
try {
|
||||
$listeSql = "SELECT $fields FROM jo.bilans WHERE $where";
|
||||
@ -391,6 +400,8 @@ class Metier_Partenaires_MBilans
|
||||
'dureeExercicePre' => $bil['dureeExercicePre'],
|
||||
'monnaie' => $bil['monnaieOrigine'],
|
||||
'source' => $bil['partenaire'],
|
||||
'confidentiel' => $bil['confidentiel'],
|
||||
'confidentielClient' => $bil['confidentiel_client'],
|
||||
);
|
||||
$tabTri[''.$bil['dateExercice'].'-'.$bil['typeBilan']] = $bil['typeBilan'].$millesime;
|
||||
}
|
||||
|
@ -3335,7 +3335,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
if(!in_array($key, array('SIREN', 'DATE_FRAICHE_BILAN',
|
||||
'DATE_CLOTURE', 'DATE_CLOTURE_PRE', 'DUREE_MOIS',
|
||||
'DUREE_MOIS_PRE', 'MONNAIE', 'CONSOLIDE', 'MONNAIE_ORI',
|
||||
'MONNAIE_LIV_UNITE', 'SOURCE', 'devise'))){
|
||||
'MONNAIE_LIV_UNITE', 'SOURCE', 'devise', 'TOP_CONFIDENTIEL'))){
|
||||
$resultPoste = new BilanPoste();
|
||||
$resultPoste->id = $key;
|
||||
$resultPoste->val = $value;
|
||||
|
@ -4384,7 +4384,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
|
||||
$mBil = new Metier_Partenaires_MBilans();
|
||||
$mBil->setSiren($siren);
|
||||
$tabBilans = $mBil->listeBilans(true);
|
||||
$tabBilans = $mBil->listeBilans(true, 0, $this->User->idClient);
|
||||
foreach($tabBilans as $bilan) {
|
||||
$element = new ListeBilans();
|
||||
$element->dateProvPartenaire = $bilan['dateProvPartenaire']; //@todo : date
|
||||
@ -4397,6 +4397,8 @@ class Entreprise extends Scores_Ws_Server
|
||||
$element->dureeExercicePre = $bilan['dureeExercicePre'];
|
||||
$element->monnaie = $bilan['monnaie'];
|
||||
$element->source = $bilan['source'];
|
||||
$element->confidentiel = $bilan['confidentiel'];
|
||||
$element->confidentielClient = $bilan['confidentielClient'];
|
||||
$tabRet[] = $element;
|
||||
}
|
||||
|
||||
@ -4703,7 +4705,7 @@ class Entreprise extends Scores_Ws_Server
|
||||
// Ratios
|
||||
$mBil = new Metier_Partenaires_MBilans();
|
||||
$mBil->setSiren($siren);
|
||||
$tabBilans = $mBil->listeBilans($accesPartenaire, 5);
|
||||
$tabBilans = $mBil->listeBilans($accesPartenaire, 5, $this->User->idClient);
|
||||
$nbBilans = count($tabBilans);
|
||||
$tabBilan = $tabBil = array();
|
||||
if ($nbBilans > 0) {
|
||||
|
@ -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[]
|
||||
*/
|
||||
|
@ -1485,7 +1485,7 @@ class Saisie extends Scores_Ws_Server
|
||||
'unite' => $data->unite,
|
||||
'postes' => $data->postes,
|
||||
'partenaire' => 1,
|
||||
'confidentiel' => 0,
|
||||
'confidentiel' => 0,
|
||||
'dateInsert' => date('YmdHis'),
|
||||
);
|
||||
|
||||
@ -1532,7 +1532,7 @@ class Saisie extends Scores_Ws_Server
|
||||
'unite' => $data->unite,
|
||||
'postes' => $data->postes,
|
||||
'partenaire' => 1,
|
||||
'confidentiel' => 0,
|
||||
'confidentiel' => 0,
|
||||
'dateInsert' => date('YmdHis'),
|
||||
);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user