Saisie des bilans

This commit is contained in:
Michael RICOIS 2013-05-15 16:08:54 +00:00
parent da516375cc
commit 1bbb39eb7a

View File

@ -1080,24 +1080,305 @@ class SaisieController extends Zend_Controller_Action
$ws = new WsScores();
$selection = $request->getParam('selection', '');
if ( !empty($selection) ) {
list($date, $type) = explode(':', $selection);
if ($date!='NEW') {
$response = $ws->getBilan($siren, $date, $type, true);
$infos = new stdClass();
$infos->siren = $response->siren;
$infos->dateCloture = $response->DATE_CLOTURE;
$infos->dateCloturePre = $response->DATE_CLOTURE_PRE;
$infos->dureeMois = $response->DUREE_MOIS;
$infos->dureeMoisPre = $response->DUREE_MOIS_PRE;
$infos->unite = empty($response->MONNAIE_LIV_UNITE) ? 'U' : $response->MONNAIE_LIV_UNITE;
$postes = array();
foreach ($response->POSTES->item as $item) {
$postes[$item->id] = $item->val;
$milDate = $milDatePre = null;
$listBilans = $ws->getListeBilans($siren);
if ( count($listBilans->result->item) > 0 ) {
foreach ($listBilans->result->item as $item) {
if ($type == $item->typeBilan) {
if ($item->dateExercice == $date) {
$milDate = $item->dateExercice;
}
if (substr($item->dateExercice,0,4) == intval(substr($date,0,4))-1) {
$milDatePre = $item->dateExercice;
}
}
}
}
Zend_Registry::get('firebug')->info($postes);
if ( null !== $milDate ) {
$response = $ws->getBilan($siren, $milDate, $type, true);
Zend_Registry::get('firebug')->info($response);
$infos = new stdClass();
$infos->siren = $response->siren;
$infos->dateCloture = $response->DATE_CLOTURE;
$infos->dateCloturePre = $response->DATE_CLOTURE_PRE;
$infos->dureeMois = $response->DUREE_MOIS;
$infos->dureeMoisPre = $response->DUREE_MOIS_PRE;
$infos->unite = empty($response->MONNAIE_LIV_UNITE) ? 'U' : $response->MONNAIE_LIV_UNITE;
$postes = array();
foreach ($response->POSTES->item as $item) {
$postes[$item->id] = $item->val;
}
} elseif ( null === $milDate && null !== $milDatePre ) {
$response = $ws->getBilan($siren, $milDatePre, $type, true);
Zend_Registry::get('firebug')->info($response);
$infos = new stdClass();
$infos->siren = $response->siren;
$infos->dateCloturePre = $response->DATE_CLOTURE_PRE;
$infos->dureeMoisPre = $response->DUREE_MOIS_PRE;
$infos->unite = empty($response->MONNAIE_LIV_UNITE) ? 'U' : $response->MONNAIE_LIV_UNITE;
$postesN1 = array();
foreach ($response->POSTES->item as $item) {
$postesN1[$item->id] = $item->val;
}
$postes = array();
/** Reprises des valeures N-1 si l'information est absente en base **/
if ($type=='N' || $type=='C') {
// Actif
if (!isset($postes['AA3']) && isset($postesN1['AA2'])) $postes['AA3']=$postesN1['AA2'];
if (!isset($postes['AC2']) && isset($postesN1['AC1'])) $postes['AC2']=$postesN1['AC1'];
if (!isset($postes['AE2']) && isset($postesN1['AE1'])) $postes['AE2']=$postesN1['AE1'];
if (!isset($postes['AG2']) && isset($postesN1['AG1'])) $postes['AG2']=$postesN1['AG1'];
if (!isset($postes['AI2']) && isset($postesN1['AI1'])) $postes['AI2']=$postesN1['AI1'];
if (!isset($postes['AK2']) && isset($postesN1['AK1'])) $postes['AK2']=$postesN1['AK1'];
if (!isset($postes['AM2']) && isset($postesN1['AM1'])) $postes['AM2']=$postesN1['AM1'];
if (!isset($postes['AO2']) && isset($postesN1['AO1'])) $postes['AO2']=$postesN1['AO1'];
if (!isset($postes['AQ2']) && isset($postesN1['AQ1'])) $postes['AQ2']=$postesN1['AQ1'];
if (!isset($postes['AS2']) && isset($postesN1['AS1'])) $postes['AS2']=$postesN1['AS1'];
if (!isset($postes['AU2']) && isset($postesN1['AU1'])) $postes['AU2']=$postesN1['AU1'];
if (!isset($postes['AW2']) && isset($postesN1['AW1'])) $postes['AW2']=$postesN1['AW1'];
if (!isset($postes['AY2']) && isset($postesN1['AY1'])) $postes['AY2']=$postesN1['AY1'];
if (!isset($postes['CT2']) && isset($postesN1['CT1'])) $postes['CT2']=$postesN1['CT1'];
if (!isset($postes['CV2']) && isset($postesN1['CV1'])) $postes['CV2']=$postesN1['CV1'];
if (!isset($postes['BC2']) && isset($postesN1['BC1'])) $postes['BC2']=$postesN1['BC1'];
if (!isset($postes['BE2']) && isset($postesN1['BE1'])) $postes['BE2']=$postesN1['BE1'];
if (!isset($postes['BG2']) && isset($postesN1['BG1'])) $postes['BG2']=$postesN1['BG1'];
if (!isset($postes['BI2']) && isset($postesN1['BI1'])) $postes['BI2']=$postesN1['BI1'];
if (!isset($postes['BK2']) && isset($postesN1['BK1'])) $postes['BK2']=$postesN1['BK1'];
if (!isset($postes['BM2']) && isset($postesN1['BM1'])) $postes['BM2']=$postesN1['BM1'];
if (!isset($postes['BO2']) && isset($postesN1['BO1'])) $postes['BO2']=$postesN1['BO1'];
if (!isset($postes['BQ2']) && isset($postesN1['BQ1'])) $postes['BQ2']=$postesN1['BQ1'];
if (!isset($postes['BS2']) && isset($postesN1['BS1'])) $postes['BS2']=$postesN1['BS1'];
if (!isset($postes['BU2']) && isset($postesN1['BU1'])) $postes['BU2']=$postesN1['BU1'];
if (!isset($postes['BW2']) && isset($postesN1['BW1'])) $postes['BW2']=$postesN1['BW1'];
if (!isset($postes['BY2']) && isset($postesN1['BY1'])) $postes['BY2']=$postesN1['BY1'];
if (!isset($postes['CA2']) && isset($postesN1['CA1'])) $postes['CA2']=$postesN1['CA1'];
if (!isset($postes['CC2']) && isset($postesN1['CC1'])) $postes['CC2']=$postesN1['CC1'];
if (!isset($postes['CE2']) && isset($postesN1['CE1'])) $postes['CE2']=$postesN1['CE1'];
if (!isset($postes['CG2']) && isset($postesN1['CG1'])) $postes['CG2']=$postesN1['CG1'];
if (!isset($postes['CI2']) && isset($postesN1['CI1'])) $postes['CI2']=$postesN1['CI1'];
if (!isset($postes['CK2']) && isset($postesN1['CK1'])) $postes['CK2']=$postesN1['CK1'];
if (!isset($postes['CL3']) && isset($postesN1['CL2'])) $postes['CL3']=$postesN1['CL2'];
if (!isset($postes['CM3']) && isset($postesN1['CM2'])) $postes['CM3']=$postesN1['CM2'];
if (!isset($postes['CN3']) && isset($postesN1['CN2'])) $postes['CN3']=$postesN1['CN2'];
if (!isset($postes['1A2']) && isset($postesN1['1A1'])) $postes['1A2']=$postesN1['1A1'];
// Passif
if (!isset($postes['DA1']) && isset($postesN1['DA'])) $postes['DA1']=$postesN1['DA'];
if (!isset($postes['DB1']) && isset($postesN1['DB'])) $postes['DB1']=$postesN1['DB'];
if (!isset($postes['DC1']) && isset($postesN1['DC'])) $postes['DC1']=$postesN1['DC'];
if (!isset($postes['DD1']) && isset($postesN1['DD'])) $postes['DD1']=$postesN1['DD'];
if (!isset($postes['DE1']) && isset($postesN1['DE'])) $postes['DE1']=$postesN1['DE'];
if (!isset($postes['DF1']) && isset($postesN1['DF'])) $postes['DF1']=$postesN1['DF'];
if (!isset($postes['DG1']) && isset($postesN1['DG'])) $postes['DG1']=$postesN1['DG'];
if (!isset($postes['DH1']) && isset($postesN1['DH'])) $postes['DH1']=$postesN1['DH'];
if (!isset($postes['DI1']) && isset($postesN1['DI'])) $postes['DI1']=$postesN1['DI'];
if (!isset($postes['DJ1']) && isset($postesN1['DJ'])) $postes['DJ1']=$postesN1['DJ'];
if (!isset($postes['DK1']) && isset($postesN1['DK'])) $postes['DK1']=$postesN1['DK'];
if (!isset($postes['DL1']) && isset($postesN1['DL'])) $postes['DL1']=$postesN1['DL'];
if (!isset($postes['DM1']) && isset($postesN1['DM'])) $postes['DM1']=$postesN1['DM'];
if (!isset($postes['DN1']) && isset($postesN1['DN'])) $postes['DN1']=$postesN1['DN'];
if (!isset($postes['DO1']) && isset($postesN1['DO'])) $postes['DO1']=$postesN1['DO'];
if (!isset($postes['DP1']) && isset($postesN1['DP'])) $postes['DP1']=$postesN1['DP'];
if (!isset($postes['DQ1']) && isset($postesN1['DQ'])) $postes['DQ1']=$postesN1['DQ'];
if (!isset($postes['DR1']) && isset($postesN1['DR'])) $postes['DR1']=$postesN1['DR'];
if (!isset($postes['DS1']) && isset($postesN1['DS'])) $postes['DS1']=$postesN1['DS'];
if (!isset($postes['DT1']) && isset($postesN1['DT'])) $postes['DT1']=$postesN1['DT'];
if (!isset($postes['DU1']) && isset($postesN1['DU'])) $postes['DU1']=$postesN1['DU'];
if (!isset($postes['DV1']) && isset($postesN1['DV'])) $postes['DV1']=$postesN1['DV'];
if (!isset($postes['DW1']) && isset($postesN1['DW'])) $postes['DW1']=$postesN1['DW'];
if (!isset($postes['DX1']) && isset($postesN1['DX'])) $postes['DX1']=$postesN1['DX'];
if (!isset($postes['DY1']) && isset($postesN1['DY'])) $postes['DY1']=$postesN1['DY'];
if (!isset($postes['DZ1']) && isset($postesN1['DZ'])) $postes['DZ1']=$postesN1['DZ'];
if (!isset($postes['EA1']) && isset($postesN1['EA'])) $postes['EA1']=$postesN1['EA'];
if (!isset($postes['EB1']) && isset($postesN1['EB'])) $postes['EB1']=$postesN1['EB'];
if (!isset($postes['EC1']) && isset($postesN1['EC'])) $postes['EC1']=$postesN1['EC'];
if (!isset($postes['ED1']) && isset($postesN1['ED'])) $postes['ED1']=$postesN1['ED'];
if (!isset($postes['EE1']) && isset($postesN1['EE'])) $postes['EE1']=$postesN1['EE'];
if (!isset($postes['1B1']) && isset($postesN1['1B'])) $postes['1B1']=$postesN1['1B'];
if (!isset($postes['1C1']) && isset($postesN1['1C'])) $postes['1C1']=$postesN1['1C'];
if (!isset($postes['1D1']) && isset($postesN1['1D'])) $postes['1D1']=$postesN1['1D'];
if (!isset($postes['1E1']) && isset($postesN1['1E'])) $postes['1E1']=$postesN1['1E'];
if (!isset($postes['EF1']) && isset($postesN1['EF'])) $postes['EF1']=$postesN1['EF'];
if (!isset($postes['EG1']) && isset($postesN1['EG'])) $postes['EG1']=$postesN1['EG'];
if (!isset($postes['EH1']) && isset($postesN1['EH'])) $postes['EH1']=$postesN1['EH'];
// Compte de Résultats
if (!isset($postes['FC1']) && isset($postesN1['FC'])) $postes['FC1']=$postesN1['FC'];
if (!isset($postes['FF1']) && isset($postesN1['FF'])) $postes['FF1']=$postesN1['FF'];
if (!isset($postes['FI1']) && isset($postesN1['FI'])) $postes['FI1']=$postesN1['FI'];
if (!isset($postes['FL1']) && isset($postesN1['FL'])) $postes['FL1']=$postesN1['FL'];
if (!isset($postes['FM1']) && isset($postesN1['FM'])) $postes['FM1']=$postesN1['FM'];
if (!isset($postes['FN1']) && isset($postesN1['FN'])) $postes['FN1']=$postesN1['FN'];
if (!isset($postes['FO1']) && isset($postesN1['FO'])) $postes['FO1']=$postesN1['FO'];
if (!isset($postes['FP1']) && isset($postesN1['FP'])) $postes['FP1']=$postesN1['FP'];
if (!isset($postes['FQ1']) && isset($postesN1['FQ'])) $postes['FQ1']=$postesN1['FQ'];
if (!isset($postes['FR1']) && isset($postesN1['FR'])) $postes['FR1']=$postesN1['FR'];
if (!isset($postes['FS1']) && isset($postesN1['FS'])) $postes['FS1']=$postesN1['FS'];
if (!isset($postes['FT1']) && isset($postesN1['FT'])) $postes['FT1']=$postesN1['FT'];
if (!isset($postes['FU1']) && isset($postesN1['FU'])) $postes['FU1']=$postesN1['FU'];
if (!isset($postes['FV1']) && isset($postesN1['FV'])) $postes['FV1']=$postesN1['FV'];
if (!isset($postes['FW1']) && isset($postesN1['FW'])) $postes['FW1']=$postesN1['FW'];
if (!isset($postes['FX1']) && isset($postesN1['FX'])) $postes['FX1']=$postesN1['FX'];
if (!isset($postes['FY1']) && isset($postesN1['FY'])) $postes['FY1']=$postesN1['FY'];
if (!isset($postes['FZ1']) && isset($postesN1['FZ'])) $postes['FZ1']=$postesN1['FZ'];
if (!isset($postes['GA1']) && isset($postesN1['GA'])) $postes['GA1']=$postesN1['GA'];
if (!isset($postes['GB1']) && isset($postesN1['GB'])) $postes['GB1']=$postesN1['GB'];
if (!isset($postes['GC1']) && isset($postesN1['GC'])) $postes['GC1']=$postesN1['GC'];
if (!isset($postes['GD1']) && isset($postesN1['GD'])) $postes['GD1']=$postesN1['GD'];
if (!isset($postes['GE1']) && isset($postesN1['GE'])) $postes['GE1']=$postesN1['GE'];
if (!isset($postes['GF1']) && isset($postesN1['GF'])) $postes['GF1']=$postesN1['GF'];
if (!isset($postes['GG1']) && isset($postesN1['GG'])) $postes['GG1']=$postesN1['GG'];
if (!isset($postes['GH1']) && isset($postesN1['GH'])) $postes['GH1']=$postesN1['GH'];
if (!isset($postes['GI1']) && isset($postesN1['GI'])) $postes['GI1']=$postesN1['GI'];
if (!isset($postes['GJ1']) && isset($postesN1['GJ'])) $postes['GJ1']=$postesN1['GJ'];
if (!isset($postes['GK1']) && isset($postesN1['GK'])) $postes['GK1']=$postesN1['GK'];
if (!isset($postes['GL1']) && isset($postesN1['GL'])) $postes['GL1']=$postesN1['GL'];
if (!isset($postes['GM1']) && isset($postesN1['GM'])) $postes['GM1']=$postesN1['GM'];
if (!isset($postes['GN1']) && isset($postesN1['GN'])) $postes['GN1']=$postesN1['GN'];
if (!isset($postes['GO1']) && isset($postesN1['GO'])) $postes['GO1']=$postesN1['GO'];
if (!isset($postes['GP1']) && isset($postesN1['GP'])) $postes['GP1']=$postesN1['GP'];
if (!isset($postes['GQ1']) && isset($postesN1['GQ'])) $postes['GQ1']=$postesN1['GQ'];
if (!isset($postes['GR1']) && isset($postesN1['GR'])) $postes['GR1']=$postesN1['GR'];
if (!isset($postes['GS1']) && isset($postesN1['GS'])) $postes['GS1']=$postesN1['GS'];
if (!isset($postes['GT1']) && isset($postesN1['GT'])) $postes['GT1']=$postesN1['GT'];
if (!isset($postes['GU1']) && isset($postesN1['GU'])) $postes['GU1']=$postesN1['GU'];
if (!isset($postes['GV1']) && isset($postesN1['GV'])) $postes['GV1']=$postesN1['GV'];
if (!isset($postes['GW1']) && isset($postesN1['GW'])) $postes['GW1']=$postesN1['GW'];
if (!isset($postes['HA1']) && isset($postesN1['HA'])) $postes['HA1']=$postesN1['HA'];
if (!isset($postes['HB1']) && isset($postesN1['HB'])) $postes['HB1']=$postesN1['HB'];
if (!isset($postes['HC1']) && isset($postesN1['HC'])) $postes['HC1']=$postesN1['HC'];
if (!isset($postes['HD1']) && isset($postesN1['HD'])) $postes['HD1']=$postesN1['HD'];
if (!isset($postes['HE1']) && isset($postesN1['HE'])) $postes['HE1']=$postesN1['HE'];
if (!isset($postes['HF1']) && isset($postesN1['HF'])) $postes['HF1']=$postesN1['HF'];
if (!isset($postes['HG1']) && isset($postesN1['HG'])) $postes['HG1']=$postesN1['HG'];
if (!isset($postes['HH1']) && isset($postesN1['HH'])) $postes['HH1']=$postesN1['HH'];
if (!isset($postes['HI1']) && isset($postesN1['HI'])) $postes['HI1']=$postesN1['HI'];
if (!isset($postes['HJ1']) && isset($postesN1['HJ'])) $postes['HJ1']=$postesN1['HJ'];
if (!isset($postes['HK1']) && isset($postesN1['HK'])) $postes['HK1']=$postesN1['HK'];
if (!isset($postes['HL1']) && isset($postesN1['HL'])) $postes['HL1']=$postesN1['HL'];
if (!isset($postes['HM1']) && isset($postesN1['HM'])) $postes['HM1']=$postesN1['HM'];
if (!isset($postes['HN1']) && isset($postesN1['HN'])) $postes['HN1']=$postesN1['HN'];
if (!isset($postes['HO1']) && isset($postesN1['HO'])) $postes['HO1']=$postesN1['HO'];
if (!isset($postes['HY1']) && isset($postesN1['HY'])) $postes['HY1']=$postesN1['HY'];
if (!isset($postes['1G1']) && isset($postesN1['1G'])) $postes['1G1']=$postesN1['1G'];
if (!isset($postes['HP1']) && isset($postesN1['HP'])) $postes['HP1']=$postesN1['HP'];
if (!isset($postes['HQ1']) && isset($postesN1['HQ'])) $postes['HQ1']=$postesN1['HQ'];
if (!isset($postes['1H1']) && isset($postesN1['1H'])) $postes['1H1']=$postesN1['1H'];
if (!isset($postes['1J1']) && isset($postesN1['1J'])) $postes['1J1']=$postesN1['1J'];
if (!isset($postes['1K1']) && isset($postesN1['1K'])) $postes['1K1']=$postesN1['1K'];
if (!isset($postes['HX1']) && isset($postesN1['HX'])) $postes['HX1']=$postesN1['HX'];
if (!isset($postes['A11']) && isset($postesN1['A1'])) $postes['A11']=$postesN1['A1'];
if (!isset($postes['A21']) && isset($postesN1['A2'])) $postes['A21']=$postesN1['A2'];
if (!isset($postes['A31']) && isset($postesN1['A3'])) $postes['A31']=$postesN1['A3'];
if (!isset($postes['A41']) && isset($postesN1['A4'])) $postes['A41']=$postesN1['A4'];
} elseif ($type=='S') {
// Calcul des chiffres net N-1 si absent 2033
if (!isset($postesN1['013']) && (isset($postesN1['010'])||isset($postesN1['012'])))$postesN1['013']=$postesN1['010']-$postesN1['012'];
if (!isset($postesN1['017']) && (isset($postesN1['014'])||isset($postesN1['016'])))$postesN1['017']=$postesN1['014']-$postesN1['016'];
if (!isset($postesN1['031']) && (isset($postesN1['028'])||isset($postesN1['030'])))$postesN1['031']=$postesN1['028']-$postesN1['030'];
if (!isset($postesN1['043']) && (isset($postesN1['040'])||isset($postesN1['042'])))$postesN1['043']=$postesN1['040']-$postesN1['042'];
if (!isset($postesN1['049']) && (isset($postesN1['044'])||isset($postesN1['048'])))$postesN1['049']=$postesN1['044']-$postesN1['048'];
if (!isset($postesN1['053']) && (isset($postesN1['050'])||isset($postesN1['052'])))$postesN1['053']=$postesN1['050']-$postesN1['052'];
if (!isset($postesN1['063']) && (isset($postesN1['060'])||isset($postesN1['062'])))$postesN1['063']=$postesN1['060']-$postesN1['062'];
if (!isset($postesN1['067']) && (isset($postesN1['064'])||isset($postesN1['066'])))$postesN1['067']=$postesN1['064']-$postesN1['066'];
if (!isset($postesN1['071']) && (isset($postesN1['068'])||isset($postesN1['070'])))$postesN1['071']=$postesN1['068']-$postesN1['070'];
if (!isset($postesN1['075']) && (isset($postesN1['072'])||isset($postesN1['074'])))$postesN1['075']=$postesN1['072']-$postesN1['074'];
if (!isset($postesN1['083']) && (isset($postesN1['080'])||isset($postesN1['082'])))$postesN1['083']=$postesN1['080']-$postesN1['082'];
if (!isset($postesN1['087']) && (isset($postesN1['084'])||isset($postesN1['086'])))$postesN1['087']=$postesN1['084']-$postesN1['086'];
if (!isset($postesN1['091']) && (isset($postesN1['088'])||isset($postesN1['090'])))$postesN1['091']=$postesN1['088']-$postesN1['090'];
if (!isset($postesN1['095']) && (isset($postesN1['092'])||isset($postesN1['094'])))$postesN1['095']=$postesN1['092']-$postesN1['094'];
if (!isset($postesN1['099']) && (isset($postesN1['096'])||isset($postesN1['098'])))$postesN1['099']=$postesN1['096']-$postesN1['098'];
if (!isset($postesN1['113']) && (isset($postesN1['110'])||isset($postesN1['112'])))$postesN1['113']=$postesN1['110']-$postesN1['112'];
// Récupération des chiffres N-1 si absent du bilan N
// ACTIF 2033
if (!isset($postes['N00']) && isset($postesN1['013'])) $postes['N00']=$postesN1['013'];
if (!isset($postes['N01']) && isset($postesN1['017'])) $postes['N01']=$postesN1['017'];
if (!isset($postes['N02']) && isset($postesN1['031'])) $postes['N02']=$postesN1['031'];
if (!isset($postes['N03']) && isset($postesN1['043'])) $postes['N03']=$postesN1['043'];
if (!isset($postes['N04']) && isset($postesN1['049'])) $postes['N04']=$postesN1['049'];
if (!isset($postes['N05']) && isset($postesN1['053'])) $postes['N05']=$postesN1['053'];
if (!isset($postes['N06']) && isset($postesN1['063'])) $postes['N06']=$postesN1['063'];
if (!isset($postes['N07']) && isset($postesN1['067'])) $postes['N07']=$postesN1['067'];
if (!isset($postes['N08']) && isset($postesN1['071'])) $postes['N08']=$postesN1['071'];
if (!isset($postes['N09']) && isset($postesN1['075'])) $postes['N09']=$postesN1['075'];
if (!isset($postes['N10']) && isset($postesN1['083'])) $postes['N10']=$postesN1['083'];
if (!isset($postes['N11']) && isset($postesN1['087'])) $postes['N11']=$postesN1['087'];
if (!isset($postes['N12']) && isset($postesN1['091'])) $postes['N12']=$postesN1['091'];
if (!isset($postes['N13']) && isset($postesN1['095'])) $postes['N13']=$postesN1['095'];
if (!isset($postes['N14']) && isset($postesN1['099'])) $postes['N14']=$postesN1['099'];
if (!isset($postes['N15']) && isset($postesN1['113'])) $postes['N15']=$postesN1['113'];
// PASSIF 2033
if (!isset($postes['N16']) && isset($postesN1['120'])) $postes['N16']=$postesN1['120'];
if (!isset($postes['N17']) && isset($postesN1['124'])) $postes['N17']=$postesN1['124'];
if (!isset($postes['N18']) && isset($postesN1['126'])) $postes['N18']=$postesN1['126'];
if (!isset($postes['N19']) && isset($postesN1['130'])) $postes['N19']=$postesN1['130'];
if (!isset($postes['N20']) && isset($postesN1['132'])) $postes['N20']=$postesN1['132'];
if (!isset($postes['N21']) && isset($postesN1['134'])) $postes['N21']=$postesN1['134'];
if (!isset($postes['N22']) && isset($postesN1['136'])) $postes['N22']=$postesN1['136'];
if (!isset($postes['N23']) && isset($postesN1['140'])) $postes['N23']=$postesN1['140'];
if (!isset($postes['N24']) && isset($postesN1['142'])) $postes['N24']=$postesN1['142'];
if (!isset($postes['N25']) && isset($postesN1['154'])) $postes['N25']=$postesN1['154'];
if (!isset($postes['N26']) && isset($postesN1['156'])) $postes['N26']=$postesN1['156'];
if (!isset($postes['N27']) && isset($postesN1['164'])) $postes['N27']=$postesN1['164'];
if (!isset($postes['N28']) && isset($postesN1['166'])) $postes['N28']=$postesN1['166'];
if (!isset($postes['N29']) && isset($postesN1['172'])) $postes['N29']=$postesN1['172'];
if (!isset($postes['N30']) && isset($postesN1['174'])) $postes['N30']=$postesN1['174'];
if (!isset($postes['N31']) && isset($postesN1['176'])) $postes['N31']=$postesN1['176'];
if (!isset($postes['N32']) && isset($postesN1['180'])) $postes['N32']=$postesN1['180'];
// COMPTE DE RESULTAT 2033
if (!isset($postes['N33']) && isset($postesN1['210'])) $postes['N33']=$postesN1['210'];
if (!isset($postes['N34']) && isset($postesN1['214'])) $postes['N34']=$postesN1['214'];
if (!isset($postes['N35']) && isset($postesN1['218'])) $postes['N35']=$postesN1['218'];
if (!isset($postes['N36']) && isset($postesN1['222'])) $postes['N36']=$postesN1['222'];
if (!isset($postes['N37']) && isset($postesN1['224'])) $postes['N37']=$postesN1['224'];
if (!isset($postes['N38']) && isset($postesN1['226'])) $postes['N38']=$postesN1['226'];
if (!isset($postes['N39']) && isset($postesN1['230'])) $postes['N39']=$postesN1['230'];
if (!isset($postes['N40']) && isset($postesN1['232'])) $postes['N40']=$postesN1['232'];
if (!isset($postes['N41']) && isset($postesN1['234'])) $postes['N41']=$postesN1['234'];
if (!isset($postes['N42']) && isset($postesN1['236'])) $postes['N42']=$postesN1['236'];
if (!isset($postes['N43']) && isset($postesN1['238'])) $postes['N43']=$postesN1['238'];
if (!isset($postes['N44']) && isset($postesN1['240'])) $postes['N44']=$postesN1['240'];
if (!isset($postes['N45']) && isset($postesN1['242'])) $postes['N45']=$postesN1['242'];
if (!isset($postes['N46']) && isset($postesN1['244'])) $postes['N46']=$postesN1['244'];
if (!isset($postes['N47']) && isset($postesN1['250'])) $postes['N47']=$postesN1['250'];
if (!isset($postes['N48']) && isset($postesN1['252'])) $postes['N48']=$postesN1['252'];
if (!isset($postes['N49']) && isset($postesN1['254'])) $postes['N49']=$postesN1['254'];
if (!isset($postes['N50']) && isset($postesN1['256'])) $postes['N50']=$postesN1['256'];
if (!isset($postes['N51']) && isset($postesN1['262'])) $postes['N51']=$postesN1['262'];
if (!isset($postes['N52']) && isset($postesN1['264'])) $postes['N52']=$postesN1['264'];
if (!isset($postes['N53']) && isset($postesN1['270'])) $postes['N53']=$postesN1['270'];
if (!isset($postes['N54']) && isset($postesN1['280'])) $postes['N54']=$postesN1['280'];
if (!isset($postes['N55']) && isset($postesN1['290'])) $postes['N55']=$postesN1['290'];
if (!isset($postes['N56']) && isset($postesN1['294'])) $postes['N56']=$postesN1['294'];
if (!isset($postes['N57']) && isset($postesN1['300'])) $postes['N57']=$postesN1['300'];
if (!isset($postes['N58']) && isset($postesN1['306'])) $postes['N58']=$postesN1['306'];
if (!isset($postes['N59']) && isset($postesN1['310'])) $postes['N59']=$postesN1['310'];
} elseif ($type=='A' || $type=='B') {
// BANQUES
if (!isset($postes['NA1']) && isset($postesN1['AA1'])) $postes['NA1']=$postesN1['AA1'];
if (!isset($postes['NA2']) && isset($postesN1['AA2'])) $postes['NA2']=$postesN1['AA2'];
if (!isset($postes['NA3']) && isset($postesN1['AA3'])) $postes['NA3']=$postesN1['AA3'];
if (!isset($postes['NP1']) && isset($postesN1['AP1'])) $postes['NP1']=$postesN1['AP1'];
if (!isset($postes['NP2']) && isset($postesN1['AP2'])) $postes['NP2']=$postesN1['AP2'];
if (!isset($postes['NP3']) && isset($postesN1['AP3'])) $postes['NP3']=$postesN1['AP3'];
if (!isset($postes['NP4']) && isset($postesN1['AP4'])) $postes['NP4']=$postesN1['AP4'];
if (!isset($postes['NP5']) && isset($postesN1['AP5'])) $postes['NP5']=$postesN1['AP5'];
if (!isset($postes['NP6']) && isset($postesN1['AP6'])) $postes['NP6']=$postesN1['AP6'];
if (!isset($postes['NP7']) && isset($postesN1['AP7'])) $postes['NP7']=$postesN1['AP7'];
if (!isset($postes['NP8']) && isset($postesN1['AP8'])) $postes['NP8']=$postesN1['AP8'];
if (!isset($postes['NP9']) && isset($postesN1['AP9'])) $postes['NP9']=$postesN1['AP9'];
if (!isset($postes['NR1']) && isset($postesN1['AR1'])) $postes['NR1']=$postesN1['AR1'];
if (!isset($postes['NR2']) && isset($postesN1['AR2'])) $postes['NR2']=$postesN1['AR2'];
if (!isset($postes['NR3']) && isset($postesN1['AR3'])) $postes['NR3']=$postesN1['AR3'];
// ASSURANCE
if (!isset($postes['NR4']) && isset($postesN1['AR4'])) $postes['AR4']=$postesN1['AR4'];
}
}
} else {
$infos = 'NEW';
}
@ -1154,8 +1435,8 @@ class SaisieController extends Zend_Controller_Action
$dureeMoisPre = '0';
$unite = 'U';
} else {
$dateCloture = $infos->dateCloture;
$dureeMois = $infos->dureeMois;
$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;
@ -1176,9 +1457,7 @@ class SaisieController extends Zend_Controller_Action
$this->view->assign('ancres', $ancres[$type]);
$this->view->inlineScript()->appendFile('/libs/editable/jquery.jeditable.js');
$this->view->assign('infos', $infos);
}
}
}
/**