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] 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'); } }