Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX Asset Module Update to use gmt (versus tz) everywhere to avoid time/calculation issues #32308

Merged
merged 3 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions htdocs/asset/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@

// 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');
Expand Down Expand Up @@ -273,7 +273,7 @@
// 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');
Expand Down
2 changes: 1 addition & 1 deletion htdocs/asset/class/assetdepreciationoptions.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ public function setDeprecationOptionsFromPost($class_type = 0)
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') {
Expand Down
Loading