Skip to content
Snippets Groups Projects
Commit e9dc4b9d authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Fix: We must not add month holidays after init of sold.

parent da7b5e35
No related branches found
No related tags found
No related merge requests found
...@@ -72,6 +72,13 @@ if ($action == 'update' && isset($_POST['update_cp'])) ...@@ -72,6 +72,13 @@ if ($action == 'update' && isset($_POST['update_cp']))
// Mise à jour des congés de l'utilisateur // Mise à jour des congés de l'utilisateur
$holiday->updateSoldeCP($userID,$userValue); $holiday->updateSoldeCP($userID,$userValue);
// If it first update of sold, we set date to havoid to have sold incremented by new month
$now=dol_now();
$sql = "UPDATE ".MAIN_DB_PREFIX."holiday_config SET";
$sql.= " value = '".dol_print_date($now,'%Y%m%d%H%M%S')."'";
$sql.= " WHERE name = 'lastUpdate' and value IS NULL"; // Add value IS NULL to be sure to update only at init.
dol_syslog('define_holiday update lastUpdate entry sql='.$sql);
$result = $db->query($sql);
$mesg='<div class="ok">'.$langs->trans('UpdateConfCPOK').'</div>'; $mesg='<div class="ok">'.$langs->trans('UpdateConfCPOK').'</div>';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment