Merge pull request #32308 from josett225/patch-3

FIX Asset Module Update to use gmt (versus tz) everywhere to avoid time/calculation issues
This commit is contained in:
Laurent Destailleur
2024-12-13 15:52:29 +01:00
committed by GitHub
2 changed files with 3 additions and 3 deletions

View File

@@ -132,7 +132,7 @@ if (empty($reshook)) {
// Action dispose object
if ($action == 'confirm_disposal' && $confirm == 'yes' && $permissiontoadd) {
$object->disposal_date = dol_mktime(12, 0, 0, GETPOSTINT('disposal_datemonth'), GETPOSTINT('disposal_dateday'), GETPOSTINT('disposal_dateyear')); // for date without hour, we use gmt
$object->disposal_date = dol_mktime(0, 0, 0, GETPOSTINT('disposal_datemonth'), GETPOSTINT('disposal_dateday'), GETPOSTINT('disposal_dateyear'), 'gmt'); // for date without hour, we use gmt
$object->disposal_amount_ht = GETPOSTINT('disposal_amount');
$object->fk_disposal_type = GETPOSTINT('fk_disposal_type');
$disposal_invoice_id = GETPOSTINT('disposal_invoice_id');
@@ -273,7 +273,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// Disposal
$langs->load('bills');
$disposal_date = dol_mktime(12, 0, 0, GETPOSTINT('disposal_datemonth'), GETPOSTINT('disposal_dateday'), GETPOSTINT('disposal_dateyear')); // for date without hour, we use gmt
$disposal_date = dol_mktime(0, 0, 0, GETPOSTINT('disposal_datemonth'), GETPOSTINT('disposal_dateday'), GETPOSTINT('disposal_dateyear'), 'gmt'); // for date without hour, we use gmt
$disposal_amount = GETPOSTINT('disposal_amount');
$fk_disposal_type = GETPOSTINT('fk_disposal_type');
$disposal_invoice_id = GETPOSTINT('disposal_invoice_id');

View File

@@ -262,7 +262,7 @@ class AssetDepreciationOptions extends CommonObject
if (in_array($field_info['type'], array('text', 'html'))) {
$value = GETPOST($html_name, 'restricthtml');
} elseif ($field_info['type'] == 'date') {
$value = dol_mktime(12, 0, 0, GETPOSTINT($html_name . 'month'), GETPOSTINT($html_name . 'day'), GETPOSTINT($html_name . 'year')); // for date without hour, we use gmt
$value = dol_mktime(0, 0, 0, GETPOSTINT($html_name . 'month'), GETPOSTINT($html_name . 'day'), GETPOSTINT($html_name . 'year'), 'gmt'); // for date without hour, we use gmt
} elseif ($field_info['type'] == 'datetime') {
$value = dol_mktime(GETPOSTINT($html_name . 'hour'), GETPOSTINT($html_name . 'min'), GETPOSTINT($html_name . 'sec'), GETPOSTINT($html_name . 'month'), GETPOSTINT($html_name . 'day'), GETPOSTINT($html_name . 'year'), 'tzuserrel');
} elseif ($field_info['type'] == 'duration') {