';
switch ($r->DataSetType) {
case 'Full':
print '
RAPPORT COMPLET
';
break;
case 'Compact':
print '
RAPPORT DE SYNTHESE
';
break;
case 'CreditRecommendation':
print '
RAPPORT DE SCORE
';
break;
}
$d = unserialize($r->DataSet);
$c = $d->Company;
print '
SOCIÉTÉ : '.$c->CompanyName->_.'
';
// --------------------------------------------------------------------------- //
// Identite de l'entreprise
// --------------------------------------------------------------------------- //
print '
IDENTITÉ DE L\'ENTREPRISE
';
print '
';
dRow('Numéro identifiant', $c->CompanyId);
if (isset($c->Vat->VatNumber) == true) {
dRow('Numéro de TVA Intracom.', $c->Vat->VatNumber);
}
if (isset($c->SocialSecurityNumber) == true) {
dRow('Numéro de Securité Sociale', $c->SocialSecurityNumber);
}
if (isset($c->CompanyStatus) == true) {
dRow('Etablissement actif', ($c->CompanyStatus == 'Active') ? 'Oui' : 'Non');
}
print '
';
// --------------------------------------------------------------------------- //
// Raison sociale et coordonnees
// --------------------------------------------------------------------------- //
print '
Raison sociale & Coordonnées
';
print '
';
dRow('Raison Sociale', $c->CompanyName->_);
if (isset($c->TradeName) == true) {
$libelle = 'Enseigne(s)';
foreach (getArray($c->TradeName) as $t) {
dRow($libelle, $t->_);
$libelle = '';
}
}
if (isset($c->LegalForm->CountryLegalForm) == true) {
dRow('Forme juridique',
$c->LegalForm->CountryLegalForm->code.' : '.
$c->LegalForm->CountryLegalForm->_);
}
dRow('Adresse',
$c->CompanyAddress->HouseNumber.' '.
$c->CompanyAddress->Street.' '.
$c->CompanyAddress->PostCode.' '.
$c->CompanyAddress->City.' '.
$c->CompanyAddress->Country);
if (isset($c->TelephoneNumber) == true) {
$libelle = 'Téléphone(s)';
foreach (getArray($c->TelephoneNumber) as $t) {
$mobile = (isset($t->isMobile) == true &&
$t->isMobile == 1) ? ' (mobile)' : '';
dRow($libelle, $t->_.$mobile);
$libelle = '';
}
}
if (isset($c->Telefax) == true) {
dRow('Fax', $c->Telefax);
}
if (isset($c->WebAddress) == true) {
dRow('Site Internet',
''.$c->WebAddress.'');
}
if (isset($c->EmailAddress) == true) {
dRow('Courriel',
''.
$c->EmailAddress.'');
}
print '
';
// --------------------------------------------------------------------------- //
// Banques
// --------------------------------------------------------------------------- //
if (isset($c->Bank) == true) {
print '
Banques
';
print '
';
foreach (getArray($c->Bank) as $t) {
$libelle = $t->BankName;
if (isset($t->BankIdentifierCode) == true) {
dRow($libelle, 'BIC: '.$t->BankIdentifierCode);
$libelle = '';
}
if (isset($t->BankAccount) == true) {
dRow($libelle,
$t->BankAccount->AccountType.': '.
$t->BankAccount->AccountNumber);
$libelle = '';
}
if (isset($t->BankAddress) == true) {
$adresse = '';
if ( isset($t->BankAddress->HouseNumber) == true) {
$adresse .= $t->BankAddress->HouseNumber.' ';
}
if ( isset($t->BankAddress->Street) == true) {
$adresse .= $t->BankAddress->Street.' ';
}
if ( isset($t->BankAddress->PostCode) == true) {
$adresse .= $t->BankAddress->PostCode.' ';
}
if ( isset($t->BankAddress->City) == true) {
$adresse .= $t->BankAddress->City.' ';
}
if ( isset($t->BankAddress->Country) == true) {
$adresse .= $t->BankAddress->Country.' ';
}
dRow($libelle, $adresse);
}
}
print '
';
}
// --------------------------------------------------------------------------- //
// Activite(s) et chiffre d'affaire
// --------------------------------------------------------------------------- //
if (isset($c->Operations->IndustryCode) == true ||
isset($c->FinancialSummary) == true ||
isset($capital) == true ||
isset($c->Employees) == true) {
print '
Activité(s) & Chiffre d\'affaire
';
print '
';
if (isset($c->Operations->IndustryCode) == true) {
$libelle = 'Activité(s)';
foreach (getArray($c->Operations->IndustryCode) as $t) {
$desc = 'Nace '.$t->NaceCode;
if ( isset($t->Description->_) == true) {
$desc .= ' '.$t->Description->_;
}
dRow($libelle, $desc);
$libelle = '';
}
}
if (isset($c->FinancialSummary) == true) {
$tab = getArray($c->FinancialSummary);
$date = 0;
foreach ($tab as $t) {
if ($t->SummaryDate->_ > $date &&
isset($t->AuthorizedCapital) == true) {
$capital = $t->AuthorizedCapital->_;
$date = $t->SummaryDate->_;
}
}
}
if (isset($capital) == false &&
isset($c->ShareCapital->AuthorizedCapital->_) == true &&
(isset($c->ShareCapital->AuthorizedCapital->currency) == false ||
$c->ShareCapital->AuthorizedCapital->currency == 'EUR')) {
$capital = $c->ShareCapital->AuthorizedCapital->_;
}
if (isset($capital) == true) {
dRow('Capital', $capital.' €');
}
if (isset($c->Employees) == true) {
$annee = 0;
$total = 0;
foreach (getArray($c->Employees) as $t) {
if (isset($t->Period) == true) {
if (isset($t->Period->StartDate->_) == true &&
$t->Period->StartDate->_ > $annee) {
$annee = $t->Period->StartDate->_;
$total = $t->TotalStaffEmployed + 0;
} else if (isset($t->Period->EndDate->_) == true &&
$t->Period->EndDate->_ > $annee) {
$annee = $t->Period->EndDate->_;
$total = $t->TotalStaffEmployed + 0;
}
} else {
$total = $t->TotalStaffEmployed + 0;
}
}
if ($total > 0) {
if ($annee > 0) {
dRow('Effectif de l\'entreprise',
$total.' salarié(s) en '.substr($annee, 0, 4));
} else {
dRow('Effectif de l\'entreprise', $total.' salarié(s)');
}
}
}
print '
';
}
// --------------------------------------------------------------------------- //
// Annonces legales
// --------------------------------------------------------------------------- //
if (isset($c->Event) == true) {
print '
ANNONCES LÉGALES
';
print '
';
$tab = getArray($c->Event);
usort($tab, 'cmp');
foreach ($tab as $t) {
if (isset($t->Value) == true) {
$desc = printObj($t->Value);
if ( isset($t->Description->_) == true) {
$desc = $t->Description->_.' '.$desc;
}
dRow(pdate($t->Date), $desc);
} else if (isset($t->Description->_) == true) {
dRow(pdate($t->Date), $t->Description->_);
} else {
dRow(pdate($t->Date), '('.$t->EventCode.')');
}
}
print '
';
}
// --------------------------------------------------------------------------- //
// Dirigeants
// --------------------------------------------------------------------------- //
if (isset($c->Position) == true) {
print '
DIRIGEANTS
';
print '
';
foreach (getArray($c->Position) as $t) {
if (isset($t->Person) == false) {
continue;
}
$date = '';
if (isset($t->Period->StartDate) == true) {
$date .= pdate($t->Period->StartDate);
}
$date .= ' - ';
if (isset($t->Period->EndDate) == true) {
$date .= pdate($t->Period->EndDate);
}
$desc = $t->PositionTitle->_.' '.$t->Person->LastName;
if (isset($t->Person->FirstName) == true) {
$desc .= ' '.$t->Person->FirstName;
}
dRow($date, $desc);
}
print '
';
}
// --------------------------------------------------------------------------- //
// Employés
// --------------------------------------------------------------------------- //
if (isset($c->Employees) == true) {
print '
EMPLOYÉS
';
print '
';
foreach (getArray($c->Employees) as $t) {
if (isset($t->Period) == true) {
if (isset($t->Period->StartDate) == true) {
dRow(pdate($t->Period->StartDate), $t->TotalStaffEmployed + 0);
} else if (isset($t->Period->EndDate) == true) {
dRow(pdate($t->Period->EndDate), $t->TotalStaffEmployed + 0);
}
} else {
dRow('', $t->TotalStaffEmployed + 0);
}
}
print '
';
}
// --------------------------------------------------------------------------- //
// Synthese
// --------------------------------------------------------------------------- //
if (isset($c->FinancialSummary) == true) {
print '
Synthèse
';
print '
';
print '';
$tab = getArray($c->FinancialSummary);
print ' | ';
foreach ($tab as $t) {
print ''.substr($t->SummaryDate->_, 0, 4).
' | ';
}
print '
';
foreach (array('Revenue',
'TotalEquity',
'ProfitLossBeforeTax',
'ProfitLoss',
'WorkingCapital',
'AuthorizedCapital') as $n) {
print '';
print '';
print $n;
print ' | ';
foreach ($tab as $t) {
print '';
if (isset($t->$n) == true) {
$val = $t->$n->_;
if (is_numeric($val) == true) {
print $val * $t->Unit;
} else {
print $val;
}
}
print ' | ';
}
print '
';
}
print '
';
print '';
}
// --------------------------------------------------------------------------- //
// Bilans
// --------------------------------------------------------------------------- //
if (isset($c->AnnualAccounts) == true) {
print '
ÉLÉMENTS FINANCIERS - BILANS
';
print '
';
print '';
printAccountItem($c, 'ACTIF');
printAccountItem($c, 'PASSIF');
printAccountItem($c, 'COMPTE DE RÉSULTAT');
print '
';
print '';
}
// --------------------------------------------------------------------------- //
// Etablissements
// --------------------------------------------------------------------------- //
if (isset($c->Branch) == true) {
print '
Établissements
';
print '
';
foreach (getArray($c->Branch) as $t) {
if (isset($t->BranchName->_) == true) {
$libelle = $t->BranchName->_;
} else if (isset($t->BranchName) == true) {
$libelle = $t->BranchName;
} else if (isset($t->BranchId) == true) {
$libelle = $t->BranchId;
}
dRow($libelle,
$c->CompanyAddress->HouseNumber.' '.
$c->CompanyAddress->Street.' '.
$c->CompanyAddress->PostCode.' '.
$c->CompanyAddress->City.' '.
$c->CompanyAddress->Country);
}
print '
';
}
// --------------------------------------------------------------------------- //
// Liens financiers
// --------------------------------------------------------------------------- //
if (isset($c->Associated) == true) {
print '
Liens financiers
';
print '
Actionnariat
';
print '
';
printLiensFinanciers($c, 'Shareholder');
print '
';
print '
Participations
';
print '
';
printLiensFinanciers($c, 'Participation');
print '
';
}
// --------------------------------------------------------------------------- //
// Paiements
// --------------------------------------------------------------------------- //
if (isset($c->PaymentBehaviour) == true) {
print '
Paiements
';
print '
';
$date = '';
if (isset($c->PaymentBehaviour->Period->StartDate) == true) {
$date = pdate($c->PaymentBehaviour->Period->StartDate);
}
if (isset($c->PaymentBehaviour->Period->EndDate) == true) {
$date .= ' -> '.pdate($c->PaymentBehaviour->Period->EndDate);
}
if (empty($date) == false) {
dRow('Date', $date);
}
if (isset($c->PaymentBehaviour->DebtorDays) == true) {
dRow('DebtorDays', $c->PaymentBehaviour->DebtorDays);
}
if (isset($c->PaymentBehaviour->CreditorDays) == true) {
dRow('CreditorDays', $c->PaymentBehaviour->CreditorDays);
}
if (isset($c->PaymentBehaviour->LiquidityAssessment) == true) {
$desc = $c->PaymentBehaviour->LiquidityAssessment->Qualification;
if (isset($c->PaymentBehaviour->LiquidityAssessment
->AdditionalQualification) == true) {
$desc .= ', '.$c->PaymentBehaviour->LiquidityAssessment
->AdditionalQualification->_;
}
dRow('LiquidityAssessment', $desc);
}
if (isset($c->PaymentBehaviour->PaymentQualification) == true) {
$desc = $c->PaymentBehaviour->PaymentQualification->Qualification;
if (isset($c->PaymentBehaviour->PaymentQualification
->AdditionalQualification) == true) {
$desc .= ', '.$c->PaymentBehaviour->PaymentQualification
->AdditionalQualification->_;
}
dRow('PaymentQualification', $desc);
}
print '
';
if (isset($c->PaymentBehaviour->AnalysisByPeriod) == true) {
$ap = $c->PaymentBehaviour->AnalysisByPeriod;
$tab = array();
foreach ($ap->Category as $cat) {
$trim =
pdate($cat->Period->StartDate).' - '.
pdate($cat->Period->EndDate);
$total = 0;
foreach (getArray($cat->DueDateExceeds) as $e) {
if ($e->NrOfDaysExceeds->LowerLimit->_ >= 90) {
$total += $e->Percentage;
} else {
$lab =
$e->NrOfDaysExceeds->LowerLimit->_.' to '.
$e->NrOfDaysExceeds->UpperLimit->_;
$tab[$lab][$trim] = $e->Percentage;
}
}
$tab['90-'][$trim] = $total;
}
ksort($tab);
print '
'.$ap->Description->_.'
';
print '
';
print '';
print 'Quarter | ';
print 'Within term | ';
foreach ($tab as $tranche => $valeurs) {
print ''.$tranche.' | ';
}
print '
';
foreach ($ap->Category as $cat) {
$trim =
pdate($cat->Period->StartDate).' - '.
pdate($cat->Period->EndDate);
print ''.
''.$trim.' | '.
''.$cat->PercentageWithinTerms.' % | ';
foreach ($tab as $tranche => $valeurs) {
if (isset($tab[$tranche][$trim]) == true) {
print ''.$tab[$tranche][$trim].' % | ';
} else {
print '0 % | ';
}
}
print '
';
}
print '
';
}
if (isset($c->PaymentBehaviour->AnalysisByAmount) == true) {
$ap = $c->PaymentBehaviour->AnalysisByAmount;
$tab = array();
foreach ($ap->Category as $cat) {
$amount = '';
if ( isset($cat->AmountCategory->LowerLimit) == true) {
$amount .= $cat->AmountCategory->LowerLimit->_;
}
$amount .= '-';
if ( isset($cat->AmountCategory->HigherLimit) == true) {
$amount .= $cat->AmountCategory->HigherLimit->_;
}
$total = 0;
foreach (getArray($cat->DueDateExceeds) as $e) {
if ($e->NrOfDaysExceeds->LowerLimit->_ >= 90) {
$total += $e->Percentage;
} else {
$lab =
$e->NrOfDaysExceeds->LowerLimit->_.' to '.
$e->NrOfDaysExceeds->UpperLimit->_;
$tab[$lab][$amount] = $e->Percentage;
}
}
$tab['90-'][$amount] = $total;
}
ksort($tab);
print '
'.$ap->Description->_.'
';
print '
';
print '';
print 'Amount | ';
print 'Within term | ';
foreach ($tab as $tranche => $valeurs) {
print ''.$tranche.' | ';
}
print '
';
foreach ($ap->Category as $cat) {
$amount = '';
if ( isset($cat->AmountCategory->LowerLimit) == true) {
$amount .= $cat->AmountCategory->LowerLimit->_;
}
$amount .= '-';
if ( isset($cat->AmountCategory->HigherLimit) == true) {
$amount .= $cat->AmountCategory->HigherLimit->_;
}
print ''.
''.$amount.' | '.
''.$cat->PercentageWithinTerms.' % | ';
foreach ($tab as $tranche => $valeurs) {
if (isset($tab[$tranche][$amount]) == true) {
print ''.$tab[$tranche][$amount].' % | ';
} else {
print '0 % | ';
}
}
print '
';
}
print '
';
}
}
// --------------------------------------------------------------------------- //
// Score
// --------------------------------------------------------------------------- //
print '
Score
';
print '
';
if (isset($c->CreditRecommendation->Date) == true) {
dRow('Date', pdate($c->CreditRecommendation->Date));
}
if (isset($c->CreditRecommendation->RiskClasses) == true) {
foreach (getArray($c->CreditRecommendation
->RiskClasses->ProviderRiskClass) as $t) {
if (isset($t->Description->_) == true) {
$desc = ' '.
'';
} else {
$desc = '';
}
dRow($t->RatingName->_.$desc, $t->RatingValue);
}
$t = $c->CreditRecommendation->RiskClasses->CommonRiskClass;
if (isset($t->Description->_) == true) {
$desc = ' '.
'';
} else {
$desc = '';
}
dRow($t->RatingName->_.$desc, $t->RatingValue);
}
dRow('AmountAdvised', $c->CreditRecommendation->AmountAdvised->_.' '.
$c->CreditRecommendation->AmountAdvised->currency);
print '
';
// --------------------------------------------------------------------------- //
// Ratios secteur
// --------------------------------------------------------------------------- //
if (isset($c->PeerGroup->FlexibleComparisonItems
->ComparisonItemsGroup[0]->FlexibleComparisonItem) == true) {
print '
Ratios secteur
';
print '
';
print '';
print '';
print ' | ';
foreach ($c->PeerGroup->FlexibleComparisonItems->ComparisonItemsGroup as
$group) {
print '';
print substr($group->Period->EndDate->_, 0, 4);
print ' | ';
print '';
print 'secteur';
print ' | ';
}
print '
';
foreach ($c->PeerGroup->FlexibleComparisonItems
->ComparisonItemsGroup[0]->FlexibleComparisonItem as $i => $item) {
print '
';
print '';
print $item->ItemName->_;
print ' | ';
foreach ($c->PeerGroup->FlexibleComparisonItems->ComparisonItemsGroup as
$group) {
print '';
print $group->FlexibleComparisonItem[$i]->SubjectValue;
print ' | ';
print '';
print $group->FlexibleComparisonItem[$i]->AverageValue;
print ' | ';
}
print '
';
}
print '
';
}
print '
';
?>