issue #0001894 : Conversion bilan simplifié vers réel normal (partie N-1)

This commit is contained in:
Michael RICOIS 2014-03-14 08:39:08 +00:00
parent 4973170121
commit 6a34eaa87c

View File

@ -77,115 +77,240 @@ class Scores_Finance_Liasse
function bilanSimplifie2Normal($bilanRS)
{
$tabBS2BN = array(
'AH'=>'010',
'AI'=>'012',
'AI1'=>'013',
'AJ'=>'014',
'AK'=>'016',
'AK1'=>'017',
'AT'=>'028',
'AU'=>'030',
'AU1'=>'031',
'BH'=>'040',
'BI'=>'042',
'BI1'=>'043',
'BJ'=>'044',
'BK'=>'048',
'BK1'=>'049',
'BL'=>'050',
'BM'=>'052',
'BM1'=>'053',
'BT'=>'060',
'BU'=>'062',
'BU1'=>'063',
'BV'=>'064',
'BW'=>'066',
'BW1'=>'067',
'BX'=>'068',
'BY'=>'070',
'BY1'=>'071',
'BZ'=>'072',
'CA'=>'074',
'CA1'=>'075',
'CD'=>'080',
'CE'=>'082',
'CE1'=>'083',
'CF'=>'084',
'CG'=>'086',
'CG1'=>'087',
'CH'=>'092',
'CI'=>'094',
'CI1'=>'095',
'CJ'=>'096',
'CK'=>'098',
'CK1'=>'099',
'CO'=>'110',
'1A'=>'112',
'1A1'=>'113',
'DA'=>'120',
'DC'=>'124',
'DD'=>'126',
'DF'=>'130',
'DG'=>'132',
'DH'=>'134',
'DI'=>'136',
'DK'=>'140',
'DL'=>'142',
'DR'=>'154',
'DP'=>'154',
'DU'=>'156',
'DV'=>'169',
'DW'=>'164',
'DX'=>'166',
'EA'=>'172-169',
'EB'=>'174',
'EC'=>'176',
'EE'=>'180',
'EH'=>'156-195',
'FA'=>'210-209',
'FB'=>'209',
'FC'=>'210',
'FD'=>'214-215',
'FE'=>'215',
'FF'=>'214',
'FH'=>'217',
'FI'=>'218',
'FK'=>'209+215+217',
'FL'=>'210+214+218',
'FM'=>'222',
'FN'=>'224',
'FO'=>'226',
'FQ'=>'230',
'FR'=>'232',
'FS'=>'234',
'FT'=>'236',
'FU'=>'238',
'FV'=>'240',
'FW'=>'242',
'FX'=>'244',
'FY'=>'250',
'FZ'=>'252',
'GA'=>'254',
'GE'=>'262',
'GF'=>'264',
'GG'=>'270',
'GP'=>'280',
'GU'=>'294',
'GW'=>'270+280+294',
'HD'=>'290',
'HH'=>'300',
'HI'=>'290-300',
'HK'=>'306',
'HL'=>'232+280+290',
'HM'=>'264+294+300+306',
'HN'=>'310',
'YY'=>'374',
'YZ'=>'378',
'YP'=>'376',
//2033 ACTIF PASSIF
'AH' => '010',
'AI' => '012',
'AI1' => '013',
'AI2' => 'N00',
//@todo : Traiter N-1
'AJ' => '014',
'AK' => '016',
'AK1' => '017',
'AK2' => 'N01',
'AT' => '028',
'AU' => '030',
'AU1' => '031',
'AU2' => 'N02',
'BH' => '040',
'BI' => '042',
'BI1' => '043',
'BI2' => 'N03',
'BJ' => '044',
'BK' => '048',
'BK1' => '049',
'BK2' => 'N04',
'BL' => '050',
'BM' => '052',
'BM1' => '053',
'BM2' => 'N05',
'BT' => '060',
'BU' => '062',
'BU1' => '063',
'BU2' => 'N06',
'BV' => '064',
'BW' => '066',
'BW1' => '067',
'BW2' => 'N07',
'BX' => '068',
'BY' => '070',
'BY1' => '071',
'BY2' => 'N08',
'BZ' => '072',
'CA' => '074',
'CA1' => '075',
'CA2' => 'N09',
'CD' => '080',
'CE' => '082',
'CE1' => '083',
'CE2' => 'N10',
'CF' => '084',
'CG' => '086',
'CG1' => '087',
'CG2' => 'N11',
'CH' => '092',
'CI' => '094',
'CI1' => '095',
'CI2' => 'N13',
'CJ' => '096',
'CK' => '098',
'CK1' => '099',
'CK2' => 'N14',
'CO' => '110',
'1A' => '112',
'1A1' => '113',
'1A2' => 'N15',
'DA' => '120',
'DA1' => 'N16',
'DC' => '124',
'DC1' => 'N17',
'DD' => '126',
'DD1' => 'N18',
'DF' => '130',
'DF1' => 'N19',
'DG' => '132',
'DG1' => 'N20',
'DH' => '134',
'DH1' => 'N21',
'DI' => '136',
'DI1' => 'N22',
'DK' => '140',
'DK1' => 'N23',
'DL' => '142',
'DL1' => 'N24',
'DR' => '154',
'DR1' => 'N25',
'DU' => '156',
'DU1' => 'N26',
'DW' => '164',
'DW1' => 'N27',
'DX' => '166',
'DX1' => 'N28',
'EA' => '172',
'EA1' => 'N29',
'EB' => '174',
'EB1' => 'N30',
'EC' => '176',
'EC1' => 'N31',
'EE' => '180',
'EE1' => 'N32',
'EH' => '156-195',
//2033 CDR
'FA' => '210-209',
'FB' => '209',
'FC' => '210',
'FC1' => 'N33',
'FD' => '214-215',
'FE' => '215',
'FF' => '214',
'FF1' => 'N34',
'FH' => '217',
'FI' => '218',
'FI1' => 'N35',
'FK' => '209+215+217',
'FL' => '210+214+218',
'FL1' => 'N33+N34+N35',
'FM' => '222',
'FM1' => 'N36',
'FN' => '224',
'FN' => 'N37',
'FO' => '226',
'FO' => 'N38',
'FQ' => '230',
'FQ' => 'N39',
'FR' => '232',
'FR1' => 'N40',
'FS' => '234',
'FS1' => 'N41',
'FT' => '236',
'FT1' => 'N42',
'FU' => '238',
'FU1' => 'N43',
'FV' => '240',
'FV1' => 'N44',
'FW' => '242',
'FW1' => 'N45',
'FX' => '244',
'FX1' => 'N46',
'FY' => '250',
'FY1' => 'N47',
'FZ' => '252',
'FZ1' => 'N48',
'GA' => '254',
'GA1' => 'N49',
'GE' => '262',
'GE1' => 'N50',
'GF' => '264',
'GF1' => 'N52',
'GG' => '270',
'GG1' => 'N53',
'GP' => '280',
'GP1' => 'N54',
'GU' => '294',
'GU1' => 'N56',
'GW' => '270+280+294',
'GW1' => 'N53+N54+N56',
'HD' => '290',
'HD1' => 'N55',
'HH' => '300',
'HH1' => 'N57',
'HI' => '290-300',
'HI1' => 'N55-N57',
'HK' => '306',
'HK1' => 'N58',
'HL' => '232+280+290',
'HL1' => 'N40+N54+N55',
'HM' => '264+294+300+306',
'HM1' => 'N52+N56+N57+N58',
'HN' => '310',
'HN1' => 'N59',
'YY' => '374',
'YZ' => '378',
'YP' => '376',
);
$bilanRN=array();
@ -211,7 +336,7 @@ class Scores_Finance_Liasse
}
else $bilanRN[$posteRN]=$bilanRS[$formule];
}
if ($bilanRS['240']<>0) {
if ( $bilanRS['240']<>0 ) {
$bilanRN['BL']=$bilanRS['050'];
$bilanRN['BM']=$bilanRS['052'];
} else {
@ -219,22 +344,25 @@ class Scores_Finance_Liasse
$bilanRN['BO']=$bilanRS['052'];
}
if ($bilanRS['070']<>0 || $bilanRS['074']<>0 || $bilanRS['052']<>0 || $bilanRS['062']<>0)
$bilanRN['GC']=$bilanRS['256'];
elseif ($bilanRS['070']==0 && $bilanRS['074']==0 && $bilanRS['052']==0 && $bilanRS['062']==0 && $bilanRS['254']<>0)
$bilanRN['GD']=$bilanRS['256'];
if ( $bilanRS['070']<>0 || $bilanRS['074']<>0 || $bilanRS['052']<>0 || $bilanRS['062']<>0 ) {
$bilanRN['GC']=$bilanRS['256'];
} elseif ($bilanRS['070']==0 && $bilanRS['074']==0 && $bilanRS['052']==0 && $bilanRS['062']==0 && $bilanRS['254']<>0 ) {
$bilanRN['GD']=$bilanRS['256'];
}
if ($bilanRS['584']<>0) {
if ( $bilanRS['584']<>0 ) {
$bilanRN['HB']=$bilanRS['584'];
$bilanRN['HA']=$bilanRS['290']-$bilanRS['584'];
} else
$bilanRN['HA']=$bilanRS['290'];
} else {
$bilanRN['HA']=$bilanRS['290'];
}
if ($bilanRS['582']<>0) {
if ( $bilanRS['582']<>0 ) {
$bilanRN['HF']=$bilanRS['582'];
$bilanRN['HE']=$bilanRS['582']-$bilanRS['300'];
} else
$bilanRN['HE']=$bilanRS['300'];
} else {
$bilanRN['HE']=$bilanRS['300'];
}
return $bilanRN;
}