From 4d6372dda12f9c36c00c1901fb0c9f529f7a8ab1 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Fri, 16 Jul 2021 12:10:25 +0200 Subject: [PATCH] FIX: holiday balances: revert part of commit 1e7df0ba9 to still increment on page visit --- htdocs/holiday/define_holiday.php | 4 ++++ htdocs/holiday/list.php | 3 +++ htdocs/hrm/index.php | 10 ++++++++++ 3 files changed, 17 insertions(+) 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