From 80febc2fede685d4e1f7ed1b24febfb647bb310d Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 1 May 2022 08:01:55 +0200 Subject: [PATCH] FIX fk_account is lost when we update payment information --- htdocs/compta/bank/line.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/bank/line.php b/htdocs/compta/bank/line.php index b3675feb63e67..c8eec7208cba1 100644 --- a/htdocs/compta/bank/line.php +++ b/htdocs/compta/bank/line.php @@ -130,9 +130,9 @@ $actarget = new Account($db); if (GETPOST('accountid', 'int') > 0 && !$acline->rappro && !$acline->getVentilExportCompta()) { // We ask to change bank account - $actarget->fetch(GETPOST('accountid', 'int')); + $account_id = $actarget->fetch(GETPOST('accountid', 'int')); } else { - $actarget->fetch($id); + $account_id = $acline->fk_account; } if ($actarget->courant == Account::TYPE_CASH && GETPOST('value', 'alpha') != 'LIQ') { @@ -176,7 +176,7 @@ $sql .= " datev = '".$db->idate($dateval)."',"; } } - $sql .= " fk_account = ".((int) $actarget->id); + $sql .= " fk_account = ".((int) $account_id); $sql .= " WHERE rowid = ".((int) $acline->id); $result = $db->query($sql);