From 6c2ca119f6d302157d66250abda0ddf84cd3ca5e Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Thu, 10 Apr 2014 15:00:54 +0000 Subject: [PATCH] Error --- library/Metier/partenaires/classMBilans.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/library/Metier/partenaires/classMBilans.php b/library/Metier/partenaires/classMBilans.php index fc2fcd8f..ab21456a 100644 --- a/library/Metier/partenaires/classMBilans.php +++ b/library/Metier/partenaires/classMBilans.php @@ -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'];