diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php index fcb8b73d486..b3d2c25adda 100644 --- a/htdocs/holiday/define_holiday.php +++ b/htdocs/holiday/define_holiday.php @@ -193,6 +193,10 @@ llxHeader('', $langs->trans('CPTitreMenu')); $typeleaves = $holiday->getTypes(1, 1); +$result = $holiday->updateBalance(); // Create users into table holiday if they don't exists. TODO Remove this whif we use field into table user. +if ($result < 0) { + setEventMessages($holiday->error, $holiday->errors, 'errors'); +} print '
'; diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index 9d569f4344e..c62185d5f2a 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -231,6 +231,9 @@ $formfile = new FormFile($db); $fuser = new User($db); $holidaystatic = new Holiday($db); +// Update sold +$result = $object->updateBalance(); + $title = $langs->trans('CPTitreMenu'); llxHeader('', $title); diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php index 6cc4dc3b5bd..50fd4c3f521 100644 --- a/htdocs/hrm/index.php +++ b/htdocs/hrm/index.php @@ -68,6 +68,16 @@ if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INF $max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT; +/* + * Actions + */ + +// Update sold +if (!empty($conf->holiday->enabled) && !empty($setupcompanynotcomplete)) { + $holidaystatic = new Holiday($db); + $result = $holidaystatic->updateBalance(); +} + /* * View