issue #0001743: XML problem part fix for Full report, some design changes

This commit is contained in:
Arman KYOKCHAN 2013-10-21 13:21:46 +00:00
parent 8a8cec352a
commit 8ca0ea98d7
9 changed files with 157 additions and 123 deletions

View File

@ -131,6 +131,7 @@ class GiantController extends Zend_Controller_Action
$giantConstroller = new GiantControllerLib($this->getRequest()->getParam('CompanyId').'-'.$this->getRequest()->getParam('Type'));
$identiteController->ficheAction();
$fiche = $identiteController->getObjet('fiche');
foreach($creditrecommendationAction as $action => $val) {
if(isset($creditrecommendation->DataSet->Company->$val)) {
$creditrecommendation = $giantConstroller->$action($creditrecommendation);
@ -166,7 +167,6 @@ class GiantController extends Zend_Controller_Action
$giantConstroller = new GiantControllerLib($this->getRequest()->getParam('CompanyId').'-'.$this->getRequest()->getParam('Type'));
$identiteController->ficheAction();
$fiche = $identiteController->getObjet('fiche');
foreach($compactAction as $action => $val) {
if(isset($compact->DataSet->Company->$val)) {
$compact = $giantConstroller->$action($compact);

View File

@ -10,7 +10,7 @@
</div>
<h2>3. Compte Annuels</h2>
<div id="break">
<?php echo $this->partial('giant/partials/rapports/ComptesAnnuels.phtml', null, array('report' => $this->report, 'Type' => $this->Type)); ?>
<?php echo $this->partial('giant/partials/rapports/ComptesAnnuels.phtml', null, array('report' => $this->report, 'Type' => $this->Type, 'dateFunction' => $this->dateFunction)); ?>
</div>
<h2>4. Position financiére</h2>
<div id="break">
@ -18,7 +18,7 @@
</div>
<h2>5. Comportement de paiement</h2>
<div id="break">
<?php echo $this->partial('giant/partials/rapports/ComportementDePaiement.phtml', null, array('report' => $this->report, 'Type' => $this->Type)); ?>
<?php echo $this->partial('giant/partials/rapports/ComportementDePaiement.phtml', null, array('report' => $this->report, 'Type' => $this->Type, 'dateFunction' => $this->dateFunction)); ?>
</div>
<h2>6. Structure de l'entreprise</h2>
<div id="break">

View File

@ -16,10 +16,11 @@
<tbody>
<tr>
<?php foreach($this->report->ComportementPaiement as $dates => $valeurs):?>
<?preg_match('/(\d{8})(\d{8})/', $dates,$matches);$s = $matches[1];$e = $matches[2];?>
<?php $date = explode(':', $dates);?>
<tr>
<td class="head">
<a class="tooltip" title="<?php echo $date[0];?> - <?php echo $date[1];?>"><?php echo $date[0];?> - <?php echo $date[1];?></a>
<a><?php echo $this->dateFunction->dateT('Ymd', 'd/m/Y', $s);?> - <?php echo $this->dateFunction->dateT('Ymd', 'd/m/Y', $e);?></a>
</td>
<?php $i=0;foreach($valeurs as $valeur): $i++; ?>
<td class="right"><?php echo $valeur;?> %</td>

View File

@ -8,7 +8,7 @@
<a class="tooltip tooltipFont">Date de clôture</a>
</td>
<?php foreach($this->report->AnnualAccounts as $AnnualAccounts):$i++?>
<td class="right"><?php echo (empty($AnnualAccounts->AccountsDate->_))?'NC':$AnnualAccounts->AccountsDate->_;?></td>
<td class="right"><?php echo (empty($AnnualAccounts->AccountsDate->_))?'NC':$this->dateFunction->dateT('Ymd', 'd/m/Y', $AnnualAccounts->AccountsDate->_);?></td>
<?php endforeach; ?>
</tr>
<tr >
@ -39,9 +39,8 @@
<th align="center">
</th>
<?php $i=0; foreach($this->report->AnnualAccounts as $AnnualAccounts): $i++?>
<th align="right" class="date"><?php echo $AnnualAccounts->AccountsDate->_; ?></th>
<th align="right" class="date"><?php echo $this->dateFunction->dateT('Ymd', 'd/m/Y', $AnnualAccounts->AccountsDate->_); ?></th>
<?php endforeach; ?>
<th>&nbsp;</th>
</tr>
</thead>
@ -84,7 +83,7 @@
<th align="center">
</th>
<?php $i=0; foreach($this->report->AnnualAccounts as $AnnualAccounts): $i++?>
<th align="right" class="date"><?php echo $AnnualAccounts->AccountsDate->_; ?></th>
<th align="right" class="date"><?php echo $this->dateFunction->dateT('Ymd', 'd/m/Y', $AnnualAccounts->AccountsDate->_); ?></th>
<?php endforeach; ?>
<th>&nbsp;</th>
@ -129,7 +128,7 @@
<th align="center">
</th>
<?php $i=0; foreach($this->report->AnnualAccounts as $AnnualAccounts): $i++?>
<th align="right" class="date"><?php echo $AnnualAccounts->AccountsDate->_; ?></th>
<th align="right" class="date"><?php echo $this->dateFunction->dateT('Ymd', 'd/m/Y', $AnnualAccounts->AccountsDate->_); ?></th>
<?php endforeach; ?>
<th>&nbsp;</th>
@ -175,7 +174,7 @@
<th align="center">
</th>
<?php $i=0; foreach($this->report->AnnualAccounts as $AnnualAccounts): $i++?>
<th align="right" class="date"><?php echo $AnnualAccounts->AccountsDate->_; ?></th>
<th align="right" class="date"><?php echo $this->dateFunction->dateT('Ymd', 'd/m/Y', $AnnualAccounts->AccountsDate->_); ?></th>
<?php endforeach; ?>
<th>&nbsp;</th>

View File

@ -2,13 +2,12 @@
<a name="19"></a>
<span class="title">Dirigeants</span><br /><br />
<?php if(isset($this->report->Dirigeant)):?>
<table style="font-size:13px;margin-left: 19px;" width="97%" class="hoverTr">
<table style="font-size:13px;margin-left: 19px;" width="97%" class="hoverTr"><pre><?//print_r($this->report->Dirigeant);?></pre>
<?php foreach($this->report->Dirigeant as $Dirigeants):?>
<?php foreach($Dirigeants as $date => $Dirigeant):?>
<?php $date = explode(':', $date); ?>
<?php foreach($Dirigeants as $date => $Dirigeant):?>
<tr>
<td style="padding:2px;color:#2599E7"><b><?php echo ($date[0]!='//')?$date[0]:'NC';?></b></td>
<td style="padding:2px;color:#2599E7"><b><?php if(!empty($Dirigeant[0]->date[0]) || !empty($Dirigeant[0]->date[1])){echo(!empty($Dirigeant[0]->date[0]))?$this->dateFunction->dateT('Ymd', 'd/m/Y', $Dirigeant[0]->date[0]):'NC';echo' - ';
echo(!empty($Dirigeant[0]->date[1]))?$this->dateFunction->dateT('Ymd', 'd/m/Y', $Dirigeant[0]->date[1]):'NC';}else{echo 'NC';}?></b></td>
</tr>
<?php $i=0;?>
<?php foreach($Dirigeant as $dir):$i++;?>

View File

@ -1,128 +1,157 @@
<div class="paragraph">
<?php if(isset($this->report)) :?>
<?preg_match('/(\d{2})(\d{2})(\d{4})/', $this->report->IncorporationDate, $matches);$d = $matches[1];$m = $matches[2];$y = $matches[3];?>
<div>
<a name="1"></a>
<span class="title">Données officielles</span><br /><br />
<ul style="font-size:13px;margin-left:3%;list-style: none">
<li><b>Nom d'entreprise </b> <span style="float:right"><?php echo $this->report->CompanyName?></span></li>
<hr style="border:1px dotted silver" />
<li><b>Numéro de TVA </b> <span style="float:right"><?php echo $this->report->Vat?></span></li>
<hr style="border:1px dotted silver" />
<li><b>Forme juridique actuelle </b> <span style="float:right"><?php echo $this->report->LegalForm.' / '.$this->report->UnifiedLegalForm;?></span></li>
<hr style="border:1px dotted silver" />
<li><b>Date de constitution </b> <span style="float:right"><?php echo ($this->report->IncorporationDate != '//')?$this->report->IncorporationDate:'NC'?></span></li>
<hr style="border:1px dotted silver" />
<li><b>Etat de l'entreprise </b> <span style="float:right"><?php echo $this->report->CompanyStatus?></span></li>
<hr style="border:1px dotted silver" />
<li><b>No. Siret </b> <span style="float:right"><?php echo $this->report->CompanyId?></span></li>
<hr style="border:1px dotted silver" />
</ul>
<table id="giant_synthese">
<tbody>
<tr >
<td class="head">
<a class="tooltip tooltipFont">Nom d'entreprise </a>
</td>
<td class="right"><?php echo $this->report->CompanyName?></td>
</tr>
<tr >
<td class="head">
<a class="tooltip tooltipFont">Numéro de TVA</a>
</td>
<td class="right"><?php echo $this->report->Vat?></td>
</tr>
<tr >
<td class="head">
<a class="tooltip tooltipFont">Forme juridique actuelle</a>
</td>
<td class="right"><?php echo $this->report->LegalForm.' / '.$this->report->UnifiedLegalForm;?></td>
</tr>
<tr >
<td class="head">
<a class="tooltip tooltipFont">Date de constitution</a>
</td>
<td class="right"><?php echo (!empty($this->report->IncorporationDate))?$d.'/'.$m.'/'.$y:'NC'?></td>
</tr>
<tr >
<td class="head">
<a class="tooltip tooltipFont">Etat de l'entreprise</a>
</td>
<td class="right"><?php echo $this->report->CompanyStatus?></td>
</tr>
<tr >
<td class="head">
<a class="tooltip tooltipFont">No. Siret</a>
</td>
<td class="right"><?php echo $this->report->CompanyId?></td>
</tr>
</tbody>
</table>
<br />
<a name="2"></a>
<span class="title">Données de contact</span><br /><br />
<ul style="font-size:13px;margin-left:3%;list-style: none">
<li><b>Numéro de téléphone </b> <span style="float:right"><?php echo $this->report->TelephoneNumber?></span></li>
<hr style="border:1px dotted silver" />
<li><b>Numéro de fax </b> <span style="float:right"><?php echo $this->report->Telefax?></span></li>
<hr style="border:1px dotted silver" />
<li><b>Adresse Email </b> <span style="float:right"><?php echo $this->report->EmailAddress?></span></li>
<hr style="border:1px dotted silver" />
<li><b>Site internet </b> <span style="float:right"><?php echo $this->report->WebAddress?></span></li>
<hr style="border:1px dotted silver" />
<li><b>Adresse </b> <span style="float:right"><?php echo $this->report->CompanyAddress?></span></li>
<hr style="border:1px dotted silver" />
</ul>
<table id="giant_synthese">
<tbody>
<tr >
<td class="head">
<a class="tooltip tooltipFont">Numéro de téléphone</a>
</td>
<td class="right"><?php echo $this->report->TelephoneNumber?></td>
</tr>
<tr >
<td class="head">
<a class="tooltip tooltipFont">Numéro de fax</a>
</td>
<td class="right"><?php echo $this->report->Telefax?></td>
</tr>
<tr >
<td class="head">
<a class="tooltip tooltipFont">Adresse Email</a>
</td>
<td class="right"><?php echo ($this->report->EmailAddress!='<a href="mailto:"></a>')?$this->report->EmailAddress:'NC'?></td>
</tr>
<tr >
<td class="head">
<a class="tooltip tooltipFont">Site internet</a>
</td>
<td class="right"><?php echo ($this->report->WebAddress!='<a href="http://"></a>')?$this->report->WebAddress:'NC'?></td>
</tr>
<tr >
<td class="head">
<a class="tooltip tooltipFont">Adresse</a>
</td>
<td class="right"><?php echo $this->report->CompanyAddress?></td>
</tr>
</tbody>
</table>
</div>
<br />
<a name="3"></a>
<?php if(!empty($this->report->activity)):?>
<span class="title">Activités</span><br /><br />
<table style="margin-left: 19px;" width="97%">
<tr>
<td style="font-size:13px;"><b>Code</b></td>
<td style="float:right;font-size:13px;padding-left:5px"><b>Activité</b></td>
</tr>
<tr>
<td colspan="2"><hr style="border:1px dotted silver" /></td>
</tr>
<?php foreach($this->report->activity as $code => $activity): ?>
<tr>
<td>
<ul style="font-size:13px;list-style: none">
<li><span ><?php echo $code?></span></li>
</ul>
</td>
<td style="padding-left:5px">
<ul style="font-size:13px;list-style: none;">
<?php if(strlen($activity) < 50): ?>
<li style="float:right"><span ><i><?php echo $activity?></i></span></li>
<?php else: ?>
<li style="float:right;cursor:help" class="tooltip" title="<?php echo $activity;?>" style="float:right">
<span ><i><?php echo substr($activity, 0, 50);?>...</i></span>
</li>
<?php endif; ?>
</ul>
<table id="giant_synthese">
<thead>
<tr>
<th align="left" class="date">Code</th>
<th align="right" class="date">Activité</th>
</tr>
</thead>
<tbody>
<tr>
<?php foreach($this->report->activity as $code => $activity): ?>
<tr class="<?php echo ($val)? 'red':'green'; ?>">
<td class="head">
<a class="tooltip" title="<?php echo $code?>"><?php echo $code?></a>
</td>
<td class="right"><?php echo $activity?></td>
</tr>
<tr>
<td colspan="2"><hr style="border:1px dotted silver" /></td>
</tr>
<?php endforeach;?>
</table>
<?php endforeach; ?>
</tbody>
</table>
<?php endif;?>
<br />
<?php if(!empty($this->report->Employees)):?>
<a name="4"></a>
<span class="title">Personnel</span><br /><br />
<table style="font-size:13px;margin-left: 19px;" width="97%">
<table id="giant_synthese">
<thead>
<tr>
<td><b>Année</b></td>
<td><b>Total des travailleurs employés</b></td>
<td><b>Équivalent temps plein</b></td>
<th align="left" class="date">Année</th>
<th align="right" class="date">Total des travailleurs employés</th>
<th align="right" class="date">Équivalent temps plein</th>
</tr>
<?php foreach($this->report->Employees as $year => $employees): ?>
</thead>
<tbody>
<tr>
<td><?php if(strlen($year)==4)echo $year; else echo $this->dateFunction->dateT('Ymd', 'd/m/Y', $year);?></td>
<td><?php echo $employees['TotalStaffEmployed'];?> </td>
<td><?php echo $employees['FulltimeEquivalent'];?> </td>
</tr>
<tr>
<td colspan="3"><hr style="border:1px dotted silver" /></td>
</tr>
<?php endforeach;?>
<?php foreach($this->report->Employees as $year => $employees): ?>
<tr class="<?php echo ($val)? 'red':'green'; ?>">
<td class="left"><?php if(strlen($year)==4)echo $year; else echo $this->dateFunction->dateT('Ymd', 'd/m/Y', $year);?></td>
<td class="right"><?php echo $employees['TotalStaffEmployed'];?></td>
<td class="right"><?php echo $employees['FulltimeEquivalent'];?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif;?>
<br />
<?php if(!empty($this->report->ProductName)):?>
<a name="5"></a>
<span class="title">Noms de produit</span><br /><br />
<table style="margin-left: 19px;" width="97%">
<tr>
<td style="font-size:13px;"><b>Source</b></td>
<td width="100%" style="font-size:13px;padding-left:5px"><b>Produit</b></td>
</tr>
<tr>
<td colspan="2"><hr style="border:1px dotted silver" /></td>
</tr>
<table id="giant_synthese">
<thead>
<tr>
<th align="left" class="date">Source</th>
<th align="right" class="date">Produit</th>
</tr>
</thead>
<tbody>
<tr>
<?php foreach($this->report->ProductName as $ProductName): ?>
<tr>
<td style="font-size:13px;"><?php echo (empty($ProductName->source)?'NC':$ProductName->source);?></td>
<td style="padding-left:5px" width="100%">
<ul style="font-size:13px;list-style: none;">
<?php if(strlen($ProductName->_) < 50): ?>
<li style="float:right"><span ><i><?php echo $ProductName->_?></i></span></li>
<?php else: ?>
<li style="float:right;cursor:help" class="tooltip" title="<?php echo $ProductName->_;?>" style="float:right">
<span ><i><?php echo substr($ProductName->_, 0, 80);?>...</i></span>
</li>
<?php endif; ?>
</ul>
</td>
</tr>
<tr>
<td colspan="2"><hr style="border:1px dotted silver" /></td>
</tr>
<?php endforeach;?>
<tr class="<?php echo ($val)? 'red':'green'; ?>">
<td class="head">
<a class="tooltip" title="<?php echo (empty($ProductName->source)?'NC':$ProductName->source);?>"><?php echo (empty($ProductName->source)?'NC':$ProductName->source);?></a>
</td>
<td class="right"><?php echo $ProductName->_?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif;?>
<?php else: ?>

View File

@ -1,5 +1,6 @@
<div class="paragraph">
<?php if(isset($this->report->FinancialSummary)):?>
<? $dateFunction = new WDate();?>
<a name="11"></a>
<span class="title">Informations Capital</span><br />
<?php if(isset($this->report->PositionFinanciere)):?>
@ -9,7 +10,7 @@
<th align="center">
</th>
<?php $i = 0; foreach($this->report->PositionFinanciereDate as $date => $val):$i++?>
<th align="right" class="date"><?php echo $date;?></th>
<th align="right" class="date"><?php echo $dateFunction->dateT('Ymd', 'd/m/Y', $date);?></th>
<?php endforeach; ?>
</tr>
</thead>

View File

@ -20,11 +20,11 @@ Class GiantFunction
public function setDate($date, $format)
{
$date = new WDate();
$wdate = new WDate();
switch($format) {
case 'YYYYMMDD':
$formatIn = 'Ymd';
$date = $date->dateT($formatIn, 'd/m/Y', $date);
$date = $wdate->dateT($formatIn, 'd/m/Y', $date);
return ($date);
case 'YYYY':
return ($date);

View File

@ -277,8 +277,9 @@ class ComportementPaiement
if(isset($PaymentBehaviour->AnalysisByPeriod->Category)) {
foreach($PaymentBehaviour->AnalysisByPeriod->Category as $period) {
foreach($period->DueDateExceeds as $DueDateExceeds) {
$per = $period->Period->StartDate->_.$period->Period->EndDate->_;
$this->report->DataSet->Company->
ComportementPaiement[$date->dateT('Ymd', 'd/m/Y', $period->Period->StartDate->_).':'.$date->dateT('Ymd', 'd/m/Y', $period->Period->EndDate->_)][$DueDateExceeds->NrOfDaysExceeds->LowerLimit->_.':'.$DueDateExceeds->NrOfDaysExceeds->UpperLimit->_] =
ComportementPaiement[$per][$DueDateExceeds->NrOfDaysExceeds->LowerLimit->_.':'.$DueDateExceeds->NrOfDaysExceeds->UpperLimit->_] =
$DueDateExceeds->Percentage;
}
}
@ -586,13 +587,14 @@ class ComptesAnnuels
public function formatDate($report)
{
$date = new WDate();
$function = new GiantFunction();
//$date = new WDate();
//$function = new GiantFunction();
for ($i = 0; $i < count($this->report->DataSet->Company->AnnualAccounts); $i++) {
if(isset($this->report->DataSet->Company->AnnualAccounts[$i]->AccountsDate->_)) {
$this->report->DataSet->Company->AnnualAccounts[$i]->AccountsDate->_ = $date->dateT(
$this->report->DataSet->Company->AnnualAccounts[$i]->AccountsDate->_=(int)$this->report->DataSet->Company->AnnualAccounts[$i]->AccountsDate->_;
/*$this->report->DataSet->Company->AnnualAccounts[$i]->AccountsDate->_ = $date->dateT(
$function->getFormatDate($this->report->DataSet->Company->AnnualAccounts[$i]->AccountsDate->format), 'd/m/Y',
$this->report->DataSet->Company->AnnualAccounts[$i]->AccountsDate->_);
$this->report->DataSet->Company->AnnualAccounts[$i]->AccountsDate->_);*/
}
}
}
@ -617,7 +619,8 @@ class Dirigeant {
{
$date = new WDate();
foreach($this->report->DataSet->Company->Position as $Position) {
$this->report->DataSet->Company->Dirigeant[$Position->PositionTitle->code][$date->dateT('Ymd', 'd/m/Y', $Position->Period->StartDate->_).':'.$date->dateT('Ymd', 'd/m/Y',$Position->Period->EndDate->_)][] = $Position->Person;
$Position->Person->date = array($Position->Period->StartDate->_,$Position->Period->EndDate->_);
$this->report->DataSet->Company->Dirigeant[$Position->PositionTitle->code][(int)$Position->Period->StartDate->_][] = $Position->Person;
}
}
@ -687,7 +690,7 @@ class InformationGenerale
$this->report->CompanyAddress = $this->report->CompanyAddress[0]->HouseNumber.' '.$this->report->CompanyAddress[0]->Street.' - '.$this->report->CompanyAddress[0]->PostCode.' '.$this->report->CompanyAddress[0]->City;
$this->report->TelephoneNumber = $this->report->TelephoneNumber[0]->_;
$this->report->Telefax = $this->report->Telefax[0];
$this->report->IncorporationDate = $function->setDate($this->report->IncorporationDate->_, $this->report->IncorporationDate->format);
$this->report->IncorporationDate = str_replace('/', '', $function->setDate($this->report->IncorporationDate->_, $this->report->IncorporationDate->format));
$this->report->UnifiedLegalForm = $this->report->LegalForm[0]->UnifiedLegalForm;
$this->report->LegalForm = $this->report->LegalForm[0]->CountryLegalForm->_;
$this->report->WebAddress = '<a href="http://'.$this->report->WebAddress.'">'.$this->report->WebAddress.'</a>';
@ -791,13 +794,15 @@ class PositionFinanciere
public function generateStructure()
{
$dateFunction = new WDate();
foreach($this->report->DataSet->Company->FinancialSummary as $FinancialSummary) {
foreach($FinancialSummary as $name => $valeur) {
if($name != 'SummaryDate' and $name != 'AccountStatus' and $name != 'Unit') {
(($FinancialSummary->Unit == 1)?$unit=1000:$unit=1);
$date = (strlen($FinancialSummary->SummaryDate->_) == 8 )?$dateFunction->dateT('Ymd', 'd/m/Y', $FinancialSummary->SummaryDate->_):$FinancialSummary->SummaryDate->_;
$date = $FinancialSummary->SummaryDate->_;
if(strlen($FinancialSummary->SummaryDate->_) != 8){
list($date, $month, $year) = explode("/", $FinancialSummary->SummaryDate->_);
$date = $date.$month.$year;
}
$return[$name][$date] = number_format ($valeur->_/$unit, 0, '', ' ').(($unit==1000)?' K€':' €');
$this->labelDate[$date] = true;
}