From da4f3fab14098e10f9b5d1be36186100996402c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 27 Oct 2020 08:10:19 +0100 Subject: [PATCH 1/3] dol_print_date called with a bad value --- htdocs/core/boxes/box_task.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/boxes/box_task.php b/htdocs/core/boxes/box_task.php index 94983ef6bff..1daf8ea6222 100644 --- a/htdocs/core/boxes/box_task.php +++ b/htdocs/core/boxes/box_task.php @@ -1,6 +1,6 @@ - * Copyright (C) 2015-2019 Frederic France +/* Copyright (C) 2012-2018 Charlene BENKE + * Copyright (C) 2015-2020 Frederic France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -184,7 +184,7 @@ class box_task extends ModeleBoxes $taskstatic->label = $objp->label; $taskstatic->progress = $objp->progress; $taskstatic->fk_statut = $objp->fk_statut; - $taskstatic->date_end = $objp->datee; + $taskstatic->date_end = $this->db->jdate($objp->datee); $taskstatic->planned_workload = $objp->planned_workload; $taskstatic->duration_effective = $objp->duration_effective; From a33d34a165203a290423fc2af798f2019cd7274e Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Tue, 27 Oct 2020 16:48:56 +0100 Subject: [PATCH 2/3] FIX: various payments: bad data handling for subledger account + useless db commit/rollback --- htdocs/compta/bank/various_payment/card.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php index 6573207a117..ae147635099 100644 --- a/htdocs/compta/bank/various_payment/card.php +++ b/htdocs/compta/bank/various_payment/card.php @@ -115,7 +115,7 @@ if (empty($reshook)) $object->category_transaction = GETPOST("category_transaction", 'alpha'); $object->accountancy_code = GETPOST("accountancy_code") > 0 ? GETPOST("accountancy_code", "alpha") : ""; - $object->subledger_account = GETPOST("subledger_account") > 0 ? GETPOST("subledger_account", "alpha") : ""; + $object->subledger_account = $subledger_account; $object->sens = GETPOST('sens'); $object->fk_project = GETPOST('fk_project', 'int'); @@ -221,13 +221,10 @@ if (empty($reshook)) if ($action == 'setsubledger_account') { $result = $object->fetch($id); - $object->subledger_account = (GETPOST("subledger_account") > 0 ? GETPOST("subledger_account", "alpha") : ""); + $object->subledger_account = $subledger_account; $res = $object->update($user); - if ($res > 0) { - $db->commit(); - } else { - $db->rollback(); + if ($res < 0) { setEventMessages($object->error, $object->errors, 'errors'); } } From c3f0f3cc4ad4675499dae2285c8c4acf728a0604 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 29 Oct 2020 10:36:48 +0100 Subject: [PATCH 3/3] Revert "FIX: various payments: bad data handling for subledger account + useless db commit/rollback" --- htdocs/compta/bank/various_payment/card.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php index ae147635099..6573207a117 100644 --- a/htdocs/compta/bank/various_payment/card.php +++ b/htdocs/compta/bank/various_payment/card.php @@ -115,7 +115,7 @@ if (empty($reshook)) $object->category_transaction = GETPOST("category_transaction", 'alpha'); $object->accountancy_code = GETPOST("accountancy_code") > 0 ? GETPOST("accountancy_code", "alpha") : ""; - $object->subledger_account = $subledger_account; + $object->subledger_account = GETPOST("subledger_account") > 0 ? GETPOST("subledger_account", "alpha") : ""; $object->sens = GETPOST('sens'); $object->fk_project = GETPOST('fk_project', 'int'); @@ -221,10 +221,13 @@ if (empty($reshook)) if ($action == 'setsubledger_account') { $result = $object->fetch($id); - $object->subledger_account = $subledger_account; + $object->subledger_account = (GETPOST("subledger_account") > 0 ? GETPOST("subledger_account", "alpha") : ""); $res = $object->update($user); - if ($res < 0) { + if ($res > 0) { + $db->commit(); + } else { + $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); } }