From 4a384d6f7905cb0ae5ee21a86ba83817c5c8b69d Mon Sep 17 00:00:00 2001 From: benoitpotier Date: Fri, 17 Mar 2017 11:55:24 +0100 Subject: [PATCH 1/8] ajout message bilan confidentiel lors de la consultations d'un bilan de liasse fiscale, ajout d'un champ confidentiel lors de la saisie d'un bilan --- .../default/controllers/SaisieController.php | 730 +++++++++--------- .../default/scripts/finance/liasse.phtml | 9 + .../views/default/scripts/saisie/liasse.phtml | 3 +- .../default/scripts/saisie/liasse/2033.phtml | 4 + .../default/scripts/saisie/liasse/2050.phtml | 4 + library/Scores/WsScores.php | 513 ++++++------ 6 files changed, 644 insertions(+), 619 deletions(-) diff --git a/application/modules/default/controllers/SaisieController.php b/application/modules/default/controllers/SaisieController.php index 2f279cb70..d2c3b9800 100644 --- a/application/modules/default/controllers/SaisieController.php +++ b/application/modules/default/controllers/SaisieController.php @@ -9,203 +9,203 @@ class SaisieController extends Zend_Controller_Action * test de type de voie * @todo vérifier si type de voie à jour */ - protected $codVoie = array( - 'ABE' => "Abbaye", - 'AGL' => "Agglomération", - 'AIRE' => "Aire", - 'ALL' => "Allée", - 'ALL' => "Allee", - 'ACH' => "Ancien chemin", - 'ART' => "Ancienne route", - 'ANSE' => "Anse", - 'ARC' => "Arcade", - 'AUT' => "Autoroute", - 'AV' => "Avenue", - 'BRE' => "Barrière", - 'BCH' => "Bas chemin", - 'BSTD' => "Bastide", - 'BAST' => "Baston", - 'BEGI' => "Beguinage", - 'BER' => "Berge", - 'BOIS' => "Bois", - 'BCLE' => "Boucle", - 'BD' => "Boulevard", - 'BRG' => "Bourg", - 'BUT' => "Butte", - 'CALE' => "Cale", - 'CAMP' => "Camp", - 'CGNE' => "Campagne", - 'CPG' => "Camping", - 'CARR' => "Carré", - 'CAU' => "Carreau", - 'CAR' => "Carrefour", - 'CARE' => "Carrière", - 'CST' => "Castel", - 'CAV' => "Cavée", - 'CTRE' => "Central", - 'CTRE' => "Centre", - 'CHL' => "Chalet", - 'CHP' => "Chapelle", - 'CHI' => "Charmille", - 'CHT' => "Château", - 'CHS' => "Chaussée", - 'CHE' => "Chemin", - 'CHV' => "Chemin vicinaux", - 'CHV' => "Chemin vicinal", - 'CHEM' => "Cheminement", - 'CITE' => "Cîte", - 'CLOI' => "Cloître", - 'CLOS' => "Clos", - 'COL' => "Col", - 'COLI' => "Colline", - 'CTR' => "Contour", - 'COR' => "Corniche", - 'COTE' => "Côte", - 'COTT' => "Cottage", - 'COUR' => "Cour", - 'CRS' => "Cours", - 'DARS' => "Darse", - 'DEG' => "Degré", - 'DSG' => "Descente", - 'DSC' => "Descente", - 'DIG' => "Digue", - 'DOM' => "Domaine", - 'ECA' => "Ecart", - 'ECL' => "Ecluse", - 'EGL' => "Eglise", - 'EN' => "Enceinte", - 'ENV' => "Enclave", - 'ENC' => "Enclos", - 'ESC' => "Escalier", - 'ESPA' => "Espace", - 'ESP' => "Esplanade", - 'ETING' => "Etang", - 'FG' => "Faubourg", - 'FRM' => "Ferme", - 'FON' => "Fontaine", - 'FORT' => "Fort", - 'FORM' => "Forum", - 'FOS' => "Fosse", - 'FOYR' => "Foyer", - 'GAL' => "Galerie", - 'GARE' => "Gare", - 'GARN' => "Garenne", - 'GBD' => "Grand boulevard", - 'GDEN' => "Grande ensemble", - 'GR' => "Grande rue", - 'GRI' => "Grille", - 'GRIM' => "Grimpette", - 'GPE' => "Groupe", - 'GPT' => "Groupement", - 'HLE' => "Halle", - 'HAM' => "Hameau", - 'HCH' => "Haut chemin", - 'HIP' => "Hippodrome", - 'HLM' => "HLM", - 'ILE' => "Ile", - 'IMM' => "Immeuble", - 'IMP' => "Impasse", - 'JARD' => "Jardin", - 'JTE' => "Jetée", - 'LEVE' => "Levée", - 'LD' => "Lieu dit", - 'LD' => "Lieudit", - 'LOT' => "Lotissement", - 'MAIL' => "Mail", - 'MF' => "Maison forestière", - 'MAN' => "Manoir", - 'MAR' => "Marche", - 'MAS' => "Mas", - 'MET' => "Métro", - 'MTE' => "Montée", - 'MLN' => "Moulin", - 'MUS' => "Musée", - 'NTE' => "Nouvelle route", - 'PAL' => "Palais", - 'PARC' => "Parc", - 'PKG' => "Parking", - 'PRV' => "Parvis", - 'PAS' => "Passage", - 'PN' => "Passage à niveau", - 'PASS' => "Passe", - 'PLE' => "Passerelle", - 'PAT' => "Patio", - 'PAV' => "Pavillon", - 'PERI' => "Périphérique", - 'PSTY' => "Péristyle", - 'PTA' => "Petites allée", - 'PCH' => "Petit chemin", - 'PAE' => "Petite avenue", - 'PIM' => "Petite impasse", - 'PRT' => "Petite route", - 'PTR' => "Petite rue", - 'PL' => "Place", - 'PLCI' => "Placis", - 'PLAG' => "Plage", - 'PLN' => "Plaine", - 'PLAN' => "Plan", - 'PLT' => "Plateau", - 'PNT' => "Pointe", - 'PONT' => "Pont", - 'PCH' => "Porche", - 'PORT' => "Port", - 'PTE' => "Porte", - 'PORQ' => "Portique", - 'POT' => "Poterne", - 'POUR' => "Pourtour", - 'PRE' => "Pré", - 'PRQ' => "Presqu'île", - 'PROM' => "Promenade", - 'QU' => "Quai", - 'QUAI' => "Quai", - 'QUA' => "Quartier", - 'RAC' => "Raccourci", - 'RAID' => "Raidillon", - 'RPE' => "Rampe", - 'REM' => "Rempart", - 'RES' => "Résidence", - 'ROC' => "Roc", - 'ROC' => "Rocade", - 'RPT' => "Rond point", - 'ROQT' => "Roquet", - 'RTD' => "Rotonde", - 'RTE' => "Route", - 'R' => "Rue", - 'RUE' => "Rue", - 'RLE' => "Ruelle", - 'SEN' => "Sente", - 'SEN' => "Sentier", - 'SQ' => "Square", - 'STDE' => "Stade", - 'STA' => "Station", - 'TPL' => "Terre plein", - 'TRN' => "Terrain", - 'TSSE' => "Terrasse", - 'TRT' => "Tertre", - 'TOUR' => "Tour", - 'TRA' => "Traverse", - 'VAL' => "Vallon", - 'VAL' => "Vallée", - 'VEN' => "Venelle", - 'VIA' => "Via", - 'VTE' => "Vieille route", - 'VCHE' => "Vieux chemin", - 'VLA' => "Villa", - 'VGE' => "Village", - 'VLGE' => "Village", - 'VOI' => "Voie", - 'VOIE' => "Voie", - 'ZONE' => "Zone", - 'ZAC' => "Zone d'aménagement concerté", - 'Z A C' => "Zone d'aménagement concerté", - 'ZAD' => "Zone d'aménagement différé", - 'Z A D' => "Zone d'aménagement différé", - 'ZA' => "Zone artisanale", - 'Z A' => "Zone artisanale", - 'ZI' => "Zone industrielle", - 'Z I' => "Zone industrielle", - 'ZUP' => "Zone à urbaniser en priorité", - 'Z U P' => "Zone à urbaniser en priorité", + protected $codVoie = array( + 'ABE' => "Abbaye", + 'AGL' => "Agglomération", + 'AIRE' => "Aire", + 'ALL' => "Allée", + 'ALL' => "Allee", + 'ACH' => "Ancien chemin", + 'ART' => "Ancienne route", + 'ANSE' => "Anse", + 'ARC' => "Arcade", + 'AUT' => "Autoroute", + 'AV' => "Avenue", + 'BRE' => "Barrière", + 'BCH' => "Bas chemin", + 'BSTD' => "Bastide", + 'BAST' => "Baston", + 'BEGI' => "Beguinage", + 'BER' => "Berge", + 'BOIS' => "Bois", + 'BCLE' => "Boucle", + 'BD' => "Boulevard", + 'BRG' => "Bourg", + 'BUT' => "Butte", + 'CALE' => "Cale", + 'CAMP' => "Camp", + 'CGNE' => "Campagne", + 'CPG' => "Camping", + 'CARR' => "Carré", + 'CAU' => "Carreau", + 'CAR' => "Carrefour", + 'CARE' => "Carrière", + 'CST' => "Castel", + 'CAV' => "Cavée", + 'CTRE' => "Central", + 'CTRE' => "Centre", + 'CHL' => "Chalet", + 'CHP' => "Chapelle", + 'CHI' => "Charmille", + 'CHT' => "Château", + 'CHS' => "Chaussée", + 'CHE' => "Chemin", + 'CHV' => "Chemin vicinaux", + 'CHV' => "Chemin vicinal", + 'CHEM' => "Cheminement", + 'CITE' => "Cîte", + 'CLOI' => "Cloître", + 'CLOS' => "Clos", + 'COL' => "Col", + 'COLI' => "Colline", + 'CTR' => "Contour", + 'COR' => "Corniche", + 'COTE' => "Côte", + 'COTT' => "Cottage", + 'COUR' => "Cour", + 'CRS' => "Cours", + 'DARS' => "Darse", + 'DEG' => "Degré", + 'DSG' => "Descente", + 'DSC' => "Descente", + 'DIG' => "Digue", + 'DOM' => "Domaine", + 'ECA' => "Ecart", + 'ECL' => "Ecluse", + 'EGL' => "Eglise", + 'EN' => "Enceinte", + 'ENV' => "Enclave", + 'ENC' => "Enclos", + 'ESC' => "Escalier", + 'ESPA' => "Espace", + 'ESP' => "Esplanade", + 'ETING' => "Etang", + 'FG' => "Faubourg", + 'FRM' => "Ferme", + 'FON' => "Fontaine", + 'FORT' => "Fort", + 'FORM' => "Forum", + 'FOS' => "Fosse", + 'FOYR' => "Foyer", + 'GAL' => "Galerie", + 'GARE' => "Gare", + 'GARN' => "Garenne", + 'GBD' => "Grand boulevard", + 'GDEN' => "Grande ensemble", + 'GR' => "Grande rue", + 'GRI' => "Grille", + 'GRIM' => "Grimpette", + 'GPE' => "Groupe", + 'GPT' => "Groupement", + 'HLE' => "Halle", + 'HAM' => "Hameau", + 'HCH' => "Haut chemin", + 'HIP' => "Hippodrome", + 'HLM' => "HLM", + 'ILE' => "Ile", + 'IMM' => "Immeuble", + 'IMP' => "Impasse", + 'JARD' => "Jardin", + 'JTE' => "Jetée", + 'LEVE' => "Levée", + 'LD' => "Lieu dit", + 'LD' => "Lieudit", + 'LOT' => "Lotissement", + 'MAIL' => "Mail", + 'MF' => "Maison forestière", + 'MAN' => "Manoir", + 'MAR' => "Marche", + 'MAS' => "Mas", + 'MET' => "Métro", + 'MTE' => "Montée", + 'MLN' => "Moulin", + 'MUS' => "Musée", + 'NTE' => "Nouvelle route", + 'PAL' => "Palais", + 'PARC' => "Parc", + 'PKG' => "Parking", + 'PRV' => "Parvis", + 'PAS' => "Passage", + 'PN' => "Passage à niveau", + 'PASS' => "Passe", + 'PLE' => "Passerelle", + 'PAT' => "Patio", + 'PAV' => "Pavillon", + 'PERI' => "Périphérique", + 'PSTY' => "Péristyle", + 'PTA' => "Petites allée", + 'PCH' => "Petit chemin", + 'PAE' => "Petite avenue", + 'PIM' => "Petite impasse", + 'PRT' => "Petite route", + 'PTR' => "Petite rue", + 'PL' => "Place", + 'PLCI' => "Placis", + 'PLAG' => "Plage", + 'PLN' => "Plaine", + 'PLAN' => "Plan", + 'PLT' => "Plateau", + 'PNT' => "Pointe", + 'PONT' => "Pont", + 'PCH' => "Porche", + 'PORT' => "Port", + 'PTE' => "Porte", + 'PORQ' => "Portique", + 'POT' => "Poterne", + 'POUR' => "Pourtour", + 'PRE' => "Pré", + 'PRQ' => "Presqu'île", + 'PROM' => "Promenade", + 'QU' => "Quai", + 'QUAI' => "Quai", + 'QUA' => "Quartier", + 'RAC' => "Raccourci", + 'RAID' => "Raidillon", + 'RPE' => "Rampe", + 'REM' => "Rempart", + 'RES' => "Résidence", + 'ROC' => "Roc", + 'ROC' => "Rocade", + 'RPT' => "Rond point", + 'ROQT' => "Roquet", + 'RTD' => "Rotonde", + 'RTE' => "Route", + 'R' => "Rue", + 'RUE' => "Rue", + 'RLE' => "Ruelle", + 'SEN' => "Sente", + 'SEN' => "Sentier", + 'SQ' => "Square", + 'STDE' => "Stade", + 'STA' => "Station", + 'TPL' => "Terre plein", + 'TRN' => "Terrain", + 'TSSE' => "Terrasse", + 'TRT' => "Tertre", + 'TOUR' => "Tour", + 'TRA' => "Traverse", + 'VAL' => "Vallon", + 'VAL' => "Vallée", + 'VEN' => "Venelle", + 'VIA' => "Via", + 'VTE' => "Vieille route", + 'VCHE' => "Vieux chemin", + 'VLA' => "Villa", + 'VGE' => "Village", + 'VLGE' => "Village", + 'VOI' => "Voie", + 'VOIE' => "Voie", + 'ZONE' => "Zone", + 'ZAC' => "Zone d'aménagement concerté", + 'Z A C' => "Zone d'aménagement concerté", + 'ZAD' => "Zone d'aménagement différé", + 'Z A D' => "Zone d'aménagement différé", + 'ZA' => "Zone artisanale", + 'Z A' => "Zone artisanale", + 'ZI' => "Zone industrielle", + 'Z I' => "Zone industrielle", + 'ZUP' => "Zone à urbaniser en priorité", + 'Z U P' => "Zone à urbaniser en priorité", ); /** @@ -904,7 +904,7 @@ class SaisieController extends Zend_Controller_Action $this->view->assign('siret', $siret); } - public function liasseAction() + public function liasseAction() { $request = $this->getRequest(); @@ -915,16 +915,18 @@ class SaisieController extends Zend_Controller_Action $this->view->assign('siren', $siren); $session = new Scores_Session_Entreprise($siret, $id); - $this->view->assign('siret', $siret); + $this->view->assign('siret', $siret); $this->view->assign('raisonSociale', $session->getRaisonSociale()); - require_once 'Scores/WsScores.php'; + require_once 'Scores/WsScores.php'; $ws = new WsScores(); - - $selection = $request->getParam('selection', ''); + + $selection = $request->getParam('selection', ''); if ( !empty($selection) ) { - list($date, $type) = explode(':', $selection); + list($date, $type) = explode(':', $selection); + $confidentiel = 0; + // --- Correction d'un bilan if ($date!='NEW') { $milDate = $milDatePre = null; @@ -940,6 +942,7 @@ class SaisieController extends Zend_Controller_Action $milDatePre = $item->dateExercice; } } + $confidentiel = $item->confidentiel; } } @@ -954,6 +957,7 @@ class SaisieController extends Zend_Controller_Action $infos->dureeMois = $response->DUREE_MOIS; $infos->dureeMoisPre = $response->DUREE_MOIS_PRE; $infos->unite = empty($response->MONNAIE_LIV_UNITE) ? 'U' : $response->MONNAIE_LIV_UNITE; + $confidentiel = $response->TOP_CONFIDENTIEL; $postes = array(); foreach ($response->POSTES->item as $item) { $postes[$item->id] = $item->val; @@ -969,6 +973,7 @@ class SaisieController extends Zend_Controller_Action $infos->dateCloturePre = $response->DATE_CLOTURE; $infos->dureeMoisPre = $response->DUREE_MOIS; $infos->unite = empty($response->MONNAIE_LIV_UNITE) ? 'U' : $response->MONNAIE_LIV_UNITE; + $confidentiel = $response->TOP_CONFIDENTIEL; $postesN1 = array(); foreach ($response->POSTES->item as $item) { $postesN1[$item->id] = $item->val; @@ -1233,63 +1238,63 @@ class SaisieController extends Zend_Controller_Action } } - $ancres = array( - 'C' => array( - 'actif' => 'Actif', - 'passif' => 'Passif', + $ancres = array( + 'C' => array( + 'actif' => 'Actif', + 'passif' => 'Passif', 'compteDeResultat' => 'Compte de résultat', - //+ Poste YP pour l'effectif du groupe - ), - 'N' => array( - 'actif' => 'Actif', - 'passif' => 'Passif', - 'compteDeResultat' => 'Compte de résultat', - 'immobilisations' => 'Immobilisations', - 'amortissements' => 'Amortissements', - 'provisions' => 'Provisions', + //+ Poste YP pour l'effectif du groupe + ), + 'N' => array( + 'actif' => 'Actif', + 'passif' => 'Passif', + 'compteDeResultat' => 'Compte de résultat', + 'immobilisations' => 'Immobilisations', + 'amortissements' => 'Amortissements', + 'provisions' => 'Provisions', 'creancesDettes' => 'Créances, Dettes', 'resultatfiscal' => 'Détermination du résultat fiscal', - 'deficit' => 'DÉFICITS, INDEMNITÉS POUR CONGÉS À PAYER ET PROVISIONS NON DÉDUCTIBLES', + 'deficit' => 'DÉFICITS, INDEMNITÉS POUR CONGÉS À PAYER ET PROVISIONS NON DÉDUCTIBLES', 'affectation' => 'Affectation', - 'annexe16' => 'DÉTERMINATION DE LA VALEUR AJOUTÉE PRODUITE AU COURS DE L\'EXERCICE', - ), - 'S' => array( - 'actif' => 'Actif', - 'passif' => 'Passif', - 'compteDeResultat' => 'Compte de résultat', - 'immobilisations' => 'Immobilisations', - 'amortissements' => 'Amortissements', - 'provisions' => 'Provisions', - 'creancesDettes' => 'Créances, Dettes', - 'affectation' => 'Affectation' - ), - 'A' => array( - 'actif' => 'Actif', - 'passif' => 'Passif', - 'compteDeResultat' => 'Compte de résultat', - ), - 'B' => array( - 'actif' => 'Actif', - 'passif' => 'Passif', - 'compteDeResultat' => 'Compte de résultat', - ), + 'annexe16' => 'DÉTERMINATION DE LA VALEUR AJOUTÉE PRODUITE AU COURS DE L\'EXERCICE', + ), + 'S' => array( + 'actif' => 'Actif', + 'passif' => 'Passif', + 'compteDeResultat' => 'Compte de résultat', + 'immobilisations' => 'Immobilisations', + 'amortissements' => 'Amortissements', + 'provisions' => 'Provisions', + 'creancesDettes' => 'Créances, Dettes', + 'affectation' => 'Affectation' + ), + 'A' => array( + 'actif' => 'Actif', + 'passif' => 'Passif', + 'compteDeResultat' => 'Compte de résultat', + ), + 'B' => array( + 'actif' => 'Actif', + 'passif' => 'Passif', + 'compteDeResultat' => 'Compte de résultat', + ), ); if (!empty($infos)) { // --- Default value pour les nouveaux bilans - if ( is_string($infos) && $infos == 'NEW' ) { - $dateCloture = (date('Y')-1).'1231'; - $dureeMois = '12'; - $dateCloturePre = 'AAAAMMJJ'; + if ( is_string($infos) && $infos == 'NEW' ) { + $dateCloture = (date('Y')-1).'1231'; + $dureeMois = '12'; + $dateCloturePre = 'AAAAMMJJ'; $dureeMoisPre = '0'; - $unite = 'U'; + $unite = 'U'; } // --- Default value pour l' edition de bilan else { - $dateCloture = ($infos->dateCloture!='') ? $infos->dateCloture : $date; - $dureeMois = ($infos->dureeMois!='') ? $infos->dureeMois : '12'; - $dateCloturePre = empty($infos->dateCloturePre) ? 'AAAAMMJJ' : $infos->dateCloturePre ; - $dureeMoisPre = empty($infos->dureeMoisPre) ? '0' : $infos->dureeMoisPre; + $dateCloture = ($infos->dateCloture!='') ? $infos->dateCloture : $date; + $dureeMois = ($infos->dureeMois!='') ? $infos->dureeMois : '12'; + $dateCloturePre = empty($infos->dateCloturePre) ? 'AAAAMMJJ' : $infos->dateCloturePre ; + $dureeMoisPre = empty($infos->dureeMoisPre) ? '0' : $infos->dureeMoisPre; $unite = $infos->unite; $this->view->assign('liasse', $postes); } @@ -1298,23 +1303,24 @@ class SaisieController extends Zend_Controller_Action $dateCloture = substr($dateCloture,6,2).'/'.substr($dateCloture,4,2).'/'.substr($dateCloture,0,4); $dateCloturePre = substr($dateCloturePre,6,2).'/'.substr($dateCloturePre,4,2).'/'.substr($dateCloturePre,0,4); - $this->view->assign('dateCloture', $dateCloture); - $this->view->assign('dateCloturePre', $dateCloturePre); - $this->view->assign('dureeMois', $dureeMois); + $this->view->assign('dateCloture', $dateCloture); + $this->view->assign('dateCloturePre', $dateCloturePre); + $this->view->assign('dureeMois', $dureeMois); $this->view->assign('dureeMoisPre', $dureeMoisPre); - $this->view->assign('unite', $unite); + $this->view->assign('unite', $unite); $this->view->assign('typeBilan', $type); + $this->view->assign('confidentiel', $confidentiel); $this->view->assign('ancres', $ancres[$type]); $this->view->inlineScript()->appendFile('/libs/editable/jquery.jeditable.js'); $this->view->assign('infos', $infos); - } + } } /** * Sauvegarde de la liasse saisie */ - public function liassesaveAction() + public function liassesaveAction() { $this->_helper->layout()->disableLayout(); //Renvoyer flux json STATUS : OK ou ERR, MESSAGE : TEXTE, POSTE : ARRAY ou vide @@ -1669,14 +1675,14 @@ class SaisieController extends Zend_Controller_Action $this->_helper->layout()->disableLayout(); $dep = new Application_Model_TabDepartements(); $sql = $dep->select(); - $rows = $dep->fetchAll($sql); - if ( count($rows)>0 ) { - foreach ($rows as $item) { - $depListe[] = array( - 'num' => $item->numdep, - 'lib' => $item->libdep, - ); - } + $rows = $dep->fetchAll($sql); + if ( count($rows)>0 ) { + foreach ($rows as $item) { + $depListe[] = array( + 'num' => $item->numdep, + 'lib' => $item->libdep, + ); + } } $this->view->assign('depListe', $depListe); $this->view->assign('countries', $this->countries); @@ -1872,9 +1878,9 @@ class SaisieController extends Zend_Controller_Action if($params['transfer'] && ($params['MajMin'] == 'T' || $params['MajMin'] == 'F')) { - $liens = $ws->getLiensById($idPar); + $liens = $ws->getLiensById($idPar); $participations = $liens->participations->item; - + if (count($participations)>0) { $ws->setLienChange('tupfusion', $idPar, $idAct); } @@ -2071,12 +2077,12 @@ class SaisieController extends Zend_Controller_Action $ws = new WsScores(); $result = $ws->getSaisieBourse($isin); $infos = json_decode($result, true); - $dateFields = array( - 'dateIntroduction', - 'dateIntroYmd', - 'dateRadiation', - 'dateNbTitres', - 'dateDerAG'); + $dateFields = array( + 'dateIntroduction', + 'dateIntroYmd', + 'dateRadiation', + 'dateNbTitres', + 'dateDerAG'); if ( $infos === null ) { $this->view->assign('error', $result); @@ -2244,21 +2250,21 @@ class SaisieController extends Zend_Controller_Action if ($items['PpPm']=='PM') { $this->view->assign('nom', $items['RS']); } else { - $dep = new Application_Model_TabDepartements(); - $sql = $dep->select(); - $rows = $dep->fetchAll($sql); - if ( count($rows)>0 ) { - foreach ($rows as $item) { - $depListe[] = array( - 'num' => $item->numdep, - 'lib' => $item->libdep, + $dep = new Application_Model_TabDepartements(); + $sql = $dep->select(); + $rows = $dep->fetchAll($sql); + if ( count($rows)>0 ) { + foreach ($rows as $item) { + $depListe[] = array( + 'num' => $item->numdep, + 'lib' => $item->libdep, ); if ($item->numdep == $items['naissance_dept_pays']) { $this->view->assign('naissance_dept_pays', 'FRA'); $this->view->assign('naissance_dept', $item->numdep); - } - } - } + } + } + } $this->view->assign('depListe', $depListe); $this->view->assign('nom', $items['nom']); } @@ -2320,19 +2326,19 @@ class SaisieController extends Zend_Controller_Action $request = $this->getRequest(); $id = $request->getParam('idFiche', null); $infos = array ('delete' => '1'); - - $ws = new WsScores(); - - if ($id===null) { - $siren = $request->getParam('siren'); - $result = $ws->searchLienRef($siren, 'siren'); - if (count($result->item)>0) { - foreach ($result->item as $item) { - $id = $item->id; - break; - } - } + $ws = new WsScores(); + + if ($id===null) { + $siren = $request->getParam('siren'); + + $result = $ws->searchLienRef($siren, 'siren'); + if (count($result->item)>0) { + foreach ($result->item as $item) { + $id = $item->id; + break; + } + } } if ( $request->isPost() ) { @@ -2356,7 +2362,7 @@ class SaisieController extends Zend_Controller_Action public function scorecutoffAction() { - $ws = new WsScores(); + $ws = new WsScores(); $user = new Scores_Utilisateur(); $request = $this->getRequest(); @@ -2413,22 +2419,22 @@ class SaisieController extends Zend_Controller_Action if ( $request->isPost() ) { // check values one more time - $paramlist = array( - 'siren' => 'Siren', - 'encours' => 'Encours', - 'scoreSolv' => 'Indiscore', - 'scoreDir' => 'Score dirigeance', - 'scoreConf' => 'Score de conformité', + $paramlist = array( + 'siren' => 'Siren', + 'encours' => 'Encours', + 'scoreSolv' => 'Indiscore', + 'scoreDir' => 'Score dirigeance', + 'scoreConf' => 'Score de conformité', 'remarque' => 'Remarque', - 'paiement' => 'Information de paiement', - ); - foreach ($paramlist as $item => $val) { - if ( !isset($params[$item]) ) { - $message .= "Valeur $val vide !
"; - } - if ( $params['encours']<0 || $params['encours']>500 ) { - $message = "Encours : Erreur borne"; - } + 'paiement' => 'Information de paiement', + ); + foreach ($paramlist as $item => $val) { + if ( !isset($params[$item]) ) { + $message .= "Valeur $val vide !
"; + } + if ( $params['encours']<0 || $params['encours']>500 ) { + $message = "Encours : Erreur borne"; + } } // end checking values @@ -2483,7 +2489,7 @@ class SaisieController extends Zend_Controller_Action ) , 'default', true)); } - + $this->view->assign('getcutoff', $getcutoff); $this->view->assign('siren', $siren); $this->view->assign('typescore', $user->getTypeScore()); @@ -2492,11 +2498,11 @@ class SaisieController extends Zend_Controller_Action public function citysearchAction() { - $this->_helper->layout()->disableLayout(); - + $this->_helper->layout()->disableLayout(); + $cpVille = $this->getRequest()->getParam('cpville', null); - $output = array(); - + $output = array(); + if ( null !== $cpVille) { $city = new Application_Model_City(); $sql = $city->select('code, libelle'); @@ -2505,39 +2511,39 @@ class SaisieController extends Zend_Controller_Action } else { $sql->where('libelle LIKE ?', "%$cpVille%"); } - $sql->limit(20); - $rows = $city->fetchAll($sql); - if ( count($rows)>0 ) { - foreach ($rows as $item) { - $output[] = array( - 'label' => str_pad($item->code, 5, 0, STR_PAD_LEFT).": ".$item->libelle, - 'value' => str_pad($item->code, 5, 0, STR_PAD_LEFT), - ); - } - } + $sql->limit(20); + $rows = $city->fetchAll($sql); + if ( count($rows)>0 ) { + foreach ($rows as $item) { + $output[] = array( + 'label' => str_pad($item->code, 5, 0, STR_PAD_LEFT).": ".$item->libelle, + 'value' => str_pad($item->code, 5, 0, STR_PAD_LEFT), + ); + } + } } - + $this->view->assign('output', $output); } - public function codvoieAction() - { - $this->_helper->layout()->disableLayout(); - - $codvoie = $this->getRequest()->getParam('codvoie', null); - $output = array(); - + public function codvoieAction() + { + $this->_helper->layout()->disableLayout(); + + $codvoie = $this->getRequest()->getParam('codvoie', null); + $output = array(); + if ( null !== $codvoie) { foreach($this->codVoie as $key=>$val){ if (stripos($key, $codvoie)!==false || stripos($val, $codvoie)!==false){ - $output[] = array( - 'label' => $key.": ".$val, - 'value' => $key + $output[] = array( + 'label' => $key.": ".$val, + 'value' => $key ); } - } - } - $this->view->assign('output', $output); + } + } + $this->view->assign('output', $output); } /** @@ -2553,8 +2559,8 @@ class SaisieController extends Zend_Controller_Action $siret = $request->getParam('siret'); $siren = substr($siret, 0, 9); $nic = substr($siret, 9, 5); - - $ws = new WsScores(); + + $ws = new WsScores(); switch ($mode) { case 'add': @@ -2575,23 +2581,23 @@ class SaisieController extends Zend_Controller_Action $this->view->assign('mode', $mode); $this->view->assign('id', $id); $this->view->assign('siren', $siren); - $this->view->assign('nic', $nic); + $this->view->assign('nic', $nic); } - /** - * Sauvegarder les modifications des dirigeants oppérationnels - */ - public function diropsaveAction() - { + /** + * Sauvegarder les modifications des dirigeants oppérationnels + */ + public function diropsaveAction() + { $this->_helper->layout()->disableLayout(); $params = $this->getRequest()->getParams(); $message = ''; $newDate = '0000-00-00'; - if (trim($params['naiss_date']) != '') { - $date = new Zend_Date($params['naiss_date'], 'dd/MM/yyyy'); - $newDate = $date->toString('yyyy-MM-dd'); + if (trim($params['naiss_date']) != '') { + $date = new Zend_Date($params['naiss_date'], 'dd/MM/yyyy'); + $newDate = $date->toString('yyyy-MM-dd'); } $infos = array( @@ -2611,25 +2617,25 @@ class SaisieController extends Zend_Controller_Action $ws = new WsScores(); - if($params['mode'] == 'add'){ - $message = $this->view->translate('Ajout'); - } else if ($params['mode'] == 'edit') { - $message = $this->view->translate('Edition'); - } else if ($params['mode'] == 'del') { - $message = $this->view->translate('Suppression'); + if($params['mode'] == 'add'){ + $message = $this->view->translate('Ajout'); + } else if ($params['mode'] == 'edit') { + $message = $this->view->translate('Edition'); + } else if ($params['mode'] == 'del') { + $message = $this->view->translate('Suppression'); } $result = $ws->setDirigeantsOp(json_encode($infos), $params['mode'], $params['id']); - if ($result>0) { - $message = $message.' '.$this->view->translate('a été réussi!'); - } else if ($result===0) { - $message = $message.' '.$this->view->translate('n\'a pas été réussi!'); + if ($result>0) { + $message = $message.' '.$this->view->translate('a été réussi!'); + } else if ($result===0) { + $message = $message.' '.$this->view->translate('n\'a pas été réussi!'); } else { $message = $result; - } - - $this->view->assign('message', $message); + } + + $this->view->assign('message', $message); } /** diff --git a/application/modules/default/views/default/scripts/finance/liasse.phtml b/application/modules/default/views/default/scripts/finance/liasse.phtml index ebbd23b96..7796b0d10 100644 --- a/application/modules/default/views/default/scripts/finance/liasse.phtml +++ b/application/modules/default/views/default/scripts/finance/liasse.phtml @@ -40,6 +40,15 @@ +exportObjet->TOP_CONFIDENTIEL) : ?> + +   + + + Ce bilan est confidentiel. + + + champType == 'S' ) {?> diff --git a/application/modules/default/views/default/scripts/saisie/liasse.phtml b/application/modules/default/views/default/scripts/saisie/liasse.phtml index 8bf2c5d1a..ad17f850f 100644 --- a/application/modules/default/views/default/scripts/saisie/liasse.phtml +++ b/application/modules/default/views/default/scripts/saisie/liasse.phtml @@ -31,12 +31,13 @@ span.poste input { width:50px; }

Liasse

-infos) {?> +infos) { ?>
$this->ancres, 'typeBilan' => $this->typeBilan, + 'confidentiel' => $this->confidentiel, 'unite' => $this->unite, 'dateCloture' => $this->dateCloture, 'dureeMois'=> $this->dureeMois, diff --git a/application/modules/default/views/default/scripts/saisie/liasse/2033.phtml b/application/modules/default/views/default/scripts/saisie/liasse/2033.phtml index 600a2151c..f032d1b94 100644 --- a/application/modules/default/views/default/scripts/saisie/liasse/2033.phtml +++ b/application/modules/default/views/default/scripts/saisie/liasse/2033.phtml @@ -3,6 +3,10 @@ typeBilan?>
+
+ + +
unite?> € diff --git a/application/modules/default/views/default/scripts/saisie/liasse/2050.phtml b/application/modules/default/views/default/scripts/saisie/liasse/2050.phtml index eb3f1f34c..de5444cf2 100644 --- a/application/modules/default/views/default/scripts/saisie/liasse/2050.phtml +++ b/application/modules/default/views/default/scripts/saisie/liasse/2050.phtml @@ -3,6 +3,10 @@ typeBilan?>
+
+ + +
unite?> € diff --git a/library/Scores/WsScores.php b/library/Scores/WsScores.php index bea3960d0..88eb63bf5 100644 --- a/library/Scores/WsScores.php +++ b/library/Scores/WsScores.php @@ -405,24 +405,24 @@ class WsScores } } - public function getCatalogCity($id, $columns) - { - $params = new stdClass(); - $params->id = $id; - $params->columns = $columns; - $client = $this->loadClient('catalog'); - try { - $reponse = $client->getCity($params); - return $reponse->getCityResult; - } catch (SoapFault $fault) { - if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){ - return $fault->faultstring; - } else { - echo $client->__getLastResponse(); - //$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); - return false; - } - } + public function getCatalogCity($id, $columns) + { + $params = new stdClass(); + $params->id = $id; + $params->columns = $columns; + $client = $this->loadClient('catalog'); + try { + $reponse = $client->getCity($params); + return $reponse->getCityResult; + } catch (SoapFault $fault) { + if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){ + return $fault->faultstring; + } else { + echo $client->__getLastResponse(); + //$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); + return false; + } + } } public function getCatalogLegalForm($id, $columns) @@ -501,42 +501,42 @@ class WsScores } } - /** - * Get Score Cut Off - * @param string $siren - * @return Cutoff values or False - */ - public function getScoreCutoff($siren) - { + /** + * Get Score Cut Off + * @param string $siren + * @return Cutoff values or False + */ + public function getScoreCutoff($siren) + { $params = new stdClass(); - $params->siren = $siren; - $client = $this->loadClient('saisie'); - try { - $reponse = $client->getScoreCutoff($params); - return $reponse->getScoreCutoffResult; - } catch (SoapFault $fault) { + $params->siren = $siren; + $client = $this->loadClient('saisie'); + try { + $reponse = $client->getScoreCutoff($params); + return $reponse->getScoreCutoffResult; + } catch (SoapFault $fault) { $this->logger->info($fault->faultcode.':'.$fault->faultstring); - return $fault->faultstring; - } + return $fault->faultstring; + } } - /** - * Delete Score Cut Off - * @param string $siren - * @return boolean - */ - public function delScoreCutoff($siren) - { + /** + * Delete Score Cut Off + * @param string $siren + * @return boolean + */ + public function delScoreCutoff($siren) + { $params = new stdClass(); - $params->siren = $siren; - $client = $this->loadClient('saisie'); - try { - $reponse = $client->delScoreCutoff($params); //change name when webservice is ready - return $reponse->delScoreCutoffResult; //change name when webservice is ready - } catch (SoapFault $fault) { + $params->siren = $siren; + $client = $this->loadClient('saisie'); + try { + $reponse = $client->delScoreCutoff($params); //change name when webservice is ready + return $reponse->delScoreCutoffResult; //change name when webservice is ready + } catch (SoapFault $fault) { $this->logger->info($fault->faultcode.':'.$fault->faultstring); - return $fault->faultstring; - } + return $fault->faultstring; + } } public function searchLogin($idClient, $query) @@ -884,22 +884,22 @@ class WsScores $params->type = $type; $params->libelle = $libelle; $params->date = $date; - $client = $this->loadClient('saisie'); - try { - $reponse = $client->setActeAsso($params); - return $reponse->setActeAssoResult; - } catch (SoapFault $fault) { - $this->logger->info($fault->faultcode.':'.$fault->faultstring); - if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){ - return $fault->faultstring; - } else { - $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); - return false; - } + $client = $this->loadClient('saisie'); + try { + $reponse = $client->setActeAsso($params); + return $reponse->setActeAssoResult; + } catch (SoapFault $fault) { + $this->logger->info($fault->faultcode.':'.$fault->faultstring); + if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){ + return $fault->faultstring; + } else { + $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); + return false; + } } } - public function setBilan($siren, $originalDateCloture, $originalTypeBilan, $unite, $dateCloture, $dureeMois, $dateCloturePre, $dureeMoisPre, $typeBilan, $postes, $step = 'normal') + public function setBilan($siren, $originalDateCloture, $originalTypeBilan, $unite, $dateCloture, $dureeMois, $dateCloturePre, $dureeMoisPre, $typeBilan, $postes, $step = 'normal', $confidentiel=0) { $params = new stdClass(); $params->siren = $siren; @@ -913,6 +913,7 @@ class WsScores $params->data->typeBilan = $typeBilan; $params->data->postes = $postes; $params->step = $step; + $params->confidentiel = $confidentiel; $client = $this->loadClient('saisie'); try { $reponse = $client->setBilan($params); @@ -943,14 +944,14 @@ class WsScores $params->identifiant = $identifiant; $params->position = $position; $params->nbRep = $nbRep; - $client = $this->loadClient('pieces'); - try { - $reponse = $client->getBilans($params); - return $reponse->getBilansResult; + $client = $this->loadClient('pieces'); + try { + $reponse = $client->getBilans($params); + return $reponse->getBilansResult; } catch (SoapFault $fault) { - $this->logger->info($fault->faultcode.':'.$fault->faultstring); - $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); - return false; + $this->logger->info($fault->faultcode.':'.$fault->faultstring); + $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); + return false; } } @@ -964,21 +965,21 @@ class WsScores */ public function getPiecesBilan($siren, $type, $diffusion, $dateCloture, $reference = '') { - $params = new stdClass(); + $params = new stdClass(); $params->identifiant = $siren; $params->dateCloture = $dateCloture; $params->type = $type; $params->diffusion = $diffusion; $params->reference = $reference; - $client = $this->loadClient('pieces'); - try { + $client = $this->loadClient('pieces'); + try { $reponse = $client->getBilan($params); - $this->logger->info(print_r($reponse,1)); - return $reponse->getBilanResult; - } catch (SoapFault $fault) { - $this->logger->info($fault->faultcode.':'.$fault->faultstring); - $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); - return false; + $this->logger->info(print_r($reponse,1)); + return $reponse->getBilanResult; + } catch (SoapFault $fault) { + $this->logger->info($fault->faultcode.':'.$fault->faultstring); + $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); + return false; } } @@ -1103,15 +1104,15 @@ class WsScores */ public function getUser($login) { - $params = new stdClass(); - $params->login = $login; - $client = $this->loadClient('gestion'); - try { - $reponse = $client->getUser($params); - return $reponse->getUserResult; - } catch (SoapFault $fault) { - $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); - return false; + $params = new stdClass(); + $params->login = $login; + $client = $this->loadClient('gestion'); + try { + $reponse = $client->getUser($params); + return $reponse->getUserResult; + } catch (SoapFault $fault) { + $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); + return false; } } @@ -1170,17 +1171,17 @@ class WsScores { $params = new stdClass(); $params->siren = $siren; - $client = $this->loadClient('interne'); - try { - $reponse = $client->getGroupeInfos($params); - return $reponse->getGroupeInfosResult; + $client = $this->loadClient('interne'); + try { + $reponse = $client->getGroupeInfos($params); + return $reponse->getGroupeInfosResult; } catch (SoapFault $fault) { if ( in_array($fault->faultcode, array('Error')) ){ return $fault->faultstring; } else { $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); return false; - } + } } } @@ -1196,7 +1197,7 @@ class WsScores $filename.= '-0'; if ($stopAtIsin === true) { $filename.= '-1'; - } + } if ($this->cacheWrite) { $cache = new Cache($filename); @@ -1214,7 +1215,7 @@ class WsScores try { $reponse = $client->getGroupesArbo($params); if ($this->cacheWrite) { - $cache->deletefile(); + $cache->deletefile(); $cache->setBlock($reponse->getGroupesArboResult); } return $reponse->getGroupesArboResult; @@ -1913,28 +1914,28 @@ class WsScores } } - /** - * getListeDepartements - * Liste des départements + /** + * getListeDepartements + * Liste des départements */ - public function getCatalogDepartements($id, $columns) - { - $params = new stdClass(); - $params->id = $id; - $params->columns = $columns; - $client = $this->loadClient('catalog'); - try { - $reponse = $client->getDepartements($params); - return $reponse->getDepartementsResult; - } catch (SoapFault $fault) { - if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){ - return $fault->faultstring; - } else { - echo $client->__getLastResponse(); - //$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); - return false; - } - } + public function getCatalogDepartements($id, $columns) + { + $params = new stdClass(); + $params->id = $id; + $params->columns = $columns; + $client = $this->loadClient('catalog'); + try { + $reponse = $client->getDepartements($params); + return $reponse->getDepartementsResult; + } catch (SoapFault $fault) { + if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){ + return $fault->faultstring; + } else { + echo $client->__getLastResponse(); + //$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); + return false; + } + } } /** @@ -2185,11 +2186,11 @@ class WsScores return false; } } - } + } public function getAnnoncesNum($siren) { - $filename = 'annoncesnum-'.$siren; + $filename = 'annoncesnum-'.$siren; if ($this->cacheWrite) { $cache = new Cache($filename); @@ -2197,26 +2198,26 @@ class WsScores return $cache->getBlock(); } } - - $params = new stdClass(); - $params->siren = $siren; - $client = $this->loadClient('entreprise'); - try { - $reponse = $client->getAnnoncesNum($params); + + $params = new stdClass(); + $params->siren = $siren; + $client = $this->loadClient('entreprise'); + try { + $reponse = $client->getAnnoncesNum($params); if ($this->cacheWrite) { - $cache->deletefile(); + $cache->deletefile(); $cache->setBlock($reponse->getAnnoncesNumResult); - } - return $reponse->getAnnoncesNumResult; - } catch (SoapFault $fault) { - $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); - return false; + } + return $reponse->getAnnoncesNumResult; + } catch (SoapFault $fault) { + $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); + return false; } } public function getAnnoncesBalo($siren, $idAnn=null, $filtre=null, $position=0, $nbRep=20) { - $filename = 'annoncesbalo-'.$siren.'-'.$idAnn.'-'.$position.'-'.$nbRep; + $filename = 'annoncesbalo-'.$siren.'-'.$idAnn.'-'.$position.'-'.$nbRep; if ($this->cacheWrite) { $cache = new Cache($filename); @@ -2224,30 +2225,30 @@ class WsScores return $cache->getBlock(); } } - - $params = new stdClass(); - $params->siren = $siren; + + $params = new stdClass(); + $params->siren = $siren; $params->idAnn = $idAnn; $params->filtre = $filtre; $params->position = $position; - $params->nbRep = $nbRep; - $client = $this->loadClient('entreprise'); - try { + $params->nbRep = $nbRep; + $client = $this->loadClient('entreprise'); + try { $reponse = $client->getAnnoncesBalo($params); if ($this->cacheWrite) { - $cache->deletefile(); + $cache->deletefile(); $cache->setBlock($reponse->getAnnoncesBaloResult); - } - return $reponse->getAnnoncesBaloResult; - } catch (SoapFault $fault) { - $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); - return false; + } + return $reponse->getAnnoncesBaloResult; + } catch (SoapFault $fault) { + $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); + return false; } } - public function getAnnoncesBoamp($siren, $idAnn=null, $filtre = null, $position=0, $nbRep=20) - { - $filename = 'annoncesboamp-'.$siren.'-'.$filtre.'-'.$position.'-'.$nbRep; + public function getAnnoncesBoamp($siren, $idAnn=null, $filtre = null, $position=0, $nbRep=20) + { + $filename = 'annoncesboamp-'.$siren.'-'.$filtre.'-'.$position.'-'.$nbRep; if ($idAnn !== null) { $filename = 'annoncesboamp-'.$siren.'-'.$filtre.'-'.$idAnn.'-'.$position.'-'.$nbRep; @@ -2259,38 +2260,38 @@ class WsScores return $cache->getBlock(); } } - - $params = new stdClass(); - $params->siren = $siren; + + $params = new stdClass(); + $params->siren = $siren; $params->idAnn = $idAnn; $params->filtre = null; if (!empty($filtre) && in_array($filtre,array('A','M'))) { $filtreStruct = new stdClass(); - $filtreStruct->key = 'type'; + $filtreStruct->key = 'type'; $filtreStruct->value = $filtre; $params->filtre[] = $filtreStruct; } - - $params->position = $position; - $params->nbRep = $nbRep; - $client = $this->loadClient('entreprise'); - try { + + $params->position = $position; + $params->nbRep = $nbRep; + $client = $this->loadClient('entreprise'); + try { $reponse = $client->getAnnoncesBoamp($params); if ($this->cacheWrite) { - $cache->deletefile(); + $cache->deletefile(); $cache->setBlock($reponse->getAnnoncesBoampResult); - } - return $reponse->getAnnoncesBoampResult; - } catch (SoapFault $fault) { - $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); - return false; - } + } + return $reponse->getAnnoncesBoampResult; + } catch (SoapFault $fault) { + $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); + return false; + } } - public function getAnnoncesAsso($siren, $idAnn=null, $filtre=null, $position=0, $nbRep=20) - { - $filename = 'annoncesasso-'.$siren.'-'.$idAnn.'-'.$position.'-'.$nbRep; + public function getAnnoncesAsso($siren, $idAnn=null, $filtre=null, $position=0, $nbRep=20) + { + $filename = 'annoncesasso-'.$siren.'-'.$idAnn.'-'.$position.'-'.$nbRep; if ($this->cacheWrite) { $cache = new Cache($filename); @@ -2298,30 +2299,30 @@ class WsScores return $cache->getBlock(); } } - - $params = new stdClass(); - $params->siren = $siren; + + $params = new stdClass(); + $params->siren = $siren; $params->idAnn = $idAnn; - $params->filtre = $filtre; - $params->position = $position; - $params->nbRep = $nbRep; - $client = $this->loadClient('entreprise'); - try { - $reponse = $client->getAnnoncesAsso($params); + $params->filtre = $filtre; + $params->position = $position; + $params->nbRep = $nbRep; + $client = $this->loadClient('entreprise'); + try { + $reponse = $client->getAnnoncesAsso($params); if ($this->cacheWrite) { - $cache->deletefile(); + $cache->deletefile(); $cache->setBlock($reponse->getAnnoncesAssoResult); - } - return $reponse->getAnnoncesAssoResult; - } catch (SoapFault $fault) { - $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); - return false; - } + } + return $reponse->getAnnoncesAssoResult; + } catch (SoapFault $fault) { + $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); + return false; + } } - public function getAnnoncesLegales($siren, $idAnn=null, $filtre=null, $position=0, $nbRep=20) - { - $filename = 'annonceslegales-'.$siren.'-'.$idAnn.'-'.$position.'-'.$nbRep; + public function getAnnoncesLegales($siren, $idAnn=null, $filtre=null, $position=0, $nbRep=20) + { + $filename = 'annonceslegales-'.$siren.'-'.$idAnn.'-'.$position.'-'.$nbRep; if ($this->cacheWrite) { $cache = new Cache($filename); @@ -2329,28 +2330,28 @@ class WsScores return $cache->getBlock(); } } - - $params = new stdClass(); - $params->siren = $siren; + + $params = new stdClass(); + $params->siren = $siren; $params->idAnn = $idAnn; - $params->filtre = $filtre; - $params->position = $position; - $params->nbRep = $nbRep; - $client = $this->loadClient('entreprise'); - try { - $reponse = $client->getAnnoncesLegales($params); - $this->logger->info(print_r($reponse,1)); + $params->filtre = $filtre; + $params->position = $position; + $params->nbRep = $nbRep; + $client = $this->loadClient('entreprise'); + try { + $reponse = $client->getAnnoncesLegales($params); + $this->logger->info(print_r($reponse,1)); if ($this->cacheWrite) { - $cache->deletefile(); + $cache->deletefile(); $cache->setBlock($reponse->getAnnoncesLegalesResult); - } - return $reponse->getAnnoncesLegalesResult; - } catch (SoapFault $fault) { - $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); - return false; - } + } + return $reponse->getAnnoncesLegalesResult; + } catch (SoapFault $fault) { + $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); + return false; + } } - + /** * getAnnonces * @param string $siren @@ -2684,29 +2685,29 @@ class WsScores } } - /** - * setDirigeantsOp - * @param array $infos - */ - public function setDirigeantsOp($infos, $mode, $id) - { - $params = new stdClass(); + /** + * setDirigeantsOp + * @param array $infos + */ + public function setDirigeantsOp($infos, $mode, $id) + { + $params = new stdClass(); $params->infos = $infos; - $params->mode = $mode; - $params->id = $id; - $client = $this->loadClient('saisie'); - try { - $reponse = $client->setDirigeantsOp($params); - return $reponse->setDirigeantsOpResult; - } catch (SoapFault $fault) { - $this->logger->info($fault->faultcode.':'.$fault->faultstring); - if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){ - return $fault->faultstring; - } else { - $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); - return false; - } - } + $params->mode = $mode; + $params->id = $id; + $client = $this->loadClient('saisie'); + try { + $reponse = $client->setDirigeantsOp($params); + return $reponse->setDirigeantsOpResult; + } catch (SoapFault $fault) { + $this->logger->info($fault->faultcode.':'.$fault->faultstring); + if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){ + return $fault->faultstring; + } else { + $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); + return false; + } + } } /** @@ -3214,24 +3215,24 @@ class WsScores } } - /** - * getScoreHistorique pour les derniers 5 ans - * @param string $siret - * @param string $type - */ - public function getScoresHisto($siret, $type = 'indiscore') - { - $params = new stdClass(); - $params->siret = $siret; - $params->type = $type; - try { - $client = $this->loadClient('interne'); - $reponse = $client->getScoresHisto($params); - return $reponse->getScoresHistoResult; + /** + * getScoreHistorique pour les derniers 5 ans + * @param string $siret + * @param string $type + */ + public function getScoresHisto($siret, $type = 'indiscore') + { + $params = new stdClass(); + $params->siret = $siret; + $params->type = $type; + try { + $client = $this->loadClient('interne'); + $reponse = $client->getScoresHisto($params); + return $reponse->getScoresHistoResult; } catch (SoapFault $fault) { $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); return false; - } + } } /** @@ -3327,25 +3328,25 @@ class WsScores /** * getCategory */ - public function getCategory() - { - $filename = 'category'; - $cache = new Cache($filename); - if ($cache->exist() && $this->cacheEnable ){ - return $cache->getBlock('category'); - } - try { - $client = $this->loadClient('gestion'); - $reponse = $client->getCategory(); - $cache->deletefile(); - $cache->setBlock($reponse->getCategoryResult); - return $reponse->getCategoryResult; - } catch (SoapFault $fault) { - $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); - //Placer exception pour affichage message - return false; - } - + public function getCategory() + { + $filename = 'category'; + $cache = new Cache($filename); + if ($cache->exist() && $this->cacheEnable ){ + return $cache->getBlock('category'); + } + try { + $client = $this->loadClient('gestion'); + $reponse = $client->getCategory(); + $cache->deletefile(); + $cache->setBlock($reponse->getCategoryResult); + return $reponse->getCategoryResult; + } catch (SoapFault $fault) { + $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); + //Placer exception pour affichage message + return false; + } + } /** From 9eec98395bc9fde3ee7a5f2defbe1291d69f9b9f Mon Sep 17 00:00:00 2001 From: benoitpotier Date: Fri, 17 Mar 2017 16:25:22 +0100 Subject: [PATCH 2/8] saisi bilan confidentiel peut avoir une valeur --- application/modules/default/controllers/SaisieController.php | 3 ++- .../modules/default/views/default/scripts/saisie/liasse.phtml | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/application/modules/default/controllers/SaisieController.php b/application/modules/default/controllers/SaisieController.php index d2c3b9800..b5e82eed3 100644 --- a/application/modules/default/controllers/SaisieController.php +++ b/application/modules/default/controllers/SaisieController.php @@ -1361,7 +1361,8 @@ class SaisieController extends Zend_Controller_Action $params['dureeMoisPre'], $params['typeBilan'], $params['postes'], - $params['step'] + $params['step'], + $params['confidentiel'] ); $this->logger->info(print_r($response,1)); diff --git a/application/modules/default/views/default/scripts/saisie/liasse.phtml b/application/modules/default/views/default/scripts/saisie/liasse.phtml index ad17f850f..d2a2e5be7 100644 --- a/application/modules/default/views/default/scripts/saisie/liasse.phtml +++ b/application/modules/default/views/default/scripts/saisie/liasse.phtml @@ -175,6 +175,7 @@ span.poste input { width:50px; } dateCloturePre: $('input#dateCloturePre').val(), dureeMoisPre: $('span#dureeMoisPre').html(), typeBilan: $('span#typeBilan').html(), + confidentiel: $('input#confidentiel').val(), postes: strPostes }; if (step=='debug') { From 3510df43e25c960dd2c5ff7a90763ab304be78c1 Mon Sep 17 00:00:00 2001 From: benoitpotier Date: Mon, 20 Mar 2017 14:31:58 +0100 Subject: [PATCH 3/8] ne pass visualiser un bilan confidentiel --- .../default/scripts/finance/liasselist.phtml | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/application/modules/default/views/default/scripts/finance/liasselist.phtml b/application/modules/default/views/default/scripts/finance/liasselist.phtml index 80671e51c..98a4ebb63 100644 --- a/application/modules/default/views/default/scripts/finance/liasselist.phtml +++ b/application/modules/default/views/default/scripts/finance/liasselist.phtml @@ -92,9 +92,14 @@ switch ($type) { $date = new Zend_Date($element->dateExercicePre, 'yyyyMMdd'); echo $date->toString('dd/MM/yyyy'); } ?> - dureeExercicePre > 0) {?>dureeExercicePre?> Mois - - Visualiser + confidentiel) : ?> + Confidentiel + + + Visualiser + + @@ -150,9 +155,13 @@ switch ($type) { ?> - dureeExercicePre > 0) {?>dureeExercicePre?> Mois - - Visualiser + confidentiel) : ?> + Confidentiel + + + Visualiser + From 5313c9265bf6d4027bb6ce9cccf73fb90dd11eae Mon Sep 17 00:00:00 2001 From: benoitpotier Date: Tue, 21 Mar 2017 08:53:24 +0100 Subject: [PATCH 4/8] suppression renseignement du confidentiel ou non lors de la saisie du bilan --- .../modules/default/controllers/SaisieController.php | 10 +++------- .../default/views/default/scripts/saisie/liasse.phtml | 1 - .../views/default/scripts/saisie/liasse/2033.phtml | 4 ---- .../views/default/scripts/saisie/liasse/2050.phtml | 4 ---- library/Scores/WsScores.php | 3 +-- 5 files changed, 4 insertions(+), 18 deletions(-) diff --git a/application/modules/default/controllers/SaisieController.php b/application/modules/default/controllers/SaisieController.php index b5e82eed3..1c05ba4f9 100644 --- a/application/modules/default/controllers/SaisieController.php +++ b/application/modules/default/controllers/SaisieController.php @@ -925,7 +925,6 @@ class SaisieController extends Zend_Controller_Action if ( !empty($selection) ) { list($date, $type) = explode(':', $selection); - $confidentiel = 0; // --- Correction d'un bilan if ($date!='NEW') { @@ -942,7 +941,6 @@ class SaisieController extends Zend_Controller_Action $milDatePre = $item->dateExercice; } } - $confidentiel = $item->confidentiel; } } @@ -957,7 +955,7 @@ class SaisieController extends Zend_Controller_Action $infos->dureeMois = $response->DUREE_MOIS; $infos->dureeMoisPre = $response->DUREE_MOIS_PRE; $infos->unite = empty($response->MONNAIE_LIV_UNITE) ? 'U' : $response->MONNAIE_LIV_UNITE; - $confidentiel = $response->TOP_CONFIDENTIEL; + $postes = array(); foreach ($response->POSTES->item as $item) { $postes[$item->id] = $item->val; @@ -973,7 +971,7 @@ class SaisieController extends Zend_Controller_Action $infos->dateCloturePre = $response->DATE_CLOTURE; $infos->dureeMoisPre = $response->DUREE_MOIS; $infos->unite = empty($response->MONNAIE_LIV_UNITE) ? 'U' : $response->MONNAIE_LIV_UNITE; - $confidentiel = $response->TOP_CONFIDENTIEL; + $postesN1 = array(); foreach ($response->POSTES->item as $item) { $postesN1[$item->id] = $item->val; @@ -1309,7 +1307,6 @@ class SaisieController extends Zend_Controller_Action $this->view->assign('dureeMoisPre', $dureeMoisPre); $this->view->assign('unite', $unite); $this->view->assign('typeBilan', $type); - $this->view->assign('confidentiel', $confidentiel); $this->view->assign('ancres', $ancres[$type]); $this->view->inlineScript()->appendFile('/libs/editable/jquery.jeditable.js'); @@ -1361,8 +1358,7 @@ class SaisieController extends Zend_Controller_Action $params['dureeMoisPre'], $params['typeBilan'], $params['postes'], - $params['step'], - $params['confidentiel'] + $params['step'] ); $this->logger->info(print_r($response,1)); diff --git a/application/modules/default/views/default/scripts/saisie/liasse.phtml b/application/modules/default/views/default/scripts/saisie/liasse.phtml index d2a2e5be7..1ffa6db01 100644 --- a/application/modules/default/views/default/scripts/saisie/liasse.phtml +++ b/application/modules/default/views/default/scripts/saisie/liasse.phtml @@ -37,7 +37,6 @@ span.poste input { width:50px; } $params = array( 'ancres' => $this->ancres, 'typeBilan' => $this->typeBilan, - 'confidentiel' => $this->confidentiel, 'unite' => $this->unite, 'dateCloture' => $this->dateCloture, 'dureeMois'=> $this->dureeMois, diff --git a/application/modules/default/views/default/scripts/saisie/liasse/2033.phtml b/application/modules/default/views/default/scripts/saisie/liasse/2033.phtml index f032d1b94..600a2151c 100644 --- a/application/modules/default/views/default/scripts/saisie/liasse/2033.phtml +++ b/application/modules/default/views/default/scripts/saisie/liasse/2033.phtml @@ -3,10 +3,6 @@ typeBilan?>
-
- - -
unite?> € diff --git a/application/modules/default/views/default/scripts/saisie/liasse/2050.phtml b/application/modules/default/views/default/scripts/saisie/liasse/2050.phtml index de5444cf2..eb3f1f34c 100644 --- a/application/modules/default/views/default/scripts/saisie/liasse/2050.phtml +++ b/application/modules/default/views/default/scripts/saisie/liasse/2050.phtml @@ -3,10 +3,6 @@ typeBilan?>
-
- - -
unite?> € diff --git a/library/Scores/WsScores.php b/library/Scores/WsScores.php index 88eb63bf5..1bcda8884 100644 --- a/library/Scores/WsScores.php +++ b/library/Scores/WsScores.php @@ -899,7 +899,7 @@ class WsScores } } - public function setBilan($siren, $originalDateCloture, $originalTypeBilan, $unite, $dateCloture, $dureeMois, $dateCloturePre, $dureeMoisPre, $typeBilan, $postes, $step = 'normal', $confidentiel=0) + public function setBilan($siren, $originalDateCloture, $originalTypeBilan, $unite, $dateCloture, $dureeMois, $dateCloturePre, $dureeMoisPre, $typeBilan, $postes, $step = 'normal') { $params = new stdClass(); $params->siren = $siren; @@ -913,7 +913,6 @@ class WsScores $params->data->typeBilan = $typeBilan; $params->data->postes = $postes; $params->step = $step; - $params->confidentiel = $confidentiel; $client = $this->loadClient('saisie'); try { $reponse = $client->setBilan($params); From a0ebfe4d14b66bc66cddee7e96d184b76de34344 Mon Sep 17 00:00:00 2001 From: benoitpotier Date: Tue, 21 Mar 2017 09:47:05 +0100 Subject: [PATCH 5/8] =?UTF-8?q?modification=20de=20la=20visibilit=C3=A9=20?= =?UTF-8?q?des=20rapports=20confidentiels?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../default/controllers/FinanceController.php | 1 + .../views/default/scripts/finance/liasselist.phtml | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/application/modules/default/controllers/FinanceController.php b/application/modules/default/controllers/FinanceController.php index b788ca42c..4aa606061 100644 --- a/application/modules/default/controllers/FinanceController.php +++ b/application/modules/default/controllers/FinanceController.php @@ -852,6 +852,7 @@ class FinanceController extends Zend_Controller_Action $this->view->assign('raisonSociale', $entreprise->getRaisonSociale()); $this->view->assign('siren', substr($this->siret, 0, 9)); $this->view->assign('siret', $this->siret); + $this->view->assign('idClient', $user->identity->idClient); $this->view->haveLiasse = ($bilanList->nbReponses > 0) ? true : false; diff --git a/application/modules/default/views/default/scripts/finance/liasselist.phtml b/application/modules/default/views/default/scripts/finance/liasselist.phtml index 98a4ebb63..cb91ef263 100644 --- a/application/modules/default/views/default/scripts/finance/liasselist.phtml +++ b/application/modules/default/views/default/scripts/finance/liasselist.phtml @@ -92,13 +92,13 @@ switch ($type) { $date = new Zend_Date($element->dateExercicePre, 'yyyyMMdd'); echo $date->toString('dd/MM/yyyy'); } ?> - dureeExercicePre > 0) {?>dureeExercicePre?> Mois - confidentiel) : ?> - Confidentiel - + idClient == 1 || ($this->idClient == $element->confidentiel || 0 == $element->confidentiel)) : ?> Visualiser + + Confidentiel @@ -155,12 +155,12 @@ switch ($type) { ?> - dureeExercicePre > 0) {?>dureeExercicePre?> Mois - confidentiel) : ?> - Confidentiel - + idClient == 1 || ($this->idClient == $element->confidentiel || 0 == $element->confidentiel)) : ?> Visualiser + + Confidentiel From bdc8be36709a4a3c023c54831e72b526e05a44fd Mon Sep 17 00:00:00 2001 From: benoitpotier Date: Tue, 21 Mar 2017 16:16:53 +0100 Subject: [PATCH 6/8] progress confidentiel --- .../default/views/default/scripts/finance/liasselist.phtml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/modules/default/views/default/scripts/finance/liasselist.phtml b/application/modules/default/views/default/scripts/finance/liasselist.phtml index cb91ef263..47a5a8037 100644 --- a/application/modules/default/views/default/scripts/finance/liasselist.phtml +++ b/application/modules/default/views/default/scripts/finance/liasselist.phtml @@ -92,7 +92,7 @@ switch ($type) { $date = new Zend_Date($element->dateExercicePre, 'yyyyMMdd'); echo $date->toString('dd/MM/yyyy'); } ?> - dureeExercicePre > 0) {?>dureeExercicePre?> Mois - idClient == 1 || ($this->idClient == $element->confidentiel || 0 == $element->confidentiel)) : ?> + idClient, [1, 147]) || ($element->confidentielClient == $this->idClient || 0 == $element->confidentiel)) : ?> Visualiser @@ -155,7 +155,7 @@ switch ($type) { ?> - dureeExercicePre > 0) {?>dureeExercicePre?> Mois - idClient == 1 || ($this->idClient == $element->confidentiel || 0 == $element->confidentiel)) : ?> + idClient, [1, 147]) || ($element->confidentielClient == $this->idClient || 0 == $element->confidentiel)) : ?> Visualiser From 2b9e237d318f2996f559329da2d7400f9044f041 Mon Sep 17 00:00:00 2001 From: benoitpotier Date: Thu, 23 Mar 2017 15:28:50 +0100 Subject: [PATCH 7/8] delete dead code --- .../modules/default/views/default/scripts/saisie/liasse.phtml | 1 - 1 file changed, 1 deletion(-) diff --git a/application/modules/default/views/default/scripts/saisie/liasse.phtml b/application/modules/default/views/default/scripts/saisie/liasse.phtml index 1ffa6db01..a60660d61 100644 --- a/application/modules/default/views/default/scripts/saisie/liasse.phtml +++ b/application/modules/default/views/default/scripts/saisie/liasse.phtml @@ -174,7 +174,6 @@ span.poste input { width:50px; } dateCloturePre: $('input#dateCloturePre').val(), dureeMoisPre: $('span#dureeMoisPre').html(), typeBilan: $('span#typeBilan').html(), - confidentiel: $('input#confidentiel').val(), postes: strPostes }; if (step=='debug') { From 0e2ad852b239eec9c5330f794d5a26f61b329608 Mon Sep 17 00:00:00 2001 From: benoitpotier Date: Mon, 27 Mar 2017 17:02:45 +0200 Subject: [PATCH 8/8] delete cash --- library/Scores/WsScores.php | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/library/Scores/WsScores.php b/library/Scores/WsScores.php index 1bcda8884..6de798503 100644 --- a/library/Scores/WsScores.php +++ b/library/Scores/WsScores.php @@ -2457,24 +2457,11 @@ class WsScores */ public function getListeBilans($siren) { - $filename = 'listebilans-'.$siren; - - if ($this->cacheWrite) { - $cache = new Cache($filename); - if ($cache->exist() && $this->cacheEnable ){ - return $cache->getBlock(); - } - } - $params = new StdClass; $params->siren = $siren; $client = $this->loadClient('entreprise'); try { $reponse = $client->getListeBilans($params); - if ($this->cacheWrite) { - $cache->deletefile(); - $cache->setBlock($reponse->getListeBilansResult); - } return $reponse->getListeBilansResult; } catch (SoapFault $fault) { $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse()); @@ -2592,25 +2579,12 @@ class WsScores */ public function getRatios($siren, $page = 'ratios') { - $filename = 'ratios-'.$siren.'-'.$page; - - if ($this->cacheWrite) { - $cache = new Cache($filename); - if ($cache->exist() && $this->cacheEnable ){ - return $cache->getBlock(); - } - } - $params = new StdClass(); $params->siren = $siren; $params->page = $page; $client = $this->loadClient('entreprise'); try { $reponse = $client->getRatios($params); - if ($this->cacheWrite) { - $cache->deletefile(); - $cache->setBlock($reponse->getRatiosResult); - } return $reponse->getRatiosResult; } catch (SoapFault $fault) { $this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());