|
|
@@ -637,13 +637,17 @@ class salaries
|
|
|
$forSFTP["actif"] = 1;
|
|
|
$SFTP[$cp["forSFTP"]++] = $forSFTP;
|
|
|
} elseif ($salaries["log"] == "DISABLE") {
|
|
|
+ // Récupérer la date de sortie existante pour ne pas l'écraser
|
|
|
+ $existingSalarie = self::getSalarieByidLocal($salaries["idLocal"]);
|
|
|
+ $dateJourSortie = (!empty($existingSalarie["jourSortie"])) ? $existingSalarie["jourSortie"] : $jourSortie;
|
|
|
+
|
|
|
db::query("UPDATE " . DB_T_SALARIES . " SET "
|
|
|
. "jourSortie = :jourSortie, "
|
|
|
. "maj = CURRENT_TIMESTAMP(), "
|
|
|
. "actif = :actif "
|
|
|
. "WHERE idLocal = :idLocal");
|
|
|
|
|
|
- db::bind(':jourSortie', $jourSortie);
|
|
|
+ db::bind(':jourSortie', $dateJourSortie);
|
|
|
db::bind(':actif', 0);
|
|
|
db::bind(':idLocal', $salaries["idLocal"]);
|
|
|
|
|
|
@@ -659,7 +663,7 @@ class salaries
|
|
|
$forSFTP["loginId"] = $salaries["loginId"];
|
|
|
$forSFTP["contrat"] = $salaries["contrat"];
|
|
|
$forSFTP["jourEntree"] = $salaries["jourEntree"];
|
|
|
- $forSFTP["jourSortie"] = $jourSortie;
|
|
|
+ $forSFTP["jourSortie"] = $dateJourSortie;
|
|
|
$forSFTP["repriseContrat"] = NULL;
|
|
|
$forSFTP["actif"] = 0;
|
|
|
$SFTP[$cp["forSFTP"]++] = $forSFTP;
|