1298 lines
23 KiB
PHP
1298 lines
23 KiB
PHP
<?php
|
|
class Metier_Scores_MSolvabilite
|
|
{
|
|
protected $iDb;
|
|
private $naf;
|
|
private $trEff;
|
|
private $dep;
|
|
private $fj;
|
|
private $capital;
|
|
private $anneeCrea;
|
|
private $singularite;
|
|
|
|
private $tabPtNaf = array(
|
|
'000Z'=>5,
|
|
'0099'=>5,
|
|
'011A'=>6,
|
|
'011C'=>6,
|
|
'011D'=>6,
|
|
'011F'=>6,
|
|
'011G'=>6,
|
|
'012A'=>6,
|
|
'012C'=>6,
|
|
'012E'=>6,
|
|
'012G'=>6,
|
|
'012J'=>6,
|
|
'013Z'=>6,
|
|
'014A'=>6,
|
|
'014B'=>5,
|
|
'014D'=>5,
|
|
'015Z'=>6,
|
|
'0199'=>6,
|
|
'020A'=>6,
|
|
'020B'=>5,
|
|
'020D'=>6,
|
|
'0299'=>6,
|
|
'050A'=>6,
|
|
'050C'=>6,
|
|
'0599'=>6,
|
|
'101Z'=>6,
|
|
'103Z'=>1,
|
|
'1099'=>3,
|
|
'111Z'=>6,
|
|
'112Z'=>6,
|
|
'1199'=>6,
|
|
'120Z'=>6,
|
|
'1299'=>6,
|
|
'131Z'=>6,
|
|
'132Z'=>4,
|
|
'1399'=>4,
|
|
'141A'=>5,
|
|
'141C'=>6,
|
|
'141E'=>6,
|
|
'142A'=>6,
|
|
'142C'=>6,
|
|
'143Z'=>5,
|
|
'144Z'=>6,
|
|
'145Z'=>5,
|
|
'1499'=>6,
|
|
'151A'=>2,
|
|
'151C'=>4,
|
|
'151E'=>4,
|
|
'151F'=>5,
|
|
'152Z'=>3,
|
|
'153A'=>5,
|
|
'153C'=>6,
|
|
'153E'=>3,
|
|
'153F'=>4,
|
|
'154A'=>6,
|
|
'154C'=>6,
|
|
'154E'=>6,
|
|
'155A'=>6,
|
|
'155B'=>6,
|
|
'155C'=>6,
|
|
'155D'=>6,
|
|
'155F'=>6,
|
|
'156A'=>6,
|
|
'156B'=>6,
|
|
'156D'=>6,
|
|
'157A'=>5,
|
|
'157C'=>6,
|
|
'158A'=>3,
|
|
'158B'=>4,
|
|
'158C'=>4,
|
|
'158D'=>5,
|
|
'158F'=>5,
|
|
'158H'=>6,
|
|
'158K'=>5,
|
|
'158M'=>6,
|
|
'158P'=>5,
|
|
'158R'=>5,
|
|
'158T'=>2,
|
|
'158V'=>4,
|
|
'1599'=>4,
|
|
'159A'=>6,
|
|
'159B'=>6,
|
|
'159D'=>6,
|
|
'159F'=>6,
|
|
'159G'=>6,
|
|
'159J'=>5,
|
|
'159L'=>6,
|
|
'159N'=>0,
|
|
'159Q'=>6,
|
|
'159S'=>6,
|
|
'159T'=>5,
|
|
'160Z'=>6,
|
|
'1699'=>6,
|
|
'171A'=>6,
|
|
'171C'=>2,
|
|
'171E'=>6,
|
|
'171F'=>0,
|
|
'171H'=>6,
|
|
'171K'=>5,
|
|
'171M'=>1,
|
|
'171P'=>0,
|
|
'172A'=>4,
|
|
'172C'=>0,
|
|
'172E'=>1,
|
|
'172G'=>0,
|
|
'172J'=>0,
|
|
'173Z'=>0,
|
|
'174A'=>3,
|
|
'174B'=>4,
|
|
'174C'=>4,
|
|
'175A'=>6,
|
|
'175C'=>6,
|
|
'175E'=>6,
|
|
'175G'=>3,
|
|
'176Z'=>0,
|
|
'177A'=>4,
|
|
'177C'=>0,
|
|
'1799'=>2,
|
|
'181Z'=>1,
|
|
'182A'=>3,
|
|
'182C'=>5,
|
|
'182D'=>4,
|
|
'182E'=>0,
|
|
'182G'=>1,
|
|
'182J'=>1,
|
|
'183Z'=>5,
|
|
'1899'=>2,
|
|
'191Z'=>3,
|
|
'192Z'=>4,
|
|
'193Z'=>2,
|
|
'1999'=>3,
|
|
'201A'=>4,
|
|
'201B'=>0,
|
|
'202Z'=>4,
|
|
'203Z'=>3,
|
|
'204Z'=>3,
|
|
'205A'=>5,
|
|
'205C'=>6,
|
|
'2099'=>4,
|
|
'211A'=>6,
|
|
'211C'=>3,
|
|
'212A'=>5,
|
|
'212B'=>3,
|
|
'212C'=>3,
|
|
'212E'=>1,
|
|
'212G'=>4,
|
|
'212J'=>0,
|
|
'212L'=>4,
|
|
'2199'=>3,
|
|
'221A'=>4,
|
|
'221C'=>2,
|
|
'221E'=>4,
|
|
'221G'=>4,
|
|
'221J'=>5,
|
|
'222A'=>1,
|
|
'222C'=>2,
|
|
'222E'=>3,
|
|
'222G'=>3,
|
|
'222J'=>5,
|
|
'223A'=>2,
|
|
'223C'=>6,
|
|
'223E'=>4,
|
|
'2299'=>4,
|
|
'231Z'=>6,
|
|
'232Z'=>6,
|
|
'233Z'=>6,
|
|
'2399'=>6,
|
|
'241A'=>6,
|
|
'241C'=>4,
|
|
'241E'=>5,
|
|
'241G'=>6,
|
|
'241J'=>4,
|
|
'241L'=>4,
|
|
'241N'=>0,
|
|
'242Z'=>6,
|
|
'243Z'=>3,
|
|
'244A'=>5,
|
|
'244C'=>5,
|
|
'244D'=>6,
|
|
'245A'=>4,
|
|
'245C'=>3,
|
|
'246A'=>6,
|
|
'246C'=>6,
|
|
'246E'=>6,
|
|
'246G'=>6,
|
|
'246J'=>0,
|
|
'246L'=>4,
|
|
'247Z'=>6,
|
|
'2499'=>4,
|
|
'251A'=>6,
|
|
'251C'=>3,
|
|
'251E'=>5,
|
|
'252A'=>3,
|
|
'252C'=>4,
|
|
'252E'=>4,
|
|
'252G'=>4,
|
|
'252H'=>3,
|
|
'2599'=>4,
|
|
'261A'=>6,
|
|
'261C'=>2,
|
|
'261E'=>3,
|
|
'261G'=>6,
|
|
'261J'=>5,
|
|
'261K'=>6,
|
|
'262A'=>5,
|
|
'262C'=>6,
|
|
'262E'=>6,
|
|
'262G'=>6,
|
|
'262J'=>6,
|
|
'262L'=>6,
|
|
'263Z'=>5,
|
|
'264A'=>4,
|
|
'264B'=>6,
|
|
'264C'=>6,
|
|
'265A'=>6,
|
|
'265C'=>3,
|
|
'265E'=>0,
|
|
'266A'=>4,
|
|
'266C'=>3,
|
|
'266E'=>6,
|
|
'266G'=>6,
|
|
'266J'=>6,
|
|
'266L'=>3,
|
|
'267Z'=>4,
|
|
'268A'=>0,
|
|
'268C'=>5,
|
|
'2699'=>4,
|
|
'271Y'=>4,
|
|
'271Z'=>6,
|
|
'272A'=>6,
|
|
'272C'=>4,
|
|
'273A'=>6,
|
|
'273C'=>6,
|
|
'273E'=>6,
|
|
'273G'=>2,
|
|
'274A'=>3,
|
|
'274C'=>6,
|
|
'274D'=>6,
|
|
'274F'=>6,
|
|
'274G'=>6,
|
|
'274J'=>6,
|
|
'274K'=>6,
|
|
'274M'=>2,
|
|
'275A'=>4,
|
|
'275C'=>0,
|
|
'275E'=>3,
|
|
'275G'=>4,
|
|
'2799'=>4,
|
|
'281A'=>2,
|
|
'281C'=>3,
|
|
'282A'=>6,
|
|
'282C'=>3,
|
|
'282D'=>6,
|
|
'283A'=>1,
|
|
'283B'=>6,
|
|
'283C'=>1,
|
|
'284A'=>5,
|
|
'284B'=>4,
|
|
'284C'=>6,
|
|
'285A'=>2,
|
|
'285C'=>5,
|
|
'285D'=>3,
|
|
'286A'=>5,
|
|
'286C'=>4,
|
|
'286D'=>3,
|
|
'286F'=>4,
|
|
'287A'=>6,
|
|
'287C'=>5,
|
|
'287E'=>3,
|
|
'287G'=>5,
|
|
'287H'=>6,
|
|
'287J'=>6,
|
|
'287L'=>4,
|
|
'287N'=>3,
|
|
'287P'=>6,
|
|
'287Q'=>4,
|
|
'2899'=>3,
|
|
'291A'=>5,
|
|
'291B'=>3,
|
|
'291C'=>0,
|
|
'291D'=>4,
|
|
'291E'=>5,
|
|
'291F'=>3,
|
|
'291H'=>6,
|
|
'291J'=>6,
|
|
'292A'=>3,
|
|
'292C'=>4,
|
|
'292D'=>2,
|
|
'292F'=>4,
|
|
'292H'=>4,
|
|
'292J'=>3,
|
|
'292K'=>3,
|
|
'292L'=>5,
|
|
'292M'=>3,
|
|
'293A'=>1,
|
|
'293C'=>5,
|
|
'293D'=>4,
|
|
'294A'=>2,
|
|
'294B'=>4,
|
|
'294C'=>4,
|
|
'294D'=>4,
|
|
'294E'=>4,
|
|
'295A'=>5,
|
|
'295B'=>2,
|
|
'295C'=>6,
|
|
'295D'=>3,
|
|
'295E'=>3,
|
|
'295G'=>4,
|
|
'295J'=>3,
|
|
'295L'=>5,
|
|
'295M'=>6,
|
|
'295N'=>1,
|
|
'295P'=>6,
|
|
'295Q'=>0,
|
|
'295R'=>2,
|
|
'296A'=>6,
|
|
'296B'=>6,
|
|
'297A'=>3,
|
|
'297C'=>6,
|
|
'2999'=>4,
|
|
'300A'=>3,
|
|
'300C'=>2,
|
|
'3099'=>2,
|
|
'311A'=>0,
|
|
'311B'=>6,
|
|
'311C'=>4,
|
|
'312A'=>4,
|
|
'312B'=>5,
|
|
'313Z'=>4,
|
|
'314Z'=>6,
|
|
'315A'=>6,
|
|
'315B'=>0,
|
|
'315C'=>0,
|
|
'316A'=>5,
|
|
'316C'=>3,
|
|
'316D'=>4,
|
|
'3199'=>3,
|
|
'321A'=>4,
|
|
'321B'=>6,
|
|
'321C'=>2,
|
|
'321D'=>3,
|
|
'322A'=>4,
|
|
'322B'=>4,
|
|
'323Z'=>2,
|
|
'3299'=>3,
|
|
'331A'=>4,
|
|
'331B'=>6,
|
|
'332A'=>3,
|
|
'332B'=>4,
|
|
'333Z'=>3,
|
|
'334A'=>4,
|
|
'334B'=>5,
|
|
'335Z'=>4,
|
|
'3399'=>5,
|
|
'341Z'=>4,
|
|
'342A'=>3,
|
|
'342B'=>6,
|
|
'343Z'=>4,
|
|
'3499'=>3,
|
|
'351A'=>6,
|
|
'351B'=>4,
|
|
'351C'=>2,
|
|
'351E'=>3,
|
|
'352Z'=>3,
|
|
'353A'=>5,
|
|
'353B'=>2,
|
|
'353C'=>6,
|
|
'354A'=>3,
|
|
'354C'=>2,
|
|
'354E'=>1,
|
|
'355Z'=>3,
|
|
'3599'=>3,
|
|
'361A'=>4,
|
|
'361C'=>0,
|
|
'361E'=>5,
|
|
'361G'=>5,
|
|
'361H'=>0,
|
|
'361J'=>5,
|
|
'361K'=>5,
|
|
'361M'=>5,
|
|
'362A'=>6,
|
|
'362C'=>4,
|
|
'363Z'=>6,
|
|
'364Z'=>4,
|
|
'365Z'=>4,
|
|
'366A'=>5,
|
|
'366C'=>4,
|
|
'366E'=>5,
|
|
'3699'=>5,
|
|
'371Z'=>5,
|
|
'372Z'=>4,
|
|
'3799'=>5,
|
|
'401A'=>6,
|
|
'401C'=>6,
|
|
'401E'=>6,
|
|
'401Z'=>6,
|
|
'402A'=>6,
|
|
'402C'=>6,
|
|
'403Z'=>6,
|
|
'4099'=>6,
|
|
'410Z'=>6,
|
|
'4199'=>6,
|
|
'451A'=>4,
|
|
'451B'=>4,
|
|
'451D'=>4,
|
|
'452A'=>0,
|
|
'452B'=>1,
|
|
'452C'=>5,
|
|
'452D'=>6,
|
|
'452E'=>4,
|
|
'452F'=>3,
|
|
'452J'=>3,
|
|
'452K'=>0,
|
|
'452L'=>4,
|
|
'452N'=>6,
|
|
'452P'=>5,
|
|
'452R'=>5,
|
|
'452T'=>1,
|
|
'452U'=>3,
|
|
'452V'=>1,
|
|
'453A'=>4,
|
|
'453C'=>2,
|
|
'453E'=>4,
|
|
'453F'=>4,
|
|
'453H'=>2,
|
|
'454A'=>2,
|
|
'454C'=>4,
|
|
'454D'=>3,
|
|
'454F'=>3,
|
|
'454H'=>4,
|
|
'454J'=>3,
|
|
'454L'=>1,
|
|
'454M'=>3,
|
|
'455Z'=>5,
|
|
'4599'=>3,
|
|
'501Z'=>3,
|
|
'502Z'=>4,
|
|
'503A'=>3,
|
|
'503B'=>3,
|
|
'504Z'=>3,
|
|
'505Z'=>5,
|
|
'5099'=>4,
|
|
'511A'=>6,
|
|
'511C'=>5,
|
|
'511E'=>4,
|
|
'511G'=>5,
|
|
'511J'=>3,
|
|
'511L'=>5,
|
|
'511N'=>5,
|
|
'511P'=>5,
|
|
'511R'=>6,
|
|
'511T'=>5,
|
|
'511U'=>4,
|
|
'512A'=>6,
|
|
'512C'=>2,
|
|
'512E'=>6,
|
|
'512G'=>2,
|
|
'512J'=>6,
|
|
'513A'=>4,
|
|
'513C'=>2,
|
|
'513D'=>5,
|
|
'513E'=>4,
|
|
'513G'=>6,
|
|
'513J'=>4,
|
|
'513L'=>0,
|
|
'513N'=>2,
|
|
'513Q'=>6,
|
|
'513S'=>3,
|
|
'513T'=>3,
|
|
'513V'=>4,
|
|
'513W'=>3,
|
|
'514A'=>2,
|
|
'514C'=>1,
|
|
'514D'=>1,
|
|
'514F'=>1,
|
|
'514H'=>4,
|
|
'514J'=>3,
|
|
'514L'=>2,
|
|
'514N'=>5,
|
|
'514Q'=>3,
|
|
'514R'=>2,
|
|
'514S'=>3,
|
|
'515A'=>5,
|
|
'515C'=>4,
|
|
'515E'=>3,
|
|
'515F'=>3,
|
|
'515H'=>4,
|
|
'515J'=>3,
|
|
'515L'=>5,
|
|
'515N'=>4,
|
|
'515Q'=>4,
|
|
'516A'=>6,
|
|
'516C'=>6,
|
|
'516E'=>6,
|
|
'516G'=>4,
|
|
'516J'=>5,
|
|
'516K'=>6,
|
|
'516L'=>5,
|
|
'516N'=>6,
|
|
'517Z'=>5,
|
|
'518A'=>3,
|
|
'518C'=>3,
|
|
'518E'=>0,
|
|
'518G'=>2,
|
|
'518H'=>2,
|
|
'518J'=>2,
|
|
'518L'=>3,
|
|
'518M'=>3,
|
|
'518N'=>3,
|
|
'518P'=>5,
|
|
'5199'=>4,
|
|
'519A'=>1,
|
|
'519B'=>3,
|
|
'521A'=>3,
|
|
'521B'=>5,
|
|
'521C'=>4,
|
|
'521D'=>6,
|
|
'521E'=>6,
|
|
'521F'=>6,
|
|
'521H'=>6,
|
|
'521J'=>5,
|
|
'522A'=>4,
|
|
'522C'=>5,
|
|
'522E'=>4,
|
|
'522G'=>4,
|
|
'522J'=>4,
|
|
'522L'=>6,
|
|
'522N'=>5,
|
|
'522P'=>4,
|
|
'523A'=>6,
|
|
'523C'=>5,
|
|
'523E'=>4,
|
|
'524A'=>5,
|
|
'524C'=>4,
|
|
'524E'=>4,
|
|
'524F'=>5,
|
|
'524H'=>3,
|
|
'524J'=>4,
|
|
'524L'=>3,
|
|
'524N'=>3,
|
|
'524P'=>3,
|
|
'524R'=>5,
|
|
'524T'=>5,
|
|
'524U'=>5,
|
|
'524V'=>5,
|
|
'524W'=>4,
|
|
'524X'=>4,
|
|
'524Y'=>5,
|
|
'524Z'=>3,
|
|
'525Z'=>5,
|
|
'526A'=>4,
|
|
'526B'=>3,
|
|
'526D'=>5,
|
|
'526E'=>5,
|
|
'526G'=>5,
|
|
'526H'=>4,
|
|
'527A'=>6,
|
|
'527C'=>5,
|
|
'527D'=>4,
|
|
'527F'=>6,
|
|
'527H'=>5,
|
|
'5299'=>5,
|
|
'551A'=>4,
|
|
'551C'=>6,
|
|
'551D'=>6,
|
|
'551E'=>6,
|
|
'552A'=>6,
|
|
'552C'=>6,
|
|
'552E'=>6,
|
|
'552F'=>6,
|
|
'553A'=>3,
|
|
'553B'=>3,
|
|
'554A'=>5,
|
|
'554B'=>3,
|
|
'554C'=>0,
|
|
'555A'=>6,
|
|
'555C'=>3,
|
|
'555D'=>3,
|
|
'5599'=>4,
|
|
'601Z'=>6,
|
|
'602A'=>5,
|
|
'602B'=>6,
|
|
'602C'=>6,
|
|
'602E'=>6,
|
|
'602G'=>4,
|
|
'602L'=>2,
|
|
'602M'=>2,
|
|
'602N'=>0,
|
|
'602P'=>3,
|
|
'603Z'=>6,
|
|
'6099'=>4,
|
|
'611A'=>6,
|
|
'611B'=>6,
|
|
'612Z'=>6,
|
|
'6199'=>6,
|
|
'621Z'=>1,
|
|
'622Z'=>4,
|
|
'623Z'=>6,
|
|
'6299'=>3,
|
|
'631A'=>6,
|
|
'631B'=>3,
|
|
'631D'=>6,
|
|
'631E'=>5,
|
|
'632A'=>6,
|
|
'632C'=>6,
|
|
'632E'=>4,
|
|
'633Z'=>5,
|
|
'634A'=>1,
|
|
'634B'=>4,
|
|
'634C'=>3,
|
|
'6399'=>4,
|
|
'641A'=>6,
|
|
'641C'=>1,
|
|
'642B'=>6,
|
|
'642C'=>2,
|
|
'642D'=>3,
|
|
'6499'=>2,
|
|
'651A'=>6,
|
|
'651C'=>6,
|
|
'651D'=>6,
|
|
'651E'=>6,
|
|
'651F'=>6,
|
|
'652A'=>6,
|
|
'652C'=>6,
|
|
'652E'=>6,
|
|
'652F'=>5,
|
|
'6599'=>6,
|
|
'660A'=>6,
|
|
'660C'=>6,
|
|
'660E'=>6,
|
|
'660F'=>6,
|
|
'660G'=>5,
|
|
'6699'=>5,
|
|
'671A'=>3,
|
|
'671C'=>5,
|
|
'671E'=>6,
|
|
'672Z'=>6,
|
|
'6799'=>6,
|
|
'701A'=>6,
|
|
'701B'=>6,
|
|
'701C'=>6,
|
|
'701D'=>6,
|
|
'701F'=>5,
|
|
'702A'=>6,
|
|
'702B'=>6,
|
|
'702C'=>6,
|
|
'703A'=>5,
|
|
'703C'=>6,
|
|
'703D'=>6,
|
|
'703E'=>6,
|
|
'7099'=>6,
|
|
'711A'=>3,
|
|
'711B'=>6,
|
|
'711Z'=>5,
|
|
'712A'=>6,
|
|
'712C'=>6,
|
|
'712E'=>6,
|
|
'713A'=>6,
|
|
'713C'=>3,
|
|
'713E'=>4,
|
|
'713G'=>6,
|
|
'714A'=>6,
|
|
'714B'=>5,
|
|
'7199'=>5,
|
|
'721Z'=>4,
|
|
'722A'=>2,
|
|
'722C'=>3,
|
|
'722Z'=>6,
|
|
'723Z'=>4,
|
|
'724Z'=>4,
|
|
'725Z'=>3,
|
|
'726Z'=>6,
|
|
'7299'=>4,
|
|
'731Z'=>6,
|
|
'732Z'=>6,
|
|
'7399'=>6,
|
|
'741A'=>6,
|
|
'741C'=>6,
|
|
'741E'=>5,
|
|
'741G'=>5,
|
|
'741J'=>15, // 6
|
|
'742A'=>6,
|
|
'742B'=>6,
|
|
'742C'=>4,
|
|
'743A'=>6,
|
|
'743B'=>5,
|
|
'744A'=>3,
|
|
'744B'=>3,
|
|
'745A'=>5,
|
|
'745B'=>3,
|
|
'746Z'=>0,
|
|
'747Z'=>3,
|
|
'748A'=>5,
|
|
'748B'=>2,
|
|
'748D'=>3,
|
|
'748F'=>6,
|
|
'748G'=>4,
|
|
'748H'=>0,
|
|
'748J'=>4,
|
|
'748K'=>6,
|
|
'7499'=>6,
|
|
'751A'=>6,
|
|
'751C'=>6,
|
|
'751E'=>6,
|
|
'751G'=>6,
|
|
'752A'=>6,
|
|
'752C'=>6,
|
|
'752E'=>6,
|
|
'752G'=>6,
|
|
'752J'=>6,
|
|
'753A'=>6,
|
|
'753B'=>6,
|
|
'753C'=>6,
|
|
'7599'=>6,
|
|
'801Z'=>6,
|
|
'802A'=>6,
|
|
'802C'=>6,
|
|
'803Z'=>6,
|
|
'804A'=>5,
|
|
'804C'=>5,
|
|
'804D'=>6,
|
|
'8099'=>6,
|
|
'851A'=>6,
|
|
'851C'=>6,
|
|
'851E'=>6,
|
|
'851G'=>6,
|
|
'851H'=>6,
|
|
'851J'=>5,
|
|
'851K'=>6,
|
|
'851L'=>6,
|
|
'852Z'=>6,
|
|
'853A'=>6,
|
|
'853B'=>6,
|
|
'853C'=>6,
|
|
'853D'=>6,
|
|
'853E'=>6,
|
|
'853G'=>6,
|
|
'853H'=>6,
|
|
'853J'=>6,
|
|
'853K'=>6,
|
|
'8599'=>6,
|
|
'900A'=>5,
|
|
'900B'=>6,
|
|
'900C'=>6,
|
|
'900E'=>4,
|
|
'900G'=>3,
|
|
'9099'=>5,
|
|
'911A'=>6,
|
|
'911C'=>6,
|
|
'912Z'=>6,
|
|
'913A'=>6,
|
|
'913C'=>6,
|
|
'913E'=>6,
|
|
'9199'=>6,
|
|
'921A'=>4,
|
|
'921B'=>4,
|
|
'921C'=>4,
|
|
'921D'=>4,
|
|
'921F'=>4,
|
|
'921G'=>5,
|
|
'921J'=>6,
|
|
'922A'=>6,
|
|
'922B'=>4,
|
|
'922C'=>6,
|
|
'922D'=>6,
|
|
'922E'=>3,
|
|
'922F'=>2,
|
|
'923A'=>6,
|
|
'923B'=>5,
|
|
'923D'=>6,
|
|
'923F'=>6,
|
|
'923H'=>6,
|
|
'923J'=>6,
|
|
'923K'=>5,
|
|
'924Z'=>6,
|
|
'925A'=>6,
|
|
'925C'=>6,
|
|
'925E'=>6,
|
|
'926A'=>5,
|
|
'926C'=>6,
|
|
'927A'=>5,
|
|
'927C'=>5,
|
|
'9299'=>6,
|
|
'930A'=>2,
|
|
'930B'=>4,
|
|
'930D'=>5,
|
|
'930E'=>5,
|
|
'930G'=>3,
|
|
'930H'=>5,
|
|
'930K'=>4,
|
|
'930L'=>4,
|
|
'930N'=>6,
|
|
'9399'=>5,
|
|
'950Z'=>6,
|
|
'9599'=>6,
|
|
'990Z'=>6,
|
|
'9999'=>6,
|
|
);
|
|
|
|
/*
|
|
* La tranche d'effectifs permet de regrouper les sociétés en fonction de leur
|
|
* effectif siège. L'INSEE a défini 15 tranches d'effectifs : 0 salarié ;
|
|
* 1 à 2 salariés ; 3 à 5 salariés ; 6 à 9 salariés ; 10 à 19 salariés ;
|
|
* 20 à 49 salariés ; 50 à 99 salariés ; 100 à 199 salariés ;
|
|
* 200 à 249 salariés ; 250 à 499 salariés ; 500 à 999 salariés ;
|
|
* 1 000 à 1 999 salariés ; 2 000 à 4 999 salariés ; plus ; plus de.
|
|
*/
|
|
private $tabPtTeff = array(
|
|
'NN'=>3, // de 5 000 à 9 999 salariés
|
|
'00'=>3, // 0 salariés
|
|
'01'=>1, // de 1 à 2 salarié(s)
|
|
'02'=>1, // de 3 à 5 salariés
|
|
'03'=>1, // de 6 à 9 salariés
|
|
'11'=>0, // de 10 à 19 salariés
|
|
'12'=>1, // de 20 à 49 salariés
|
|
'21'=>2, // de 50 à 99 salariés
|
|
'22'=>2, // de 100 à 199 salariés
|
|
'31'=>3, // de 200 à 249 salariés // 3
|
|
'32'=>5, // de 250 à 499 salariés // 3
|
|
'41'=>7, // de 500 à 999 salariés // 3
|
|
'42'=>10, // de 1 000 à 1 999 salariés // 3
|
|
'51'=>15, // de 2 000 à 4 999 salariés // 4
|
|
'52'=>20, // de 5 000 à 9 999 salariés // 4
|
|
'53'=>25, // + de 10 000 salariés // 4
|
|
);
|
|
|
|
private $tabPtDep=array(
|
|
'01'=>6,
|
|
'02'=>5,
|
|
'03'=>6,
|
|
'04'=>6,
|
|
'05'=>7,
|
|
'06'=>5,
|
|
'07'=>6,
|
|
'08'=>5,
|
|
'09'=>6,
|
|
'10'=>6,
|
|
'11'=>6,
|
|
'12'=>7,
|
|
'13'=>5,
|
|
'14'=>6,
|
|
'15'=>7,
|
|
'16'=>6,
|
|
'17'=>6,
|
|
'18'=>5,
|
|
'19'=>6,
|
|
'20'=>6,
|
|
'21'=>6,
|
|
'22'=>6,
|
|
'23'=>6,
|
|
'24'=>6,
|
|
'25'=>6,
|
|
'26'=>6,
|
|
'27'=>6,
|
|
'28'=>5,
|
|
'29'=>6,
|
|
'2A'=>6,
|
|
'2B'=>6,
|
|
'30'=>5,
|
|
'31'=>5,
|
|
'32'=>7,
|
|
'33'=>5,
|
|
'34'=>6,
|
|
'35'=>6,
|
|
'36'=>6,
|
|
'37'=>6,
|
|
'38'=>6,
|
|
'39'=>6,
|
|
'40'=>6,
|
|
'41'=>6,
|
|
'42'=>5,
|
|
'43'=>6,
|
|
'44'=>6,
|
|
'45'=>6,
|
|
'46'=>6,
|
|
'47'=>6,
|
|
'48'=>7,
|
|
'49'=>6,
|
|
'50'=>6,
|
|
'51'=>6,
|
|
'52'=>6,
|
|
'53'=>6,
|
|
'54'=>5,
|
|
'55'=>6,
|
|
'56'=>6,
|
|
'57'=>4,
|
|
'58'=>6,
|
|
'59'=>5,
|
|
'60'=>5,
|
|
'61'=>6,
|
|
'62'=>5,
|
|
'63'=>6,
|
|
'64'=>6,
|
|
'65'=>7,
|
|
'66'=>5,
|
|
'67'=>5,
|
|
'68'=>5,
|
|
'69'=>5,
|
|
'70'=>6,
|
|
'71'=>6,
|
|
'72'=>5,
|
|
'73'=>6,
|
|
'74'=>6,
|
|
'75'=>5,
|
|
'76'=>6,
|
|
'77'=>4,
|
|
'78'=>5,
|
|
'79'=>6,
|
|
'80'=>6,
|
|
'81'=>6,
|
|
'82'=>6,
|
|
'83'=>5,
|
|
'84'=>5,
|
|
'85'=>6,
|
|
'86'=>6,
|
|
'87'=>5,
|
|
'88'=>5,
|
|
'89'=>6,
|
|
'90'=>5,
|
|
'91'=>5,
|
|
'92'=>5,
|
|
'93'=>4,
|
|
'94'=>4,
|
|
'95'=>5,
|
|
'971'=>6,
|
|
'972'=>6,
|
|
'973'=>6,
|
|
'974'=>6,
|
|
'975'=>6,
|
|
);
|
|
|
|
private $tabPtFJ=array(
|
|
'10'=>11, // PP
|
|
'11'=>9, // Artisan Commerçant
|
|
'12'=>9, // Commerçant
|
|
'13'=>8, // Artisan
|
|
'15'=>12, // Profession libérale
|
|
'16'=>12, // Exploitant agricole
|
|
'17'=>12, // Agent commercial
|
|
'18'=>12, // Associé Gérant de société
|
|
'19'=>12, // Personne Physique Autre
|
|
'21'=>12, // Indivision
|
|
'22'=>12, // Société créée de fait
|
|
'23'=>13, // Société en participation
|
|
'27'=>13, // Paroisse
|
|
'29'=>12, // Autre groupement de droit privé non doté de la personnalité morale
|
|
'31'=>10, // Personne morale de droit étranger immatriculée au RCS
|
|
'32'=>12, // Personne morale de droit étranger, non immatriculée au RCS
|
|
'41'=>25, // Etab public ou régie à caractère industriel // 13
|
|
'51'=>11, // Société coopérative commerciale particulière
|
|
'52'=>11, // Société en nom collectif
|
|
'5306'=>10, // Société en commandite
|
|
'5308'=>11, //
|
|
'54'=>5, // SARL
|
|
'5410'=>4, //
|
|
'5458'=>0, //
|
|
'5460'=>2, //
|
|
'5485'=>12, //
|
|
'5498'=>6, //
|
|
'55'=>8, // SA à conseil d'administration
|
|
'5510'=>9, //
|
|
'5515'=>11, //
|
|
'5532'=>11, //
|
|
'5553'=>6, //
|
|
'5558'=>6, //
|
|
'5560'=>9, //
|
|
'5585'=>11, //
|
|
'56'=>8, // SA à directoire
|
|
'57'=>9, // SA par actions simplifiées
|
|
'61'=>13, // Caisse épargne et prévoyance
|
|
'62'=>12, // Groupement d'intérêt économique
|
|
'63'=>12, // Société coopérative agricole
|
|
'65'=>12, // Société civile
|
|
'69'=>13, // Autre Pers de droit privé inscrit au RCS
|
|
'71'=>25, // Administration de l'état // 13
|
|
'72'=>25, // Collectivité locale // 13
|
|
'73'=>25, // Etab publique administratif // 13
|
|
'74'=>25, // Autre PM de droit public administratif // 13
|
|
'81'=>13, // Organisme gérant un régime de SECU
|
|
'82'=>9, // Organisme mutualiste
|
|
'83'=>13, // CE
|
|
'84'=>12, // Organisme professionnel Syndicat de propriétaires
|
|
'91'=>13, // Syndicat copro / ASL
|
|
'9210'=>12, // Association loi 1901 ou assimilé
|
|
'9220'=>12, //
|
|
'9221'=>6, //
|
|
'9222'=>10, //
|
|
'9223'=>12, //
|
|
'9230'=>12, //
|
|
'9260'=>12, //
|
|
'93'=>13, // Fondations
|
|
'99'=>13, // Autre PM de droit privé
|
|
);
|
|
|
|
/* Points par age : 1=>xx : 1ère année, 2=>yy : 2ème année */
|
|
private $tabPtAge=array(
|
|
1=>9,
|
|
2=>5,
|
|
3=>4,
|
|
4=>7,
|
|
5=>8,
|
|
6=>10,
|
|
7=>11,
|
|
8=>11,
|
|
9=>13,
|
|
10=>12,
|
|
11=>13,
|
|
12=>13,
|
|
13=>13,
|
|
14=>14,
|
|
);
|
|
|
|
/**
|
|
*
|
|
* @param unknown $siren
|
|
* @param string $naf
|
|
* @param string $trancheEff
|
|
* @param string $effectifReel
|
|
* @param string $depSiege_CodePosSiege
|
|
* @param string $fj
|
|
* @param string $capital
|
|
* @param string $capitalDev
|
|
* @param string $dateCreaEn
|
|
* @param string $dateCreaSiege
|
|
* @param string $singularite
|
|
* @param number $recme
|
|
* @return boolean
|
|
*/
|
|
public function __construct($siren, $naf='', $trancheEff='', $effectifReel='', $depSiege_CodePosSiege='', $fj='', $capital='', $capitalDev='', $dateCreaEn='', $dateCreaSiege='', $singularite='', $recme=0, $db = null)
|
|
{
|
|
if ( $db === null ) {
|
|
$this->iDb = new WDB();
|
|
} else {
|
|
$this->iDb = $db;
|
|
}
|
|
|
|
$this->naf=$naf;
|
|
$this->trEff=$trancheEff;
|
|
if($this->trEff=='NN' || $this->trEff=='00' || ($this->trEff*1)==0) {
|
|
$effectif=$effectifReel*1;
|
|
if ($effectif==0) $this->trEff='00';
|
|
elseif ($effectif<=2) $this->trEff='01';
|
|
elseif ($effectif<=5) $this->trEff='02';
|
|
elseif ($effectif<=9) $this->trEff='03';
|
|
elseif ($effectif<=19) $this->trEff='11';
|
|
elseif ($effectif<=49) $this->trEff='12';
|
|
elseif ($effectif<=99) $this->trEff='21';
|
|
elseif ($effectif<=199) $this->trEff='22';
|
|
elseif ($effectif<=249) $this->trEff='31';
|
|
elseif ($effectif<=499) $this->trEff='32';
|
|
elseif ($effectif<=999) $this->trEff='41';
|
|
elseif ($effectif<=1999) $this->trEff='42';
|
|
elseif ($effectif<=4999) $this->trEff='51';
|
|
elseif ($effectif<=9999) $this->trEff='52';
|
|
else $this->trEff='53';
|
|
}
|
|
|
|
$cp=$depSiege_CodePosSiege*1;
|
|
|
|
if ($cp>0 && $cp<96) { $dep=$cp; $cp=false; }
|
|
elseif ($cp>970 && $cp<977) { $dep=$cp; $cp=false; }
|
|
elseif ($cp>999 && $cp<10000) { $dep='0'.substr($cp,0,1); $cp='0'.$cp; }
|
|
elseif ($cp>=10000 && $cp<96000) $dep=substr($cp,0,2);
|
|
elseif ($cp>=99000) $dep=substr($cp,0,3);
|
|
elseif ($cp>=98000) $dep=substr($cp,0,3);
|
|
elseif ($cp>=97100 && $cp<97700) $dep=substr($cp,0,3);
|
|
$this->dep=$dep;
|
|
|
|
$this->fj=$fj;
|
|
$this->capital=$capital;
|
|
|
|
if (substr($dateCreaEn,0,4)*1>0)
|
|
$this->anneeCrea=substr($dateCreaEn,0,4);
|
|
else
|
|
$this->anneeCrea=substr($dateCreaSiege,0,4);
|
|
|
|
$this->singularite=$singularite;
|
|
$this->recme=$recme;
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
*
|
|
* @return Ambigous <number, multitype:number >
|
|
*/
|
|
public function getPtActivite()
|
|
{
|
|
if (strlen($this->naf)==4)
|
|
if (isset($this->tabPtNaf[$this->naf]))
|
|
$nbPoints=$this->tabPtNaf[$this->naf];
|
|
else
|
|
$nbPoints=5;
|
|
elseif (strlen($this->naf)==5) {
|
|
$iCotation = new Metier_Scores_ICotation(array(), true, $this->iDb);
|
|
//print_r($iCotation->tabNaf21);
|
|
//die();
|
|
if (isset($iCotation->tabNaf21[$this->naf])) {
|
|
$naf4=$iCotation->tabNaf21[$this->naf];
|
|
if (isset($this->tabPtNaf[$naf4]))
|
|
$nbPoints=$this->tabPtNaf[$naf4];
|
|
else
|
|
$nbPoints=5;
|
|
}
|
|
else
|
|
$nbPoints=5;
|
|
}
|
|
else
|
|
$nbPoints=5;
|
|
|
|
return $nbPoints;
|
|
}
|
|
|
|
/**
|
|
*
|
|
* @param string $naf5
|
|
* @return multitype:|Ambigous <string, string>
|
|
*/
|
|
public function getNaf4($naf5='')
|
|
{
|
|
if ($naf5=='')
|
|
$naf5=$this->naf;
|
|
|
|
if (strlen($naf5)==5) {
|
|
$iCotation = new Metier_Scores_ICotation(array(), true, $this->iDb);
|
|
return $iCotation->tabNaf21[$naf5];
|
|
}
|
|
return $naf5;
|
|
}
|
|
|
|
function getPtEffectif()
|
|
{
|
|
if (isset($this->tabPtTeff[$this->trEff]))
|
|
return $this->tabPtTeff[$this->trEff];
|
|
else return 3;
|
|
}
|
|
|
|
function getTrEff()
|
|
{
|
|
return $this->trEff;
|
|
}
|
|
|
|
function getPtGeographie()
|
|
{
|
|
return $this->tabPtDep[$this->dep];
|
|
}
|
|
|
|
function getPtFormeJuridique()
|
|
{
|
|
if (isset($this->tabPtFJ[$this->fj]))
|
|
return $this->tabPtFJ[$this->fj];
|
|
else
|
|
return $this->tabPtFJ[substr($this->fj,0,2)];
|
|
}
|
|
|
|
function getPtCapital()
|
|
{
|
|
$cj2=substr(''.$this->fj,0,2)*1;
|
|
$pt=0;
|
|
if ($this->capital==0) {
|
|
if ($cj2=='54') $pt=3;
|
|
elseif ($cj2=='55' || $cj2=='56' || $cj2=='57') $pt=5;
|
|
}
|
|
if ($pt==0) {
|
|
if ($this->capital < 8000) $pt=8;
|
|
elseif ($this->capital < 30000) $pt=3;
|
|
elseif ($this->capital < 762000) $pt=7;
|
|
elseif ($this->capital < 2000000) $pt=10; // nouveau seuil
|
|
elseif ($this->capital < 5000000) $pt=13; // nouveau seuil
|
|
elseif ($this->capital < 10000000) $pt=16; // nouveau seuil
|
|
else $pt=20; // 13
|
|
}
|
|
return $pt;
|
|
}
|
|
|
|
function getPtAge($anneeCalcul=0)
|
|
{
|
|
if ($anneeCalcul==0)
|
|
$anneeCalcul=date('Y');
|
|
$age=round($anneeCalcul-$this->anneeCrea);
|
|
if (isset($this->tabPtAge[$age]))
|
|
$pt=$this->tabPtAge[$age];
|
|
elseif ($age>50)
|
|
$pt=16;
|
|
elseif ($age>23)
|
|
$pt=15;
|
|
elseif ($age>14)
|
|
$pt=14;
|
|
else
|
|
$pt=9; // Normalement ici l'age = 0
|
|
return $pt;
|
|
}
|
|
|
|
|
|
function getPtSingularite()
|
|
{
|
|
switch ($this->singularite*1) {
|
|
case 43: $pt=0; break;
|
|
case 2: $pt=1; break;
|
|
case 1: $pt=2; break;
|
|
default: $pt=3; break;
|
|
}
|
|
return $pt;
|
|
}
|
|
|
|
|
|
function getPtRecme()
|
|
{
|
|
if ($this->recme*1==1)
|
|
return 20;
|
|
return 0;
|
|
}
|
|
|
|
function getSolvabilite($anneeCalcul=0)
|
|
{
|
|
return ( $this->getPtActivite() + $this->getPtAge($anneeCalcul) + $this->getPtCapital() + $this->getPtEffectif() +
|
|
$this->getPtFormeJuridique() + $this->getPtGeographie() + $this->getPtSingularite() + $this->getPtRecme() ) / 4.2;//3.9;
|
|
}
|
|
|
|
/** Indique si une catégorie juridique et un NAF sont soumis à publication
|
|
**
|
|
** @param integer $cj Catégorie juridique sur 4 chiffres
|
|
** @param string $naf APE sur 4 ou 5 positions (NAF rév 1 ou 2)
|
|
** @return bool
|
|
**/
|
|
function doitPublier($cj, $naf)
|
|
{
|
|
$cj2=substr($cj, 0,2)*1;
|
|
$cj4=$cj*1;
|
|
$publie=false;
|
|
switch ($cj2) {
|
|
case 53: // Société en Commandite Simple (sauf 5306, 5307)
|
|
if ($cj4==5306 || $cj4==5307)
|
|
$publie=false;
|
|
else
|
|
$publie=true;
|
|
break;
|
|
case 54: // SARL
|
|
case 55: // SA à CA
|
|
case 56: // SA à Directoire
|
|
case 57: // SA par Actions simplifiéees
|
|
$publie=true;
|
|
break;
|
|
}
|
|
|
|
switch ($naf) {
|
|
case '651A': // Banque centrale
|
|
case '6411Z':
|
|
case '651C': // Banques
|
|
case '6419Z':
|
|
case '651D': // Banques mutualistes
|
|
case '6419Z':
|
|
case '651F': // Intermédiations monétaires n.c.a.
|
|
case '6419Z':
|
|
case '672Z': // Auxiliaires d'assurance
|
|
case '6621Z':
|
|
case '6622Z':
|
|
case '6629Z':
|
|
case '660E': // Assurance dommages
|
|
case '6512Z':
|
|
case '660F': // Réassurance
|
|
case '6520Z':
|
|
case '660C': // Caisses de retraite
|
|
case '6530Z':
|
|
case '660G': // Assurance relevant du code de la mutualité
|
|
case '6512Z':
|
|
case '753A': // Activités générales de sécurité sociale
|
|
case '8430A':
|
|
case '753B': // Gestion des retraites complémentaires
|
|
case '8430B':
|
|
case '753C': // Distribution sociale de revenus
|
|
case '652E': // Organismes de placement en valeurs mobilières
|
|
case '6420Z':
|
|
case '6430Z':
|
|
case '671A': // Administration de marchés financiers
|
|
case '6611Z':
|
|
case '671C': // Gestion de portefeuilles
|
|
case '6612Z':
|
|
case '6630Z':
|
|
$publie=false;
|
|
break;
|
|
}
|
|
|
|
return $publie;
|
|
}
|
|
} |