Fix date timezone

This commit is contained in:
Laurent Destailleur 2022-12-29 23:51:47 +01:00
parent 400a168687
commit 3cf90352bf
2 changed files with 6 additions and 5 deletions

View File

@ -266,6 +266,7 @@ class PaymentSalary extends CommonObject
$this->num_paiement = $obj->num_payment;
$this->num_payment = $obj->num_payment;
$this->note = $obj->note;
$this->note_private = $obj->note;
$this->fk_bank = $obj->fk_bank;
$this->fk_user_author = $obj->fk_user_author;
$this->fk_user_modif = $obj->fk_user_modif;

View File

@ -43,6 +43,8 @@ $action = GETPOST('action', 'aZ09');
$confirm = GETPOST('confirm');
if ($user->socid) $socid = $user->socid;
$salary = new Salary($db);
$object = new PaymentSalary($db);
if ($id > 0) {
$result = $object->fetch($id);
@ -71,7 +73,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->hasRight('salarie
}
if ($action == 'setdatep' && GETPOST('datepday') && $user->hasRight('salaries', 'write')) {
$datepaye = dol_mktime(GETPOST('datephour', 'int'), GETPOST('datepmin', 'int'), GETPOST('datepsec', 'int'), GETPOST('datepmonth', 'int'), GETPOST('datepday', 'int'), GETPOST('datepyear', 'int'), 'tzuserrel');
$datepaye = dol_mktime(GETPOST('datephour', 'int'), GETPOST('datepmin', 'int'), GETPOST('datepsec', 'int'), GETPOST('datepmonth', 'int'), GETPOST('datepday', 'int'), GETPOST('datepyear', 'int')); // field is a date in database, not a datetime, so we must use 'gmt' not 'tzuserrel'
$res = $object->updatePaymentDate($datepaye);
if ($res === 0) {
setEventMessages($langs->trans('PaymentDateUpdateSucceeded'), null, 'mesgs');
@ -85,12 +87,10 @@ if ($action == 'setdatep' && GETPOST('datepday') && $user->hasRight('salaries',
* View
*/
llxHeader();
$salary = new Salary($db);
$form = new Form($db);
llxHeader('', $langs->trans("SalaryPayment"));
$h = 0;
$head = array();