Remove the use of WDate

This commit is contained in:
Michael RICOIS 2013-10-29 16:14:14 +00:00
parent 75e2dd7c19
commit e20af343a0

View File

@ -302,7 +302,8 @@ class Infogreffe
$commande->addChild('dossier_statut',$ref[4]);
$commande->addChild('dossier_chrono',$ref[5]);
$commande->addChild('num_depot',$ref[6]);
$commande->addChild('date_cloture', WDate::dateT('Ymd','d/m/Y', $ref[1]));
$date = new Zend_Date($ref[1],'yyyyMMdd');
$commande->addChild('date_cloture', $date->toString('dd/MM/yyyy'));
$fichierOption = $option;
@ -596,14 +597,21 @@ class Infogreffe
foreach($actes as $key => $depot)
{
$tabActes[$key]['num_depot'] = $depot['num_depot'];
$tabActes[$key]['date_depot'] = WDate::dateT('Y-m-d', 'd/m/Y', $depot['date_depot']);
$date = new Zend_Date($depot['date_depot'],'yyyy-MM-dd');
$tabActes[$key]['date_depot'] = $date->toString('dd/MM/yyyy');
//Pour chaque acte dans le depot
foreach($depot['depot'] as $acte)
{
//Génération date (date_acte peut être vide)
if(!empty($acte['date_acte'])){ $date = WDate::dateT('Y-m-d', 'Ymd', $acte['date_acte']); }
else { $date = WDate::dateT('Y-m-d', 'Ymd', $depot['date_depot']); }
if(!empty($acte['date_acte'])){
$dateF = new Zend_Date($acte['date_acte'],'yyyy-MM-dd');
$date = $dateF->toString('yyyyMMdd');
}
else {
$dateF = new Zend_Date($depot['date_depot'],'yyyy-MM-dd');
$date = $dateF->toString('yyyyMMdd');
}
//Recherche du fichier suivant le siren, le type de document et la reference
$file_exist = false;
@ -632,13 +640,14 @@ class Infogreffe
Zend_Registry::get('firebug')->info($acte);
if ($result->type != $acte['type_acte'] && $result->type2 == '') {
Zend_Registry::get('firebug')->info('Update Database');
$dateDepot = new Zend_Date($depot['date_depot'],'yyyy-MM-dd');
//Add to the database
try {
$actesM->update(array(
'type2' => $acte['type_acte'],
'type_libelle' => $acte['type_acte_libelle'],
'num_depot' => $depot['num_depot'],
'date_depot' => WDate::dateT('Y-m-d', 'Ymd', $depot['date_depot'])
'date_depot' => $dateDepot->toString('yyyyMMdd')
), 'id='.$result->id);
} catch (Zend_Exception $e) {
Zend_Registry::get('firebug')->info($e->getMessage());
@ -648,7 +657,7 @@ class Infogreffe
$actesM->update(array(
'type_libelle' => $acte['type_acte_libelle'],
'num_depot' => $depot['num_depot'],
'date_depot' => WDate::dateT('Y-m-d', 'Ymd', $depot['date_depot'])
'date_depot' => $dateDepot->toString('yyyyMMdd')
), 'id='.$result->id);
} catch (Zend_Exception $e) {
Zend_Registry::get('firebug')->info($e->getMessage());
@ -686,13 +695,15 @@ class Infogreffe
}
}
//Assignation
$tabActe['num_acte'] = $acte['num_acte'];
$tabActe['nbpages_acte'] = $acte['nbpages_acte'];
$tabActe['type'] = $acte['type_acte'];
$tabActe['type_lib'] = $acte['type_acte_libelle'];
$tabActe['decision'] = $acte['decision']['libelle'];
$tabActe['date_acte'] = ($date!='') ? WDate::dateT('Ymd', 'd/m/Y', $date) : '';
$tabActe['date_acte'] = ($date!='') ? $dateF->toString('dd/MM/yyyy') : '';
$tabActe['mode'] = $mode;
$tabActe['ref'] = $ref;
@ -710,8 +721,14 @@ class Infogreffe
foreach($actes['actes'] as $acte)
{
//Génération date (date_acte peut être vide)
if(!empty($acte['date_acte'])){ $date = WDate::dateT('Y-m-d', 'Ymd', $acte['date_acte']); }
else { $date = WDate::dateT('Y-m-d', 'Ymd', $actes['date_depot']); }
if(!empty($acte['date_acte'])){
$dateF = new Zend_Date($acte['date_acte'],'yyyy-MM-dd');
$date = $dateF->toString('yyyyMMdd');
}
else {
$dateF = new Zend_Date($actes['date_depot'],'yyyy-MM-dd');
$date = $dateF->toString('yyyyMMdd');
}
$tabActe = '';
@ -887,8 +904,14 @@ class Infogreffe
foreach($actes as $acte)
{
if(!empty($acte['date_acte'])){ $date = $acte['date_acte']; }
else { $date = WDate::dateT('Y-m-d', 'Ymd', $result['date_depot']); }
if(!empty($acte['date_acte'])){
$dateF = new Zend_Date($acte['date_acte'],'yyyy-MM-dd');
$date = $dateF->toString('yyyyMMdd');
}
else {
$dateF = new Zend_Date($result['date_depot'],'yyyy-MM-dd');
$date = $dateF->toString('yyyyMMdd');
}
$ref = $acte['type_acte'].'-'.$date.'-'.$num_gest.'-'.$acte['num_acte'];
@ -899,13 +922,14 @@ class Infogreffe
//Add to the database
$actesM = new Application_Model_ActesFiles();
if ( false !== $fichierdl) {
$dateDepot = new Zend_Date($result['date_depot'],'yyyy-MM-dd');
$actesM->insert(array(
'siren' => $siren,
'type' => $acte['type_acte'],
'date' => $date,
'num' => $acte['num_acte'],
'num_depot' => $result['num_depot'],
'date_depot' => WDate::dateT('Y-m-d', 'Ymd', $result['date_depot']),
'date_depot' => $dateDepot->toString('yyyyMMdd'),
'file' => $fichierdl,
));
}
@ -1170,8 +1194,15 @@ class Infogreffe
}
//Génération date (date_acte peut être vide)
if(!empty($acte['date_acte'])){ $date = WDate::dateT('Y-m-d', 'Ymd', $acte['date_acte']); }
else { $date = WDate::dateT('Y-m-d', 'Ymd', $depot['date_depot']); }
if(!empty($acte['date_acte'])){
$dateF = new Zend_Date($acte['date_acte'],'yyyy-MM-dd');
$date = $dateF->toString('yyyyMMdd');
}
else {
$dateF = new Zend_Date($depot['date_depot'],'yyyy-MM-dd');
$date = $dateF->toString('yyyyMMdd');
}
return $acte['type_acte'].'-'.$date.'-'.$num_gest.'-'.$num_acte;
}
else
@ -1206,7 +1237,9 @@ class Infogreffe
$ref =
$bilan['millesime'].'_'.
$bilan['type_comptes'].'-'.
WDate::dateT('Y-m-d', 'Ymd', $bilan['date_cloture_iso']).'-'.
substr($bilan['date_cloture_iso'],0,4).
substr($bilan['date_cloture_iso'],5,2).
substr($bilan['date_cloture_iso'],8,2).'-'.
$bilan['num_gest']['greffe'].'-'.
$bilan['num_gest']['dossier_millesime'].'-'.
$bilan['num_gest']['dossier_statut'].'-'.