This commit is contained in:
Michael RICOIS 2014-04-10 15:02:08 +00:00
commit 17d13761b5

View File

@ -610,9 +610,9 @@ class MBilans {
'postes' =>$strPostes,
'partenaire' =>$tabBilan['SOURCE'],
);
if (!$iDb2->insert('bilans', $tabInsert, true))
$iDb2->update('bilans', $tabInsert, "siren='$this->siren' AND typeBilan='$typeBilan' AND dateExercice='$millesimeDB'");
$ret=$iDb2->select('bilans', 'dateProvPartenaire, dateExercice, dateExercicePre, dureeExercice, dureeExercicePre, monnaie, typeBilan, monnaieOrigine, unite, postes, partenaire, id, confidentiel, dateInsert', "siren='$this->siren' AND typeBilan='$typeBilan' AND dateExercice='$millesimeDB'", true);
if (!$this->iDb->insert('bilans', $tabInsert, true))
$this->iDb->update('bilans', $tabInsert, "siren='$this->siren' AND typeBilan='$typeBilan' AND dateExercice='$millesimeDB'");
$ret=$this->iDb->select('bilans', 'dateProvPartenaire, dateExercice, dateExercicePre, dureeExercice, dureeExercicePre, monnaie, typeBilan, monnaieOrigine, unite, postes, partenaire, id, confidentiel, dateInsert', "siren='$this->siren' AND typeBilan='$typeBilan' AND dateExercice='$millesimeDB'", true);
$bilan=$ret[0];
}
}
@ -740,7 +740,7 @@ class MBilans {
) {
/** Il n'y a aucune information sur le bilan précédent **/
$ret=$iDb2->select('bilans', 'dateProvPartenaire, dateExercice, dateExercicePre, dureeExercice, dureeExercicePre, monnaie, typeBilan, monnaieOrigine, unite, postes', "siren='$this->siren' AND typeBilan='$typeBilan' AND dateExercice<'$millesimeDB' ORDER BY dateExercice DESC LIMIT 0,1", true);
$ret=$this->iDb->select('bilans', 'dateProvPartenaire, dateExercice, dateExercicePre, dureeExercice, dureeExercicePre, monnaie, typeBilan, monnaieOrigine, unite, postes', "siren='$this->siren' AND typeBilan='$typeBilan' AND dateExercice<'$millesimeDB' ORDER BY dateExercice DESC LIMIT 0,1", true);
$bilanPre=$ret[0];
$tabBilan['DATE_CLOTURE_PRE'] = $bilanPre['dateExercice']; // SSAAMMJJ
$tabBilan['DUREE_MOIS_PRE'] = $bilanPre['dureeExercice'];