FIX: holiday balances: revert part of commit 1e7df0ba9 to still increment on page visit

This commit is contained in:
Marc de Lima Lucio 2021-07-16 12:10:25 +02:00
parent 82feb57fcf
commit 4d6372dda1
3 changed files with 17 additions and 0 deletions

View File

@ -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 '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';

View File

@ -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);

View File

@ -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