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 fk_account is lost when we update payment information #20759

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions htdocs/compta/bank/line.php
Expand Up @@ -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'));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks strange: A fetch return an error code (so 0 or -1) but you store it into a field that is an id of a bank account ?

} else {
$actarget->fetch($id);
$account_id = $acline->fk_account;
}

if ($actarget->courant == Account::TYPE_CASH && GETPOST('value', 'alpha') != 'LIQ') {
Expand Down Expand Up @@ -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);
Expand Down